Skip to content

Commit

Permalink
style: use join for metadata endpoints
Browse files Browse the repository at this point in the history
  • Loading branch information
nanderstabel committed Aug 9, 2023
1 parent 8d75a0b commit 35bafbd
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions oid4vc-manager/src/managers/credential_issuer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ impl<S: Storage<CFC> + Clone, CFC: CredentialFormatCollection> CredentialIssuerM
storage: S,
subjects: [Arc<dyn Subject>; N],
) -> Result<Self> {
// `TcpListener::bind("127.0.0.1:0")` will bind to a random port.
let listener = listener.unwrap_or_else(|| TcpListener::bind("127.0.0.1:0").unwrap());
let issuer_url: Url = format!("http://{:?}", listener.local_addr()?).parse()?;
Ok(Self {
Expand All @@ -37,16 +38,16 @@ impl<S: Storage<CFC> + Clone, CFC: CredentialFormatCollection> CredentialIssuerM
metadata: CredentialIssuerMetadata {
credential_issuer: issuer_url.clone(),
authorization_server: None,
credential_endpoint: format!("{issuer_url}credential").parse()?,
credential_endpoint: issuer_url.join("/credential")?,
batch_credential_endpoint: None,
deferred_credential_endpoint: None,
credentials_supported: storage.get_credentials_supported(),
display: None,
},
authorization_server_metadata: AuthorizationServerMetadata {
issuer: issuer_url.clone(),
authorization_endpoint: format!("{issuer_url}authorize").parse()?,
token_endpoint: format!("{issuer_url}token").parse()?,
authorization_endpoint: issuer_url.join("/authorize")?,
token_endpoint: issuer_url.join("/token")?,
..Default::default()
},
},
Expand Down

0 comments on commit 35bafbd

Please sign in to comment.