Skip to content

Commit 4c15460

Browse files
committed
make ChallengeGenerator public
1 parent d906591 commit 4c15460

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

Sources/WebAuthn/Helpers/ChallengeGenerator.swift

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,14 @@
1111
//
1212
//===----------------------------------------------------------------------===//
1313

14-
package struct ChallengeGenerator: Sendable {
15-
var generate: @Sendable () -> [UInt8]
14+
public struct ChallengeGenerator: Sendable {
15+
public var generate: @Sendable () -> [UInt8]
1616

17-
package static var live: Self {
17+
public init(generate: @Sendable @escaping () -> [UInt8]) {
18+
self.generate = generate
19+
}
20+
21+
public static var live: Self {
1822
.init(generate: { [UInt8].random(count: 32) })
1923
}
2024
}

Sources/WebAuthn/WebAuthnManager.swift

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,8 @@ public struct WebAuthnManager: Sendable {
3535
///
3636
/// - Parameters:
3737
/// - configuration: The configuration to use for this manager.
38-
public init(configuration: Configuration) {
39-
self.init(configuration: configuration, challengeGenerator: .live)
40-
}
41-
42-
package init(configuration: Configuration, challengeGenerator: ChallengeGenerator) {
38+
/// - challengeGenerator: The generator of challenge.
39+
public init(configuration: Configuration, challengeGenerator: ChallengeGenerator = .live) {
4340
self.configuration = configuration
4441
self.challengeGenerator = challengeGenerator
4542
}

0 commit comments

Comments
 (0)