mirror of
https://github.com/pomerium/pomerium.git
synced 2025-08-04 01:09:36 +02:00
all: remove unused handler code (#2439)
* - Remove unused middleware Signed-off-by: Bobby DeSimone <bobbydesimone@gmail.com> * remove unused func weightedStrings Signed-off-by: Bobby DeSimone <bobbydesimone@gmail.com> * remove unused func getJWTSetCookieHeaders Signed-off-by: Bobby DeSimone <bobbydesimone@gmail.com> * Fix test name
This commit is contained in:
parent
87c9ace12c
commit
87c3c675d2
8 changed files with 2 additions and 413 deletions
|
@ -2,9 +2,7 @@ package authorize
|
|||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"net/http"
|
||||
"net/http/httptest"
|
||||
|
||||
"github.com/pomerium/pomerium/config"
|
||||
"github.com/pomerium/pomerium/internal/encoding"
|
||||
|
@ -64,22 +62,3 @@ func getCookieStore(options *config.Options, encoder encoding.MarshalUnmarshaler
|
|||
}
|
||||
return cookieStore, nil
|
||||
}
|
||||
|
||||
func getJWTSetCookieHeaders(cookieStore sessions.SessionStore, rawjwt []byte) (map[string]string, error) {
|
||||
recorder := httptest.NewRecorder()
|
||||
err := cookieStore.SaveSession(recorder, nil /* unused by cookie store */, string(rawjwt))
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("authorize: error saving cookie: %w", err)
|
||||
}
|
||||
|
||||
res := recorder.Result()
|
||||
res.Body.Close()
|
||||
|
||||
hdrs := make(map[string]string)
|
||||
for k, vs := range res.Header {
|
||||
for _, v := range vs {
|
||||
hdrs[k] = v
|
||||
}
|
||||
}
|
||||
return hdrs, nil
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue