You've already forked oauth2-proxy
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:
@@ -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())
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user