Fix Okta IdP signing cert. - #37078
Conversation
|
@coderabbitai full review |
✅ Actions performedFull review triggered. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #37078 +/- ##
==========================================
- Coverage 65.93% 65.92% -0.01%
==========================================
Files 2298 2327 +29
Lines 184624 184695 +71
Branches 7752 7652 -100
==========================================
+ Hits 121726 121756 +30
- Misses 51762 51804 +42
+ Partials 11136 11135 -1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
WalkthroughA new client-side certificate download flow is introduced for the Okta Conditional Access Modal. A new API method fetches the IdP signing certificate as a blob, while the modal component replaces a static link with an interactive button that triggers the download with loading state and error handling via flash notifications. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes
Possibly related PRs
Suggested reviewers
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 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 |
mostlikelee
left a comment
There was a problem hiding this comment.
unauthenticated routes are always going to raise red flags for me, even if they're not exposing sensitive information.
- Rate limiting would help as one could DDoS the database
- leaking of config info: this endpoint tells anyone if conditional access is enabled, (probably a low risk)
Good point. I'll work on making it work as an authenticated endpoint. And I filed a bug on the other SAML unauthenticated endpoints: #37092 |
|
@coderabbitai full review |
✅ Actions performedFull review triggered. |
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (2)
frontend/services/entities/conditional_access.ts (1)
35-42: IdP signing cert service method is consistent with existing patternsThis follows the same
sendRequestshape asgetIdpAppleProfileand correctly requests the signing cert as ablob, which fits the new download flow. Looks good as-is.If
sendRequestsupports generics, you could make the return type explicit for stronger typing (optional):- getIdpSigningCert: (): Promise<Blob> => { - return sendRequest( + getIdpSigningCert: (): Promise<Blob> => { + return sendRequest<Blob>( "GET", endpoints.CONDITIONAL_ACCESS_IDP_SIGNING_CERT, undefined, "blob" ); },frontend/pages/admin/IntegrationsPage/cards/ConditionalAccess/components/OktaConditionalAccessModal/OktaConditionalAccessModal.tsx (1)
148-166: Download handler correctly manages async blob download and loading stateThe
isDownloadingCertflag andonDownloadSigningCertflow look solid:
- Uses the new
conditionalAccessAPI.getIdpSigningCert()and treats the response as aBlob.- Creates a blob URL, triggers a download with a stable filename, and cleans up via
URL.revokeObjectURL.- Properly wraps the call in a try/catch with a user-facing flash and resets loading state in
finally.If you want to be extra defensive, you could consider revoking the object URL in a
setTimeoutto avoid any hypothetical timing issues in older browsers, but for modern environments this is usually fine.
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
frontend/pages/admin/IntegrationsPage/cards/ConditionalAccess/components/OktaConditionalAccessModal/OktaConditionalAccessModal.tsx(2 hunks)frontend/services/entities/conditional_access.ts(1 hunks)
🔇 Additional comments (1)
frontend/pages/admin/IntegrationsPage/cards/ConditionalAccess/components/OktaConditionalAccessModal/OktaConditionalAccessModal.tsx (1)
310-316: Button wiring to download handler and loading state looks correctHooking the “Download certificate”
ButtontoonDownloadSigningCertand bindingisLoading={isDownloadingCert}matches the new async flow and aligns with how the Save button usesisLoading. This should prevent repeated clicks during the download and keeps the UX consistent.
|
|
||
| const [isDownloadingCert, setIsDownloadingCert] = useState(false); | ||
|
|
||
| const onDownloadSigningCert = useCallback(async () => { |
There was a problem hiding this comment.
This all makes sense, dicey and specific stuff. If you run into more trouble here, @gillespi314 did
some similar interesting engineering in DownloadCSR that might be helpful to reference. Looks like
she has some additional memoization layers.
…components/OktaConditionalAccessModal/OktaConditionalAccessModal.tsx
jacobshandling
left a comment
There was a problem hiding this comment.
Assuming Tim's concerns are going to be addressed server-side this LGTM
Fixing unreleased Okta IdP signing cert issue which prevented from setting up Okta conditional access. ## Testing - [x] QA'd all new/changed functionality manually For unreleased bug fixes in a release candidate, one of: - [x] Confirmed that the fix is not expected to adversely impact load test results <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Enhanced the IdP signing certificate download feature with an interactive button that provides real-time loading indicators and improved error handling. Users now receive immediate feedback during the download process with helpful error messages if any issues occur. * **Chores** * Removed unused import references. <sub>✏️ Tip: You can customize this high-level summary in your review settings.</sub> <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: jacobshandling <61553566+jacobshandling@users.noreply.github.com> (cherry picked from commit 0c2d465)
Fixing unreleased Okta IdP signing cert issue which prevented from setting up Okta conditional access.
Testing
For unreleased bug fixes in a release candidate, one of:
Summary by CodeRabbit
New Features
Chores
✏️ Tip: You can customize this high-level summary in your review settings.