From 38eecf7a529fa26348bb28a750807b96cd6691f2 Mon Sep 17 00:00:00 2001 From: "kacaii.dev" Date: Mon, 6 Jul 2026 09:11:49 -0300 Subject: [PATCH] possum/oauth/metadata: use shorter name for field --- src/possum/oauth/metadata.gleam | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/src/possum/oauth/metadata.gleam b/src/possum/oauth/metadata.gleam index a899e79..362bb5d 100644 --- a/src/possum/oauth/metadata.gleam +++ b/src/possum/oauth/metadata.gleam @@ -63,9 +63,9 @@ pub opaque type Builder { /// The fully-qualified redirect/callback URL is declared here. redirect_uris: List(uri.Uri), /// Confidential clients must set this to `private_key_jwt`. - token_endpoint_auth_method: option.Option(String), + auth_method: option.Option(String), /// Confidential client set this to ES256 - token_endpoint_auth_signing_alg: option.Option(String), + auth_signing_alg: option.Option(String), /// HTTP URL to human-readable terms of service ("ToS") for the client tos_uri: option.Option(uri.Uri), ) @@ -86,8 +86,8 @@ pub fn new() -> Builder { redirect_uris: [], response_types: ["code"], scope: ["atproto"], - token_endpoint_auth_method: option.None, - token_endpoint_auth_signing_alg: option.None, + auth_method: option.None, + auth_signing_alg: option.None, tos_uri: option.None, ) } @@ -157,7 +157,7 @@ pub fn parse(builder: Builder) -> Result(Metadata, MetadataError) { option.None -> body } - let body = case builder.token_endpoint_auth_method { + let body = case builder.auth_method { option.Some(value) -> [ #("token_endpoint_auth_method", json.string(value)), ..body @@ -165,7 +165,7 @@ pub fn parse(builder: Builder) -> Result(Metadata, MetadataError) { option.None -> body } - let body = case builder.token_endpoint_auth_signing_alg { + let body = case builder.auth_signing_alg { option.Some(value) -> [ #("token_endpoint_auth_signing_alg", json.string(value)), ..body @@ -267,16 +267,13 @@ pub fn scope(builder: Builder, value: List(String)) -> Builder { } /// Set the `token_endpoint_auth_method` field. -pub fn token_endpoint_auth_method(builder: Builder, value: String) -> Builder { - Builder(..builder, token_endpoint_auth_method: option.Some(value)) +pub fn auth_method(builder: Builder, value: String) -> Builder { + Builder(..builder, auth_method: option.Some(value)) } /// Set the `token_endpoint_auth_signing_alg` field. -pub fn token_endpoint_auth_signing_algorithm( - builder: Builder, - value: String, -) -> Builder { - Builder(..builder, token_endpoint_auth_signing_alg: option.Some(value)) +pub fn auth_signing_algorithm(builder: Builder, value: String) -> Builder { + Builder(..builder, auth_signing_alg: option.Some(value)) } /// Set the `terms_of_service_uri` field. -- 2.51.2