Skip to content

Commit

Permalink
Deprecate GAP-Signature and add a warning on usage (oauth2-proxy#1103)
Browse files Browse the repository at this point in the history
  • Loading branch information
Nick Meves authored and k-jell committed Apr 6, 2022
1 parent b7d6e7a commit 59bf378
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 28 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,16 @@

## Important Notes


- [#1103](https://github.com/oauth2-proxy/oauth2-proxy/pull/1103) Upstream request signatures via `--signature-key` is
deprecated. Support will be removed completely in v8.0.0.

## Breaking Changes

## Changes since v7.0.1

- [#1045](https://github.com/oauth2-proxy/oauth2-proxy/pull/1045) Ensure redirect URI always has a scheme (@JoelSpeed)
- [#1103](https://github.com/oauth2-proxy/oauth2-proxy/pull/1103) Deprecate upstream request signatures (@NickMeves)
- [#914](https://github.com/oauth2-proxy/oauth2-proxy/pull/914) Extract email from id_token for azure provider when oidc is configured
- [#1047](https://github.com/oauth2-proxy/oauth2-proxy/pull/1047) Refactor HTTP Server and add ServerGroup to handle graceful shutdown of multiple servers (@JoelSpeed)
- [#1070](https://github.com/oauth2-proxy/oauth2-proxy/pull/1070) Refactor logging middleware to middleware package (@NickMeves)
Expand Down
20 changes: 0 additions & 20 deletions docs/docs/features/request_signatures.md

This file was deleted.

2 changes: 1 addition & 1 deletion docs/sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ module.exports = {
type: 'category',
label: 'Features',
collapsed: false,
items: ['features/endpoints', 'features/request_signatures'],
items: ['features/endpoints'],
},
{
type: 'category',
Expand Down
13 changes: 6 additions & 7 deletions pkg/validation/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package validation

import (
"context"
"crypto"
"crypto/tls"
"fmt"
"io/ioutil"
Expand Down Expand Up @@ -30,8 +29,8 @@ func Validate(o *options.Options) error {
msgs = append(msgs, validateRedisSessionStore(o)...)
msgs = append(msgs, prefixValues("injectRequestHeaders: ", validateHeaders(o.InjectRequestHeaders)...)...)
msgs = append(msgs, prefixValues("injectResponseHeaders: ", validateHeaders(o.InjectResponseHeaders)...)...)
msgs = parseSignatureKey(o, msgs)
msgs = configureLogger(o.Logging, msgs)
msgs = parseSignatureKey(o, msgs)

if o.SSLInsecureSkipVerify {
// InsecureSkipVerify is a configurable option we allow
Expand Down Expand Up @@ -355,18 +354,18 @@ func parseSignatureKey(o *options.Options, msgs []string) []string {
return msgs
}

logger.Print("WARNING: `--signature-key` is deprecated. It will be removed in a future release")

components := strings.Split(o.SignatureKey, ":")
if len(components) != 2 {
return append(msgs, "invalid signature hash:key spec: "+
o.SignatureKey)
}

algorithm, secretKey := components[0], components[1]
var hash crypto.Hash
var err error
if hash, err = hmacauth.DigestNameToCryptoHash(algorithm); err != nil {
return append(msgs, "unsupported signature hash algorithm: "+
o.SignatureKey)
hash, err := hmacauth.DigestNameToCryptoHash(algorithm)
if err != nil {
return append(msgs, "unsupported signature hash algorithm: "+o.SignatureKey)
}
o.SetSignatureData(&options.SignatureData{Hash: hash, Key: secretKey})
return msgs
Expand Down

0 comments on commit 59bf378

Please sign in to comment.