microsoft -> prompt select_account#289
Conversation
- also fixed minor cache issues in user crud api
📝 WalkthroughWalkthroughThis PR adds cache invalidation to user mutation operations and enhances OAuth account selection. User creation and reactivation now clear cached user data after committing changes. Microsoft OAuth requests explicitly prompt users to select an account during authentication. ChangesUser data cache invalidation
OAuth account selection
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
wavefront/server/plugins/authenticator/authenticator/microsoft_oauth/authenticator.py (1)
170-170: 💤 Low valueConsider making the prompt parameter configurable.
The
promptvalue is now hardcoded toselect_account, which forces account selection for all OAuth flows. While this may be the desired default behavior for security reasons, consider making it configurable throughMicrosoftOAuthConfigto allow flexibility for different deployment scenarios (e.g., some environments might preferloginor want to omit the parameter entirely).♻️ Proposed approach to make prompt configurable
Add a prompt field to the config class with a sensible default:
# In config.py (MicrosoftOAuthConfig) prompt: str = 'select_account'Then reference it in the method:
params = { 'response_type': self.config.response_type, 'client_id': self.config.client_id, 'redirect_uri': self.config.redirect_uri, 'scope': ' '.join(self.config.scopes), 'state': state, 'response_mode': self.config.response_mode, - 'prompt': 'select_account', + 'prompt': self.config.prompt, }🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@wavefront/server/plugins/authenticator/authenticator/microsoft_oauth/authenticator.py` at line 170, The hardcoded 'prompt': 'select_account' in the authorization parameter construction should be made configurable: add a prompt: str = 'select_account' (or Optional[str] = None if you want to allow omission) to MicrosoftOAuthConfig, update any config parsing/validation to include the new field, and replace the literal 'prompt' usage in the method that builds the auth URL (e.g., the function in authenticator.py that assembles authorize_params / build_authorization_url) to read the value from MicrosoftOAuthConfig and only include the parameter when the config value is non-empty; also update docstrings/tests that assume the previous hardcoded behavior.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In
`@wavefront/server/plugins/authenticator/authenticator/microsoft_oauth/authenticator.py`:
- Line 170: The hardcoded 'prompt': 'select_account' in the authorization
parameter construction should be made configurable: add a prompt: str =
'select_account' (or Optional[str] = None if you want to allow omission) to
MicrosoftOAuthConfig, update any config parsing/validation to include the new
field, and replace the literal 'prompt' usage in the method that builds the auth
URL (e.g., the function in authenticator.py that assembles authorize_params /
build_authorization_url) to read the value from MicrosoftOAuthConfig and only
include the parameter when the config value is non-empty; also update
docstrings/tests that assume the previous hardcoded behavior.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 4799a2d2-b535-45b2-a408-0702f5dc0c87
📒 Files selected for processing (3)
wavefront/server/modules/user_management_module/user_management_module/controllers/user_controller.pywavefront/server/modules/user_management_module/user_management_module/services/user_service.pywavefront/server/plugins/authenticator/authenticator/microsoft_oauth/authenticator.py
Summary by CodeRabbit
Bug Fixes
Improvements