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