Skip to content

Commit

Permalink
Merge pull request #465 from mesosphere/ack-rename-secret
Browse files Browse the repository at this point in the history
Rename iam secret to private_key
  • Loading branch information
sargun committed Aug 25, 2016
2 parents bfcd401 + 956db97 commit ea801fa
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion httpcli/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func TestValidate(t *testing.T) {
am: AuthIAM,
cm: ConfigMapOptions{iam.Configuration(iam.Config{
ID: "foo",
Secret: "bar",
PrivateKey: "bar",
LoginEndpoint: "blah",
})}.ToConfigMap(),
},
Expand Down
2 changes: 1 addition & 1 deletion httpcli/iam/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ var ErrInvalidConfiguration = errors.New("invalid HTTP IAM configuration")
// IAM endpoint.
type Config struct {
ID string `json:"uid"` // ID
Secret string `json:"secret"` // Secret
PrivateKey string `json:"private_key"` // PrivateKey
LoginEndpoint string `json:"login_endpoint"` // LoginEndpoint
}

Expand Down
4 changes: 2 additions & 2 deletions httpcli/iam/iam.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func Register() {
}

func validate(c Config) {
if c.ID == "" || c.Secret == "" || c.LoginEndpoint == "" {
if c.ID == "" || c.PrivateKey == "" || c.LoginEndpoint == "" {
panic(ErrInvalidConfiguration)
}
}
Expand All @@ -42,7 +42,7 @@ func Doer(client *http.Client, config Config) httpcli.Doer {
token.Claims["uid"] = config.ID
token.Claims["exp"] = time.Now().Add(time.Hour).Unix()
// SignedString will treat secret as PEM-encoded key
tokenStr, err := token.SignedString([]byte(config.Secret))
tokenStr, err := token.SignedString([]byte(config.PrivateKey))
if err != nil {
return nil, err
}
Expand Down

0 comments on commit ea801fa

Please sign in to comment.