use crate::{ domain::api::models::oauth::*, inbound::http::handlers::oauth::AuthorizationCodeRequest, }; use super::super::models::user::*; use std::future::Future; pub trait ApiService: Clone + Send + Sync + 'static { // --- // USER // --- fn create_user( &self, req: CreateUserRequest, ) -> impl Future> + Send; fn get_user_session( &self, session: &axum_session::SessionAnySession, // TODO: Get rid of this and make cleaner ) -> impl Future> + Send; fn activate_user_account( &self, token: ActivationToken, ) -> impl Future> + Send; fn user_login( &self, req: UserLoginRequest, ) -> impl Future> + Send; fn forgot_password(&self, email: &EmailAddress) -> impl Future + Send; fn reset_password( &self, token: &PasswordResetToken, password: &Password, ) -> impl Future> + Send; fn find_user_by_password_reset_token( &self, token: &PasswordResetToken, ) -> impl Future> + Send; // --- // OAUTH // --- fn find_client_by_id(&self, id: uuid::Uuid) -> impl Future> + Send; fn generate_authorization_code( &self, user: &User, req: AuthorizeRequest, ) -> impl Future> + Send; fn create_token( &self, req: AuthorizationCodeRequest, ) -> impl Future, TokenError>> + Send; }