-
-
Notifications
You must be signed in to change notification settings - Fork 34
Unsafe Challenge Overrides #112
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -21,8 +21,17 @@ import Foundation | |||||
| public struct PublicKeyCredentialRequestOptions: Sendable { | ||||||
| /// A challenge that the authenticator signs, along with other data, when producing an authentication assertion. | ||||||
| /// | ||||||
| /// When encoding using `Encodable` this is encoded as base64url. | ||||||
| public var challenge: [UInt8] | ||||||
| /// The Relying Party should store the challenge temporarily until the authentication flow is complete. When encoding using `Encodable` this is encoded as base64url. | ||||||
| /// | ||||||
| /// - Warning: Although the challenge can be changed, doing so is not recommended and can lead to an insecure implementation of the WebAuthn protocol. See ``setUnsafeChallenge(_:)``. | ||||||
| public private(set) var challenge: [UInt8] | ||||||
|
|
||||||
| /// Unsafely change the challenge that will be delivered to the client. | ||||||
| /// | ||||||
| /// - Warning: Although the challenge can be changed, doing so is not recommended and can lead to an insecure implementation of the WebAuthn protocol. | ||||||
| public mutating func setUnsafeChallenge(_ newValue: [UInt8]) { | ||||||
|
||||||
| public mutating func setUnsafeChallenge(_ newValue: [UInt8]) { | |
| public mutating func unsafeSetChallenge(_ newValue: [UInt8]) { |
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.
Renamed.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -25,7 +25,16 @@ public struct PublicKeyCredentialCreationOptions: Sendable { | |
| /// | ||
| /// The Relying Party should store the challenge temporarily until the registration flow is complete. When | ||
| /// encoding using `Encodable`, the challenge is base64url encoded. | ||
| public let challenge: [UInt8] | ||
| /// | ||
| /// - Warning: Although the challenge can be changed, dooing so is not recommended and can lead to an insecure implementation of the WebAuthn protocol. See ``setUnsafeChallenge(_:)``. | ||
|
||
| public private(set) var challenge: [UInt8] | ||
|
|
||
| /// Unsafely change the challenge that will be delivered to the client. | ||
| /// | ||
| /// - Warning: Although the challenge can be changed, doing so is not recommended and can lead to an insecure implementation of the WebAuthn protocol. | ||
| public mutating func setUnsafeChallenge(_ newValue: [UInt8]) { | ||
| challenge = newValue | ||
| } | ||
|
|
||
| /// Contains names and an identifier for the user account performing the registration. | ||
| public var user: PublicKeyCredentialUserEntity | ||
|
|
||
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.
Let's just remove this from the API docs, I don't think we need it
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.
Removed in favor of a
SeeAlso