@@ -62,7 +62,6 @@ type EditHookOption struct {
6262
6363// Payloader payload is some part of one hook
6464type Payloader interface {
65- SetSecret (string )
6665 JSONPayload () ([]byte , error )
6766}
6867
@@ -124,19 +123,13 @@ var (
124123
125124// CreatePayload FIXME
126125type CreatePayload struct {
127- Secret string `json:"secret"`
128126 Sha string `json:"sha"`
129127 Ref string `json:"ref"`
130128 RefType string `json:"ref_type"`
131129 Repo * Repository `json:"repository"`
132130 Sender * User `json:"sender"`
133131}
134132
135- // SetSecret modifies the secret of the CreatePayload
136- func (p * CreatePayload ) SetSecret (secret string ) {
137- p .Secret = secret
138- }
139-
140133// JSONPayload return payload information
141134func (p * CreatePayload ) JSONPayload () ([]byte , error ) {
142135 json := jsoniter .ConfigCompatibleWithStandardLibrary
@@ -181,19 +174,13 @@ const (
181174
182175// DeletePayload represents delete payload
183176type DeletePayload struct {
184- Secret string `json:"secret"`
185177 Ref string `json:"ref"`
186178 RefType string `json:"ref_type"`
187179 PusherType PusherType `json:"pusher_type"`
188180 Repo * Repository `json:"repository"`
189181 Sender * User `json:"sender"`
190182}
191183
192- // SetSecret modifies the secret of the DeletePayload
193- func (p * DeletePayload ) SetSecret (secret string ) {
194- p .Secret = secret
195- }
196-
197184// JSONPayload implements Payload
198185func (p * DeletePayload ) JSONPayload () ([]byte , error ) {
199186 json := jsoniter .ConfigCompatibleWithStandardLibrary
@@ -209,17 +196,11 @@ func (p *DeletePayload) JSONPayload() ([]byte, error) {
209196
210197// ForkPayload represents fork payload
211198type ForkPayload struct {
212- Secret string `json:"secret"`
213199 Forkee * Repository `json:"forkee"`
214200 Repo * Repository `json:"repository"`
215201 Sender * User `json:"sender"`
216202}
217203
218- // SetSecret modifies the secret of the ForkPayload
219- func (p * ForkPayload ) SetSecret (secret string ) {
220- p .Secret = secret
221- }
222-
223204// JSONPayload implements Payload
224205func (p * ForkPayload ) JSONPayload () ([]byte , error ) {
225206 json := jsoniter .ConfigCompatibleWithStandardLibrary
@@ -238,7 +219,6 @@ const (
238219
239220// IssueCommentPayload represents a payload information of issue comment event.
240221type IssueCommentPayload struct {
241- Secret string `json:"secret"`
242222 Action HookIssueCommentAction `json:"action"`
243223 Issue * Issue `json:"issue"`
244224 Comment * Comment `json:"comment"`
@@ -248,11 +228,6 @@ type IssueCommentPayload struct {
248228 IsPull bool `json:"is_pull"`
249229}
250230
251- // SetSecret modifies the secret of the IssueCommentPayload
252- func (p * IssueCommentPayload ) SetSecret (secret string ) {
253- p .Secret = secret
254- }
255-
256231// JSONPayload implements Payload
257232func (p * IssueCommentPayload ) JSONPayload () ([]byte , error ) {
258233 json := jsoniter .ConfigCompatibleWithStandardLibrary
@@ -278,18 +253,12 @@ const (
278253
279254// ReleasePayload represents a payload information of release event.
280255type ReleasePayload struct {
281- Secret string `json:"secret"`
282256 Action HookReleaseAction `json:"action"`
283257 Release * Release `json:"release"`
284258 Repository * Repository `json:"repository"`
285259 Sender * User `json:"sender"`
286260}
287261
288- // SetSecret modifies the secret of the ReleasePayload
289- func (p * ReleasePayload ) SetSecret (secret string ) {
290- p .Secret = secret
291- }
292-
293262// JSONPayload implements Payload
294263func (p * ReleasePayload ) JSONPayload () ([]byte , error ) {
295264 json := jsoniter .ConfigCompatibleWithStandardLibrary
@@ -305,7 +274,6 @@ func (p *ReleasePayload) JSONPayload() ([]byte, error) {
305274
306275// PushPayload represents a payload information of push event.
307276type PushPayload struct {
308- Secret string `json:"secret"`
309277 Ref string `json:"ref"`
310278 Before string `json:"before"`
311279 After string `json:"after"`
@@ -317,11 +285,6 @@ type PushPayload struct {
317285 Sender * User `json:"sender"`
318286}
319287
320- // SetSecret modifies the secret of the PushPayload
321- func (p * PushPayload ) SetSecret (secret string ) {
322- p .Secret = secret
323- }
324-
325288// JSONPayload FIXME
326289func (p * PushPayload ) JSONPayload () ([]byte , error ) {
327290 json := jsoniter .ConfigCompatibleWithStandardLibrary
@@ -389,7 +352,6 @@ const (
389352
390353// IssuePayload represents the payload information that is sent along with an issue event.
391354type IssuePayload struct {
392- Secret string `json:"secret"`
393355 Action HookIssueAction `json:"action"`
394356 Index int64 `json:"number"`
395357 Changes * ChangesPayload `json:"changes,omitempty"`
@@ -398,11 +360,6 @@ type IssuePayload struct {
398360 Sender * User `json:"sender"`
399361}
400362
401- // SetSecret modifies the secret of the IssuePayload.
402- func (p * IssuePayload ) SetSecret (secret string ) {
403- p .Secret = secret
404- }
405-
406363// JSONPayload encodes the IssuePayload to JSON, with an indentation of two spaces.
407364func (p * IssuePayload ) JSONPayload () ([]byte , error ) {
408365 json := jsoniter .ConfigCompatibleWithStandardLibrary
@@ -430,7 +387,6 @@ type ChangesPayload struct {
430387
431388// PullRequestPayload represents a payload information of pull request event.
432389type PullRequestPayload struct {
433- Secret string `json:"secret"`
434390 Action HookIssueAction `json:"action"`
435391 Index int64 `json:"number"`
436392 Changes * ChangesPayload `json:"changes,omitempty"`
@@ -440,11 +396,6 @@ type PullRequestPayload struct {
440396 Review * ReviewPayload `json:"review"`
441397}
442398
443- // SetSecret modifies the secret of the PullRequestPayload.
444- func (p * PullRequestPayload ) SetSecret (secret string ) {
445- p .Secret = secret
446- }
447-
448399// JSONPayload FIXME
449400func (p * PullRequestPayload ) JSONPayload () ([]byte , error ) {
450401 json := jsoniter .ConfigCompatibleWithStandardLibrary
@@ -476,18 +427,12 @@ const (
476427
477428// RepositoryPayload payload for repository webhooks
478429type RepositoryPayload struct {
479- Secret string `json:"secret"`
480430 Action HookRepoAction `json:"action"`
481431 Repository * Repository `json:"repository"`
482432 Organization * User `json:"organization"`
483433 Sender * User `json:"sender"`
484434}
485435
486- // SetSecret modifies the secret of the RepositoryPayload
487- func (p * RepositoryPayload ) SetSecret (secret string ) {
488- p .Secret = secret
489- }
490-
491436// JSONPayload JSON representation of the payload
492437func (p * RepositoryPayload ) JSONPayload () ([]byte , error ) {
493438 json := jsoniter .ConfigCompatibleWithStandardLibrary
0 commit comments