From dfbe9d3ad1222c0b12d22791bcd76bdcfbf37967 Mon Sep 17 00:00:00 2001 From: Shane C Date: Fri, 13 Sep 2024 11:21:37 -0400 Subject: [PATCH] add gpg token function --- forgejo/user_gpgkey.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/forgejo/user_gpgkey.go b/forgejo/user_gpgkey.go index 660bb1c..498e586 100644 --- a/forgejo/user_gpgkey.go +++ b/forgejo/user_gpgkey.go @@ -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"` + ArmoredKey string `json:"armored_public_key"` + ArmoredSignature string `json:"armored_signature"` } // CreateGPGKey create GPG key with options