Skip to content

Commit

Permalink
Move user info out of security credentials, bup version
Browse files Browse the repository at this point in the history
  • Loading branch information
jimbydamonk committed Jun 19, 2019
1 parent c51520c commit d9a9f41
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion mock-ec2-metadata-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
"mac": "00:00:00:00:00:00",
"profile": "mock-profile",
"reservation-id":"mock-reservation-id",
"user" : "mock-user",
"security-credentials": {
"user": "mock-user",
"AccessKeyId" : "mock-access-key",
"SecretAccessKey" : "mock-secret-key",
"Token": "mock-token",
Expand Down
6 changes: 3 additions & 3 deletions service.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import (

type (
SecurityCredentials struct {
User string `json:"User"`
AccessKeyId string `json:"AccessKeyId"`
SecretAccessKey string `json:"SecretAccessKey"`
Token string `json:"Token"`
Expand All @@ -33,6 +32,7 @@ type (
Mac string `json:"mac"`
Profile string `json:"profile"`
ReservationId string `json:"reservation-id"`
User string `json:"User"`
SecurityGroups []string `json:"security-groups"`
SecurityCredentials SecurityCredentials `json:"security-credentials"`
}
Expand Down Expand Up @@ -129,7 +129,7 @@ func (s *MetadataService) GetReservationId(w http.ResponseWriter, r *http.Reques
}

func (s *MetadataService) GetSecurityCredentials(w http.ResponseWriter, r *http.Request) {
fmt.Fprintf(w, s.config.MetadataValues.SecurityCredentials.User)
fmt.Fprintf(w, s.config.MetadataValues.User)
}

func (s *MetadataService) GetSecurityGroups(w http.ResponseWriter, r *http.Request) {
Expand All @@ -139,7 +139,7 @@ func (s *MetadataService) GetSecurityGroups(w http.ResponseWriter, r *http.Reque
func (s *MetadataService) GetSecurityCredentialDetails(w http.ResponseWriter, r *http.Request) {
username := server.Vars(r)["username"]

if username != s.config.MetadataValues.SecurityCredentials.User {
if username != s.config.MetadataValues.User {
server.Log.Error("error, IAM user not found")
http.Error(w, "", http.StatusNotFound)
return
Expand Down
2 changes: 1 addition & 1 deletion version.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ package metadata
var GitCommit string

// The main version number that is being run at the moment.
const Version = "0.4.0"
const Version = "0.4.1"

// A pre-release marker for the version. If this is "" (empty string)
// then it means that it is a final release. Otherwise, this is a pre-release
Expand Down

0 comments on commit d9a9f41

Please sign in to comment.