Skip to content

Commit d438a23

Browse files
committed
Replace http_service with http_client
1 parent 9bf53c3 commit d438a23

File tree

12 files changed

+27
-27
lines changed

12 files changed

+27
-27
lines changed

crates/oidc-client/src/requests/authorization_code.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ pub fn build_authorization_url(
347347
///
348348
/// # Arguments
349349
///
350-
/// * `http_service` - The service to use for making HTTP requests.
350+
/// * `http_client` - The reqwest client to use for making HTTP requests.
351351
///
352352
/// * `client_credentials` - The credentials obtained when registering the
353353
/// client.

crates/oidc-client/src/requests/client_credentials.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ use crate::{
2828
///
2929
/// # Arguments
3030
///
31-
/// * `http_service` - The service to use for making HTTP requests.
31+
/// * `http_client` - The reqwest client to use for making HTTP requests.
3232
///
3333
/// * `client_credentials` - The credentials obtained when registering the
3434
/// client.

crates/oidc-client/src/requests/discovery.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ pub async fn discover(
6969
///
7070
/// # Arguments
7171
///
72-
/// * `http_service` - The service to use for making HTTP requests.
72+
/// * `http_client` - The reqwest client to use for making HTTP requests.
7373
///
7474
/// * `issuer` - The URL of the OpenID Connect Provider to fetch metadata for.
7575
///

crates/oidc-client/src/requests/jose.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ use crate::{
2828
///
2929
/// # Arguments
3030
///
31-
/// * `http_service` - The service to use for making HTTP requests.
31+
/// * `http_client` - The reqwest client to use for making HTTP requests.
3232
///
3333
/// * `jwks_uri` - The URL where the JWKS can be retrieved.
3434
///

crates/oidc-client/src/requests/refresh_token.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ use crate::{
3131
///
3232
/// # Arguments
3333
///
34-
/// * `http_service` - The service to use for making HTTP requests.
34+
/// * `http_client` - The reqwest client to use for making HTTP requests.
3535
///
3636
/// * `client_credentials` - The credentials obtained when registering the
3737
/// client.

crates/oidc-client/src/requests/token.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ use crate::{
2121
///
2222
/// # Arguments
2323
///
24-
/// * `http_service` - The service to use for making HTTP requests.
24+
/// * `http_client` - The reqwest client to use for making HTTP requests.
2525
///
2626
/// * `client_credentials` - The credentials obtained when registering the
2727
/// client.

crates/oidc-client/src/requests/userinfo.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ use crate::{
3232
///
3333
/// # Arguments
3434
///
35-
/// * `http_service` - The service to use for making HTTP requests.
35+
/// * `http_client` - The reqwest client to use for making HTTP requests.
3636
///
3737
/// * `userinfo_endpoint` - The URL of the issuer's User Info endpoint.
3838
///

crates/oidc-client/tests/it/requests/authorization_code.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ fn is_valid_token_endpoint_request(req: &Request) -> bool {
178178

179179
#[tokio::test]
180180
async fn pass_access_token_with_authorization_code() {
181-
let (http_service, mock_server, issuer) = init_test().await;
181+
let (http_client, mock_server, issuer) = init_test().await;
182182
let client_credentials = client_credentials(&OAuthClientAuthenticationMethod::None, &issuer);
183183
let token_endpoint = issuer.join("token").unwrap();
184184
let mut rng = rand_chacha::ChaCha8Rng::seed_from_u64(42);
@@ -216,7 +216,7 @@ async fn pass_access_token_with_authorization_code() {
216216
.await;
217217

218218
let (response, response_id_token) = access_token_with_authorization_code(
219-
&http_service,
219+
&http_client,
220220
client_credentials,
221221
&token_endpoint,
222222
AUTHORIZATION_CODE.to_owned(),
@@ -236,7 +236,7 @@ async fn pass_access_token_with_authorization_code() {
236236

237237
#[tokio::test]
238238
async fn fail_access_token_with_authorization_code_wrong_nonce() {
239-
let (http_service, mock_server, issuer) = init_test().await;
239+
let (http_client, mock_server, issuer) = init_test().await;
240240
let client_credentials = client_credentials(&OAuthClientAuthenticationMethod::None, &issuer);
241241
let token_endpoint = issuer.join("token").unwrap();
242242
let mut rng = rand_chacha::ChaCha8Rng::seed_from_u64(42);
@@ -274,7 +274,7 @@ async fn fail_access_token_with_authorization_code_wrong_nonce() {
274274
.await;
275275

276276
let error = access_token_with_authorization_code(
277-
&http_service,
277+
&http_client,
278278
client_credentials,
279279
&token_endpoint,
280280
AUTHORIZATION_CODE.to_owned(),
@@ -297,7 +297,7 @@ async fn fail_access_token_with_authorization_code_wrong_nonce() {
297297

298298
#[tokio::test]
299299
async fn fail_access_token_with_authorization_code_no_id_token() {
300-
let (http_service, mock_server, issuer) = init_test().await;
300+
let (http_client, mock_server, issuer) = init_test().await;
301301
let client_credentials = client_credentials(&OAuthClientAuthenticationMethod::None, &issuer);
302302
let token_endpoint = issuer.join("token").unwrap();
303303
let mut rng = rand_chacha::ChaCha8Rng::seed_from_u64(42);
@@ -335,7 +335,7 @@ async fn fail_access_token_with_authorization_code_no_id_token() {
335335
.await;
336336

337337
let error = access_token_with_authorization_code(
338-
&http_service,
338+
&http_client,
339339
client_credentials,
340340
&token_endpoint,
341341
AUTHORIZATION_CODE.to_owned(),

crates/oidc-client/tests/it/requests/client_credentials.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ use crate::{client_credentials, init_test, now, ACCESS_TOKEN, CLIENT_ID, CLIENT_
2222

2323
#[tokio::test]
2424
async fn pass_access_token_with_client_credentials() {
25-
let (http_service, mock_server, issuer) = init_test().await;
25+
let (http_client, mock_server, issuer) = init_test().await;
2626
let client_credentials =
2727
client_credentials(&OAuthClientAuthenticationMethod::ClientSecretPost, &issuer);
2828
let token_endpoint = issuer.join("token").unwrap();
@@ -83,7 +83,7 @@ async fn pass_access_token_with_client_credentials() {
8383
.await;
8484

8585
let response = access_token_with_client_credentials(
86-
&http_service,
86+
&http_client,
8787
client_credentials,
8888
&token_endpoint,
8989
Some(scope),

crates/oidc-client/tests/it/requests/discovery.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,39 +53,39 @@ async fn pass_discover() {
5353

5454
#[tokio::test]
5555
async fn fail_discover_404() {
56-
let (http_service, _mock_server, issuer) = init_test().await;
56+
let (http_client, _mock_server, issuer) = init_test().await;
5757

58-
let error = discover(&http_service, issuer.as_str()).await.unwrap_err();
58+
let error = discover(&http_client, issuer.as_str()).await.unwrap_err();
5959

6060
assert_matches!(error, DiscoveryError::Http(_));
6161
}
6262

6363
#[tokio::test]
6464
async fn fail_discover_not_json() {
65-
let (http_service, mock_server, issuer) = init_test().await;
65+
let (http_client, mock_server, issuer) = init_test().await;
6666

6767
Mock::given(method("GET"))
6868
.and(path("/.well-known/openid-configuration"))
6969
.respond_with(ResponseTemplate::new(200))
7070
.mount(&mock_server)
7171
.await;
7272

73-
let error = discover(&http_service, issuer.as_str()).await.unwrap_err();
73+
let error = discover(&http_client, issuer.as_str()).await.unwrap_err();
7474

7575
assert_matches!(error, DiscoveryError::Http(_));
7676
}
7777

7878
#[tokio::test]
7979
async fn fail_discover_invalid_metadata() {
80-
let (http_service, mock_server, issuer) = init_test().await;
80+
let (http_client, mock_server, issuer) = init_test().await;
8181

8282
Mock::given(method("GET"))
8383
.and(path("/.well-known/openid-configuration"))
8484
.respond_with(ResponseTemplate::new(200).set_body_json(ProviderMetadata::default()))
8585
.mount(&mock_server)
8686
.await;
8787

88-
let error = discover(&http_service, issuer.as_str()).await.unwrap_err();
88+
let error = discover(&http_client, issuer.as_str()).await.unwrap_err();
8989

9090
assert_matches!(error, DiscoveryError::Validation(_));
9191
}

0 commit comments

Comments
 (0)