Skip to content

Commit

Permalink
Removing the aud claim (#35)
Browse files Browse the repository at this point in the history
* fix: no need for aud anymore

* fix: pin zenith to v0.10.1

* chore: fmt
  • Loading branch information
rswanson authored Dec 18, 2024
1 parent 59ba745 commit e25bdfd
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 14 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ name = "zenith-builder-example"
path = "bin/builder.rs"

[dependencies]
zenith-types = { git = "https://github.com/init4tech/zenith-rs", branch = "main" }
zenith-types = { git = "https://github.com/init4tech/zenith-rs", tag = "v0.10.1" }

alloy-primitives = { version = "=0.8.8", features = ["serde", "tiny-keccak"] }
alloy-sol-types = { version = "=0.8.8", features = ["json"] }
Expand Down
4 changes: 0 additions & 4 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ const OAUTH_CLIENT_ID: &str = "OAUTH_CLIENT_ID";
const OAUTH_CLIENT_SECRET: &str = "OAUTH_CLIENT_SECRET";
const OAUTH_AUTHENTICATE_URL: &str = "OAUTH_AUTHENTICATE_URL";
const OAUTH_TOKEN_URL: &str = "OAUTH_TOKEN_URL";
const OAUTH_AUDIENCE: &str = "OAUTH_AUDIENCE";

/// Configuration for a builder running a specific rollup on a specific host
/// chain.
Expand Down Expand Up @@ -84,8 +83,6 @@ pub struct BuilderConfig {
pub oauth_authenticate_url: String,
/// OAuth token URL for the builder to get an OAuth2 access token
pub oauth_token_url: String,
/// OAuth audience for the builder.
pub oauth_audience: String,
/// The oauth token refresh interval in seconds.
pub oauth_token_refresh_interval: u64,
}
Expand Down Expand Up @@ -176,7 +173,6 @@ impl BuilderConfig {
oauth_client_secret: load_string(OAUTH_CLIENT_SECRET)?,
oauth_authenticate_url: load_string(OAUTH_AUTHENTICATE_URL)?,
oauth_token_url: load_string(OAUTH_TOKEN_URL)?,
oauth_audience: load_string(OAUTH_AUDIENCE)?,
oauth_token_refresh_interval: load_u64(AUTH_TOKEN_REFRESH_INTERVAL)?,
})
}
Expand Down
8 changes: 1 addition & 7 deletions src/tasks/oauth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ use oauth2::{
};
use tokio::{sync::RwLock, task::JoinHandle};

const OAUTH_AUDIENCE_CLAIM: &str = "audience";

type Token = StandardTokenResponse<EmptyExtraTokenFields, BasicTokenType>;

/// A self-refreshing, periodically fetching authenticator for the block builder.
Expand Down Expand Up @@ -91,10 +89,7 @@ impl Authenticator {
Some(TokenUrl::new(config.oauth_token_url.clone())?),
);

let token_result = client
.exchange_client_credentials()
.add_extra_param(OAUTH_AUDIENCE_CLAIM, config.oauth_audience.clone())
.request(http_client)?;
let token_result = client.exchange_client_credentials().request(http_client)?;

Ok(token_result)
}
Expand Down Expand Up @@ -166,7 +161,6 @@ mod tests {
oauth_client_secret: "some_client_secret".into(),
oauth_authenticate_url: "http://localhost:9000".into(),
oauth_token_url: "http://localhost:9000".into(),
oauth_audience: "https://transactions.holesky.signet.sh".into(),
tx_broadcast_urls: vec!["http://localhost:9000".into()],
oauth_token_refresh_interval: 300, // 5 minutes
};
Expand Down
1 change: 0 additions & 1 deletion tests/bundle_poller_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ mod tests {
oauth_client_secret: "some_client_secret".into(),
oauth_authenticate_url: "http://localhost:8080".into(),
oauth_token_url: "http://localhost:8080".into(),
oauth_audience: "https://transactions.holesky.signet.sh".into(),
tx_broadcast_urls: vec!["http://localhost:9000".into()],
oauth_token_refresh_interval: 300, // 5 minutes
};
Expand Down
1 change: 0 additions & 1 deletion tests/tx_poller_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ mod tests {
oauth_client_secret: "some_client_secret".into(),
oauth_authenticate_url: "http://localhost:8080".into(),
oauth_token_url: "http://localhost:8080".into(),
oauth_audience: "https://transactions.holesky.signet.sh".into(),
oauth_token_refresh_interval: 300, // 5 minutes
};
Ok(config)
Expand Down

0 comments on commit e25bdfd

Please sign in to comment.