add ID as an output for list API
This commit is contained in:
parent
e211c28452
commit
112ec99322
4
public/swagger.v1.json
vendored
4
public/swagger.v1.json
vendored
|
|
@ -7512,6 +7512,10 @@
|
||||||
"AccessToken": {
|
"AccessToken": {
|
||||||
"description": "AccessToken represents a API access token.",
|
"description": "AccessToken represents a API access token.",
|
||||||
"headers": {
|
"headers": {
|
||||||
|
"id": {
|
||||||
|
"type": "integer",
|
||||||
|
"format": "int64"
|
||||||
|
},
|
||||||
"name": {
|
"name": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -39,6 +39,7 @@ func ListAccessTokens(ctx *context.APIContext) {
|
||||||
apiTokens[i] = &api.AccessToken{
|
apiTokens[i] = &api.AccessToken{
|
||||||
Name: tokens[i].Name,
|
Name: tokens[i].Name,
|
||||||
Sha1: tokens[i].Sha1,
|
Sha1: tokens[i].Sha1,
|
||||||
|
ID: tokens[i].ID,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ctx.JSON(200, &apiTokens)
|
ctx.JSON(200, &apiTokens)
|
||||||
|
|
@ -73,6 +74,7 @@ func CreateAccessToken(ctx *context.APIContext, form api.CreateAccessTokenOption
|
||||||
ctx.JSON(201, &api.AccessToken{
|
ctx.JSON(201, &api.AccessToken{
|
||||||
Name: t.Name,
|
Name: t.Name,
|
||||||
Sha1: t.Sha1,
|
Sha1: t.Sha1,
|
||||||
|
ID: t.ID,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
1
vendor/code.gitea.io/sdk/gitea/user_app.go
generated
vendored
1
vendor/code.gitea.io/sdk/gitea/user_app.go
generated
vendored
|
|
@ -22,6 +22,7 @@ func BasicAuthEncode(user, pass string) string {
|
||||||
type AccessToken struct {
|
type AccessToken struct {
|
||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
Sha1 string `json:"sha1"`
|
Sha1 string `json:"sha1"`
|
||||||
|
ID int64 `json:"id"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// AccessTokenList represents a list of API access token.
|
// AccessTokenList represents a list of API access token.
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user