| 1 |
package proton |
| 2 |
|
| 3 |
type AuthInfoReq struct { |
| 4 |
Username string |
| 5 |
} |
| 6 |
|
| 7 |
type AuthInfo struct { |
| 8 |
Version int |
| 9 |
Modulus string |
| 10 |
ServerEphemeral string |
| 11 |
Salt string |
| 12 |
SRPSession string |
| 13 |
TwoFA TwoFAInfo `json:"2FA"` |
| 14 |
} |
| 15 |
|
| 16 |
type AuthVerifier struct { |
| 17 |
Version int |
| 18 |
ModulusID string |
| 19 |
Salt string |
| 20 |
Verifier string |
| 21 |
} |
| 22 |
|
| 23 |
type AuthModulus struct { |
| 24 |
Modulus string |
| 25 |
ModulusID string |
| 26 |
} |
| 27 |
|
| 28 |
type FIDO2Req struct { |
| 29 |
AuthenticationOptions any |
| 30 |
ClientData string |
| 31 |
AuthenticatorData string |
| 32 |
Signature string |
| 33 |
CredentialID string |
| 34 |
} |
| 35 |
|
| 36 |
type AuthReq struct { |
| 37 |
Auth2FAReq `json:",omitempty"` |
| 38 |
|
| 39 |
Username string |
| 40 |
ClientEphemeral string |
| 41 |
ClientProof string |
| 42 |
SRPSession string |
| 43 |
} |
| 44 |
|
| 45 |
type Auth struct { |
| 46 |
UserID string |
| 47 |
|
| 48 |
UID string |
| 49 |
AccessToken string |
| 50 |
RefreshToken string |
| 51 |
ServerProof string |
| 52 |
|
| 53 |
Scope string |
| 54 |
TwoFA TwoFAInfo `json:"2FA"` |
| 55 |
PasswordMode PasswordMode |
| 56 |
} |
| 57 |
|
| 58 |
type RegisteredKey struct { |
| 59 |
AttestationFormat string |
| 60 |
CredentialID []int |
| 61 |
Name string |
| 62 |
} |
| 63 |
|
| 64 |
type FIDO2Info struct { |
| 65 |
AuthenticationOptions any |
| 66 |
RegisteredKeys []RegisteredKey |
| 67 |
} |
| 68 |
|
| 69 |
type TwoFAInfo struct { |
| 70 |
Enabled TwoFAStatus |
| 71 |
FIDO2 FIDO2Info |
| 72 |
} |
| 73 |
|
| 74 |
type TwoFAStatus int |
| 75 |
|
| 76 |
const ( |
| 77 |
HasTOTP TwoFAStatus = 1 << iota |
| 78 |
HasFIDO2 |
| 79 |
) |
| 80 |
|
| 81 |
type PasswordMode int |
| 82 |
|
| 83 |
const ( |
| 84 |
OnePasswordMode PasswordMode = iota + 1 |
| 85 |
TwoPasswordMode |
| 86 |
) |
| 87 |
|
| 88 |
type Auth2FAReq struct { |
| 89 |
TwoFactorCode string `json:",omitempty"` |
| 90 |
FIDO2 FIDO2Req `json:",omitempty"` |
| 91 |
} |
| 92 |
|
| 93 |
type AuthRefreshReq struct { |
| 94 |
UID string |
| 95 |
RefreshToken string |
| 96 |
ResponseType string |
| 97 |
GrantType string |
| 98 |
RedirectURI string |
| 99 |
State string |
| 100 |
} |
| 101 |
|
| 102 |
type AuthSession struct { |
| 103 |
UID string |
| 104 |
CreateTime int64 |
| 105 |
|
| 106 |
ClientID string |
| 107 |
MemberID string |
| 108 |
Revocable Bool |
| 109 |
|
| 110 |
LocalizedClientName string |
| 111 |
} |