From 5106026faf6672ad125157bedc06e20c7eaedc01 Mon Sep 17 00:00:00 2001 From: "Berengar W. Lehr" Date: Sat, 27 Oct 2018 01:10:41 +0200 Subject: [PATCH 1/5] fix: Add secret to all webhook's payload where it has been missing affects webhooks for: * Delete * Fork * IssueComment * Release Resolves: #4732, #5173 Signed-off-by: Berengar W. Lehr --- vendor/code.gitea.io/sdk/gitea/hook.go | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/vendor/code.gitea.io/sdk/gitea/hook.go b/vendor/code.gitea.io/sdk/gitea/hook.go index f346381679848..80a5192d8eeda 100644 --- a/vendor/code.gitea.io/sdk/gitea/hook.go +++ b/vendor/code.gitea.io/sdk/gitea/hook.go @@ -199,7 +199,7 @@ type CreatePayload struct { Sender *User `json:"sender"` } -// SetSecret FIXME +// SetSecret modifies the secret of the CreatePayload func (p *CreatePayload) SetSecret(secret string) { p.Secret = secret } @@ -246,6 +246,7 @@ const ( // DeletePayload represents delete payload type DeletePayload struct { + Secret string `json:"secret"` Ref string `json:"ref"` RefType string `json:"ref_type"` PusherType PusherType `json:"pusher_type"` @@ -253,8 +254,9 @@ type DeletePayload struct { Sender *User `json:"sender"` } -// SetSecret implements Payload +// SetSecret modifies the secret of the DeletePayload func (p *DeletePayload) SetSecret(secret string) { + p.Secret = secret } // JSONPayload implements Payload @@ -271,13 +273,15 @@ func (p *DeletePayload) JSONPayload() ([]byte, error) { // ForkPayload represents fork payload type ForkPayload struct { + Secret string `json:"secret"` Forkee *Repository `json:"forkee"` Repo *Repository `json:"repository"` Sender *User `json:"sender"` } -// SetSecret implements Payload +// SetSecret modifies the secret of the ForkPayload func (p *ForkPayload) SetSecret(secret string) { + p.Secret = secret } // JSONPayload implements Payload @@ -297,6 +301,7 @@ const ( // IssueCommentPayload represents a payload information of issue comment event. type IssueCommentPayload struct { + Secret string `json:"secret"` Action HookIssueCommentAction `json:"action"` Issue *Issue `json:"issue"` Comment *Comment `json:"comment"` @@ -305,8 +310,9 @@ type IssueCommentPayload struct { Sender *User `json:"sender"` } -// SetSecret implements Payload +// SetSecret modifies the secret of the IssueCommentPayload func (p *IssueCommentPayload) SetSecret(secret string) { + p.Secret = secret } // JSONPayload implements Payload @@ -333,14 +339,16 @@ const ( // ReleasePayload represents a payload information of release event. type ReleasePayload struct { + Secret string `json:"secret"` Action HookReleaseAction `json:"action"` Release *Release `json:"release"` Repository *Repository `json:"repository"` Sender *User `json:"sender"` } -// SetSecret implements Payload +// SetSecret modifies the secret of the ReleasePayload func (p *ReleasePayload) SetSecret(secret string) { + p.Secret = secret } // JSONPayload implements Payload @@ -368,7 +376,7 @@ type PushPayload struct { Sender *User `json:"sender"` } -// SetSecret FIXME +// SetSecret modifies the secret of the PushPayload func (p *PushPayload) SetSecret(secret string) { p.Secret = secret } @@ -520,7 +528,7 @@ type RepositoryPayload struct { Sender *User `json:"sender"` } -// SetSecret set the payload's secret +// SetSecret modifies the secret of the RepositoryPayload func (p *RepositoryPayload) SetSecret(secret string) { p.Secret = secret } From 80900df9df28b2ecac576164c458dff337fe9b3f Mon Sep 17 00:00:00 2001 From: "Berengar W. Lehr" Date: Sun, 28 Oct 2018 13:35:52 +0100 Subject: [PATCH 2/5] fix: Add secret to all webhook's payload where it has been missing * Updated dependency manager via `dep ensure -update code.gitea.io/sdk` * Gopkg.toml was nat changed as sdk version is set to "master" Signed-off-by: Berengar W. Lehr --- Gopkg.lock | 4 ++-- vendor/code.gitea.io/sdk/gitea/admin_user.go | 22 ++++++++++---------- vendor/code.gitea.io/sdk/gitea/issue.go | 6 ++++++ vendor/code.gitea.io/sdk/gitea/repo.go | 1 + vendor/code.gitea.io/sdk/gitea/repo_key.go | 15 +++++++------ vendor/code.gitea.io/sdk/gitea/user_key.go | 5 ++++- 6 files changed, 33 insertions(+), 20 deletions(-) diff --git a/Gopkg.lock b/Gopkg.lock index 054989b0f96f7..db5d6b4f548cd 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -11,11 +11,11 @@ [[projects]] branch = "master" - digest = "1:5e7f14543006a44047fb1d0df16da08b2ebc2428f1fd53bd8af26a2b34928b11" + digest = "1:bf4f822f636b99ac7d4f8fa5210a7439bacaf8d1f15d5783956bdd5dd2069bdc" name = "code.gitea.io/sdk" packages = ["gitea"] pruneopts = "NUT" - revision = "021567c9c12fe289b8980c34e81e6684434dd082" + revision = "11c860c8e49a23be26e6d6c6a039a46ad2ae1d27" [[projects]] digest = "1:3fcef06a1a6561955c94af6c7757a6fa37605eb653f0d06ab960e5bb80092195" diff --git a/vendor/code.gitea.io/sdk/gitea/admin_user.go b/vendor/code.gitea.io/sdk/gitea/admin_user.go index 4eab8c255fdbd..089ff2964495b 100644 --- a/vendor/code.gitea.io/sdk/gitea/admin_user.go +++ b/vendor/code.gitea.io/sdk/gitea/admin_user.go @@ -42,17 +42,17 @@ type EditUserOption struct { FullName string `json:"full_name" binding:"MaxSize(100)"` // required: true // swagger:strfmt email - Email string `json:"email" binding:"Required;Email;MaxSize(254)"` - Password string `json:"password" binding:"MaxSize(255)"` - Website string `json:"website" binding:"MaxSize(50)"` - Location string `json:"location" binding:"MaxSize(50)"` - Active *bool `json:"active"` - Admin *bool `json:"admin"` - AllowGitHook *bool `json:"allow_git_hook"` - AllowImportLocal *bool `json:"allow_import_local"` - MaxRepoCreation *int `json:"max_repo_creation"` - ProhibitLogin *bool `json:"prohibit_login"` - AllowCreateOrganization *bool `json:"allow_create_organization"` + Email string `json:"email" binding:"Required;Email;MaxSize(254)"` + Password string `json:"password" binding:"MaxSize(255)"` + Website string `json:"website" binding:"MaxSize(50)"` + Location string `json:"location" binding:"MaxSize(50)"` + Active *bool `json:"active"` + Admin *bool `json:"admin"` + AllowGitHook *bool `json:"allow_git_hook"` + AllowImportLocal *bool `json:"allow_import_local"` + MaxRepoCreation *int `json:"max_repo_creation"` + ProhibitLogin *bool `json:"prohibit_login"` + AllowCreateOrganization *bool `json:"allow_create_organization"` } // AdminEditUser modify user informations diff --git a/vendor/code.gitea.io/sdk/gitea/issue.go b/vendor/code.gitea.io/sdk/gitea/issue.go index fee7cd6f9fca2..8fc2b2bf7b137 100644 --- a/vendor/code.gitea.io/sdk/gitea/issue.go +++ b/vendor/code.gitea.io/sdk/gitea/issue.go @@ -152,3 +152,9 @@ type IssueDeadline struct { // swagger:strfmt date-time Deadline *time.Time `json:"due_date"` } + +// EditPriorityOption options for updating priority +type EditPriorityOption struct { + // required:true + Priority int `json:"priority"` +} diff --git a/vendor/code.gitea.io/sdk/gitea/repo.go b/vendor/code.gitea.io/sdk/gitea/repo.go index 339cbd33deaac..8b7c0b1e681c6 100644 --- a/vendor/code.gitea.io/sdk/gitea/repo.go +++ b/vendor/code.gitea.io/sdk/gitea/repo.go @@ -40,6 +40,7 @@ type Repository struct { Watchers int `json:"watchers_count"` OpenIssues int `json:"open_issues_count"` DefaultBranch string `json:"default_branch"` + Archived bool `json:"archived"` // swagger:strfmt date-time Created time.Time `json:"created_at"` // swagger:strfmt date-time diff --git a/vendor/code.gitea.io/sdk/gitea/repo_key.go b/vendor/code.gitea.io/sdk/gitea/repo_key.go index ec53311bdaa55..a1ae4584e0c12 100644 --- a/vendor/code.gitea.io/sdk/gitea/repo_key.go +++ b/vendor/code.gitea.io/sdk/gitea/repo_key.go @@ -13,13 +13,16 @@ import ( // DeployKey a deploy key type DeployKey struct { - ID int64 `json:"id"` - Key string `json:"key"` - URL string `json:"url"` - Title string `json:"title"` + ID int64 `json:"id"` + KeyID int64 `json:"key_id"` + Key string `json:"key"` + URL string `json:"url"` + Title string `json:"title"` + Fingerprint string `json:"fingerprint"` // swagger:strfmt date-time - Created time.Time `json:"created_at"` - ReadOnly bool `json:"read_only"` + Created time.Time `json:"created_at"` + ReadOnly bool `json:"read_only"` + Repository *Repository `json:"repository,omitempty"` } // ListDeployKeys list all the deploy keys of one repository diff --git a/vendor/code.gitea.io/sdk/gitea/user_key.go b/vendor/code.gitea.io/sdk/gitea/user_key.go index 4488c033f1a37..cccaa65db91ef 100644 --- a/vendor/code.gitea.io/sdk/gitea/user_key.go +++ b/vendor/code.gitea.io/sdk/gitea/user_key.go @@ -19,7 +19,10 @@ type PublicKey struct { Title string `json:"title,omitempty"` Fingerprint string `json:"fingerprint,omitempty"` // swagger:strfmt date-time - Created time.Time `json:"created_at,omitempty"` + Created time.Time `json:"created_at,omitempty"` + Owner *User `json:"user,omitempty"` + ReadOnly bool `json:"read_only,omitempty"` + KeyType string `json:"key_type,omitempty"` } // ListPublicKeys list all the public keys of the user From b664c1c484b21b2708cf6e3085b995d61a020be5 Mon Sep 17 00:00:00 2001 From: "Berengar W. Lehr" Date: Sun, 28 Oct 2018 13:44:27 +0100 Subject: [PATCH 3/5] fix: Removed changes that had nothing to do with this commit * WTF just happened?! Signed-off-by: Berengar W. Lehr --- vendor/code.gitea.io/sdk/gitea/issue.go | 8 +------- vendor/code.gitea.io/sdk/gitea/repo.go | 1 - vendor/code.gitea.io/sdk/gitea/repo_key.go | 3 --- vendor/code.gitea.io/sdk/gitea/user_key.go | 3 --- 4 files changed, 1 insertion(+), 14 deletions(-) diff --git a/vendor/code.gitea.io/sdk/gitea/issue.go b/vendor/code.gitea.io/sdk/gitea/issue.go index 8fc2b2bf7b137..85ac22cd50266 100644 --- a/vendor/code.gitea.io/sdk/gitea/issue.go +++ b/vendor/code.gitea.io/sdk/gitea/issue.go @@ -151,10 +151,4 @@ type EditDeadlineOption struct { type IssueDeadline struct { // swagger:strfmt date-time Deadline *time.Time `json:"due_date"` -} - -// EditPriorityOption options for updating priority -type EditPriorityOption struct { - // required:true - Priority int `json:"priority"` -} +} \ No newline at end of file diff --git a/vendor/code.gitea.io/sdk/gitea/repo.go b/vendor/code.gitea.io/sdk/gitea/repo.go index 8b7c0b1e681c6..339cbd33deaac 100644 --- a/vendor/code.gitea.io/sdk/gitea/repo.go +++ b/vendor/code.gitea.io/sdk/gitea/repo.go @@ -40,7 +40,6 @@ type Repository struct { Watchers int `json:"watchers_count"` OpenIssues int `json:"open_issues_count"` DefaultBranch string `json:"default_branch"` - Archived bool `json:"archived"` // swagger:strfmt date-time Created time.Time `json:"created_at"` // swagger:strfmt date-time diff --git a/vendor/code.gitea.io/sdk/gitea/repo_key.go b/vendor/code.gitea.io/sdk/gitea/repo_key.go index a1ae4584e0c12..e3d044d547701 100644 --- a/vendor/code.gitea.io/sdk/gitea/repo_key.go +++ b/vendor/code.gitea.io/sdk/gitea/repo_key.go @@ -14,15 +14,12 @@ import ( // DeployKey a deploy key type DeployKey struct { ID int64 `json:"id"` - KeyID int64 `json:"key_id"` Key string `json:"key"` URL string `json:"url"` Title string `json:"title"` - Fingerprint string `json:"fingerprint"` // swagger:strfmt date-time Created time.Time `json:"created_at"` ReadOnly bool `json:"read_only"` - Repository *Repository `json:"repository,omitempty"` } // ListDeployKeys list all the deploy keys of one repository diff --git a/vendor/code.gitea.io/sdk/gitea/user_key.go b/vendor/code.gitea.io/sdk/gitea/user_key.go index cccaa65db91ef..56692c313ec2f 100644 --- a/vendor/code.gitea.io/sdk/gitea/user_key.go +++ b/vendor/code.gitea.io/sdk/gitea/user_key.go @@ -20,9 +20,6 @@ type PublicKey struct { Fingerprint string `json:"fingerprint,omitempty"` // swagger:strfmt date-time Created time.Time `json:"created_at,omitempty"` - Owner *User `json:"user,omitempty"` - ReadOnly bool `json:"read_only,omitempty"` - KeyType string `json:"key_type,omitempty"` } // ListPublicKeys list all the public keys of the user From 4ced24a9951ce31ad8346e7ddbd555c8df18c221 Mon Sep 17 00:00:00 2001 From: "Berengar W. Lehr" Date: Sun, 28 Oct 2018 13:48:57 +0100 Subject: [PATCH 4/5] fix: Trying to make this fix run * Don't know anymore why stuff I never touched is changing Signed-off-by: Berengar W. Lehr --- vendor/code.gitea.io/sdk/gitea/issue.go | 8 +++++++- vendor/code.gitea.io/sdk/gitea/repo.go | 1 + vendor/code.gitea.io/sdk/gitea/repo_key.go | 3 +++ vendor/code.gitea.io/sdk/gitea/user_key.go | 3 +++ 4 files changed, 14 insertions(+), 1 deletion(-) diff --git a/vendor/code.gitea.io/sdk/gitea/issue.go b/vendor/code.gitea.io/sdk/gitea/issue.go index 85ac22cd50266..8fc2b2bf7b137 100644 --- a/vendor/code.gitea.io/sdk/gitea/issue.go +++ b/vendor/code.gitea.io/sdk/gitea/issue.go @@ -151,4 +151,10 @@ type EditDeadlineOption struct { type IssueDeadline struct { // swagger:strfmt date-time Deadline *time.Time `json:"due_date"` -} \ No newline at end of file +} + +// EditPriorityOption options for updating priority +type EditPriorityOption struct { + // required:true + Priority int `json:"priority"` +} diff --git a/vendor/code.gitea.io/sdk/gitea/repo.go b/vendor/code.gitea.io/sdk/gitea/repo.go index 339cbd33deaac..8b7c0b1e681c6 100644 --- a/vendor/code.gitea.io/sdk/gitea/repo.go +++ b/vendor/code.gitea.io/sdk/gitea/repo.go @@ -40,6 +40,7 @@ type Repository struct { Watchers int `json:"watchers_count"` OpenIssues int `json:"open_issues_count"` DefaultBranch string `json:"default_branch"` + Archived bool `json:"archived"` // swagger:strfmt date-time Created time.Time `json:"created_at"` // swagger:strfmt date-time diff --git a/vendor/code.gitea.io/sdk/gitea/repo_key.go b/vendor/code.gitea.io/sdk/gitea/repo_key.go index e3d044d547701..a1ae4584e0c12 100644 --- a/vendor/code.gitea.io/sdk/gitea/repo_key.go +++ b/vendor/code.gitea.io/sdk/gitea/repo_key.go @@ -14,12 +14,15 @@ import ( // DeployKey a deploy key type DeployKey struct { ID int64 `json:"id"` + KeyID int64 `json:"key_id"` Key string `json:"key"` URL string `json:"url"` Title string `json:"title"` + Fingerprint string `json:"fingerprint"` // swagger:strfmt date-time Created time.Time `json:"created_at"` ReadOnly bool `json:"read_only"` + Repository *Repository `json:"repository,omitempty"` } // ListDeployKeys list all the deploy keys of one repository diff --git a/vendor/code.gitea.io/sdk/gitea/user_key.go b/vendor/code.gitea.io/sdk/gitea/user_key.go index 56692c313ec2f..cccaa65db91ef 100644 --- a/vendor/code.gitea.io/sdk/gitea/user_key.go +++ b/vendor/code.gitea.io/sdk/gitea/user_key.go @@ -20,6 +20,9 @@ type PublicKey struct { Fingerprint string `json:"fingerprint,omitempty"` // swagger:strfmt date-time Created time.Time `json:"created_at,omitempty"` + Owner *User `json:"user,omitempty"` + ReadOnly bool `json:"read_only,omitempty"` + KeyType string `json:"key_type,omitempty"` } // ListPublicKeys list all the public keys of the user From cab1bd0608360f0f42d5b75b8a094743aee6975d Mon Sep 17 00:00:00 2001 From: "Berengar W. Lehr" Date: Sun, 28 Oct 2018 22:43:01 +0100 Subject: [PATCH 5/5] fix: Add secret to all webhook's payload where it has been missing * Updated dependency manager via `dep ensure -update code.gitea.io/sdk` * Gopkg.toml was nat changed as sdk version is set to "master" * Rebuild swagger as it became necessary b/c PR go-gitea/go-sdk#121 Signed-off-by: Berengar W. Lehr --- Gopkg.lock | 4 +-- templates/swagger/v1_json.tmpl | 27 ++++++++++++++++++++ vendor/code.gitea.io/sdk/gitea/admin_user.go | 22 ++++++++-------- vendor/code.gitea.io/sdk/gitea/issue.go | 6 +++++ vendor/code.gitea.io/sdk/gitea/repo.go | 1 + vendor/code.gitea.io/sdk/gitea/repo_key.go | 15 ++++++----- vendor/code.gitea.io/sdk/gitea/user_key.go | 5 +++- 7 files changed, 60 insertions(+), 20 deletions(-) diff --git a/Gopkg.lock b/Gopkg.lock index 054989b0f96f7..db5d6b4f548cd 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -11,11 +11,11 @@ [[projects]] branch = "master" - digest = "1:5e7f14543006a44047fb1d0df16da08b2ebc2428f1fd53bd8af26a2b34928b11" + digest = "1:bf4f822f636b99ac7d4f8fa5210a7439bacaf8d1f15d5783956bdd5dd2069bdc" name = "code.gitea.io/sdk" packages = ["gitea"] pruneopts = "NUT" - revision = "021567c9c12fe289b8980c34e81e6684434dd082" + revision = "11c860c8e49a23be26e6d6c6a039a46ad2ae1d27" [[projects]] digest = "1:3fcef06a1a6561955c94af6c7757a6fa37605eb653f0d06ab960e5bb80092195" diff --git a/templates/swagger/v1_json.tmpl b/templates/swagger/v1_json.tmpl index 4987691fdab52..efba90b18b5a8 100644 --- a/templates/swagger/v1_json.tmpl +++ b/templates/swagger/v1_json.tmpl @@ -6366,6 +6366,10 @@ "format": "date-time", "x-go-name": "Created" }, + "fingerprint": { + "type": "string", + "x-go-name": "Fingerprint" + }, "id": { "type": "integer", "format": "int64", @@ -6375,10 +6379,18 @@ "type": "string", "x-go-name": "Key" }, + "key_id": { + "type": "integer", + "format": "int64", + "x-go-name": "KeyID" + }, "read_only": { "type": "boolean", "x-go-name": "ReadOnly" }, + "repository": { + "$ref": "#/definitions/Repository" + }, "title": { "type": "string", "x-go-name": "Title" @@ -7260,6 +7272,14 @@ "type": "string", "x-go-name": "Key" }, + "key_type": { + "type": "string", + "x-go-name": "KeyType" + }, + "read_only": { + "type": "boolean", + "x-go-name": "ReadOnly" + }, "title": { "type": "string", "x-go-name": "Title" @@ -7267,6 +7287,9 @@ "url": { "type": "string", "x-go-name": "URL" + }, + "user": { + "$ref": "#/definitions/User" } }, "x-go-package": "code.gitea.io/gitea/vendor/code.gitea.io/sdk/gitea" @@ -7481,6 +7504,10 @@ "description": "Repository represents a repository", "type": "object", "properties": { + "archived": { + "type": "boolean", + "x-go-name": "Archived" + }, "clone_url": { "type": "string", "x-go-name": "CloneURL" diff --git a/vendor/code.gitea.io/sdk/gitea/admin_user.go b/vendor/code.gitea.io/sdk/gitea/admin_user.go index 4eab8c255fdbd..089ff2964495b 100644 --- a/vendor/code.gitea.io/sdk/gitea/admin_user.go +++ b/vendor/code.gitea.io/sdk/gitea/admin_user.go @@ -42,17 +42,17 @@ type EditUserOption struct { FullName string `json:"full_name" binding:"MaxSize(100)"` // required: true // swagger:strfmt email - Email string `json:"email" binding:"Required;Email;MaxSize(254)"` - Password string `json:"password" binding:"MaxSize(255)"` - Website string `json:"website" binding:"MaxSize(50)"` - Location string `json:"location" binding:"MaxSize(50)"` - Active *bool `json:"active"` - Admin *bool `json:"admin"` - AllowGitHook *bool `json:"allow_git_hook"` - AllowImportLocal *bool `json:"allow_import_local"` - MaxRepoCreation *int `json:"max_repo_creation"` - ProhibitLogin *bool `json:"prohibit_login"` - AllowCreateOrganization *bool `json:"allow_create_organization"` + Email string `json:"email" binding:"Required;Email;MaxSize(254)"` + Password string `json:"password" binding:"MaxSize(255)"` + Website string `json:"website" binding:"MaxSize(50)"` + Location string `json:"location" binding:"MaxSize(50)"` + Active *bool `json:"active"` + Admin *bool `json:"admin"` + AllowGitHook *bool `json:"allow_git_hook"` + AllowImportLocal *bool `json:"allow_import_local"` + MaxRepoCreation *int `json:"max_repo_creation"` + ProhibitLogin *bool `json:"prohibit_login"` + AllowCreateOrganization *bool `json:"allow_create_organization"` } // AdminEditUser modify user informations diff --git a/vendor/code.gitea.io/sdk/gitea/issue.go b/vendor/code.gitea.io/sdk/gitea/issue.go index fee7cd6f9fca2..8fc2b2bf7b137 100644 --- a/vendor/code.gitea.io/sdk/gitea/issue.go +++ b/vendor/code.gitea.io/sdk/gitea/issue.go @@ -152,3 +152,9 @@ type IssueDeadline struct { // swagger:strfmt date-time Deadline *time.Time `json:"due_date"` } + +// EditPriorityOption options for updating priority +type EditPriorityOption struct { + // required:true + Priority int `json:"priority"` +} diff --git a/vendor/code.gitea.io/sdk/gitea/repo.go b/vendor/code.gitea.io/sdk/gitea/repo.go index 339cbd33deaac..8b7c0b1e681c6 100644 --- a/vendor/code.gitea.io/sdk/gitea/repo.go +++ b/vendor/code.gitea.io/sdk/gitea/repo.go @@ -40,6 +40,7 @@ type Repository struct { Watchers int `json:"watchers_count"` OpenIssues int `json:"open_issues_count"` DefaultBranch string `json:"default_branch"` + Archived bool `json:"archived"` // swagger:strfmt date-time Created time.Time `json:"created_at"` // swagger:strfmt date-time diff --git a/vendor/code.gitea.io/sdk/gitea/repo_key.go b/vendor/code.gitea.io/sdk/gitea/repo_key.go index ec53311bdaa55..a1ae4584e0c12 100644 --- a/vendor/code.gitea.io/sdk/gitea/repo_key.go +++ b/vendor/code.gitea.io/sdk/gitea/repo_key.go @@ -13,13 +13,16 @@ import ( // DeployKey a deploy key type DeployKey struct { - ID int64 `json:"id"` - Key string `json:"key"` - URL string `json:"url"` - Title string `json:"title"` + ID int64 `json:"id"` + KeyID int64 `json:"key_id"` + Key string `json:"key"` + URL string `json:"url"` + Title string `json:"title"` + Fingerprint string `json:"fingerprint"` // swagger:strfmt date-time - Created time.Time `json:"created_at"` - ReadOnly bool `json:"read_only"` + Created time.Time `json:"created_at"` + ReadOnly bool `json:"read_only"` + Repository *Repository `json:"repository,omitempty"` } // ListDeployKeys list all the deploy keys of one repository diff --git a/vendor/code.gitea.io/sdk/gitea/user_key.go b/vendor/code.gitea.io/sdk/gitea/user_key.go index 4488c033f1a37..cccaa65db91ef 100644 --- a/vendor/code.gitea.io/sdk/gitea/user_key.go +++ b/vendor/code.gitea.io/sdk/gitea/user_key.go @@ -19,7 +19,10 @@ type PublicKey struct { Title string `json:"title,omitempty"` Fingerprint string `json:"fingerprint,omitempty"` // swagger:strfmt date-time - Created time.Time `json:"created_at,omitempty"` + Created time.Time `json:"created_at,omitempty"` + Owner *User `json:"user,omitempty"` + ReadOnly bool `json:"read_only,omitempty"` + KeyType string `json:"key_type,omitempty"` } // ListPublicKeys list all the public keys of the user