Skip to content

Commit

Permalink
log sts host instead of global/regional
Browse files Browse the repository at this point in the history
  • Loading branch information
sushanth0910 committed Nov 13, 2024
1 parent 7770163 commit 95f5bb8
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
20 changes: 10 additions & 10 deletions pkg/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -344,12 +344,12 @@ func (h *handler) authenticateEndpoint(w http.ResponseWriter, req *http.Request)

if h.isLoggableIdentity(identity) {
log.WithFields(logrus.Fields{
"accesskeyid": identity.AccessKeyID,
"arn": identity.ARN,
"accountid": identity.AccountID,
"userid": identity.UserID,
"session": identity.SessionName,
"stsendpointtype": identity.STSEndpointType,
"accesskeyid": identity.AccessKeyID,
"arn": identity.ARN,
"accountid": identity.AccountID,
"userid": identity.UserID,
"session": identity.SessionName,
"stsendpoint": identity.STSEndpoint,
}).Info("STS response")

// look up the ARN in each of our mappings to fill in the username and groups
Expand All @@ -373,10 +373,10 @@ func (h *handler) authenticateEndpoint(w http.ResponseWriter, req *http.Request)

// the token is valid and the role is mapped, return success!
log.WithFields(logrus.Fields{
"username": username,
"uid": uid,
"groups": groups,
"stsendpointtype": identity.STSEndpointType,
"username": username,
"uid": uid,
"groups": groups,
"stsendpoint": identity.STSEndpoint,
}).Info("access granted")
metrics.Get().Latency.WithLabelValues(metrics.Success).Observe(duration(start))
w.WriteHeader(http.StatusOK)
Expand Down
8 changes: 4 additions & 4 deletions pkg/token/token.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ type Identity struct {
// if the individual assumed an IAM role before making the request.
AccessKeyID string

// ASW STS endpoint type(global/regional) used to authenticate (expected values sts_global/sts_regional)
STSEndpointType string
// ASW STS endpoint (global/regional) used to authenticate (expected values sts_global/sts_regional)
STSEndpoint string
}

const (
Expand Down Expand Up @@ -608,8 +608,8 @@ func (v tokenVerifier) Verify(token string) (*Identity, error) {
}

id := &Identity{
AccessKeyID: accessKeyID,
STSEndpointType: stsEndpointType,
AccessKeyID: accessKeyID,
STSEndpoint: parsedURL.Host,
}
return getIdentityFromSTSResponse(id, callerIdentity)
}
Expand Down

0 comments on commit 95f5bb8

Please sign in to comment.