pub struct PingCredentialsProvider {
pub ssl_insecure: bool,
/* private fields */
}Expand description
PingFederate identity provider plugin for SAML-based Redshift authentication.
See the Amazon Redshift IAM docs for setup instructions.
Fields§
§ssl_insecure: boolWhen true, TLS certificate verification is disabled. Defaults to false.
Implementations§
Source§impl PingCredentialsProvider
impl PingCredentialsProvider
Sourcepub fn new(
partner_sp_id_option: Option<impl ToString>,
idp_host: impl ToString,
idp_port: Option<u16>,
user_name: impl ToString,
password: SecretString,
) -> Self
pub fn new( partner_sp_id_option: Option<impl ToString>, idp_host: impl ToString, idp_port: Option<u16>, user_name: impl ToString, password: SecretString, ) -> Self
Creates a new PingCredentialsProvider.
partner_sp_id: The SP entity ID sent to PingFederate.Nonedefaults to"urn%3Aamazon%3Awebservices".idp_port: Defaults to443whenNone.
§Examples
use secrecy::SecretString;
use redshift_iam::PingCredentialsProvider;
let scp = PingCredentialsProvider::new(
None::<String>,
"pingfed.example.com",
None,
"alice",
SecretString::new("s3cr3t".to_string().into_boxed_str()),
);
assert!(!scp.ssl_insecure);
assert!(scp.do_verify_ssl_cert());
assert_eq!(scp.user(), "alice");Sourcepub fn do_verify_ssl_cert(&self) -> bool
pub fn do_verify_ssl_cert(&self) -> bool
Returns true when TLS certificate verification is enabled (i.e. ssl_insecure is false).
Sourcepub fn get_credentials(
&self,
preferred_role: impl ToString,
) -> Option<Credentials>
pub fn get_credentials( &self, preferred_role: impl ToString, ) -> Option<Credentials>
Synchronously retrieves temporary AWS credentials for preferred_role.
Drives the full SAML -> STS flow on a new Tokio runtime. Prefer the async
get_credentials free function when already inside an async context.
Trait Implementations§
Source§impl Debug for PingCredentialsProvider
impl Debug for PingCredentialsProvider
Source§impl SamlProvider for PingCredentialsProvider
impl SamlProvider for PingCredentialsProvider
Source§async fn get_saml_assertion(&self) -> String
async fn get_saml_assertion(&self) -> String
Logs in to the PingFederate IdP and returns a base64-encoded SAML assertion.
Issues a GET to the SSO start URL, parses the login form, submits credentials,
and extracts the SAMLResponse value from the resulting page.
§Panics
- If the login form cannot be parsed or credentials fields are missing.
- If the POST to the IdP returns a non-200 status.
- If no
SAMLResponseinput is found in the response.
Auto Trait Implementations§
impl Freeze for PingCredentialsProvider
impl RefUnwindSafe for PingCredentialsProvider
impl Send for PingCredentialsProvider
impl Sync for PingCredentialsProvider
impl Unpin for PingCredentialsProvider
impl UnsafeUnpin for PingCredentialsProvider
impl UnwindSafe for PingCredentialsProvider
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> 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 more