go fmt
This commit is contained in:
parent
135281c48a
commit
897ec17f53
|
@ -28,8 +28,8 @@ import (
|
||||||
|
|
||||||
func newClient() *protonmail.Client {
|
func newClient() *protonmail.Client {
|
||||||
return &protonmail.Client{
|
return &protonmail.Client{
|
||||||
RootURL: "https://mail.protonmail.com/api",
|
RootURL: "https://mail.protonmail.com/api",
|
||||||
AppVersion: "Web_3.16.6",
|
AppVersion: "Web_3.16.6",
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -209,10 +209,10 @@ func main() {
|
||||||
}
|
}
|
||||||
|
|
||||||
err = auth.EncryptAndSave(&auth.CachedAuth{
|
err = auth.EncryptAndSave(&auth.CachedAuth{
|
||||||
Auth: *a,
|
Auth: *a,
|
||||||
LoginPassword: loginPassword,
|
LoginPassword: loginPassword,
|
||||||
MailboxPassword: mailboxPassword,
|
MailboxPassword: mailboxPassword,
|
||||||
KeySalts: keySalts,
|
KeySalts: keySalts,
|
||||||
}, username, secretKey)
|
}, username, secretKey)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
|
|
|
@ -12,7 +12,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
type authInfoReq struct {
|
type authInfoReq struct {
|
||||||
Username string
|
Username string
|
||||||
}
|
}
|
||||||
|
|
||||||
type AuthInfo struct {
|
type AuthInfo struct {
|
||||||
|
@ -45,7 +45,7 @@ func (resp *AuthInfoResp) authInfo() *AuthInfo {
|
||||||
|
|
||||||
func (c *Client) AuthInfo(username string) (*AuthInfo, error) {
|
func (c *Client) AuthInfo(username string) (*AuthInfo, error) {
|
||||||
reqData := &authInfoReq{
|
reqData := &authInfoReq{
|
||||||
Username: username,
|
Username: username,
|
||||||
}
|
}
|
||||||
|
|
||||||
req, err := c.newJSONRequest(http.MethodPost, "/auth/info", reqData)
|
req, err := c.newJSONRequest(http.MethodPost, "/auth/info", reqData)
|
||||||
|
@ -84,10 +84,10 @@ type Auth struct {
|
||||||
UserID string
|
UserID string
|
||||||
EventID string
|
EventID string
|
||||||
PasswordMode PasswordMode
|
PasswordMode PasswordMode
|
||||||
TwoFactor struct {
|
TwoFactor struct {
|
||||||
Enabled int
|
Enabled int
|
||||||
U2F interface{} // TODO
|
U2F interface{} // TODO
|
||||||
TOTP int
|
TOTP int
|
||||||
} `json:"2FA"`
|
} `json:"2FA"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -212,7 +212,7 @@ func (c *Client) ListKeySalts() (map[string][]byte, error) {
|
||||||
var respData struct {
|
var respData struct {
|
||||||
resp
|
resp
|
||||||
KeySalts []struct {
|
KeySalts []struct {
|
||||||
ID string
|
ID string
|
||||||
KeySalt string
|
KeySalt string
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue