From 8920c2af029a930bf904685c606285da17de9e9d Mon Sep 17 00:00:00 2001 From: Niall Sheridan Date: Thu, 21 Apr 2016 21:53:34 +0100 Subject: Some small fixes. Rename 'GoogleOpts' to 'ProviderOpts'. Rename Principals to AdditionalPrincipals to match the config option. --- server/auth/google/google.go | 2 +- server/auth/google/google_test.go | 4 ++-- server/config/config.go | 10 +++++----- server/signer/signer.go | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) (limited to 'server') diff --git a/server/auth/google/google.go b/server/auth/google/google.go index d464b14..231312b 100644 --- a/server/auth/google/google.go +++ b/server/auth/google/google.go @@ -35,7 +35,7 @@ func New(c *config.Auth) auth.Provider { Endpoint: google.Endpoint, Scopes: []string{googleapi.UserinfoEmailScope, googleapi.UserinfoProfileScope}, }, - domain: c.GoogleOpts["domain"].(string), + domain: c.ProviderOpts["domain"].(string), } } diff --git a/server/auth/google/google_test.go b/server/auth/google/google_test.go index 489aa1a..3a86610 100644 --- a/server/auth/google/google_test.go +++ b/server/auth/google/google_test.go @@ -44,8 +44,8 @@ func newGoogle() auth.Provider { OauthClientID: oauthClientID, OauthClientSecret: oauthClientSecret, OauthCallbackURL: oauthCallbackURL, - GoogleOpts: make(map[string]interface{}), + ProviderOpts: make(map[string]interface{}), } - c.GoogleOpts["domain"] = domain + c.ProviderOpts["domain"] = domain return New(c) } diff --git a/server/config/config.go b/server/config/config.go index 4011d82..49b0f2e 100644 --- a/server/config/config.go +++ b/server/config/config.go @@ -24,16 +24,16 @@ type Auth struct { OauthClientSecret string `mapstructure:"oauth_client_secret"` OauthCallbackURL string `mapstructure:"oauth_callback_url"` Provider string `mapstructure:"provider"` - GoogleOpts map[string]interface{} `mapstructure:"google_opts"` + ProviderOpts map[string]interface{} `mapstructure:"provider_opts"` JWTSigningKey string `mapstructure:"jwt_signing_key"` } // SSH holds the configuration specific to signing ssh keys. type SSH struct { - SigningKey string `mapstructure:"signing_key"` - Principals []string `mapstructure:"additional_principals"` - MaxAge string `mapstructure:"max_age"` - Permissions []string `mapstructure:"permissions"` + SigningKey string `mapstructure:"signing_key"` + AdditionalPrincipals []string `mapstructure:"additional_principals"` + MaxAge string `mapstructure:"max_age"` + Permissions []string `mapstructure:"permissions"` } // ReadConfig parses a JSON configuration file into a Config struct. diff --git a/server/signer/signer.go b/server/signer/signer.go index f897195..854d70e 100644 --- a/server/signer/signer.go +++ b/server/signer/signer.go @@ -82,7 +82,7 @@ func New(conf config.SSH) (*KeySigner, error) { return &KeySigner{ ca: key, validity: validity, - principals: conf.Principals, + principals: conf.AdditionalPrincipals, permissions: makeperms(conf.Permissions), }, nil } -- cgit v1.2.3