Skip to main content

Module native

Module native 

Source

Re-exportsΒ§

use std::fmt::Write; πŸ”’
use std::net::IpAddr; πŸ”’
use axum::extract::Form; πŸ”’
use axum::extract::Request; πŸ”’
use axum::extract::State; πŸ”’
use axum::response::Redirect; πŸ”’
use axum::response::Response; πŸ”’
use const_str::format as const_format; πŸ”’
use http::StatusCode; πŸ”’
use itertools::Either::Left; πŸ”’
use itertools::Either::Right; πŸ”’
use ruma::OwnedUserId; πŸ”’
use ruma::UserId; πŸ”’
use serde::Deserialize; πŸ”’
use serde::Deserialize; πŸ”’
use serde_json::json; πŸ”’
use tuwunel_api::router::ACCOUNT_HEAD; πŸ”’
use tuwunel_core::Err; πŸ”’
use tuwunel_core::Error; πŸ”’
use tuwunel_core::Result; πŸ”’
use tuwunel_core::config::IdentityProvider; πŸ”’
use tuwunel_core::err; πŸ”’
use tuwunel_core::smallstr::SmallString; πŸ”’
use tuwunel_core::utils; πŸ”’
use tuwunel_core::utils::BoolExt; πŸ”’
use tuwunel_core::utils::hash::verify_password; πŸ”’
use tuwunel_core::utils::html::escape as html_escape; πŸ”’
use tuwunel_service::Services; πŸ”’
use tuwunel_service::users::Register; πŸ”’
use url::Url; πŸ”’
use super::account::account_error_response; πŸ”’
use super::account::account_html_response; πŸ”’
use super::account::account_redirect_response; πŸ”’
use super::account::account_sso_redirect; πŸ”’
use super::account::validate_account_action; πŸ”’
use super::authorization_sso_url; πŸ”’
use super::device::device_sso_redirect; πŸ”’
use super::require_account_usable; πŸ”’
use super::url_encode; πŸ”’
use crate::ClientIp; πŸ”’
use crate::RateLimitIp; πŸ”’

StructsΒ§

NativeQuery πŸ”’
NativeSubmit πŸ”’

EnumsΒ§

Flow πŸ”’
PasswordAuth πŸ”’
Password authentication the login page offers beside the providers.

ConstantsΒ§

LOGIN_TOKEN_LENGTH πŸ”’

StaticsΒ§

BOUND_HTML πŸ”’
LOGIN_HTML πŸ”’
PASSWORD_FORM πŸ”’
REGISTER_HTML πŸ”’
TOKEN_FIELD πŸ”’

FunctionsΒ§

authenticate_local πŸ”’
Authenticate through the local branch of an authorization request.
complete_redirect πŸ”’
Redirects with 303 so the browser cannot replay the password form into the completion or callback route.
configured_password_auth πŸ”’
do_register πŸ”’
error_block πŸ”’
native_get_route πŸ”’
Renders the native login or registration page for a pending authorization, device, or account flow.
native_submit πŸ”’
native_submit_route πŸ”’
Authenticates submitted credentials and sends the login token to the authorization completion, device-consent, or account-management callback.
parse_flow πŸ”’
provider_choice πŸ”’
provider_redirect πŸ”’
Send the browser to the provider chosen on the login page.
record_accepted_terms πŸ”’
render_bound πŸ”’
Offer only the provider a pending request is bound to.
render_login πŸ”’
render_page πŸ”’
Render the page for a flow, reading an authorization request’s binding.
render_register πŸ”’
render_sso_options πŸ”’
List each provider as a link that preserves the authentication flow.
render_submit_error πŸ”’
Re-render the page a failed submission came from, carrying its error.
require_native πŸ”’
sso_choices πŸ”’
Providers the login page offers, as the client login flows list them.
terms_block πŸ”’
verify_credentials πŸ”’
Authenticate a local account by password, mirroring the /login password flow (password_login).

Type AliasesΒ§

AccountAction πŸ”’
DeviceId πŸ”’
IdpId πŸ”’
LoginAddress πŸ”’
ProviderChoice πŸ”’