コード例 #1
0
	"github.com/concourse/atc/auth"
	"github.com/concourse/atc/auth/fakes"
	"github.com/concourse/atc/auth/provider"
	providerFakes "github.com/concourse/atc/auth/provider/fakes"
	"github.com/concourse/atc/db"
)

var _ = Describe("OAuthCallbackHandler", func() {
	var (
		fakeProviderA *providerFakes.FakeProvider
		fakeProviderB *providerFakes.FakeProvider

		fakeProviderFactory *fakes.FakeProviderFactory

		fakeAuthDB *fakes.FakeAuthDB

		signingKey *rsa.PrivateKey

		server *httptest.Server
		client *http.Client

		team db.SavedTeam
	)

	BeforeEach(func() {
		fakeProviderA = new(providerFakes.FakeProvider)
		fakeProviderB = new(providerFakes.FakeProvider)

		fakeProviderFactory = new(fakes.FakeProviderFactory)

		fakeAuthDB = new(fakes.FakeAuthDB)
コード例 #2
0
	"github.com/concourse/atc/auth"
	"github.com/concourse/atc/auth/fakes"
	"github.com/concourse/atc/auth/provider"
	providerFakes "github.com/concourse/atc/auth/provider/fakes"
)

var _ = Describe("OAuthBeginHandler", func() {
	var (
		fakeProviderA *providerFakes.FakeProvider
		fakeProviderB *providerFakes.FakeProvider

		fakeProviderFactory *fakes.FakeProviderFactory

		fakeAuthDB *fakes.FakeAuthDB

		signingKey *rsa.PrivateKey

		cookieJar *cookiejar.Jar

		server *httptest.Server
		client *http.Client
	)

	BeforeEach(func() {
		fakeProviderA = new(providerFakes.FakeProvider)
		fakeProviderB = new(providerFakes.FakeProvider)

		fakeProviderFactory = new(fakes.FakeProviderFactory)

		fakeAuthDB = new(fakes.FakeAuthDB)
コード例 #3
0
ファイル: auth_test.go プロジェクト: pcfdev-forks/atc
			It("does not generate a token", func() {
				Expect(fakeTokenGenerator.GenerateTokenCallCount()).To(Equal(0))
			})
		})
	})

	Describe("GET /api/v1/auth/methods", func() {
		Context("when providers are present", func() {
			var request *http.Request
			var response *http.Response

			var savedTeam db.SavedTeam

			BeforeEach(func() {
				authProvider1 := new(fakes.FakeProvider)
				authProvider1.DisplayNameReturns("OAuth Provider 1")

				authProvider2 := new(fakes.FakeProvider)
				authProvider2.DisplayNameReturns("OAuth Provider 2")
				providerFactory.GetProvidersReturns(
					provider.Providers{
						"oauth-provider-1": authProvider1,
						"oauth-provider-2": authProvider2,
					},
					nil,
				)

				savedTeam = db.SavedTeam{
					ID: 0,
					Team: db.Team{