pub struct Client { /* private fields */ }
Expand description
Client for AWS SSO OIDC
Client for invoking operations on AWS SSO OIDC. Each operation on AWS SSO OIDC is a method on this
this struct. .send()
MUST be invoked on the generated operations to dispatch the request to the service.
§Using the Client
A client has a function for every operation that can be performed by the service.
For example, the CreateToken
operation has
a Client::create_token
, function which returns a builder for that operation.
The fluent builder ultimately has a send()
function that returns an async future that
returns a result, as illustrated below:
let result = client.create_token()
.client_id("example")
.send()
.await;
The underlying HTTP requests that get made by this can be modified with the customize_operation
function on the fluent builder. See the customize
module for more
information.
Implementations§
Source§impl Client
impl Client
Sourcepub fn create_token(&self) -> CreateTokenFluentBuilder
pub fn create_token(&self) -> CreateTokenFluentBuilder
Constructs a fluent builder for the CreateToken
operation.
- The fluent builder is configurable:
client_id(impl Into<String>)
/set_client_id(Option<String>)
:
required: trueThe unique identifier string for the client or application. This value comes from the result of the
RegisterClient
API.client_secret(impl Into<String>)
/set_client_secret(Option<String>)
:
required: trueA secret string generated for the client. This value should come from the persisted result of the
RegisterClient
API.grant_type(impl Into<String>)
/set_grant_type(Option<String>)
:
required: trueSupports the following OAuth grant types: Device Code and Refresh Token. Specify either of the following values, depending on the grant type that you want:
* Device Code -
urn:ietf:params:oauth:grant-type:device_code
* Refresh Token -
refresh_token
For information about how to obtain the device code, see the
StartDeviceAuthorization
topic.device_code(impl Into<String>)
/set_device_code(Option<String>)
:
required: falseUsed only when calling this API for the Device Code grant type. This short-term code is used to identify this authorization request. This comes from the result of the
StartDeviceAuthorization
API.code(impl Into<String>)
/set_code(Option<String>)
:
required: falseUsed only when calling this API for the Authorization Code grant type. The short-term code is used to identify this authorization request. This grant type is currently unsupported for the
CreateToken
API.refresh_token(impl Into<String>)
/set_refresh_token(Option<String>)
:
required: falseUsed only when calling this API for the Refresh Token grant type. This token is used to refresh short-term tokens, such as the access token, that might expire.
For more information about the features and limitations of the current IAM Identity Center OIDC implementation, see Considerations for Using this Guide in the IAM Identity Center OIDC API Reference.
scope(impl Into<String>)
/set_scope(Option<Vec::<String>>)
:
required: falseThe list of scopes for which authorization is requested. The access token that is issued is limited to the scopes that are granted. If this value is not specified, IAM Identity Center authorizes all scopes that are configured for the client during the call to
RegisterClient
.redirect_uri(impl Into<String>)
/set_redirect_uri(Option<String>)
:
required: falseUsed only when calling this API for the Authorization Code grant type. This value specifies the location of the client or application that has registered to receive the authorization code.
code_verifier(impl Into<String>)
/set_code_verifier(Option<String>)
:
required: falseUsed only when calling this API for the Authorization Code grant type. This value is generated by the client and presented to validate the original code challenge value the client passed at authorization time.
- On success, responds with
CreateTokenOutput
with field(s):access_token(Option<String>)
:A bearer token to access Amazon Web Services accounts and applications assigned to a user.
token_type(Option<String>)
:Used to notify the client that the returned token is an access token. The supported token type is
Bearer
.expires_in(i32)
:Indicates the time in seconds when an access token will expire.
refresh_token(Option<String>)
:A token that, if present, can be used to refresh a previously issued access token that might have expired.
For more information about the features and limitations of the current IAM Identity Center OIDC implementation, see Considerations for Using this Guide in the IAM Identity Center OIDC API Reference.
id_token(Option<String>)
:The
idToken
is not implemented or supported. For more information about the features and limitations of the current IAM Identity Center OIDC implementation, see Considerations for Using this Guide in the IAM Identity Center OIDC API Reference.A JSON Web Token (JWT) that identifies who is associated with the issued access token.
- On failure, responds with
SdkError<CreateTokenError>
Source§impl Client
impl Client
Sourcepub fn create_token_with_iam(&self) -> CreateTokenWithIAMFluentBuilder
pub fn create_token_with_iam(&self) -> CreateTokenWithIAMFluentBuilder
Constructs a fluent builder for the CreateTokenWithIAM
operation.
- The fluent builder is configurable:
client_id(impl Into<String>)
/set_client_id(Option<String>)
:
required: trueThe unique identifier string for the client or application. This value is an application ARN that has OAuth grants configured.
grant_type(impl Into<String>)
/set_grant_type(Option<String>)
:
required: trueSupports the following OAuth grant types: Authorization Code, Refresh Token, JWT Bearer, and Token Exchange. Specify one of the following values, depending on the grant type that you want:
* Authorization Code -
authorization_code
* Refresh Token -
refresh_token
* JWT Bearer -
urn:ietf:params:oauth:grant-type:jwt-bearer
* Token Exchange -
urn:ietf:params:oauth:grant-type:token-exchange
code(impl Into<String>)
/set_code(Option<String>)
:
required: falseUsed only when calling this API for the Authorization Code grant type. This short-term code is used to identify this authorization request. The code is obtained through a redirect from IAM Identity Center to a redirect URI persisted in the Authorization Code GrantOptions for the application.
refresh_token(impl Into<String>)
/set_refresh_token(Option<String>)
:
required: falseUsed only when calling this API for the Refresh Token grant type. This token is used to refresh short-term tokens, such as the access token, that might expire.
For more information about the features and limitations of the current IAM Identity Center OIDC implementation, see Considerations for Using this Guide in the IAM Identity Center OIDC API Reference.
assertion(impl Into<String>)
/set_assertion(Option<String>)
:
required: falseUsed only when calling this API for the JWT Bearer grant type. This value specifies the JSON Web Token (JWT) issued by a trusted token issuer. To authorize a trusted token issuer, configure the JWT Bearer GrantOptions for the application.
scope(impl Into<String>)
/set_scope(Option<Vec::<String>>)
:
required: falseThe list of scopes for which authorization is requested. The access token that is issued is limited to the scopes that are granted. If the value is not specified, IAM Identity Center authorizes all scopes configured for the application, including the following default scopes:
openid
,aws
,sts:identity_context
.redirect_uri(impl Into<String>)
/set_redirect_uri(Option<String>)
:
required: falseUsed only when calling this API for the Authorization Code grant type. This value specifies the location of the client or application that has registered to receive the authorization code.
subject_token(impl Into<String>)
/set_subject_token(Option<String>)
:
required: falseUsed only when calling this API for the Token Exchange grant type. This value specifies the subject of the exchange. The value of the subject token must be an access token issued by IAM Identity Center to a different client or application. The access token must have authorized scopes that indicate the requested application as a target audience.
subject_token_type(impl Into<String>)
/set_subject_token_type(Option<String>)
:
required: falseUsed only when calling this API for the Token Exchange grant type. This value specifies the type of token that is passed as the subject of the exchange. The following value is supported:
* Access Token -
urn:ietf:params:oauth:token-type:access_token
requested_token_type(impl Into<String>)
/set_requested_token_type(Option<String>)
:
required: falseUsed only when calling this API for the Token Exchange grant type. This value specifies the type of token that the requester can receive. The following values are supported:
* Access Token -
urn:ietf:params:oauth:token-type:access_token
* Refresh Token -
urn:ietf:params:oauth:token-type:refresh_token
code_verifier(impl Into<String>)
/set_code_verifier(Option<String>)
:
required: falseUsed only when calling this API for the Authorization Code grant type. This value is generated by the client and presented to validate the original code challenge value the client passed at authorization time.
- On success, responds with
CreateTokenWithIamOutput
with field(s):access_token(Option<String>)
:A bearer token to access Amazon Web Services accounts and applications assigned to a user.
token_type(Option<String>)
:Used to notify the requester that the returned token is an access token. The supported token type is
Bearer
.expires_in(i32)
:Indicates the time in seconds when an access token will expire.
refresh_token(Option<String>)
:A token that, if present, can be used to refresh a previously issued access token that might have expired.
For more information about the features and limitations of the current IAM Identity Center OIDC implementation, see Considerations for Using this Guide in the IAM Identity Center OIDC API Reference.
id_token(Option<String>)
:A JSON Web Token (JWT) that identifies the user associated with the issued access token.
issued_token_type(Option<String>)
:Indicates the type of tokens that are issued by IAM Identity Center. The following values are supported:
* Access Token -
urn:ietf:params:oauth:token-type:access_token
* Refresh Token -
urn:ietf:params:oauth:token-type:refresh_token
scope(Option<Vec::<String>>)
:The list of scopes for which authorization is granted. The access token that is issued is limited to the scopes that are granted.
- On failure, responds with
SdkError<CreateTokenWithIAMError>
Source§impl Client
impl Client
Sourcepub fn register_client(&self) -> RegisterClientFluentBuilder
pub fn register_client(&self) -> RegisterClientFluentBuilder
Constructs a fluent builder for the RegisterClient
operation.
- The fluent builder is configurable:
client_name(impl Into<String>)
/set_client_name(Option<String>)
:
required: trueThe friendly name of the client.
client_type(impl Into<String>)
/set_client_type(Option<String>)
:
required: trueThe type of client. The service supports only
public
as a client type. Anything other than public will be rejected by the service.scopes(impl Into<String>)
/set_scopes(Option<Vec::<String>>)
:
required: falseThe list of scopes that are defined by the client. Upon authorization, this list is used to restrict permissions when granting an access token.
redirect_uris(impl Into<String>)
/set_redirect_uris(Option<Vec::<String>>)
:
required: falseThe list of redirect URI that are defined by the client. At completion of authorization, this list is used to restrict what locations the user agent can be redirected back to.
grant_types(impl Into<String>)
/set_grant_types(Option<Vec::<String>>)
:
required: falseThe list of OAuth 2.0 grant types that are defined by the client. This list is used to restrict the token granting flows available to the client.
issuer_url(impl Into<String>)
/set_issuer_url(Option<String>)
:
required: falseThe IAM Identity Center Issuer URL associated with an instance of IAM Identity Center. This value is needed for user access to resources through the client.
entitled_application_arn(impl Into<String>)
/set_entitled_application_arn(Option<String>)
:
required: falseThis IAM Identity Center application ARN is used to define administrator-managed configuration for public client access to resources. At authorization, the scopes, grants, and redirect URI available to this client will be restricted by this application resource.
- On success, responds with
RegisterClientOutput
with field(s):client_id(Option<String>)
:The unique identifier string for each client. This client uses this identifier to get authenticated by the service in subsequent calls.
client_secret(Option<String>)
:A secret string generated for the client. The client will use this string to get authenticated by the service in subsequent calls.
client_id_issued_at(i64)
:Indicates the time at which the
clientId
andclientSecret
were issued.client_secret_expires_at(i64)
:Indicates the time at which the
clientId
andclientSecret
will become invalid.authorization_endpoint(Option<String>)
:An endpoint that the client can use to request authorization.
token_endpoint(Option<String>)
:An endpoint that the client can use to create tokens.
- On failure, responds with
SdkError<RegisterClientError>
Source§impl Client
impl Client
Constructs a fluent builder for the StartDeviceAuthorization
operation.
- The fluent builder is configurable:
client_id(impl Into<String>)
/set_client_id(Option<String>)
:
required: trueThe unique identifier string for the client that is registered with IAM Identity Center. This value should come from the persisted result of the
RegisterClient
API operation.client_secret(impl Into<String>)
/set_client_secret(Option<String>)
:
required: trueA secret string that is generated for the client. This value should come from the persisted result of the
RegisterClient
API operation.start_url(impl Into<String>)
/set_start_url(Option<String>)
:
required: trueThe URL for the Amazon Web Services access portal. For more information, see Using the Amazon Web Services access portal in the IAM Identity Center User Guide.
- On success, responds with
StartDeviceAuthorizationOutput
with field(s):device_code(Option<String>)
:The short-lived code that is used by the device when polling for a session token.
user_code(Option<String>)
:A one-time user verification code. This is needed to authorize an in-use device.
verification_uri(Option<String>)
:The URI of the verification page that takes the
userCode
to authorize the device.verification_uri_complete(Option<String>)
:An alternate URL that the client can use to automatically launch a browser. This process skips the manual step in which the user visits the verification page and enters their code.
expires_in(i32)
:Indicates the number of seconds in which the verification code will become invalid.
interval(i32)
:Indicates the number of seconds the client must wait between attempts when polling for a session.
- On failure, responds with
SdkError<StartDeviceAuthorizationError>
Source§impl Client
impl Client
Sourcepub fn from_conf(conf: Config) -> Self
pub fn from_conf(conf: Config) -> Self
Creates a new client from the service Config
.
§Panics
This method will panic in the following cases:
- Retries or timeouts are enabled without a
sleep_impl
configured. - Identity caching is enabled without a
sleep_impl
andtime_source
configured. - No
behavior_version
is provided.
The panic message for each of these will have instructions on how to resolve them.
Source§impl Client
impl Client
Sourcepub fn new(sdk_config: &SdkConfig) -> Self
pub fn new(sdk_config: &SdkConfig) -> Self
Creates a new client from an SDK Config.
§Panics
- This method will panic if the
sdk_config
is missing an async sleep implementation. If you experience this panic, set thesleep_impl
on the Config passed into this function to fix it. - This method will panic if the
sdk_config
is missing an HTTP connector. If you experience this panic, set thehttp_connector
on the Config passed into this function to fix it. - This method will panic if no
BehaviorVersion
is provided. If you experience this panic, setbehavior_version
on the Config or enable thebehavior-version-latest
Cargo feature.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Client
impl !RefUnwindSafe for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl !UnwindSafe for Client
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Paint for Twhere
T: ?Sized,
impl<T> Paint for Twhere
T: ?Sized,
Source§fn fg(&self, value: Color) -> Painted<&T>
fn fg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self
with the foreground set to
value
.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like red()
and
green()
, which have the same functionality but are
pithier.
§Example
Set foreground color to white using fg()
:
use yansi::{Paint, Color};
painted.fg(Color::White);
Set foreground color to white using white()
.
use yansi::Paint;
painted.white();
Source§fn bright_black(&self) -> Painted<&T>
fn bright_black(&self) -> Painted<&T>
Returns self
with the
fg()
set to
Color::BrightBlack
.
§Example
println!("{}", value.bright_black());
Source§fn bright_red(&self) -> Painted<&T>
fn bright_red(&self) -> Painted<&T>
Source§fn bright_green(&self) -> Painted<&T>
fn bright_green(&self) -> Painted<&T>
Returns self
with the
fg()
set to
Color::BrightGreen
.
§Example
println!("{}", value.bright_green());
Source§fn bright_yellow(&self) -> Painted<&T>
fn bright_yellow(&self) -> Painted<&T>
Returns self
with the
fg()
set to
Color::BrightYellow
.
§Example
println!("{}", value.bright_yellow());
Source§fn bright_blue(&self) -> Painted<&T>
fn bright_blue(&self) -> Painted<&T>
Source§fn bright_magenta(&self) -> Painted<&T>
fn bright_magenta(&self) -> Painted<&T>
Returns self
with the
fg()
set to
Color::BrightMagenta
.
§Example
println!("{}", value.bright_magenta());
Source§fn bright_cyan(&self) -> Painted<&T>
fn bright_cyan(&self) -> Painted<&T>
Source§fn bright_white(&self) -> Painted<&T>
fn bright_white(&self) -> Painted<&T>
Returns self
with the
fg()
set to
Color::BrightWhite
.
§Example
println!("{}", value.bright_white());
Source§fn bg(&self, value: Color) -> Painted<&T>
fn bg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self
with the background set to
value
.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like on_red()
and
on_green()
, which have the same functionality but
are pithier.
§Example
Set background color to red using fg()
:
use yansi::{Paint, Color};
painted.bg(Color::Red);
Set background color to red using on_red()
.
use yansi::Paint;
painted.on_red();
Source§fn on_primary(&self) -> Painted<&T>
fn on_primary(&self) -> Painted<&T>
Source§fn on_magenta(&self) -> Painted<&T>
fn on_magenta(&self) -> Painted<&T>
Source§fn on_bright_black(&self) -> Painted<&T>
fn on_bright_black(&self) -> Painted<&T>
Returns self
with the
bg()
set to
Color::BrightBlack
.
§Example
println!("{}", value.on_bright_black());
Source§fn on_bright_red(&self) -> Painted<&T>
fn on_bright_red(&self) -> Painted<&T>
Source§fn on_bright_green(&self) -> Painted<&T>
fn on_bright_green(&self) -> Painted<&T>
Returns self
with the
bg()
set to
Color::BrightGreen
.
§Example
println!("{}", value.on_bright_green());
Source§fn on_bright_yellow(&self) -> Painted<&T>
fn on_bright_yellow(&self) -> Painted<&T>
Returns self
with the
bg()
set to
Color::BrightYellow
.
§Example
println!("{}", value.on_bright_yellow());
Source§fn on_bright_blue(&self) -> Painted<&T>
fn on_bright_blue(&self) -> Painted<&T>
Returns self
with the
bg()
set to
Color::BrightBlue
.
§Example
println!("{}", value.on_bright_blue());
Source§fn on_bright_magenta(&self) -> Painted<&T>
fn on_bright_magenta(&self) -> Painted<&T>
Returns self
with the
bg()
set to
Color::BrightMagenta
.
§Example
println!("{}", value.on_bright_magenta());
Source§fn on_bright_cyan(&self) -> Painted<&T>
fn on_bright_cyan(&self) -> Painted<&T>
Returns self
with the
bg()
set to
Color::BrightCyan
.
§Example
println!("{}", value.on_bright_cyan());
Source§fn on_bright_white(&self) -> Painted<&T>
fn on_bright_white(&self) -> Painted<&T>
Returns self
with the
bg()
set to
Color::BrightWhite
.
§Example
println!("{}", value.on_bright_white());
Source§fn attr(&self, value: Attribute) -> Painted<&T>
fn attr(&self, value: Attribute) -> Painted<&T>
Enables the styling Attribute
value
.
This method should be used rarely. Instead, prefer to use
attribute-specific builder methods like bold()
and
underline()
, which have the same functionality
but are pithier.
§Example
Make text bold using attr()
:
use yansi::{Paint, Attribute};
painted.attr(Attribute::Bold);
Make text bold using using bold()
.
use yansi::Paint;
painted.bold();
Source§fn underline(&self) -> Painted<&T>
fn underline(&self) -> Painted<&T>
Returns self
with the
attr()
set to
Attribute::Underline
.
§Example
println!("{}", value.underline());
Source§fn rapid_blink(&self) -> Painted<&T>
fn rapid_blink(&self) -> Painted<&T>
Returns self
with the
attr()
set to
Attribute::RapidBlink
.
§Example
println!("{}", value.rapid_blink());
Source§fn quirk(&self, value: Quirk) -> Painted<&T>
fn quirk(&self, value: Quirk) -> Painted<&T>
Enables the yansi
Quirk
value
.
This method should be used rarely. Instead, prefer to use quirk-specific
builder methods like mask()
and
wrap()
, which have the same functionality but are
pithier.
§Example
Enable wrapping using .quirk()
:
use yansi::{Paint, Quirk};
painted.quirk(Quirk::Wrap);
Enable wrapping using wrap()
.
use yansi::Paint;
painted.wrap();
Source§fn clear(&self) -> Painted<&T>
👎Deprecated since 1.0.1: renamed to resetting()
due to conflicts with Vec::clear()
.
The clear()
method will be removed in a future release.
fn clear(&self) -> Painted<&T>
resetting()
due to conflicts with Vec::clear()
.
The clear()
method will be removed in a future release.Source§fn whenever(&self, value: Condition) -> Painted<&T>
fn whenever(&self, value: Condition) -> Painted<&T>
Conditionally enable styling based on whether the Condition
value
applies. Replaces any previous condition.
See the crate level docs for more details.
§Example
Enable styling painted
only when both stdout
and stderr
are TTYs:
use yansi::{Paint, Condition};
painted.red().on_yellow().whenever(Condition::STDOUTERR_ARE_TTY);