Repository navigation
This release renames the main objects so that each one says which OAuth party it talks to (ADR 0016):
OAuthClient for the authorization server, OAuthSession for the signed-in user and ProtectedResourceClient for
the protected resource. The renames break source compatibility in a minor release. This is a deliberate exception to
the promise of 1.0.0, made while the library has no known consumers, and no deprecated aliases are kept. Protocol
behaviour and the format of stored credentials are unchanged, so signed-in users stay signed in after the update.
Added
CredentialStorelists its built-in stores as static members, sostore: .keychain()andstore: .inMemory()
appear in autocomplete. They take the parameters of theKeychainCredentialStoreandInMemoryCredentialStore
initializers.- Documentation of what signing in and out leave at the server:
OAuthSession.signIn(with:requestedScope:)adopts
tokens and authenticates nobody, andsignOut(revoke:)leaves the person signed in at the authorization server.
The session article and the spec name an ephemeral browser session as the only control the client enforces, and
say thatprompt=login(OpenID Connect Core §3.1.2.1) is a request that the server may ignore.
Changed
- Breaking:
TokenManagerisOAuthSession, so the two entry pointsOAuthClientandOAuthSessionappear
together in autocomplete.load()isrestore().invalidate(_:)isdiscard(_:), because it drops a cached
token and sends nothing to the server. - Breaking: the types that belong to the session are nested in it.
SessionEventisOAuthSession.Event, and
SignOutReason,SignOutResultandPendingSignOutareOAuthSession.SignOutReason,
OAuthSession.SignOutResultandOAuthSession.PendingSignOut. - Breaking: the event
refreshed(target:)isaccessTokenUpdated(target:), because a token exchange emits it
too. Its documentation states that the session caches the token only when its lifetime is known, and that a
sign-in andexchangeRefreshTokendo not emit it. - Breaking:
CredentialCoding.encode(_:)andCredentialCoding.decode(_:)areCredential.serializedData()
andCredential(serializedData:). The record format and its version are unchanged, so credentials stored by 1.0
stay readable. - Breaking:
RequestAuthorizerisProtectedResourceClient, because it talks to a protected resource (RFC 6749
§1.1) and "authorize" names the sign-in flow. Its initializer takessession:instead ofmanager:.
sign(_:for:)isaddingToken(to:for:), because a bearer token is not a signature.
data(for:target:session:)isdata(for:target:urlSession:), because "session" means the OAuth session.
RetryDecisionisProtectedResourceClient.RetryDecision. - Breaking:
PassportObserverisRequestObserverandPassportEventisRequestEvent, because the events
report requests and thePassportprefix said only which library they come from.EndpointKindis
RequestEvent.Endpoint.PassportErroris the only type left with the library prefix.
Removed
- Breaking:
EndpointKind.resource. No code emitted it, so an observer never received it.