pub struct AuthServiceImpl { /* private fields */ }Implementations§
Source§impl AuthServiceImpl
impl AuthServiceImpl
Sourcepub async fn new(email_sender: Arc<dyn EmailSender>) -> Self
pub async fn new(email_sender: Arc<dyn EmailSender>) -> Self
Creates a new AuthServiceImpl with the provided email_sender.
§Panics
- If
AETHERIS_ENVis set to “production” butAETHERIS_AUTH_BYPASSis enabled. - If
AETHERIS_ENVis set to “production” butSESSION_PASETO_KEYorTRANSPORT_PASETO_KEYare missing. - If the provided PASETO keys are not exactly 32 bytes long.
Sourcepub fn validate_and_get_jti(
&self,
token: &str,
tick: Option<u64>,
) -> Option<String>
pub fn validate_and_get_jti( &self, token: &str, tick: Option<u64>, ) -> Option<String>
Validates a session token and returns the JTI if authorized.
Validates a session by JTI, checking for revocation and enforcing 1h sliding idle window.
§Performance
if tick is provided, activity updates are coalesced to once per 60 ticks (~1s)
to reduce write-lock contention on the session map.
pub fn mint_session_token_for_test( &self, player_id: &str, ) -> Result<(String, u64), Status>
Trait Implementations§
Source§impl AuthService for AuthServiceImpl
impl AuthService for AuthServiceImpl
Source§fn request_otp<'life0, 'async_trait>(
&'life0 self,
request: Request<OtpRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<OtpRequestAck>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn request_otp<'life0, 'async_trait>(
&'life0 self,
request: Request<OtpRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<OtpRequestAck>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
── Email OTP path ──
Source§fn login<'life0, 'async_trait>(
&'life0 self,
request: Request<LoginRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<LoginResponse>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn login<'life0, 'async_trait>(
&'life0 self,
request: Request<LoginRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<LoginResponse>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
── Unified Login path ──
Source§fn logout<'life0, 'async_trait>(
&'life0 self,
request: Request<LogoutRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<LogoutResponse>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn logout<'life0, 'async_trait>(
&'life0 self,
request: Request<LogoutRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<LogoutResponse>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
── Session lifecycle (unchanged) ──
fn refresh_token<'life0, 'async_trait>(
&'life0 self,
request: Request<RefreshRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<RefreshResponse>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn issue_connect_token<'life0, 'async_trait>(
&'life0 self,
request: Request<ConnectTokenRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<ConnectTokenResponse>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn create_google_login_nonce<'life0, 'async_trait>(
&'life0 self,
_request: Request<GoogleLoginNonceRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<GoogleLoginNonceResponse>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§impl Clone for AuthServiceImpl
impl Clone for AuthServiceImpl
Source§fn clone(&self) -> AuthServiceImpl
fn clone(&self) -> AuthServiceImpl
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for AuthServiceImpl
impl !RefUnwindSafe for AuthServiceImpl
impl Send for AuthServiceImpl
impl Sync for AuthServiceImpl
impl Unpin for AuthServiceImpl
impl UnsafeUnpin for AuthServiceImpl
impl !UnwindSafe for AuthServiceImpl
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request