mirror of
https://github.com/oauth2-proxy/oauth2-proxy.git
synced 2025-05-27 23:08:10 +02:00
25 lines
524 B
Go
25 lines
524 B
Go
package authorization
|
|
|
|
import (
|
|
"net/http"
|
|
|
|
sessionsapi "github.com/oauth2-proxy/oauth2-proxy/v7/pkg/apis/sessions"
|
|
. "github.com/onsi/ginkgo"
|
|
. "github.com/onsi/gomega"
|
|
)
|
|
|
|
var _ = Describe("Authorization Suite", func() {
|
|
It("works", func() {
|
|
req, err := http.NewRequest("GET", "/", nil)
|
|
Expect(err).ToNot(HaveOccurred())
|
|
|
|
session := &sessionsapi.SessionState{
|
|
Email: "foo@bar.com",
|
|
}
|
|
|
|
authorized, err := authorize(req, session)
|
|
Expect(err).ToNot(HaveOccurred())
|
|
Expect(authorized).To(BeTrue())
|
|
})
|
|
})
|