File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed
src/controllers/trustpub/tokens/exchange Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -38,7 +38,8 @@ pub async fn exchange_trustpub_token(
38
38
39
39
let unverified_issuer = unverified_token_data. claims . iss ;
40
40
let Some ( keystore) = state. oidc_key_stores . get ( & unverified_issuer) else {
41
- return Err ( bad_request ( "Unsupported JWT issuer" ) ) ;
41
+ let error = format ! ( "Unsupported JWT issuer: {unverified_issuer}" ) ;
42
+ return Err ( bad_request ( error) ) ;
42
43
} ;
43
44
44
45
let Some ( unverified_key_id) = unverified_token_data. header . kid else {
@@ -60,7 +61,8 @@ pub async fn exchange_trustpub_token(
60
61
// The following code is only supporting GitHub Actions for now, so let's
61
62
// drop out if the issuer is not GitHub.
62
63
if unverified_issuer != GITHUB_ISSUER_URL {
63
- return Err ( bad_request ( "Unsupported JWT issuer" ) ) ;
64
+ let error = format ! ( "Unsupported JWT issuer: {unverified_issuer}" ) ;
65
+ return Err ( bad_request ( error) ) ;
64
66
}
65
67
66
68
let audience = & state. config . trustpub_audience ;
Original file line number Diff line number Diff line change @@ -157,7 +157,7 @@ async fn test_unsupported_issuer() -> anyhow::Result<()> {
157
157
let body = default_claims ( ) . as_exchange_body ( ) ?;
158
158
let response = client. post :: < ( ) > ( URL , body) . await ;
159
159
assert_snapshot ! ( response. status( ) , @"400 Bad Request" ) ;
160
- assert_snapshot ! ( response. json( ) , @r#"{"errors":[{"detail":"Unsupported JWT issuer"}]}"# ) ;
160
+ assert_snapshot ! ( response. json( ) , @r#"{"errors":[{"detail":"Unsupported JWT issuer: https://token.actions.githubusercontent.com "}]}"# ) ;
161
161
162
162
Ok ( ( ) )
163
163
}
You can’t perform that action at this time.
0 commit comments