Skip to content

Commit 32ec48c

Browse files
lovasoaclaude
andcommitted
remove unused discovery_delay field from FakeOidcProvider
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 2d0620e commit 32ec48c

File tree

1 file changed

+12
-17
lines changed

1 file changed

+12
-17
lines changed

tests/oidc/mod.rs

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ struct ProviderState<'a> {
5151
client_id: String,
5252
auth_codes: HashMap<String, String>, // code -> nonce
5353
jwt_customizer: Option<Box<JwtCustomizer<'a>>>,
54-
discovery_delay: Duration,
5554
token_endpoint_delay: Duration,
5655
discovery_count: usize,
5756
}
@@ -85,22 +84,19 @@ struct TokenResponse {
8584
}
8685

8786
async fn discovery_endpoint(state: Data<SharedProviderState>) -> impl Responder {
88-
let (discovery, delay) = {
89-
let mut state = state.lock().unwrap();
90-
state.discovery_count += 1;
91-
let discovery = DiscoveryResponse {
92-
issuer: state.issuer_url.clone(),
93-
authorization_endpoint: format!("{}/auth", state.issuer_url),
94-
token_endpoint: format!("{}/token", state.issuer_url),
95-
jwks_uri: format!("{}/jwks", state.issuer_url),
96-
response_types_supported: vec!["code".to_string()],
97-
subject_types_supported: vec!["public".to_string()],
98-
id_token_signing_alg_values_supported: vec!["HS256".to_string()],
99-
end_session_endpoint: format!("{}/logout", state.issuer_url),
100-
};
101-
(discovery, state.discovery_delay)
87+
let mut state = state.lock().unwrap();
88+
state.discovery_count += 1;
89+
let discovery = DiscoveryResponse {
90+
issuer: state.issuer_url.clone(),
91+
authorization_endpoint: format!("{}/auth", state.issuer_url),
92+
token_endpoint: format!("{}/token", state.issuer_url),
93+
jwks_uri: format!("{}/jwks", state.issuer_url),
94+
response_types_supported: vec!["code".to_string()],
95+
subject_types_supported: vec!["public".to_string()],
96+
id_token_signing_alg_values_supported: vec!["HS256".to_string()],
97+
end_session_endpoint: format!("{}/logout", state.issuer_url),
10298
};
103-
tokio::time::sleep(delay).await;
99+
drop(state);
104100
HttpResponse::Ok()
105101
.insert_header((header::CONTENT_TYPE, "application/json"))
106102
.json(discovery)
@@ -202,7 +198,6 @@ impl FakeOidcProvider {
202198
client_id: client_id.clone(),
203199
auth_codes: HashMap::new(),
204200
jwt_customizer: None,
205-
discovery_delay: Duration::ZERO,
206201
token_endpoint_delay: Duration::ZERO,
207202
discovery_count: 0,
208203
}));

0 commit comments

Comments
 (0)