mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-04-14 02:51:35 +02:00
federation: add setting to disable HTTP signature validation
This commit is contained in:
parent
a4f9ffbaf9
commit
c8dcd5ee64
2 changed files with 6 additions and 0 deletions
|
@ -19,6 +19,7 @@ var (
|
|||
DigestAlgorithm string
|
||||
GetHeaders []string
|
||||
PostHeaders []string
|
||||
SignatureEnforced bool
|
||||
}{
|
||||
Enabled: false,
|
||||
ShareUserStatistics: true,
|
||||
|
@ -27,6 +28,7 @@ var (
|
|||
DigestAlgorithm: "SHA-256",
|
||||
GetHeaders: []string{"(request-target)", "Date", "Host"},
|
||||
PostHeaders: []string{"(request-target)", "Date", "Host", "Digest"},
|
||||
SignatureEnforced: true,
|
||||
}
|
||||
)
|
||||
|
||||
|
|
|
@ -41,6 +41,10 @@ func getPublicKeyFromResponse(b []byte, keyID *url.URL) (p crypto.PublicKey, err
|
|||
}
|
||||
|
||||
func verifyHTTPSignatures(ctx *gitea_context.APIContext) (authenticated bool, err error) {
|
||||
if !setting.Federation.SignatureEnforced {
|
||||
return true, nil
|
||||
}
|
||||
|
||||
r := ctx.Req
|
||||
|
||||
// 1. Figure out what key we need to verify
|
||||
|
|
Loading…
Add table
Reference in a new issue