Skip to content

Conversation

@vishvananda
Copy link
Member

Issuer did not properly support any provider other than local.

This fixes the implementation by implementing get_iss for all providers. This also allows us to avoid having to create a token as the fallback for discovery.

Issuer did not properly support any provider other than local.

This fixes the implementation by implementing get_iss for all providers.
This also allows us to avoid having to create a token as the fallback
for discovery.
Copy link
Contributor

@wycats wycats left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great!

async fn get_sub(&self) -> Result<String>;
async fn get_token(&self, audience: &str) -> Result<String>;
async fn get_iss_and_jwks(&self) -> Result<Option<(String, String)>>;
async fn get_iss(&self) -> Result<String>;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems like a good separation.

env::set_var_file("ISSUER", &issuer, &self.issuer_path)?;
}
let issuer = self.provider.get_iss().await?;
let mut file = File::create(&self.issuer_path).await?;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason not to use tokio::fs::write?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

only because i didn't know it existed :)

// No jwks management
Ok(None)
async fn get_iss(&self) -> Result<String> {
self.config.issuer.clone().context("Issuer not configured")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@vishvananda vishvananda merged commit 31bd6d3 into main Jan 11, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants