diff options
author | Peter Hoffmann <Hoffmann.P@gmx.net> | 2018-10-28 23:03:02 +0100 |
---|---|---|
committer | techknowlogick <hello@techknowlogick.com> | 2018-10-28 18:03:02 -0400 |
commit | fb14458010e1c18dc08549bbe83cab56fc690bc7 (patch) | |
tree | ebbb34e05fb6f4e1ccd1f827813cc18c5e2a63b6 /vendor/code.gitea.io/sdk | |
parent | 48badd59e9401df50f36dbd19a4a8167265d618d (diff) | |
download | gitea-fb14458010e1c18dc08549bbe83cab56fc690bc7.tar.gz gitea-fb14458010e1c18dc08549bbe83cab56fc690bc7.zip |
fix: Add secret to all webhook's payload where it has been missing (#5199)
* fix: Add secret to all webhook's payload where it has been missing
affects webhooks for:
* Delete
* Fork
* IssueComment
* Release
Diffstat (limited to 'vendor/code.gitea.io/sdk')
-rw-r--r-- | vendor/code.gitea.io/sdk/gitea/admin_user.go | 22 | ||||
-rw-r--r-- | vendor/code.gitea.io/sdk/gitea/hook.go | 22 | ||||
-rw-r--r-- | vendor/code.gitea.io/sdk/gitea/issue.go | 6 | ||||
-rw-r--r-- | vendor/code.gitea.io/sdk/gitea/repo.go | 1 | ||||
-rw-r--r-- | vendor/code.gitea.io/sdk/gitea/repo_key.go | 15 | ||||
-rw-r--r-- | vendor/code.gitea.io/sdk/gitea/user_key.go | 5 |
6 files changed, 46 insertions, 25 deletions
diff --git a/vendor/code.gitea.io/sdk/gitea/admin_user.go b/vendor/code.gitea.io/sdk/gitea/admin_user.go index 4eab8c255f..089ff29644 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/hook.go b/vendor/code.gitea.io/sdk/gitea/hook.go index f346381679..80a5192d8e 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 } diff --git a/vendor/code.gitea.io/sdk/gitea/issue.go b/vendor/code.gitea.io/sdk/gitea/issue.go index fee7cd6f9f..8fc2b2bf7b 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 339cbd33de..8b7c0b1e68 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 ec53311bda..a1ae4584e0 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 4488c033f1..cccaa65db9 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 |