File tree Expand file tree Collapse file tree 2 files changed +9
-0
lines changed
modules/openapi-generator/src/main/resources/rust/reqwest Expand file tree Collapse file tree 2 files changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -78,9 +78,16 @@ impl {{{classname}}} for {{{classname}}}Client {
7878 { {/isKeyInHeader} }
7979 { {/isApiKey} }
8080 { {#isBasic} }
81+ { {^isBasicBearer} }
8182 if let Some(ref auth_conf) = configuration.basic_auth {
8283 req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
8384 } ;
85+ { {/isBasicBearer} }
86+ { {#isBasicBearer} }
87+ if let Some(ref token) = configuration.bearer_access_token {
88+ req_builder = req_builder.bearer_auth(token.to_owned());
89+ } ;
90+ { {/isBasicBearer} }
8491 { {/isBasic} }
8592 { {#isOAuth} }
8693 if let Some(ref token) = configuration.oauth_access_token {
Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ pub struct Configuration {
88 pub client: reqwest::Client,
99 pub basic_auth: Option< BasicAuth> ,
1010 pub oauth_access_token: Option< String> ,
11+ pub bearer_access_token: Option< String> ,
1112 pub api_key: Option< ApiKey> ,
1213 // TODO: take an oauth2 token source, similar to the go one
1314}
@@ -33,6 +34,7 @@ impl Default for Configuration {
3334 client: reqwest::Client::new(),
3435 basic_auth: None,
3536 oauth_access_token: None,
37+ bearer_access_token: None,
3638 api_key: None,
3739 }
3840 }
You can’t perform that action at this time.
0 commit comments