Skip to content

Commit b90a0f4

Browse files
Added AuthenticatorCredentialSourceIdentifier for representing credential source identifiers
1 parent 60e6815 commit b90a0f4

File tree

2 files changed

+24
-1
lines changed

2 files changed

+24
-1
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
//===----------------------------------------------------------------------===//
2+
//
3+
// This source file is part of the WebAuthn Swift open source project
4+
//
5+
// Copyright (c) 2024 the WebAuthn Swift project authors
6+
// Licensed under Apache License v2.0
7+
//
8+
// See LICENSE.txt for license information
9+
// See CONTRIBUTORS.txt for the list of WebAuthn Swift project authors
10+
//
11+
// SPDX-License-Identifier: Apache-2.0
12+
//
13+
//===----------------------------------------------------------------------===//
14+
15+
public protocol AuthenticatorCredentialSourceIdentifier: Hashable {
16+
init?(bytes: some BidirectionalCollection<UInt8>)
17+
var bytes: [UInt8] { get }
18+
}

Sources/WebAuthn/Authenticators/Protocol/AuthenticatorCredentialSourceProtocol.swift

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

15-
public protocol AuthenticatorCredentialSourceProtocol: Sendable {
15+
public protocol AuthenticatorCredentialSourceProtocol: Sendable, Identifiable where ID: AuthenticatorCredentialSourceIdentifier {
1616

17+
var id: ID { get }
18+
19+
init(
20+
id: ID
21+
) throws
1722
}

0 commit comments

Comments
 (0)