Skip to content
This repository has been archived by the owner on Jan 23, 2022. It is now read-only.

Commit

Permalink
update to github.com/greenpau/caddy-auth-jwt v1.3.9
Browse files Browse the repository at this point in the history
  • Loading branch information
greenpau committed Jun 28, 2021
1 parent 32ce561 commit f2eaa2c
Show file tree
Hide file tree
Showing 7 changed files with 40 additions and 7 deletions.
17 changes: 15 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ Please see other plugins:
Download Caddy with the plugins enabled:


* <a href="https://caddyserver.com/api/download?os=linux&arch=amd64&p=github.com%2Fgreenpau%2Fcaddy-auth-portal%40v1.4.10&p=github.com%2Fgreenpau%2Fcaddy-auth-jwt%40v1.3.8&p=github.com%2Fgreenpau%2Fcaddy-trace%40v1.1.7" target="_blank">linux/amd64</a>
* <a href="https://caddyserver.com/api/download?os=windows&arch=amd64&p=github.com%2Fgreenpau%2Fcaddy-auth-portal%40v1.4.10&p=github.com%2Fgreenpau%2Fcaddy-auth-jwt%40v1.3.8&p=github.com%2Fgreenpau%2Fcaddy-trace%40v1.1.7" target="_blank">windows/amd64</a>
* <a href="https://caddyserver.com/api/download?os=linux&arch=amd64&p=github.com%2Fgreenpau%2Fcaddy-auth-portal%40v1.4.10&p=github.com%2Fgreenpau%2Fcaddy-auth-jwt%40v1.3.9&p=github.com%2Fgreenpau%2Fcaddy-trace%40v1.1.7" target="_blank">linux/amd64</a>
* <a href="https://caddyserver.com/api/download?os=windows&arch=amd64&p=github.com%2Fgreenpau%2Fcaddy-auth-portal%40v1.4.10&p=github.com%2Fgreenpau%2Fcaddy-auth-jwt%40v1.3.9&p=github.com%2Fgreenpau%2Fcaddy-trace%40v1.1.7" target="_blank">windows/amd64</a>

<!-- begin-markdown-toc -->
## Table of Contents
Expand Down Expand Up @@ -419,6 +419,19 @@ authp {
}
```

The following transform adds role `verified` to Facebook-authenticated user
with id of `123456789`:

```
authp {
transform user {
exact match sub 123456789
exact match origin facebook
action add role verified
}
}
```

[:arrow_up: Back to Top](#table-of-contents)

<!--- end of section -->
Expand Down
4 changes: 2 additions & 2 deletions assets/docs/pages/11-download.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@

* <a href="https://caddyserver.com/api/download?os=linux&arch=amd64&p=github.com%2Fgreenpau%2Fcaddy-auth-portal%40v1.4.10&p=github.com%2Fgreenpau%2Fcaddy-auth-jwt%40v1.3.8&p=github.com%2Fgreenpau%2Fcaddy-trace%40v1.1.7" target="_blank">linux/amd64</a>
* <a href="https://caddyserver.com/api/download?os=windows&arch=amd64&p=github.com%2Fgreenpau%2Fcaddy-auth-portal%40v1.4.10&p=github.com%2Fgreenpau%2Fcaddy-auth-jwt%40v1.3.8&p=github.com%2Fgreenpau%2Fcaddy-trace%40v1.1.7" target="_blank">windows/amd64</a>
* <a href="https://caddyserver.com/api/download?os=linux&arch=amd64&p=github.com%2Fgreenpau%2Fcaddy-auth-portal%40v1.4.10&p=github.com%2Fgreenpau%2Fcaddy-auth-jwt%40v1.3.9&p=github.com%2Fgreenpau%2Fcaddy-trace%40v1.1.7" target="_blank">linux/amd64</a>
* <a href="https://caddyserver.com/api/download?os=windows&arch=amd64&p=github.com%2Fgreenpau%2Fcaddy-auth-portal%40v1.4.10&p=github.com%2Fgreenpau%2Fcaddy-auth-jwt%40v1.3.9&p=github.com%2Fgreenpau%2Fcaddy-trace%40v1.1.7" target="_blank">windows/amd64</a>
13 changes: 13 additions & 0 deletions assets/docs/pages/42-user-transforms.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,19 @@ authp {
}
```

