mirror of
https://github.com/oauth2-proxy/oauth2-proxy.git
synced 2026-10-21 10:17:22 +02:00
Improve design of Base64Cipher wrapping other ciphers.
Have it take in a cipher init function as an argument. Remove the confusing `newCipher` method that matched legacy behavior and returns a Base64Cipher(CFBCipher) -- instead explicitly ask for that in the uses.
This commit is contained in:
@@ -367,7 +367,7 @@ var _ = Describe("NewSessionStore", func() {
|
||||
_, err := rand.Read(secret)
|
||||
Expect(err).ToNot(HaveOccurred())
|
||||
cookieOpts.Secret = base64.URLEncoding.EncodeToString(secret)
|
||||
cipher, err := encryption.NewCipher(encryption.SecretBytes(cookieOpts.Secret))
|
||||
cipher, err := encryption.NewBase64Cipher(encryption.NewCFBCipher, encryption.SecretBytes(cookieOpts.Secret))
|
||||
Expect(err).ToNot(HaveOccurred())
|
||||
Expect(cipher).ToNot(BeNil())
|
||||
opts.Cipher = cipher
|
||||
|
||||
Reference in New Issue
Block a user