Username/Password credentials This is an object suitable for passing to a remote's credentials callback and for returning from said callback.
| 58 | |
| 59 | |
| 60 | class UserPass: |
| 61 | """Username/Password credentials |
| 62 | |
| 63 | This is an object suitable for passing to a remote's credentials |
| 64 | callback and for returning from said callback. |
| 65 | """ |
| 66 | |
| 67 | def __init__(self, username: str, password: str): |
| 68 | self._username = username |
| 69 | self._password = password |
| 70 | |
| 71 | @property |
| 72 | def credential_type(self) -> CredentialType: |
| 73 | return CredentialType.USERPASS_PLAINTEXT |
| 74 | |
| 75 | @property |
| 76 | def credential_tuple(self) -> tuple[str, str]: |
| 77 | return (self._username, self._password) |
| 78 | |
| 79 | def __call__( |
| 80 | self, _url: str, _username: str | None, _allowed: CredentialType |
| 81 | ) -> UserPass: |
| 82 | return self |
| 83 | |
| 84 | |
| 85 | class Keypair: |
no outgoing calls
searching dependent graphs…