Repository navigation
1.0.0
The first stable release: from here on, a breaking change to the public API of PassportKit or PassportKitTesting
needs a new major version.
Added
OAuthClient.revokeBestEffort(_:typeHint:timeLimit:)revokes a token best effort (RFC 7009) and returns a
RevocationOutcomeinstead of throwing:revoked,failed,timedOutafter the limit on the client's clock,
cancelled, orskippedwithout a revocation endpoint. It is for a token that never became a session, such as a
refresh token the app obtained but did not adopt. The limit defaults toOAuthClient.revocationTimeLimit(5
seconds), the limitTokenManagerapplies on sign-out, so apps need not copy it.TokenManager.beginSignOut(revoke:)clears the session without suspending and returns aPendingSignOut, whose
result(get async, likeTask.value) waits for the store delete and the revocation (RFC 7009) and returns the
SignOutResult. Apps no longer need to watch for.signedOut(.userInitiated)to learn that the session is gone
(ADR 0014).
Changed
- Breaking:
OAuthClient.beginAuthorization(_:)throws.invalidConfigurationwhenpromptcombines
.noInteraction(none) with another value, which OpenID Connect Core §3.1.2.1 forbids. Such a request used to be
sent. - Breaking:
LoopbackRedirectListener.waitForCallback(timeout:accept:)iswaitForCallback(timeLimit:accept:)
andLoopbackUserAgent(listener:timeout:openURL:)isLoopbackUserAgent(listener:timeLimit:openURL:), matching
thetimeLimitof the other APIs that give up after a duration on the injected clock. - Breaking: the members of
PassportError(code,recovery,statusCode,errorURI,underlying) are
read-only outside the library, likedetailalready was. Create an error with the initializers instead of
changing one. - Breaking:
SignOutResult.Revocationis the top-levelRevocationOutcome, shared by sign-out and
OAuthClient.revokeBestEffort(_:typeHint:timeLimit:);SignOutResult.revocationhas that type. Its cases are
unchanged. - Breaking:
TokenManager.exchangeRefreshTokenreturns the response when the server answered, even if the
session ended or was replaced while the request was in flight; it used to throw.notAuthenticatedand drop the
issued token, which stayed valid at the server. The rotated subject still goes to the ended session's revocation
and the new session is not touched. Callers that must not use a token of an ended session check their own state
and revoke it as the audience client (ADR 0015). - Breaking: the response of
TokenManager.exchangeRefreshTokenhasrefreshTokenset tonil. The rotated
refresh token belongs to the session, which saves it; handing it out invited presenting it twice. TokenManager.signOut(revoke:)isbeginSignOut(revoke:)followed byawait result. The revocation's time
limit and its log line now run in a task the manager owns, so a revocation outcome is logged even when the caller
ofsignOutwas cancelled. Results are unchanged.- Every public enumeration states whether it is frozen.
TokenAcceptanceandJSONValueare frozen;PassportEvent,
IssuerValidation,Discovery.Style,KeychainCredentialStore.Accessibilityand the enumerations of
PassportKitTestingmay gain cases in a minor release, so aswitchover them needs adefault.
Removed
- Breaking:
Credential.additionalFieldsand the matching initializer parameter. Nothing in the library set or
read it, andTokenManageroffered no way to fill it. Stored records that carry the field still decode; the field
is ignored.
Fixed
- A
Retry-Afterin the obsolete RFC 850 date form with a two-digit year up to 50 years ahead is read as a future
date (RFC 9110 §5.6.7); years 46 to 76 used to be read as the 20th century, which made the delay zero. LoopbackUserAgentinstalls itsstatefilter before it opens the browser, so a request with anotherstate
that reaches the listener while the browser opens is refused instead of being taken as the redirect.TokenManager.load()reads the store only after every save and delete decided before it, so a load that runs
while the delete of a signed-out or rejected session is still in progress no longer restores that session.KeychainCredentialStoreupdates an existing item in place instead of deleting it and adding it again, so a save
that fails (device locked, denied prompt) or a process that dies mid-save no longer loses the stored credential,
and stores writing the same item at once no longer fail witherrSecDuplicateItem. A save whose payload could not
be archived fails with.storageFailureinstead of storing an item without data.KeychainCredentialStorefinds, replaces and deletes its item by class, service, account and access group, never
by accessibility class. An app that changesaccessibilitykeeps its stored credential (on iOS it was no longer
found), and the next save moves the item to the new class.- The documentation of
RequestAuthorizer.sign(_:for:)forHTTPRequestand ofURLSessionTransportstates that
the never-indexed marking ofAuthorization(RFC 7541 §7.1.3) reaches the wire only through a transport that keeps
the indexing strategy ofHTTPFields.URLSessionTransportconverts toURLRequest, which drops it. DeviceAuthorization.expiresAtkeeps the fractional part of a fractionalexpires_ininstead of truncating it to
whole seconds.