-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: added missing grant to auth ids api for user notification #16680
fix: added missing grant to auth ids api for user notification #16680
Conversation
WalkthroughThe pull request introduces modifications across several configuration files related to the Changes
Possibly related PRs
Suggested labels
Suggested reviewers
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes are OK 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Outside diff range and nitpick comments (2)
charts/identity-server/values.staging.yaml (1)
431-433
: Consider documenting namespace access requirements.Multiple services have been granted access to the user-notification namespace. Consider adding documentation explaining the purpose and scope of these permissions.
Add a comment above each grantNamespaces section explaining why the service needs access to user-notification:
services-auth-ids-api: + # Requires user-notification namespace access for sending user notifications grantNamespaces: - 'user-notification'
Also applies to: 534-536
charts/identity-server/values.dev.yaml (1)
534-536
: LGTM - Consistent permissions for cleanup job.The cleanup job requires the same namespace grants as the main service to ensure proper access during maintenance operations. This maintains security consistency across the service and its supporting jobs.
Consider documenting the relationship between the main service and cleanup job's permissions in the service documentation to help future maintainers understand why both components need the same grants.
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
📒 Files selected for processing (4)
apps/services/auth/ids-api/infra/ids-api.ts
(1 hunks)charts/identity-server/values.dev.yaml
(3 hunks)charts/identity-server/values.prod.yaml
(3 hunks)charts/identity-server/values.staging.yaml
(3 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
apps/services/auth/ids-api/infra/ids-api.ts (2)
Pattern apps/services/**/*
: "Confirm that the code adheres to the following:
- NestJS architecture, including modules, services, and controllers.
- Dependency injection patterns and service encapsulation.
- Integration and unit testing coverage and practices."
Pattern apps/**/*
: "Confirm that the code adheres to the following:
- NextJS best practices, including file structure, API routes, and static generation methods.
- Efficient state management and server-side rendering techniques.
- Optimal use of TypeScript for component and utility type safety."
🔇 Additional comments (10)
apps/services/auth/ids-api/infra/ids-api.ts (2)
Line range hint 91-102
: Verify resource limits for production workload.
The service configuration specifies relatively high resource limits and implements horizontal scaling. Let's verify if these settings align with actual usage patterns:
- CPU limits: 800m with 400m requests
- Memory limits: 768Mi with 512Mi requests
- Replica count: 2-15 pods
#!/bin/bash
# Description: Search for HPA metrics or monitoring configurations
# Expected: Find evidence of resource utilization patterns
# Look for monitoring configurations or metrics collection
rg -A 5 "metrics|monitoring|prometheus" "apps/services/auth/ids-api/**/*"
125-125
: LGTM: Grant namespace addition aligns with PR objectives.
The addition of "user-notification" to grantNamespaces is consistent with the PR's purpose of fixing missing authorization grants for the user notification feature.
Let's verify the grant namespace configuration across environments:
✅ Verification successful
Verified: The user-notification namespace grant is correctly configured across environments
The search results confirm that:
- The
user-notification
namespace grant is correctly added in the IDS API infrastructure code - The grant is also properly configured in the identity server values files across dev, staging, and prod environments
- The namespace is consistently used in related services that interact with user notifications
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Verify grant namespace configuration in identity server values
# Expected: user-notification should be present in grantNamespaces for all environments
# Check values files for grantNamespaces configuration
rg -A 5 "grantNamespaces.*user-notification" "charts/identity-server/values*.yaml"
Length of output: 241
Script:
#!/bin/bash
# Let's try a broader search to find relevant files and configurations
# First, let's find all files related to identity server or auth configuration
fd -t f "values.*\.ya?ml" -X rg -l "grantNamespaces"
# Then let's check the actual content of these files
fd -t f "values.*\.ya?ml" -X rg -C 5 "grantNamespaces"
# Also search in the infrastructure code
rg -C 5 "grantNamespaces" "apps/services/auth/"
Length of output: 156494
charts/identity-server/values.prod.yaml (3)
428-430
: LGTM! Consistent namespace grant configuration.
The namespace grant configuration for services-auth-ids-api matches the identity-server configuration, maintaining consistency across services.
531-533
: LGTM! Cleanup job has consistent namespace grants.
The namespace grant configuration for the cleanup job maintains consistency with related services, ensuring proper access for scheduled maintenance tasks.
124-126
: LGTM! Verify user-notification namespace exists.
The addition of user-notification namespace and enabling grants is aligned with the PR objectives.
✅ Verification successful
✅ Namespace configuration verified and properly defined
The 'user-notification' namespace is properly defined across all environments (dev, staging, and prod) in the islandis charts, with consistent configuration including security context and pod disruption budgets. The grant access being added in identity-server is therefore valid and secure.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Verify the user-notification namespace exists in the cluster
# Expected: The namespace should be listed in the output
# Search for user-notification namespace definition
rg -l "namespace: 'user-notification'"
Length of output: 147
Script:
#!/bin/bash
# Let's verify the content of these files to ensure proper namespace configuration
rg -A 5 "namespace: 'user-notification'" charts/islandis/values.*.yaml
Length of output: 3161
charts/identity-server/values.staging.yaml (3)
431-433
: Configuration is consistent with identity-server settings.
The same namespace configuration is applied to services-auth-ids-api, maintaining consistency across related services.
534-536
: Verify cleanup job's namespace requirements.
The cleanup job also includes user-notification namespace access. While this maintains consistency, verify if the cleanup job actually requires this access.
#!/bin/bash
# Description: Check if cleanup job interacts with user-notification service
# Test: Search for user-notification related operations in cleanup job
rg -A 5 "cleanup.*user-notification|user-notification.*cleanup"
126-128
: Verify user-notification namespace access requirements.
The addition of 'user-notification' namespace and enabling grantNamespaces suggests new integration with user notification service. This change aligns with the PR objective of fixing auth ids api for user notification.
✅ Verification successful
Let me gather more information about the user-notification service configuration.
Configuration for user-notification namespace is properly aligned across environments
The addition of 'user-notification' namespace and enabling grantNamespaces is verified to be consistent with the service's requirements:
- The user-notification service uses OAuth2 authentication with proper scopes (openid, profile, documents)
- The configuration is consistently applied across dev, staging, and prod environments
- The service has proper auth delegation API integration configured
- The identity server has the required USER_NOTIFICATION_API_URL environment variable set for all environments
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Verify the user-notification service configuration and dependencies
# Test: Check for user-notification related configurations and service dependencies
rg -A 5 "USER_NOTIFICATION"
Length of output: 2796
Script:
#!/bin/bash
# Check for user-notification service configuration in identity-server values
rg -A 5 "user-notification" charts/identity-server/
# Check for any auth or permission related configurations in user-notification service
rg -A 5 "auth|permission" apps/services/user-notification/
Length of output: 27166
charts/identity-server/values.dev.yaml (2)
431-433
: LGTM - Grant configuration aligns with requirements.
The addition of user-notification namespace grant to services-auth-ids-api is correct and matches the PR objectives.
126-128
: Verify namespace grant configuration consistency.
The addition of 'user-notification' namespace grant is aligned with the PR objectives. However, let's ensure this configuration is consistent across related services.
✅ Verification successful
Configuration is consistent across environments
The 'user-notification' namespace grant is consistently configured across all environments (dev, staging, prod) in the identity-server chart, with grantNamespacesEnabled set to true. The configuration is also properly reflected in related services that need access to the user-notification namespace.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Verify if user-notification namespace grant is consistently configured
# across related services in the development environment
# Search for grantNamespaces configurations
echo "Checking grantNamespaces configurations:"
rg -A 5 "grantNamespaces:" charts/
Length of output: 53523
Datadog ReportAll test runs ✅ 2 Total Test Services: 0 Failed, 1 Passed Test Services
|
Fix
Adding missing grant NS to auth ids api for user notification worker
Summary by CodeRabbit
New Features
user-notification
namespace across multiple services.Improvements
identity-server
and related services to better handle expected loads.Configuration Changes