1
0
mirror of https://github.com/oauth2-proxy/oauth2-proxy.git synced 2025-12-03 22:59:10 +02:00

Switch to in session store initialisation

This commit is contained in:
Joel Speed
2020-06-28 12:44:12 +01:00
parent 778463906a
commit 6e1b3b9660
6 changed files with 48 additions and 35 deletions

View File

@@ -417,6 +417,19 @@ var _ = Describe("NewSessionStore", func() {
Context("the cookie.SessionStore", func() {
RunSessionTests(false)
})
Context("with an invalid cookie secret", func() {
BeforeEach(func() {
cookieOpts.Secret = "invalid"
})
It("returns an error", func() {
ss, err := sessions.NewSessionStore(opts, cookieOpts)
Expect(err).To(HaveOccurred())
Expect(err.Error()).To(Equal("error initialising cipher: crypto/aes: invalid key size 7"))
Expect(ss).To(BeNil())
})
})
})
Context("with type 'redis'", func() {
@@ -441,6 +454,19 @@ var _ = Describe("NewSessionStore", func() {
Context("the redis.SessionStore", func() {
RunSessionTests(true)
})
Context("with an invalid cookie secret", func() {
BeforeEach(func() {
cookieOpts.Secret = "invalid"
})
It("returns an error", func() {
ss, err := sessions.NewSessionStore(opts, cookieOpts)
Expect(err).To(HaveOccurred())
Expect(err.Error()).To(Equal("error initialising cipher: crypto/aes: invalid key size 7"))
Expect(ss).To(BeNil())
})
})
})
Context("with an invalid type", func() {
@@ -455,17 +481,4 @@ var _ = Describe("NewSessionStore", func() {
Expect(ss).To(BeNil())
})
})
Context("with an invalid cookie secret", func() {
BeforeEach(func() {
cookieOpts.Secret = "invalid"
})
It("returns an error", func() {
ss, err := sessions.NewSessionStore(opts, cookieOpts)
Expect(err).To(HaveOccurred())
Expect(err.Error()).To(Equal("error initialising cipher: crypto/aes: invalid key size 7"))
Expect(ss).To(BeNil())
})
})
})