Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: cache public key #655

Merged
merged 8 commits into from
Feb 27, 2023
Merged

Conversation

oddgrd
Copy link
Contributor

@oddgrd oddgrd commented Feb 27, 2023

No description provided.

Copy link
Contributor

@chesedo chesedo left a comment

Choose a reason for hiding this comment

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

This is great! I think we can make this even simpler by implementing the cache in this function. Then we don't have to pass around a cache manager since we can initiate the cache inside AuthPublicKey::new()

async fn public_key(&self) -> Result<Vec<u8>, Self::Error> {
let client = Client::new();
let uri = format!("{}public-key", self.auth_uri).parse()?;
let res = client.get(uri).await?;
let buf = body::to_bytes(res).await?;
Ok(buf.to_vec())
}

Copy link
Contributor

@chesedo chesedo left a comment

Choose a reason for hiding this comment

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

LGTM

@oddgrd oddgrd merged commit 13d8bf0 into shuttle-hq:main Feb 27, 2023
@oddgrd oddgrd deleted the feat/cache-public-key branch February 27, 2023 18:33
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.

2 participants