* Add fingerprint to ssh key endpoints. * Update gitea sdk vendortags/v1.4.0-rc1
"type": "string", | "type": "string", | ||||
"x-go-name": "Title" | "x-go-name": "Title" | ||||
}, | }, | ||||
"fingerprint": { | |||||
"type": "string", | |||||
"x-go-name": "Fingerprint" | |||||
}, | |||||
"url": { | "url": { | ||||
"type": "string", | "type": "string", | ||||
"x-go-name": "URL" | "x-go-name": "URL" | ||||
] | ] | ||||
} | } | ||||
] | ] | ||||
} | |||||
} |
// ToPublicKey convert models.PublicKey to api.PublicKey | // ToPublicKey convert models.PublicKey to api.PublicKey | ||||
func ToPublicKey(apiLink string, key *models.PublicKey) *api.PublicKey { | func ToPublicKey(apiLink string, key *models.PublicKey) *api.PublicKey { | ||||
return &api.PublicKey{ | return &api.PublicKey{ | ||||
ID: key.ID, | |||||
Key: key.Content, | |||||
URL: apiLink + com.ToStr(key.ID), | |||||
Title: key.Name, | |||||
Created: key.Created, | |||||
ID: key.ID, | |||||
Key: key.Content, | |||||
URL: apiLink + com.ToStr(key.ID), | |||||
Title: key.Name, | |||||
Fingerprint: key.Fingerprint, | |||||
Created: key.Created, | |||||
} | } | ||||
} | } | ||||
// Copyright 2017 The Gitea Authors. All rights reserved. | |||||
// Use of this source code is governed by a MIT-style | |||||
// license that can be found in the LICENSE file. | |||||
package gitea | |||||
import ( | |||||
"time" | |||||
) | |||||
// LFSLock represent a lock | |||||
// for use with the locks API. | |||||
type LFSLock struct { | |||||
ID string `json:"id"` | |||||
Path string `json:"path"` | |||||
LockedAt time.Time `json:"locked_at"` | |||||
Owner *LFSLockOwner `json:"owner"` | |||||
} | |||||
// LFSLockOwner represent a lock owner | |||||
// for use with the locks API. | |||||
type LFSLockOwner struct { | |||||
Name string `json:"name"` | |||||
} | |||||
// LFSLockRequest contains the path of the lock to create | |||||
// https://github.com/git-lfs/git-lfs/blob/master/docs/api/locking.md#create-lock | |||||
type LFSLockRequest struct { | |||||
Path string `json:"path"` | |||||
} | |||||
// LFSLockResponse represent a lock created | |||||
// https://github.com/git-lfs/git-lfs/blob/master/docs/api/locking.md#create-lock | |||||
type LFSLockResponse struct { | |||||
Lock *LFSLock `json:"lock"` | |||||
} | |||||
// LFSLockList represent a list of lock requested | |||||
// https://github.com/git-lfs/git-lfs/blob/master/docs/api/locking.md#list-locks | |||||
type LFSLockList struct { | |||||
Locks []*LFSLock `json:"locks"` | |||||
Next string `json:"next_cursor,omitempty"` | |||||
} | |||||
// LFSLockListVerify represent a list of lock verification requested | |||||
// https://github.com/git-lfs/git-lfs/blob/master/docs/api/locking.md#list-locks-for-verification | |||||
type LFSLockListVerify struct { | |||||
Ours []*LFSLock `json:"ours"` | |||||
Theirs []*LFSLock `json:"theirs"` | |||||
Next string `json:"next_cursor,omitempty"` | |||||
} | |||||
// LFSLockError contains information on the error that occurs | |||||
type LFSLockError struct { | |||||
Message string `json:"message"` | |||||
Lock *LFSLock `json:"lock,omitempty"` | |||||
Documentation string `json:"documentation_url,omitempty"` | |||||
RequestID string `json:"request_id,omitempty"` | |||||
} | |||||
// LFSLockDeleteRequest contains params of a delete request | |||||
// https://github.com/git-lfs/git-lfs/blob/master/docs/api/locking.md#delete-lock | |||||
type LFSLockDeleteRequest struct { | |||||
Force bool `json:"force"` | |||||
} |
// PublicKey publickey is a user key to push code to repository | // PublicKey publickey is a user key to push code to repository | ||||
type PublicKey struct { | type PublicKey struct { | ||||
ID int64 `json:"id"` | |||||
Key string `json:"key"` | |||||
URL string `json:"url,omitempty"` | |||||
Title string `json:"title,omitempty"` | |||||
ID int64 `json:"id"` | |||||
Key string `json:"key"` | |||||
URL string `json:"url,omitempty"` | |||||
Title string `json:"title,omitempty"` | |||||
Fingerprint string `json:"fingerprint,omitempty"` | |||||
// swagger:strfmt date-time | // swagger:strfmt date-time | ||||
Created time.Time `json:"created_at,omitempty"` | Created time.Time `json:"created_at,omitempty"` | ||||
} | } |
"revisionTime": "2017-10-23T00:52:09Z" | "revisionTime": "2017-10-23T00:52:09Z" | ||||
}, | }, | ||||
{ | { | ||||
"checksumSHA1": "OICEgmUefW4L4l/FK/NVFnl/aOM=", | |||||
"checksumSHA1": "QQ7g7B9+EIzGjO14KCGEs9TNEzM=", | |||||
"path": "code.gitea.io/sdk/gitea", | "path": "code.gitea.io/sdk/gitea", | ||||
"revision": "1da52cf95ff3e7953227cfa0469e1c05a7d02557", | |||||
"revisionTime": "2017-11-12T09:10:33Z" | |||||
"revision": "ec7d3af43b598c1a3f2cb12f633b9625649d8e54", | |||||
"revisionTime": "2017-11-28T12:30:39Z" | |||||
}, | }, | ||||
{ | { | ||||
"checksumSHA1": "bOODD4Gbw3GfcuQPU2dI40crxxk=", | "checksumSHA1": "bOODD4Gbw3GfcuQPU2dI40crxxk=", |