Skip to content

Commit e25bdfd

Browse files
authored
Removing the aud claim (#35)
* fix: no need for aud anymore * fix: pin zenith to v0.10.1 * chore: fmt
1 parent 59ba745 commit e25bdfd

File tree

5 files changed

+2
-14
lines changed

5 files changed

+2
-14
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ name = "zenith-builder-example"
1818
path = "bin/builder.rs"
1919

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

2323
alloy-primitives = { version = "=0.8.8", features = ["serde", "tiny-keccak"] }
2424
alloy-sol-types = { version = "=0.8.8", features = ["json"] }

src/config.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ const OAUTH_CLIENT_ID: &str = "OAUTH_CLIENT_ID";
3333
const OAUTH_CLIENT_SECRET: &str = "OAUTH_CLIENT_SECRET";
3434
const OAUTH_AUTHENTICATE_URL: &str = "OAUTH_AUTHENTICATE_URL";
3535
const OAUTH_TOKEN_URL: &str = "OAUTH_TOKEN_URL";
36-
const OAUTH_AUDIENCE: &str = "OAUTH_AUDIENCE";
3736

3837
/// Configuration for a builder running a specific rollup on a specific host
3938
/// chain.
@@ -84,8 +83,6 @@ pub struct BuilderConfig {
8483
pub oauth_authenticate_url: String,
8584
/// OAuth token URL for the builder to get an OAuth2 access token
8685
pub oauth_token_url: String,
87-
/// OAuth audience for the builder.
88-
pub oauth_audience: String,
8986
/// The oauth token refresh interval in seconds.
9087
pub oauth_token_refresh_interval: u64,
9188
}
@@ -176,7 +173,6 @@ impl BuilderConfig {
176173
oauth_client_secret: load_string(OAUTH_CLIENT_SECRET)?,
177174
oauth_authenticate_url: load_string(OAUTH_AUTHENTICATE_URL)?,
178175
oauth_token_url: load_string(OAUTH_TOKEN_URL)?,
179-
oauth_audience: load_string(OAUTH_AUDIENCE)?,
180176
oauth_token_refresh_interval: load_u64(AUTH_TOKEN_REFRESH_INTERVAL)?,
181177
})
182178
}

src/tasks/oauth.rs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ use oauth2::{
1010
};
1111
use tokio::{sync::RwLock, task::JoinHandle};
1212

13-
const OAUTH_AUDIENCE_CLAIM: &str = "audience";
14-
1513
type Token = StandardTokenResponse<EmptyExtraTokenFields, BasicTokenType>;
1614

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

94-
let token_result = client
95-
.exchange_client_credentials()
96-
.add_extra_param(OAUTH_AUDIENCE_CLAIM, config.oauth_audience.clone())
97-
.request(http_client)?;
92+
let token_result = client.exchange_client_credentials().request(http_client)?;
9893

9994
Ok(token_result)
10095
}
@@ -166,7 +161,6 @@ mod tests {
166161
oauth_client_secret: "some_client_secret".into(),
167162
oauth_authenticate_url: "http://localhost:9000".into(),
168163
oauth_token_url: "http://localhost:9000".into(),
169-
oauth_audience: "https://transactions.holesky.signet.sh".into(),
170164
tx_broadcast_urls: vec!["http://localhost:9000".into()],
171165
oauth_token_refresh_interval: 300, // 5 minutes
172166
};

tests/bundle_poller_test.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ mod tests {
3939
oauth_client_secret: "some_client_secret".into(),
4040
oauth_authenticate_url: "http://localhost:8080".into(),
4141
oauth_token_url: "http://localhost:8080".into(),
42-
oauth_audience: "https://transactions.holesky.signet.sh".into(),
4342
tx_broadcast_urls: vec!["http://localhost:9000".into()],
4443
oauth_token_refresh_interval: 300, // 5 minutes
4544
};

tests/tx_poller_test.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,6 @@ mod tests {
8686
oauth_client_secret: "some_client_secret".into(),
8787
oauth_authenticate_url: "http://localhost:8080".into(),
8888
oauth_token_url: "http://localhost:8080".into(),
89-
oauth_audience: "https://transactions.holesky.signet.sh".into(),
9089
oauth_token_refresh_interval: 300, // 5 minutes
9190
};
9291
Ok(config)

0 commit comments

Comments
 (0)