pub struct Hidden {
pub client: Client,
}Fields§
§client: ClientImplementations§
source§impl Hidden
impl Hidden
sourcepub async fn auth_email<'a>(
&'a self,
body: &EmailAuthenticationForm
) -> Result<VerificationTokenResponse, Error>
pub async fn auth_email<'a>( &'a self, body: &EmailAuthenticationForm ) -> Result<VerificationTokenResponse, Error>
Create an email verification request for a user.
async fn example_hidden_auth_email() -> anyhow::Result<()> {
let client = kittycad::Client::new_from_env();
let result: kittycad::types::VerificationTokenResponse = client
.hidden()
.auth_email(&kittycad::types::EmailAuthenticationForm {
callback_url: Some("https://example.com/foo/bar".to_string()),
email: "email@example.com".to_string(),
})
.await?;
println!("{:?}", result);
Ok(())
}sourcepub async fn auth_email_callback<'a>(
&'a self,
callback_url: Option<String>,
email: &'a str,
token: &'a str
) -> Result<(), Error>
pub async fn auth_email_callback<'a>( &'a self, callback_url: Option<String>, email: &'a str, token: &'a str ) -> Result<(), Error>
Listen for callbacks for email verification for users.
Parameters:
callback_url: Option<String>: The URL to redirect back to after we have authenticated.email: &'astr: The user’s email. (required)token: &'astr: The verification token. (required)
async fn example_hidden_auth_email_callback() -> anyhow::Result<()> {
let client = kittycad::Client::new_from_env();
client
.hidden()
.auth_email_callback(
Some("https://example.com/foo/bar".to_string()),
"email@example.com",
"some-string",
)
.await?;
Ok(())
}sourcepub async fn get_auth_saml<'a>(
&'a self,
callback_url: Option<String>,
provider_id: Uuid
) -> Result<(), Error>
pub async fn get_auth_saml<'a>( &'a self, callback_url: Option<String>, provider_id: Uuid ) -> Result<(), Error>
Get a redirect straight to the SAML IdP.
The UI uses this to avoid having to ask the API anything about the IdP. It already knows the SAML IdP ID from the path, so it can just link to this path and rely on the API to redirect to the actual IdP.
Parameters:
callback_url: Option<String>: The URL to redirect back to after we have authenticated.provider_id: uuid::Uuid: The ID of the identity provider. (required)
use std::str::FromStr;
async fn example_hidden_get_auth_saml() -> anyhow::Result<()> {
let client = kittycad::Client::new_from_env();
client
.hidden()
.get_auth_saml(
Some("https://example.com/foo/bar".to_string()),
uuid::Uuid::from_str("d9797f8d-9ad6-4e08-90d7-2ec17e13471c")?,
)
.await?;
Ok(())
}sourcepub async fn post_auth_saml<'a>(
&'a self,
provider_id: Uuid,
body: &Bytes
) -> Result<(), Error>
pub async fn post_auth_saml<'a>( &'a self, provider_id: Uuid, body: &Bytes ) -> Result<(), Error>
Authenticate a user via SAML
Parameters:
provider_id: uuid::Uuid: The ID of the identity provider. (required)
use std::str::FromStr;
async fn example_hidden_post_auth_saml() -> anyhow::Result<()> {
let client = kittycad::Client::new_from_env();
client
.hidden()
.post_auth_saml(
uuid::Uuid::from_str("d9797f8d-9ad6-4e08-90d7-2ec17e13471c")?,
&bytes::Bytes::from("some-string"),
)
.await?;
Ok(())
}Trait Implementations§
Auto Trait Implementations§
impl Freeze for Hidden
impl !RefUnwindSafe for Hidden
impl Send for Hidden
impl Sync for Hidden
impl Unpin for Hidden
impl !UnwindSafe for Hidden
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
Mutably borrows from an owned value. Read more
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>
Converts
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>
Converts
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