diff --git a/Gopkg.lock b/Gopkg.lock index 6551354a0..6bb0b8619 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -11,7 +11,7 @@ branch = "master" name = "code.gitea.io/sdk" packages = ["gitea"] - revision = "b2308e3f700875a3642a78bd3f6e5db8ef6f974d" + revision = "ec80752c9512cf07fc62ddc42565118183743942" [[projects]] name = "github.com/PuerkitoBio/goquery" diff --git a/vendor/code.gitea.io/sdk/gitea/user_app.go b/vendor/code.gitea.io/sdk/gitea/user_app.go index cc1f5270f..d3bfce971 100644 --- a/vendor/code.gitea.io/sdk/gitea/user_app.go +++ b/vendor/code.gitea.io/sdk/gitea/user_app.go @@ -20,9 +20,9 @@ func BasicAuthEncode(user, pass string) string { // AccessToken represents a API access token. // swagger:response AccessToken type AccessToken struct { + ID int64 `json:"id"` Name string `json:"name"` Sha1 string `json:"sha1"` - ID int64 `json:"id"` } // AccessTokenList represents a list of API access token. @@ -55,3 +55,9 @@ func (c *Client) CreateAccessToken(user, pass string, opt CreateAccessTokenOptio "Authorization": []string{"Basic " + BasicAuthEncode(user, pass)}}, bytes.NewReader(body), t) } + +// DeleteAccessToken delete token with key id +func (c *Client) DeleteAccessToken(user string, keyID int64) error { + _, err := c.getResponse("DELETE", fmt.Sprintf("/user/%s/tokens/%d", user, keyID), nil, nil) + return err +}