Skip to content

Commit ba132c0

Browse files
authored
Merge pull request #11 from Brainnwave/version-bump
rename to build.yml
2 parents ac5baaa + 8d75981 commit ba132c0

File tree

4 files changed

+21
-10
lines changed

4 files changed

+21
-10
lines changed

.github/workflows/go.yml renamed to .github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# This workflow will build a golang project
22
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go
33

4-
name: Go
4+
name: Build
55
on:
66
push:
77
branches:

README.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
1-
[![Go](https://brainnwave.com/badges/jwt-middleware/status.svg)](https://github.com/Brainnwave/jwt-middleware/actions/workflows/go.yml)
2-
[![Coverage](https://s3.amazonaws.com/brainnwave.assets/badges/jwt/coverage.svg)](https://github.com/Brainnwave/jwt-middleware/actions/workflows/go.yml)
1+
[![Build](https://github.com/Brainnwave/jwt-middleware/actions/workflows/build.yml/badge.svg)](https://github.com/Brainnwave/jwt-middleware/actions/workflows/build.yml)
2+
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=Brainnwave_jwt-middleware&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=Brainnwave_jwt-middleware)
3+
[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=Brainnwave_jwt-middleware&metric=coverage)](https://sonarcloud.io/summary/new_code?id=Brainnwave_jwt-middleware)
34

45
# Dynamic JWT Validation Middleware
56

67
This is a middleware plugin for [Traefik](https://github.com/containous/traefik) with the following features:
78
* Validation of JSON Web Tokens in cookies, headers, and/or query string parameters for access control.
8-
* Dynamic lookup of public keys from the well-known JWKS endpoint of whitelisted issuers.
9-
* HTTP redirects for unauthorized and forbidden calls when configured in interactive mode.
9+
* Dynamic lookup of public keys from the well-known OpenID configuration of whitelisted issuers.
10+
* Configurable HTTP redirects for unauthorized and forbidden calls in interactive mode.
1011
* Flexible claim checks, including optional wildcards and Go template interpolation.
1112

1213
## Configuration
@@ -17,15 +18,15 @@ experimental:
1718
plugins:
1819
jwt:
1920
moduleName: github.com/Brainnwave/jwt-middleware
20-
version: v1.1.7
21+
version: v1.1.8
2122
```
2223
1b. or with command-line options:
2324
2425
```yaml
2526
command:
2627
...
2728
- "--experimental.plugins.jwt.modulename=github.com/Brainnwave/jwt-middleware"
28-
- "--experimental.plugins.jwt.version=v1.1.7"
29+
- "--experimental.plugins.jwt.version=v1.1.8"
2930
```
3031
3132
2) Configure and activate the plugin as a middleware in your dynamic traefik config:

jwt.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ type TemplateRequirement struct {
8383
// CreateConfig creates the default plugin configuration.
8484
func CreateConfig() *Config {
8585
return &Config{
86-
ValidMethods: []string{"RS256", "RS512", "ES256", "ES384", "ES512", "HS256"},
86+
ValidMethods: []string{"RS256", "RS384", "RS512", "ES256", "ES384", "ES512", "HS256"},
8787
CookieName: "Authorization",
8888
HeaderName: "Authorization",
8989
ForwardToken: true,

jwt_test.go

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -389,6 +389,16 @@ func TestServeHTTP(tester *testing.T) {
389389
Method: jwt.SigningMethodRS256,
390390
HeaderName: "Authorization",
391391
},
392+
{
393+
Name: "SigningMethodRS384",
394+
Expect: http.StatusOK,
395+
Config: `
396+
require:
397+
aud: test`,
398+
Claims: `{"aud": "test"}`,
399+
Method: jwt.SigningMethodRS384,
400+
HeaderName: "Authorization",
401+
},
392402
{
393403
Name: "SigningMethodRS512",
394404
Expect: http.StatusOK,
@@ -1092,12 +1102,12 @@ func createTokenAndSaveKey(test *Test, config *Config) string {
10921102
var public interface{}
10931103
var publicPEM string
10941104
switch method {
1095-
case jwt.SigningMethodHS256:
1105+
case jwt.SigningMethodHS256, jwt.SigningMethodHS384, jwt.SigningMethodHS512:
10961106
if config.Secret == "" {
10971107
panic(fmt.Errorf("secret is required for %s", method.Alg()))
10981108
}
10991109
private = []byte(config.Secret)
1100-
case jwt.SigningMethodRS256, jwt.SigningMethodRS512:
1110+
case jwt.SigningMethodRS256, jwt.SigningMethodRS384, jwt.SigningMethodRS512:
11011111
secret, err := rsa.GenerateKey(rand.Reader, 2048)
11021112
if err != nil {
11031113
panic(err)

0 commit comments

Comments
 (0)