Skip to content

Commit 3de44ca

Browse files
committed
housekeeping
1 parent d711c5c commit 3de44ca

File tree

2 files changed

+1
-6
lines changed

2 files changed

+1
-6
lines changed

proxy.go

+1-4
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ const StatusHeader = "JwtPxy-Token-Status"
1717
const RequireTokenModeHeader = "JwtPxy-Require-Token-Mode"
1818
const SignatureHeader = "JwtPxy-Signature"
1919

20-
// Proxy
2120
type Proxy struct {
2221
Target *url.URL
2322
Proxy *httputil.ReverseProxy
@@ -29,19 +28,16 @@ type Proxy struct {
2928
TokenMappings []TokenMapping
3029
}
3130

32-
// JWTConfig
3331
type JWTConfig struct {
3432
PublicKey *rsa.PublicKey `json:"public_key"`
3533
}
3634

37-
// Pmx
3835
type Pmx struct {
3936
Requests prometheus.Counter
4037
Latency prometheus.Summary
4138
AuthFails prometheus.Counter
4239
}
4340

44-
// handle requests
4541
func (p *Proxy) Handle(w http.ResponseWriter, r *http.Request) {
4642

4743
var admit = true
@@ -81,6 +77,7 @@ func (p *Proxy) Handle(w http.ResponseWriter, r *http.Request) {
8177
// not a token we check requireTokenMode for "false"
8278
authHeader := r.Header.Get("Authorization")
8379
tokenString := strings.TrimPrefix(authHeader, "Bearer ")
80+
8481
if tokenString != "" {
8582
err := p.ProxyTokenHandler(r)
8683
if err != nil {

token.go

-2
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,12 @@ import (
1212
"go.uber.org/zap"
1313
)
1414

15-
// TokenMapping
1615
type TokenMapping struct {
1716
Header string
1817
TokenKey string
1918
TokenValue interface{}
2019
}
2120

22-
// ProxyTokenHandler
2321
func (p *Proxy) ProxyTokenHandler(r *http.Request) error {
2422

2523
// process JWT

0 commit comments

Comments
 (0)