Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Sources/OAuthenticator/Authenticator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ extension Authenticator {

let authConfig = TokenHandling.AuthorizationURLParameters(
credentials: config.appCredentials,
pcke: config.tokenHandling.pkce,
pkce: config.tokenHandling.pkce,
parRequestURI: parRequestURI,
stateToken: stateToken,
responseProvider: { try await self.dpopResponse(for: $0, login: nil, isAuthServer: true) }
Expand All @@ -327,7 +327,7 @@ extension Authenticator {
redirectURL: callbackURL,
responseProvider: { try await self.dpopResponse(for: $0, login: nil, isAuthServer: true) },
stateToken: stateToken,
pcke: config.tokenHandling.pkce
pkce: config.tokenHandling.pkce
)

let login = try await config.tokenHandling.loginProvider(params)
Expand Down
8 changes: 4 additions & 4 deletions Sources/OAuthenticator/Models.swift
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ public struct TokenHandling: Sendable {

public struct AuthorizationURLParameters: Sendable {
public let credentials: AppCredentials
public let pcke: PKCEVerifier?
public let pkce: PKCEVerifier?
public let parRequestURI: String?
public let stateToken: String
public let responseProvider: URLResponseProvider
Expand All @@ -146,22 +146,22 @@ public struct TokenHandling: Sendable {
public let redirectURL: URL
public let responseProvider: URLResponseProvider
public let stateToken: String
public let pcke: PKCEVerifier?
public let pkce: PKCEVerifier?

public init(
authorizationURL: URL,
credentials: AppCredentials,
redirectURL: URL,
responseProvider: @escaping URLResponseProvider,
stateToken: String,
pcke: PKCEVerifier?
pkce: PKCEVerifier?
) {
self.authorizationURL = authorizationURL
self.credentials = credentials
self.redirectURL = redirectURL
self.responseProvider = responseProvider
self.stateToken = stateToken
self.pcke = pcke
self.pkce = pkce
}
}

Expand Down
2 changes: 1 addition & 1 deletion Sources/OAuthenticator/Services/Bluesky.swift
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ public enum Bluesky {
throw AuthenticatorError.issuingServerMismatch(iss, server.issuer)
}

guard let verifier = params.pcke?.verifier else {
guard let verifier = params.pkce?.verifier else {
throw AuthenticatorError.pkceRequired
}

Expand Down
4 changes: 2 additions & 2 deletions Tests/OAuthenticatorTests/BlueskyTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ struct BlueskyTests {
redirectURL: URL(string: "app.test://callback?code=123&state=state&iss=this_is_incorrect")!,
responseProvider: provider,
stateToken: "state",
pcke: verifier
pkce: verifier
)

await #expect(throws: AuthenticatorError.issuingServerMismatch("this_is_incorrect", "https://server-metadata.test")) {
Expand Down Expand Up @@ -113,7 +113,7 @@ struct BlueskyTests {
redirectURL: URL(string: "app.test:/callback?code=123&state=state&iss=https://server-metadata.test")!,
responseProvider: provider,
stateToken: "state",
pcke: verifier
pkce: verifier
)

await #expect(throws: AuthenticatorError.tokenInvalid) {
Expand Down
4 changes: 2 additions & 2 deletions Tests/OAuthenticatorTests/GoogleTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ struct GoogleTests {
// Validate URL is properly constructed
let params = TokenHandling.AuthorizationURLParameters(
credentials: creds,
pcke: nil,
pkce: nil,
parRequestURI: nil,
stateToken: "unused",
responseProvider: provider
Expand Down Expand Up @@ -79,7 +79,7 @@ struct GoogleTests {
// Validate URL is properly constructed
let params = TokenHandling.AuthorizationURLParameters(
credentials: creds,
pcke: nil,
pkce: nil,
parRequestURI: nil,
stateToken: "unused",
responseProvider: provider
Expand Down
Loading