Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reapply gogs hmac patch #6430

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion models/webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -658,7 +658,6 @@ func prepareWebhook(e Engine, w *Webhook, repo *Repository, event HookEventType,
return fmt.Errorf("GetDingtalkPayload: %v", err)
}
default:
p.SetSecret(w.Secret)
payloader = p
}

Expand Down Expand Up @@ -731,6 +730,8 @@ func (t *HookTask) deliver() {
Header("X-Gitea-Event", string(t.EventType)).
Header("X-Gitea-Signature", t.Signature).
Header("X-Gogs-Delivery", t.UUID).
Header("X-Gogs-Signature", t.Signature).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gogs signature is already set two lines down

Header("X-Hub-Signature", "sha256="+t.Signature).
Header("X-Gogs-Event", string(t.EventType)).
Header("X-Gogs-Signature", t.Signature).
HeaderWithSensitiveCase("X-GitHub-Delivery", t.UUID).
Expand Down
3 changes: 0 additions & 3 deletions models/webhook_discord.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,6 @@ var (
failedColor = color("ff3232")
)

// SetSecret sets the discord secret
func (p *DiscordPayload) SetSecret(_ string) {}

// JSONPayload Marshals the DiscordPayload to json
func (p *DiscordPayload) JSONPayload() ([]byte, error) {
data, err := json.MarshalIndent(p, "", " ")
Expand Down
3 changes: 0 additions & 3 deletions models/webhook_slack.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,6 @@ type SlackAttachment struct {
Text string `json:"text"`
}

// SetSecret sets the slack secret
func (p *SlackPayload) SetSecret(_ string) {}

// JSONPayload Marshals the SlackPayload to json
func (p *SlackPayload) JSONPayload() ([]byte, error) {
data, err := json.MarshalIndent(p, "", " ")
Expand Down
55 changes: 0 additions & 55 deletions vendor/code.gitea.io/sdk/gitea/hook.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.