diff --git a/mock-ec2-metadata-config.json b/mock-ec2-metadata-config.json index c160c5b..2634986 100644 --- a/mock-ec2-metadata-config.json +++ b/mock-ec2-metadata-config.json @@ -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", diff --git a/service.go b/service.go index 33ea694..f81a7e5 100644 --- a/service.go +++ b/service.go @@ -11,7 +11,6 @@ import ( type ( SecurityCredentials struct { - User string `json:"User"` AccessKeyId string `json:"AccessKeyId"` SecretAccessKey string `json:"SecretAccessKey"` Token string `json:"Token"` @@ -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"` } @@ -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) { @@ -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 diff --git a/version.go b/version.go index 424ec0f..18dd1f5 100644 --- a/version.go +++ b/version.go @@ -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