Skip to content

Commit

Permalink
fix: change Request object Content-Type to `application/oauth-authz-r…
Browse files Browse the repository at this point in the history
…eq+jwt` (#157)
  • Loading branch information
nanderstabel authored Dec 12, 2024
1 parent 98045e9 commit 8daca06
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 17 deletions.
12 changes: 6 additions & 6 deletions Cargo.lock

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

10 changes: 5 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ rust-version = "1.76.0"

[workspace.dependencies]
did_manager = { git = "https://[email protected]/impierce/did-manager.git", tag = "v1.0.0-beta.3" }
siopv2 = { git = "https://[email protected]/impierce/openid4vc.git", rev = "12fed14" }
oid4vci = { git = "https://[email protected]/impierce/openid4vc.git", rev = "12fed14" }
oid4vc-core = { git = "https://[email protected]/impierce/openid4vc.git", rev = "12fed14" }
oid4vc-manager = { git = "https://[email protected]/impierce/openid4vc.git", rev = "12fed14" }
oid4vp = { git = "https://[email protected]/impierce/openid4vc.git", rev = "12fed14" }
siopv2 = { git = "https://[email protected]/impierce/openid4vc.git", rev = "7be5b72" }
oid4vci = { git = "https://[email protected]/impierce/openid4vc.git", rev = "7be5b72" }
oid4vc-core = { git = "https://[email protected]/impierce/openid4vc.git", rev = "7be5b72" }
oid4vc-manager = { git = "https://[email protected]/impierce/openid4vc.git", rev = "7be5b72" }
oid4vp = { git = "https://[email protected]/impierce/openid4vc.git", rev = "7be5b72" }

async-trait = "0.1"
axum = { version = "0.7", features = ["tracing"] }
Expand Down
9 changes: 6 additions & 3 deletions agent_api_rest/src/verification/relying_party/request.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ pub(crate) async fn request(
..
})) => (
StatusCode::OK,
[(header::CONTENT_TYPE, "application/jwt")],
[(header::CONTENT_TYPE, "application/oauth-authz-req+jwt")],
signed_authorization_request_object,
)
.into_response(),
Expand Down Expand Up @@ -57,13 +57,16 @@ pub mod tests {

assert_eq!(response.status(), StatusCode::OK);

assert_eq!(response.headers().get("Content-Type").unwrap(), "application/jwt");
assert_eq!(
response.headers().get("Content-Type").unwrap(),
"application/oauth-authz-req+jwt"
);

let body = axum::body::to_bytes(response.into_body(), usize::MAX).await.unwrap();
let body: String = String::from_utf8(body.to_vec()).unwrap();

let header = body.split_once('.').unwrap().0;
assert_eq!(header, "eyJ0eXAiOiJKV1QiLCJhbGciOiJFZERTQSIsImtpZCI6ImRpZDprZXk6ejZNa2dFODROQ01wTWVBeDlqSzljZjVXNEc4Z2NaOXh1d0p2RzFlN3dOazhLQ2d0I3o2TWtnRTg0TkNNcE1lQXg5aks5Y2Y1VzRHOGdjWjl4dXdKdkcxZTd3Tms4S0NndCJ9");
assert_eq!(header, "eyJ0eXAiOiJvYXV0aC1hdXRoei1yZXErand0IiwiYWxnIjoiRWREU0EiLCJraWQiOiJkaWQ6a2V5Ono2TWtnRTg0TkNNcE1lQXg5aks5Y2Y1VzRHOGdjWjl4dXdKdkcxZTd3Tms4S0NndCN6Nk1rZ0U4NE5DTXBNZUF4OWpLOWNmNVc0RzhnY1o5eHV3SnZHMWU3d05rOEtDZ3QifQ");
}

#[tokio::test]
Expand Down
6 changes: 3 additions & 3 deletions agent_verification/src/authorization_request/aggregate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -589,7 +589,7 @@ pub mod tests {
openid://?\
client_id=did%3Aiota%3Arms%3A0x42ad588322e58b3c07aa39e4948d021ee17ecb5747915e9e1f35f028d7ecaf90&\
request_uri=https%3A%2F%2Fmy-domain.example.org%2Frequest%2Fstate";
const SIGNED_AUTHORIZATION_REQUEST_OBJECT_DID_KEY: &str = "eyJ0eXAiOiJKV1QiLCJhbGciOiJFZERTQSIsImtpZCI6ImRpZDprZXk6ejZNa2dFODROQ01wTWVBeDlqSzljZjVXNEc4Z2NaOXh1d0p2RzFlN3dOazhLQ2d0I3o2TWtnRTg0TkNNcE1lQXg5aks5Y2Y1VzRHOGdjWjl4dXdKdkcxZTd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