findmy.reports.twofactor¶
Public classes related to handling two-factor authentication.
Classes¶
Base class for a second-factor authentication method for an Apple account. |
|
An asynchronous implementation of a second-factor authentication method. |
|
A synchronous implementation of a second-factor authentication method. |
|
Base class for SMS-based two-factor authentication. |
|
Base class for trusted device-based two-factor authentication. |
|
An async implementation of SmsSecondFactorMethod. |
|
A sync implementation of SmsSecondFactorMethod. |
|
An async implementation of TrustedDeviceSecondFactorMethod. |
|
A sync implementation of TrustedDeviceSecondFactorMethod. |
Module Contents¶
- class findmy.reports.twofactor.BaseSecondFactorMethod(account: _AccType)¶
Bases:
abc.ABC
,Generic
[_AccType
]Base class for a second-factor authentication method for an Apple account.
- property account: _AccType¶
The account associated with the second-factor method.
- abstract request() findmy.util.types.MaybeCoro[None] ¶
Put in a request for the second-factor challenge.
Exact meaning is up to the implementing class.
- abstract submit(code: str) findmy.util.types.MaybeCoro[findmy.reports.state.LoginState] ¶
Submit a code to complete the second-factor challenge.
- class findmy.reports.twofactor.AsyncSecondFactorMethod(account: findmy.reports.account.AsyncAppleAccount)¶
Bases:
BaseSecondFactorMethod
,abc.ABC
An asynchronous implementation of a second-factor authentication method.
Intended as a base class for actual implementations to inherit from.
- property account: findmy.reports.account.AsyncAppleAccount¶
The account associated with the second-factor method.
- abstract request() None ¶
- Async:
See BaseSecondFactorMethod.request.
- abstract submit(code: str) findmy.reports.state.LoginState ¶
- Async:
See BaseSecondFactorMethod.submit.
- class findmy.reports.twofactor.SyncSecondFactorMethod(account: findmy.reports.account.AppleAccount)¶
Bases:
BaseSecondFactorMethod
,abc.ABC
A synchronous implementation of a second-factor authentication method.
Intended as a base class for actual implementations to inherit from.
- property account: findmy.reports.account.AppleAccount¶
The account associated with the second-factor method.
- abstract request() None ¶
See BaseSecondFactorMethod.request.
- abstract submit(code: str) findmy.reports.state.LoginState ¶
See BaseSecondFactorMethod.submit.
- class findmy.reports.twofactor.SmsSecondFactorMethod(account: _AccType)¶
Bases:
BaseSecondFactorMethod
,abc.ABC
Base class for SMS-based two-factor authentication.
- property phone_number_id: int¶
- Abstractmethod:
The phone number’s ID. You most likely don’t need this.
- property phone_number: str¶
- Abstractmethod:
The 2FA method’s phone number.
May be masked using unicode characters; should only be used for identification purposes.
- class findmy.reports.twofactor.TrustedDeviceSecondFactorMethod(account: _AccType)¶
Bases:
BaseSecondFactorMethod
,abc.ABC
Base class for trusted device-based two-factor authentication.
- class findmy.reports.twofactor.AsyncSmsSecondFactor(account: findmy.reports.account.AsyncAppleAccount, number_id: int, phone_number: str)¶
Bases:
AsyncSecondFactorMethod
,SmsSecondFactorMethod
An async implementation of SmsSecondFactorMethod.
- property phone_number_id: int¶
The phone number’s ID. You most likely don’t need this.
- property phone_number: str¶
The 2FA method’s phone number.
May be masked using unicode characters; should only be used for identification purposes.
- async request() None ¶
Request an SMS to the corresponding phone number containing a 2FA code.
- async submit(code: str) findmy.reports.state.LoginState ¶
Submit the 2FA code as received over SMS.
- class findmy.reports.twofactor.SyncSmsSecondFactor(account: findmy.reports.account.AppleAccount, number_id: int, phone_number: str)¶
Bases:
SyncSecondFactorMethod
,SmsSecondFactorMethod
A sync implementation of SmsSecondFactorMethod.
- property phone_number_id: int¶
See AsyncSmsSecondFactor.phone_number_id.
- property phone_number: str¶
See AsyncSmsSecondFactor.phone_number.
- request() None ¶
See AsyncSmsSecondFactor.request.
- submit(code: str) findmy.reports.state.LoginState ¶
See AsyncSmsSecondFactor.submit.
- class findmy.reports.twofactor.AsyncTrustedDeviceSecondFactor(account: findmy.reports.account.AsyncAppleAccount)¶
Bases:
AsyncSecondFactorMethod
,TrustedDeviceSecondFactorMethod
An async implementation of TrustedDeviceSecondFactorMethod.
- async request() None ¶
See BaseSecondFactorMethod.request.
- async submit(code: str) findmy.reports.state.LoginState ¶
See BaseSecondFactorMethod.submit.
- class findmy.reports.twofactor.SyncTrustedDeviceSecondFactor(account: findmy.reports.account.AppleAccount)¶
Bases:
SyncSecondFactorMethod
,TrustedDeviceSecondFactorMethod
A sync implementation of TrustedDeviceSecondFactorMethod.
- request() None ¶
See AsyncTrustedDeviceSecondFactor.request.
- submit(code: str) findmy.reports.state.LoginState ¶
See AsyncTrustedDeviceSecondFactor.submit.