pub struct TraktOAuthService { /* private fields */ }Expand description
A Trakt OAuth account-linking and credential service.
Implementations§
Source§impl TraktOAuthService
impl TraktOAuthService
pub fn new( config: TraktOAuthConfig, media: MediaStore, families: Arc<dyn FamilyStore>, external_connections: Arc<dyn ExternalConnectionStore>, ) -> Result<Self, TraktError>
Sourcepub async fn begin_link(
&self,
owner_id: UserId,
family_id: FamilyId,
profile_id: MediaProfileId,
) -> Result<TraktAuthorization, TraktError>
pub async fn begin_link( &self, owner_id: UserId, family_id: FamilyId, profile_id: MediaProfileId, ) -> Result<TraktAuthorization, TraktError>
Begin linking a Trakt account to a media profile.
Only the EME user assigned to the media profile can attach their own external account. The pending state is hashed and consumed once.
Sourcepub async fn begin_personal_link(
&self,
owner_id: UserId,
profile_id: MediaProfileId,
) -> Result<TraktAuthorization, TraktError>
pub async fn begin_personal_link( &self, owner_id: UserId, profile_id: MediaProfileId, ) -> Result<TraktAuthorization, TraktError>
Start OAuth for a personal profile without requiring a family membership.
Sourcepub async fn complete_link(
&self,
expected_owner_id: UserId,
state: &str,
code: &str,
) -> Result<MediaExternalConnectionLink, TraktError>
pub async fn complete_link( &self, expected_owner_id: UserId, state: &str, code: &str, ) -> Result<MediaExternalConnectionLink, TraktError>
Complete a callback, validate its one-time state, and persist the encrypted refresh token.
Sourcepub async fn unlink_profile(
&self,
actor_id: UserId,
family_id: FamilyId,
profile_id: MediaProfileId,
) -> Result<(), TraktError>
pub async fn unlink_profile( &self, actor_id: UserId, family_id: FamilyId, profile_id: MediaProfileId, ) -> Result<(), TraktError>
Remove a profile link and revoke its encrypted external credential.
Sourcepub async fn validate_profile_owner(
&self,
user_id: UserId,
family_id: FamilyId,
profile_id: MediaProfileId,
) -> Result<(), TraktError>
pub async fn validate_profile_owner( &self, user_id: UserId, family_id: FamilyId, profile_id: MediaProfileId, ) -> Result<(), TraktError>
Validate that the actor still owns the assigned profile and belongs to its family.
Sourcepub async fn validate_personal_profile_owner(
&self,
user_id: UserId,
profile_id: MediaProfileId,
) -> Result<(), TraktError>
pub async fn validate_personal_profile_owner( &self, user_id: UserId, profile_id: MediaProfileId, ) -> Result<(), TraktError>
Validate direct ownership of a personal profile.
Sourcepub async fn unlink_personal_profile(
&self,
actor_id: UserId,
profile_id: MediaProfileId,
) -> Result<(), TraktError>
pub async fn unlink_personal_profile( &self, actor_id: UserId, profile_id: MediaProfileId, ) -> Result<(), TraktError>
Disconnect a Trakt account from the caller’s own personal profile.
Sourcepub fn token_manager(&self) -> &TraktTokenManager
pub fn token_manager(&self) -> &TraktTokenManager
Access-token manager used by Trakt history and rating synchronization.
Auto Trait Implementations§
impl !RefUnwindSafe for TraktOAuthService
impl !UnwindSafe for TraktOAuthService
impl Freeze for TraktOAuthService
impl Send for TraktOAuthService
impl Sync for TraktOAuthService
impl Unpin for TraktOAuthService
impl UnsafeUnpin for TraktOAuthService
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