The following transform adds role `verified` to Facebook-authenticated user
with id of `123456789`:

```
authp {
transform user {
exact match sub 123456789
exact match origin facebook
action add role verified
}
}
```

[:arrow_up: Back to Top](#table-of-contents)

<!--- end of section -->
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ require (
github.com/dgrijalva/jwt-go v3.2.0+incompatible
github.com/go-ldap/ldap v3.0.3+incompatible
github.com/google/go-cmp v0.5.5
github.com/greenpau/caddy-auth-jwt v1.3.8
github.com/greenpau/caddy-auth-jwt v1.3.9
github.com/greenpau/caddy-trace v1.1.7
github.com/greenpau/go-identity v1.1.2
github.com/iancoleman/strcase v0.1.3
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -356,8 +356,8 @@ github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5m
github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY=
github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ=
github.com/gostaticanalysis/analysisutil v0.0.0-20190318220348-4088753ea4d3/go.mod h1:eEOZF4jCKGi+aprrirO9e7WKB3beBRtWgqGunKl6pKE=
github.com/greenpau/caddy-auth-jwt v1.3.8 h1:B+4Dqsrf/lCkbSXSAdmuuj0hnG8G4sE7f4dhtMz+PK4=
github.com/greenpau/caddy-auth-jwt v1.3.8/go.mod h1:1k1qsOpMRisRlgfkLFjPOL7bXZ4XDwFUkLxWrNaVJc8=
github.com/greenpau/caddy-auth-jwt v1.3.9 h1:/UnFmg8CIwKEjuVLCReRmJ2sog9Dig9rexgpIt+e40k=
github.com/greenpau/caddy-auth-jwt v1.3.9/go.mod h1:1k1qsOpMRisRlgfkLFjPOL7bXZ4XDwFUkLxWrNaVJc8=
github.com/greenpau/caddy-trace v1.1.7 h1:5DzCyWpW2D68kqcLCoPYKtrw0WN8GtqkOas+gDHzryI=
github.com/greenpau/caddy-trace v1.1.7/go.mod h1:qoUivQ2RGtjvnWj300Jqjm+4Vbsa+aMIDivm91hHdcI=
github.com/greenpau/go-identity v1.1.2 h1:no+FH6pzcbQrPDMXmXh+WvsAA3eZ6zhSBzDMstxQBj8=
Expand Down
1 change: 1 addition & 0 deletions pkg/authn/handle_external_login.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import (

func (p *Authenticator) handleHTTPExternalLogin(ctx context.Context, w http.ResponseWriter, r *http.Request, rr *requests.Request, authMethod string) error {
p.disableClientCache(w)
p.injectRedirectURL(ctx, w, r, rr)
authRealm, err := getEndpoint(r.URL.Path, "/"+authMethod+"/")
if err != nil {
return p.handleHTTPError(ctx, w, r, rr, http.StatusBadRequest)
Expand Down
6 changes: 6 additions & 0 deletions pkg/authn/respond_http.go
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,12 @@ func (p *Authenticator) authorizeRequest(ctx context.Context, w http.ResponseWri
if strings.Contains(r.URL.Path, "/assets/") || strings.Contains(r.URL.Path, "/favicon") {
return nil, nil
}
p.logger.Debug(
"token error",
zap.String("session_id", rr.Upstream.SessionID),
zap.String("request_id", rr.ID),
zap.Error(err),
)
return nil, err
}
}
Expand Down

0 comments on commit f2eaa2c

Please sign in to comment.