Skip to content

Commit 0d4f9ba

Browse files
committed
feat: rename introspection endpoint to comply with spec
1 parent 39f88bb commit 0d4f9ba

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

hack/roundtrip-azure.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ user_token=$(echo ${user_token_response} | jq -r .access_token)
55
response=$(curl -s -X POST http://localhost:3000/token -H "content-type: application/json" -d '{"target": "my-target", "identity_provider": "azuread", "user_token": "'${user_token}'"}')
66
token=$(echo ${response} | jq -r .access_token)
77

8-
#validation=$(curl -s -X POST http://localhost:3000/introspection -H "content-type: application/json" -d "{\"token\": \"${token}\"}")
8+
#validation=$(curl -s -X POST http://localhost:3000/introspect -H "content-type: application/json" -d "{\"token\": \"${token}\"}")
99

1010
echo
1111
echo "JWT:"

hack/roundtrip.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/bash -e
22
response=$(curl -s -X POST http://localhost:3000/token -H "content-type: application/json" -d '{"target": "my-target", "identity_provider": "maskinporten"}')
33
token=$(echo ${response} | jq -r .access_token)
4-
validation=$(curl -s -X POST http://localhost:3000/introspection -H "content-type: application/json" -d "{\"token\": \"${token}\"}")
4+
validation=$(curl -s -X POST http://localhost:3000/introspect -H "content-type: application/json" -d "{\"token\": \"${token}\"}")
55

66
echo
77
echo "JWT:"

src/handlers.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ pub async fn token(
5757
Ok((StatusCode::OK, Json(res)))
5858
}
5959

60-
pub async fn introspection(
60+
pub async fn introspect(
6161
State(state): State<HandlerState>,
6262
Json(request): Json<IntrospectRequest>,
6363
) -> Result<impl IntoResponse, ApiError> {

src/main.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -93,11 +93,11 @@ async fn main() {
9393
};
9494

9595
let app = Router::new()
96-
.route("/token", post(handlers::token))
9796
.with_state(state.clone())
97+
.route("/token", post(handlers::token))
9898
.route(
99-
"/introspection",
100-
post(handlers::introspection).with_state(state.clone()),
99+
"/introspect",
100+
post(handlers::introspect),
101101
);
102102

103103
let listener = tokio::net::TcpListener::bind(cfg.bind_address)

0 commit comments

Comments
 (0)