Browse Source

Add fingerprint to ssh key endpoints. (#3009)

* Add fingerprint to ssh key endpoints.

* Update gitea sdk vendor
Vlad Temian 2 years ago
parent
commit
6ad4990a65

+ 5 - 1
public/swagger.v1.json

@@ -6281,6 +6281,10 @@
6281 6281
           "type": "string",
6282 6282
           "x-go-name": "Title"
6283 6283
         },
6284
+        "fingerprint": {
6285
+          "type": "string",
6286
+          "x-go-name": "Fingerprint"
6287
+        },
6284 6288
         "url": {
6285 6289
           "type": "string",
6286 6290
           "x-go-name": "URL"
@@ -7178,4 +7182,4 @@
7178 7182
       ]
7179 7183
     }
7180 7184
   ]
7181
-}
7185
+}

+ 6 - 5
routers/api/v1/convert/convert.go

@@ -77,11 +77,12 @@ func ToCommit(c *git.Commit) *api.PayloadCommit {
77 77
 // ToPublicKey convert models.PublicKey to api.PublicKey
78 78
 func ToPublicKey(apiLink string, key *models.PublicKey) *api.PublicKey {
79 79
 	return &api.PublicKey{
80
-		ID:      key.ID,
81
-		Key:     key.Content,
82
-		URL:     apiLink + com.ToStr(key.ID),
83
-		Title:   key.Name,
84
-		Created: key.Created,
80
+		ID:          key.ID,
81
+		Key:         key.Content,
82
+		URL:         apiLink + com.ToStr(key.ID),
83
+		Title:       key.Name,
84
+		Fingerprint: key.Fingerprint,
85
+		Created:     key.Created,
85 86
 	}
86 87
 }
87 88
 

+ 65 - 0
vendor/code.gitea.io/sdk/gitea/lfs_lock.go

@@ -0,0 +1,65 @@
1
+// Copyright 2017 The Gitea Authors. All rights reserved.
2
+// Use of this source code is governed by a MIT-style
3
+// license that can be found in the LICENSE file.
4
+
5
+package gitea
6
+
7
+import (
8
+	"time"
9
+)
10
+
11
+// LFSLock represent a lock
12
+// for use with the locks API.
13
+type LFSLock struct {
14
+	ID       string        `json:"id"`
15
+	Path     string        `json:"path"`
16
+	LockedAt time.Time     `json:"locked_at"`
17
+	Owner    *LFSLockOwner `json:"owner"`
18
+}
19
+
20
+// LFSLockOwner represent a lock owner
21
+// for use with the locks API.
22
+type LFSLockOwner struct {
23
+	Name string `json:"name"`
24
+}
25
+
26
+// LFSLockRequest contains the path of the lock to create
27
+// https://github.com/git-lfs/git-lfs/blob/master/docs/api/locking.md#create-lock
28
+type LFSLockRequest struct {
29
+	Path string `json:"path"`
30
+}
31
+
32
+// LFSLockResponse represent a lock created
33
+// https://github.com/git-lfs/git-lfs/blob/master/docs/api/locking.md#create-lock
34
+type LFSLockResponse struct {
35
+	Lock *LFSLock `json:"lock"`
36
+}
37
+
38
+// LFSLockList represent a list of lock requested
39
+// https://github.com/git-lfs/git-lfs/blob/master/docs/api/locking.md#list-locks
40
+type LFSLockList struct {
41
+	Locks []*LFSLock `json:"locks"`
42
+	Next  string     `json:"next_cursor,omitempty"`
43
+}
44
+
45
+// LFSLockListVerify represent a list of lock verification requested
46
+// https://github.com/git-lfs/git-lfs/blob/master/docs/api/locking.md#list-locks-for-verification
47
+type LFSLockListVerify struct {
48
+	Ours   []*LFSLock `json:"ours"`
49
+	Theirs []*LFSLock `json:"theirs"`
50
+	Next   string     `json:"next_cursor,omitempty"`
51
+}
52
+
53
+// LFSLockError contains information on the error that occurs
54
+type LFSLockError struct {
55
+	Message       string   `json:"message"`
56
+	Lock          *LFSLock `json:"lock,omitempty"`
57
+	Documentation string   `json:"documentation_url,omitempty"`
58
+	RequestID     string   `json:"request_id,omitempty"`
59
+}
60
+
61
+// LFSLockDeleteRequest contains params of a delete request
62
+// https://github.com/git-lfs/git-lfs/blob/master/docs/api/locking.md#delete-lock
63
+type LFSLockDeleteRequest struct {
64
+	Force bool `json:"force"`
65
+}

+ 5 - 4
vendor/code.gitea.io/sdk/gitea/user_key.go

@@ -13,10 +13,11 @@ import (
13 13
 
14 14
 // PublicKey publickey is a user key to push code to repository
15 15
 type PublicKey struct {
16
-	ID      int64     `json:"id"`
17
-	Key     string    `json:"key"`
18
-	URL     string    `json:"url,omitempty"`
19
-	Title   string    `json:"title,omitempty"`
16
+	ID          int64  `json:"id"`
17
+	Key         string `json:"key"`
18
+	URL         string `json:"url,omitempty"`
19
+	Title       string `json:"title,omitempty"`
20
+	Fingerprint string `json:"fingerprint,omitempty"`
20 21
 	// swagger:strfmt date-time
21 22
 	Created time.Time `json:"created_at,omitempty"`
22 23
 }

+ 3 - 3
vendor/vendor.json

@@ -9,10 +9,10 @@
9 9
 			"revisionTime": "2017-10-23T00:52:09Z"
10 10
 		},
11 11
 		{
12
-			"checksumSHA1": "OICEgmUefW4L4l/FK/NVFnl/aOM=",
12
+			"checksumSHA1": "QQ7g7B9+EIzGjO14KCGEs9TNEzM=",
13 13
 			"path": "code.gitea.io/sdk/gitea",
14
-			"revision": "1da52cf95ff3e7953227cfa0469e1c05a7d02557",
15
-			"revisionTime": "2017-11-12T09:10:33Z"
14
+			"revision": "ec7d3af43b598c1a3f2cb12f633b9625649d8e54",
15
+			"revisionTime": "2017-11-28T12:30:39Z"
16 16
 		},
17 17
 		{
18 18
 			"checksumSHA1": "bOODD4Gbw3GfcuQPU2dI40crxxk=",