atproto_core/oauth/metadata
atproto OAuth discovery as Effects: from a user’s PDS, find the
authorization server and its endpoints. Two hops of well-known metadata:
PDS /.well-known/oauth-protected-resource -> authorization_servers[]
issuer /.well-known/oauth-authorization-server -> endpoints
The AuthServerMetadata type and both decoders live here as the single
shared copy; the per-target wrappers alias the type and run the effects.
Types
pub type AuthServerMetadata {
AuthServerMetadata(
issuer: String,
authorization_endpoint: String,
token_endpoint: String,
pushed_authorization_request_endpoint: String,
revocation_endpoint: option.Option(String),
)
}
Constructors
-
AuthServerMetadata( issuer: String, authorization_endpoint: String, token_endpoint: String, pushed_authorization_request_endpoint: String, revocation_endpoint: option.Option(String), )
Values
pub fn discover(
pds: String,
) -> effect.Effect(Result(AuthServerMetadata, xrpc.XrpcError))
Resolve a PDS to its authorization server’s endpoints in one call.
pub fn fetch_authorization_server(
issuer: String,
) -> effect.Effect(Result(AuthServerMetadata, xrpc.XrpcError))
pub fn fetch_protected_resource(
pds: String,
) -> effect.Effect(Result(List(String), xrpc.XrpcError))