add gpg token function

This commit is contained in:
Shane C 2024-09-13 11:21:37 -04:00
parent 64b6c07029
commit dfbe9d3ad1
Signed by: shanec
GPG key ID: E46B5FEA35B22FF9

View file

@ -68,11 +68,18 @@ func (c *Client) GetGPGKey(keyID int64) (*GPGKey, *Response, error) {
return key, resp, err
}
// GetGPGToken get a gpg token for verification
func (c *Client) GetGPGToken() (string, *Response, error) {
body, resp, err := c.getResponse("GET", "/user/gpg_key_token", nil, nil)
return string(body), resp, err
}
// CreateGPGKeyOption options create user GPG key
type CreateGPGKeyOption struct {
// An armored GPG key to add
//
ArmoredKey string `json:"armored_public_key"`
ArmoredSignature string `json:"armored_signature"`
}
// CreateGPGKey create GPG key with options