10000 Add `PUT /api/v1/trusted_publishing/tokens` API endpoint by Turbo87 · Pull Request #11131 · rust-lang/crates.io · GitHub
[go: up one dir, main page]

Skip to content

Add PUT /api/v1/trusted_publishing/tokens API endpoint #11131

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

Merged
merged 19 commits into from
Jun 2, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
trustpub: Add OidcKeyStore trait
  • Loading branch information
Turbo87 committed Jun 2, 2025
commit ecf54556eb8427a92c31105dc7c40d17d9601aaa
2 changes: 2 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions crates/crates_io_trustpub/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ edition = "2024"
workspace = true

[dependencies]
anyhow = "=1.0.98"
async-trait = "=0.1.88"
jsonwebtoken = "=9.3.1"
reqwest = { version = "=0.12.15", features = ["gzip", "json"] }
regex = "=1.11.1"
Expand Down
13 changes: 13 additions & 0 deletions crates/crates_io_trustpub/src/keystore/mod.rs
Original file line number Diff line number Diff line change
@@ -1 +1,14 @@
mod load_jwks;

use async_trait::async_trait;
use jsonwebtoken::DecodingKey;

/// A trait for fetching OIDC keys from a key store.
#[async_trait]
pub trait OidcKeyStore: Send + Sync {
/// Fetches a [`DecodingKey`] from the key store using the provided `key_id`.
///
/// If the key is not found on the server, it will return `None`. If there
/// is an error while fetching the key, it will return an error.
async fn get_oidc_key(&self, key_id: &str) -> anyhow::Result<Option<DecodingKey>>;
}
0