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

RuntimeTransport jwt is broken #7972

Closed
2 tasks
Rjected opened this issue May 22, 2024 · 1 comment · Fixed by #7990
Closed
2 tasks

RuntimeTransport jwt is broken #7972

Rjected opened this issue May 22, 2024 · 1 comment · Fixed by #7990
Labels
T-bug Type: bug

Comments

@Rjected
Copy link
Contributor

Rjected commented May 22, 2024

Component

Cast

Have you ensured that all of these are up to date?

  • Foundry
  • Foundryup

What version of Foundry are you on?

No response

What command(s) is the bug in?

No response

Operating System

None

Describe the bug

Currently the jwt will not be included in the requests made by RuntimeTransport:

if let Some(jwt) = self.jwt.clone() {
let auth =
build_auth(jwt).map_err(|e| RuntimeTransportError::InvalidJwt(e.to_string()))?;
let mut auth_value: HeaderValue =
HeaderValue::from_str(&auth.to_string()).expect("Header should be valid string");
auth_value.set_sensitive(true);

This is because the alloy ToString implementation ignores any details of the bearer token:
https://github.com/alloy-rs/alloy/blob/b9f9f9f08db3cba4d3ac9d79d88c18005763bd57/crates/transport/src/common.rs#L48-L55

This will be set as a header value here:

HeaderValue::from_str(&auth.to_string()).expect("Header should be valid string");

which means the header will just be Bearer

@Rjected Rjected added the T-bug Type: bug label May 22, 2024
@Rjected
Copy link
Contributor Author

Rjected commented May 22, 2024

should be fixed by alloy-rs/alloy#772

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-bug Type: bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant