Skip to content

Commit 87438ed

Browse files
committed
Add some more annotation
1 parent 04f7fb4 commit 87438ed

18 files changed

+30
-30
lines changed

Sources/WebAuthn/Ceremonies/Authentication/AuthenticationCredential.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import Foundation
1717
/// The unprocessed response received from `navigator.credentials.get()`.
1818
///
1919
/// When decoding using `Decodable`, the `rawID` is decoded from base64url to bytes.
20-
public struct AuthenticationCredential {
20+
public struct AuthenticationCredential: Sendable {
2121
/// The credential ID of the newly created credential.
2222
public let id: URLEncodedBase64
2323

Sources/WebAuthn/Ceremonies/Authentication/AuthenticatorAssertionResponse.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import Crypto
1818
/// This is what the authenticator device returned after we requested it to authenticate a user.
1919
///
2020
/// When decoding using `Decodable`, byte arrays are decoded from base64url to bytes.
21-
public struct AuthenticatorAssertionResponse {
21+
public struct AuthenticatorAssertionResponse: Sendable {
2222
/// Representation of what we passed to `navigator.credentials.get()`
2323
///
2424
/// When decoding using `Decodable`, this is decoded from base64url to bytes.
@@ -69,7 +69,7 @@ extension AuthenticatorAssertionResponse: Decodable {
6969
}
7070
}
7171

72-
struct ParsedAuthenticatorAssertionResponse {
72+
struct ParsedAuthenticatorAssertionResponse: Sendable {
7373
let rawClientData: [UInt8]
7474
let clientData: CollectedClientData
7575
let rawAuthenticatorData: [UInt8]

Sources/WebAuthn/Ceremonies/Authentication/PublicKeyCredentialRequestOptions.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import Foundation
1919
/// When encoding using `Encodable`, the byte arrays are encoded as base64url.
2020
///
2121
/// - SeeAlso: https://www.w3.org/TR/webauthn-2/#dictionary-assertion-options
22-
public struct PublicKeyCredentialRequestOptions: Encodable {
22+
public struct PublicKeyCredentialRequestOptions: Encodable, Sendable {
2323
/// A challenge that the authenticator signs, along with other data, when producing an authentication assertion
2424
///
2525
/// When encoding using `Encodable` this is encoded as base64url.
@@ -68,10 +68,10 @@ public struct PublicKeyCredentialRequestOptions: Encodable {
6868
/// Information about a generated credential.
6969
///
7070
/// When encoding using `Encodable`, `id` is encoded as base64url.
71-
public struct PublicKeyCredentialDescriptor: Equatable, Encodable {
71+
public struct PublicKeyCredentialDescriptor: Equatable, Encodable, Sendable {
7272
/// Defines hints as to how clients might communicate with a particular authenticator in order to obtain an
7373
/// assertion for a specific credential
74-
public enum AuthenticatorTransport: String, Equatable, Encodable {
74+
public enum AuthenticatorTransport: String, Equatable, Encodable, Sendable {
7575
/// Indicates the respective authenticator can be contacted over removable USB.
7676
case usb
7777
/// Indicates the respective authenticator can be contacted over Near Field Communication (NFC).
@@ -125,7 +125,7 @@ public struct PublicKeyCredentialDescriptor: Equatable, Encodable {
125125

126126
/// The Relying Party may require user verification for some of its operations but not for others, and may use this
127127
/// type to express its needs.
128-
public enum UserVerificationRequirement: String, Encodable {
128+
public enum UserVerificationRequirement: String, Encodable, Sendable {
129129
/// The Relying Party requires user verification for the operation and will fail the overall ceremony if the
130130
/// user wasn't verified.
131131
case required

Sources/WebAuthn/Ceremonies/Authentication/VerifiedAuthentication.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
import Foundation
1616

1717
/// On successful authentication, this structure contains a summary of the authentication flow
18-
public struct VerifiedAuthentication {
19-
public enum CredentialDeviceType: String {
18+
public struct VerifiedAuthentication: Sendable {
19+
public enum CredentialDeviceType: String, Sendable {
2020
case singleDevice = "single_device"
2121
case multiDevice = "multi_device"
2222
}

Sources/WebAuthn/Ceremonies/Shared/AuthenticatorData.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import SwiftCBOR
1818

1919
/// Data created and/ or used by the authenticator during authentication/ registration.
2020
/// The data contains, for example, whether a user was present or verified.
21-
struct AuthenticatorData: Equatable {
21+
struct AuthenticatorData: Equatable, Sendable {
2222
let relyingPartyIDHash: [UInt8]
2323
let flags: AuthenticatorFlags
2424
let counter: UInt32

Sources/WebAuthn/Ceremonies/Shared/AuthenticatorFlags.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
//
1313
//===----------------------------------------------------------------------===//
1414

15-
struct AuthenticatorFlags: Equatable {
15+
struct AuthenticatorFlags: Equatable, Sendable {
1616

1717
/**
1818
Taken from https://w3c.github.io/webauthn/#sctn-authenticator-data

Sources/WebAuthn/Ceremonies/Shared/COSE/COSEAlgorithmIdentifier.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import Crypto
1818
/// COSEAlgorithmIdentifier From §5.10.5. A number identifying a cryptographic algorithm. The algorithm
1919
/// identifiers SHOULD be values registered in the IANA COSE Algorithms registry
2020
/// [https://www.w3.org/TR/webauthn/#biblio-iana-cose-algs-reg], for instance, -7 for "ES256" and -257 for "RS256".
21-
public enum COSEAlgorithmIdentifier: Int, RawRepresentable, CaseIterable, Encodable {
21+
public enum COSEAlgorithmIdentifier: Int, RawRepresentable, CaseIterable, Encodable, Sendable {
2222
/// AlgES256 ECDSA with SHA-256
2323
case algES256 = -7
2424
/// AlgES384 ECDSA with SHA-384

Sources/WebAuthn/Ceremonies/Shared/COSE/COSECurve.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
//
1313
//===----------------------------------------------------------------------===//
1414

15-
enum COSECurve: UInt64 {
15+
enum COSECurve: UInt64, Sendable {
1616
/// EC2, NIST P-256 also known as secp256r1
1717
case p256 = 1
1818
/// EC2, NIST P-384 also known as secp384r1

Sources/WebAuthn/Ceremonies/Shared/COSE/COSEKey.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
import SwiftCBOR
1616

17-
enum COSEKey {
17+
enum COSEKey: Sendable {
1818
// swiftlint:disable identifier_name
1919
case kty
2020
case alg

Sources/WebAuthn/Ceremonies/Shared/COSE/COSEKeyType.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
import Foundation
1616

1717
/// The Key Type derived from the IANA COSE AuthData
18-
enum COSEKeyType: UInt64, RawRepresentable {
18+
enum COSEKeyType: UInt64, RawRepresentable, Sendable {
1919
/// OctetKey is an Octet Key
2020
case octetKey = 1
2121
/// EllipticKey is an Elliptic Curve Public Key

0 commit comments

Comments
 (0)