Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CLOUDTRUST-1157 Add userID of agent in events #12

Closed
wants to merge 1 commit into from

Conversation

harture
Copy link
Contributor

@harture harture commented May 23, 2019

No description provided.

@harture harture requested a review from bsoniam May 23, 2019 09:19
@coveralls
Copy link

Coverage Status

Coverage increased (+0.1%) to 92.582% when pulling 6277c6c on CT-1157_userID_agent into 8f16e3b on master.

Copy link
Contributor

@fperot74 fperot74 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could do differently in order not to fail when a key is missing (that's the case in paper-card service when contacted from keycloak) :

func (er *ReportEventDetails) AddAgentDetails(ctx context.Context) {
	var mapper = map[cs.CtContext]string{
		cs.CtContextUsername: "agent_username",
		cs.CtContextUserID:   "userId",
		cs.CtContextRealm:    "agent_realm_name",
	}
	for keyFrom, keyTo := range mapper {
		var value = ctx.Value(keyFrom)
		if value != nil {
			er.details[keyTo] = value.(string)
		}
	}
}

@harture
Copy link
Contributor Author

harture commented Jun 4, 2019

This PR is not needed anymore once PR #15 is merged

@harture harture closed this Jun 4, 2019
@harture harture deleted the CT-1157_userID_agent branch October 28, 2019 16:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants