Skip to content
This repository has been archived by the owner on Mar 24, 2022. It is now read-only.

Commit

Permalink
Merge pull request #179 from markstgodard/fly-gitlab-oauth
Browse files Browse the repository at this point in the history
Fly and GitLab OAuth integration

Approved and testing by: @jtarchie and @topherbullock
  • Loading branch information
jtarchie authored Jul 17, 2017
2 parents f26b4a3 + efca7c2 commit bc5e6fc
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 0 deletions.
54 changes: 54 additions & 0 deletions integration/set_team_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,60 @@ var _ = Describe("Fly CLI", func() {
})
})

Describe("gitlab auth", func() {
Context("ClientID omitted", func() {
BeforeEach(func() {
cmdParams = []string{"--gitlab-auth-client-secret", "brock123"}
})

It("returns an error", func() {
sess, err := gexec.Start(flyCmd, nil, nil)
Expect(err).ToNot(HaveOccurred())
Eventually(sess.Err).Should(gbytes.Say("must specify --gitlab-auth-client-id and --gitlab-auth-client-secret to use GitLab OAuth."))
Eventually(sess).Should(gexec.Exit(1))
})
})

Context("ClientSecret omitted", func() {
BeforeEach(func() {
cmdParams = []string{"--gitlab-auth-client-id", "Brock Samson"}
})

It("returns an error", func() {
sess, err := gexec.Start(flyCmd, nil, nil)
Expect(err).ToNot(HaveOccurred())
Eventually(sess.Err).Should(gbytes.Say("must specify --gitlab-auth-client-id and --gitlab-auth-client-secret to use GitLab OAuth."))
Eventually(sess).Should(gexec.Exit(1))
})
})

Context("ClientID and ClientSecret omitted", func() {
BeforeEach(func() {
cmdParams = []string{"--gitlab-auth-group", "my-gitlab-group"}
})

It("returns an error", func() {
sess, err := gexec.Start(flyCmd, nil, nil)
Expect(err).ToNot(HaveOccurred())
Eventually(sess.Err).Should(gbytes.Say("must specify --gitlab-auth-client-id and --gitlab-auth-client-secret to use GitLab OAuth."))
Eventually(sess).Should(gexec.Exit(1))
})
})

Context("group is omitted", func() {
BeforeEach(func() {
cmdParams = []string{"--gitlab-auth-client-id", "Brock Samson", "--gitlab-auth-client-secret", "brock123"}
})

It("returns an error", func() {
sess, err := gexec.Start(flyCmd, nil, nil)
Expect(err).ToNot(HaveOccurred())
Eventually(sess.Err).Should(gbytes.Say("the following is required for gitlab-auth: groups"))
Eventually(sess).Should(gexec.Exit(1))
})
})
})

Describe("uaa auth", func() {
Context("ClientID omitted", func() {
BeforeEach(func() {
Expand Down
1 change: 1 addition & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import (

_ "github.com/concourse/atc/auth/genericoauth"
_ "github.com/concourse/atc/auth/github"
_ "github.com/concourse/atc/auth/gitlab"
_ "github.com/concourse/atc/auth/uaa"
)

Expand Down

0 comments on commit bc5e6fc

Please sign in to comment.