1
0
mirror of https://github.com/oauth2-proxy/oauth2-proxy.git synced 2025-12-05 23:08:20 +02:00

Allow binary values in signed cookies

Make signedValue & Validate operate on []byte
by default and not assume/cast string. Any casting
will be done from callers.
This commit is contained in:
Nick Meves
2020-05-04 11:34:01 -07:00
parent f9025a8f8f
commit b4530b9292
4 changed files with 11 additions and 11 deletions

View File

@@ -170,7 +170,7 @@ var _ = Describe("NewSessionStore", func() {
BeforeEach(func() {
By("Using a valid cookie with a different providers session encoding")
broken := "BrokenSessionFromADifferentSessionImplementation"
value := encryption.SignedValue(cookieOpts.Secret, cookieOpts.Name, broken, time.Now())
value := encryption.SignedValue(cookieOpts.Secret, cookieOpts.Name, []byte(broken), time.Now())
cookie := cookiesapi.MakeCookieFromOptions(request, cookieOpts.Name, value, cookieOpts, cookieOpts.Expire, time.Now())
request.AddCookie(cookie)