update auth flags setup
@@ -4,8 +4,13 @@ import (
"fmt"
"os"
- "github.com/jessevdk/go-flags"
+ "github.com/concourse/atc/auth/provider"
+ flags "github.com/jessevdk/go-flags"
"github.com/vito/twentythousandtonnesofcrudeoil"
+
+ _ "github.com/concourse/atc/auth/genericoauth"
+ _ "github.com/concourse/atc/auth/github"
+ _ "github.com/concourse/atc/auth/uaa"
)
// overridden via linker flags
@@ -26,7 +31,26 @@ func main() {
twentythousandtonnesofcrudeoil.TheEnvironmentIsPerfectlySafe(parser, "CONCOURSE_")
+ authConfigs := make(provider.AuthConfigs)
+
+ for name, p := range provider.GetProviders() {
+ authGroup := p.AuthGroup()
+
+ group, err := parser.Command.Group.AddGroup(authGroup.Name(), "", authGroup.AuthConfig())
+ if err != nil {
+ fmt.Fprintln(os.Stderr, err)
+ os.Exit(1)
+ }
+
+ group.Namespace = authGroup.Namespace()
+
+ authConfigs[name] = authGroup.AuthConfig()
+ }
+
_, err := parser.Parse()
+
+ cmd.Web.ProviderAuth = authConfigs
+
if err != nil {
fmt.Fprintln(os.Stderr, err)
os.Exit(1)
