Skip to content

Commit

Permalink
Rename to encryptedCookieEncoder
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexanderYastrebov committed Feb 22, 2024
1 parent 4b5618e commit 8e67ae3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion filters/auth/grantconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ func (c *OAuthConfig) Init() error {
}

if c.GrantCookieEncoder == nil {
c.GrantCookieEncoder = encryptingCookieEncoder{}
c.GrantCookieEncoder = encryptedCookieEncoder{}
}

c.initialized = true
Expand Down
8 changes: 4 additions & 4 deletions filters/auth/grantcookie.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,19 @@ type CookieEncoder interface {
Extract(config *OAuthConfig, request *http.Request) (*oauth2.Token, error)
}

type encryptingCookieEncoder struct{}
type encryptedCookieEncoder struct{}

var _ CookieEncoder = encryptingCookieEncoder{}
var _ CookieEncoder = encryptedCookieEncoder{}

func (encryptingCookieEncoder) Create(config *OAuthConfig, host string, t *oauth2.Token) ([]*http.Cookie, error) {
func (encryptedCookieEncoder) Create(config *OAuthConfig, host string, t *oauth2.Token) ([]*http.Cookie, error) {
c, err := createCookie(config, host, t)
if err != nil {
return nil, err
}
return []*http.Cookie{c}, nil
}

func (encryptingCookieEncoder) Extract(config *OAuthConfig, request *http.Request) (*oauth2.Token, error) {
func (encryptedCookieEncoder) Extract(config *OAuthConfig, request *http.Request) (*oauth2.Token, error) {
c, err := extractCookie(request, config)
if err != nil {
return nil, err
Expand Down

0 comments on commit 8e67ae3

Please sign in to comment.