-
Notifications
You must be signed in to change notification settings - Fork 175
fix: MFAClient getAuthenticators filtering based on Authenticator.type field #998
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
Merged
+104
−101
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
d727283
fix(mfa): match getAuthenticators by Authenticator.type field
utkrishtsahu 33509c7
fix(mfa): map TOTP enroll response fields for /mfa/associate
utkrishtsahu 0d82101
Merge branch 'main' into fix/mfa-getauthenticators-swift-parity
pmathew92 36dcaf4
docs(mfa): document TotpEnrollmentChallenge nullable properties per e…
utkrishtsahu File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -55,15 +55,53 @@ public data class OobEnrollmentChallenge( | |
| public val bindingMethod: String? = null | ||
| ) : EnrollmentChallenge() | ||
|
|
||
| /** | ||
| * Enrollment challenge for TOTP (authenticator app) and Push factors, returned by both | ||
| * the MFA `/mfa/associate` endpoint and the My Account `/authentication-methods` endpoint. | ||
| * | ||
| * The two endpoints return different field sets, so every field except [barcodeUri] is | ||
| * optional: | ||
| * - `/mfa/associate` (ROPG MFA flow) returns [authenticatorType], [secret], [barcodeUri] | ||
| * and [recoveryCodes]. It does NOT return `id`, `auth_session` or `manual_input_code`. | ||
| * - `/authentication-methods` (My Account) returns [id], [authSession], [barcodeUri] and | ||
| * [manualInputCode]. | ||
| * | ||
| * [secret] and [manualInputCode] both carry the human-readable key for manual entry into an | ||
| * authenticator app; only one is populated depending on the endpoint. The [barcodeUri] | ||
| * (`otpauth://` URI) is always present and embeds the same secret. | ||
| * | ||
| * @property id Identifier of the created authentication method. `null` on the `/mfa/associate` | ||
| * response (which does not return it); populated by the My Account `/authentication-methods` | ||
| * endpoint. | ||
| * @property authSession Authentication session for the enrollment. `null` on the | ||
| * `/mfa/associate` response; populated by the My Account `/authentication-methods` endpoint. | ||
| * @property barcodeUri The `otpauth://` URI to render as a QR code. Always present on both | ||
| * endpoints. | ||
| * @property manualInputCode Human-readable key for manual entry, returned only by the My Account | ||
| * `/authentication-methods` endpoint; `null` on the `/mfa/associate` response (which returns the | ||
| * key as [secret] instead). | ||
| * @property authenticatorType Low-level authenticator type (e.g. `otp`), returned only by the | ||
| * `/mfa/associate` endpoint; `null` on the My Account response. | ||
| * @property secret Human-readable key for manual entry, returned only by the `/mfa/associate` | ||
| * endpoint; `null` on the My Account response (which returns the key as [manualInputCode]). | ||
| * @property recoveryCodes Recovery codes generated during enrollment, returned only by the | ||
| * `/mfa/associate` endpoint; `null` on the My Account response. | ||
| */ | ||
| public data class TotpEnrollmentChallenge( | ||
| @SerializedName("id") | ||
| override val id: String, | ||
| override val id: String? = null, | ||
| @SerializedName("auth_session") | ||
| override val authSession: String, | ||
| override val authSession: String? = null, | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Document these nullable property change
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. added. |
||
| @SerializedName("barcode_uri") | ||
| public val barcodeUri: String, | ||
| @SerializedName("manual_input_code") | ||
| public val manualInputCode: String? | ||
| public val manualInputCode: String? = null, | ||
| @SerializedName("authenticator_type") | ||
| public val authenticatorType: String? = null, | ||
| @SerializedName("secret") | ||
| public val secret: String? = null, | ||
| @SerializedName("recovery_codes") | ||
| public val recoveryCodes: List<String>? = null | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
| ) : EnrollmentChallenge() | ||
|
|
||
| public data class RecoveryCodeEnrollmentChallenge( | ||
|
|
||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.