RedHatInsights / mocks

Mock services for testing cloud.redhat.com applications
4 stars 10 forks source link

Add 'is_internal', 'is_org_admin', 'is_active' to Keycloak users #14

Closed john-dupuy closed 3 years ago

john-dupuy commented 3 years ago

In playing with mocks in an ephemeral frontend, I noticed that when I do insights.chrome.auth.getUser(), these three fields were undefined. This creates a weird state where the frontend isn't sure if a user is an org admin.

Upon examining the JWT token with https://jwt.io/#debugger-io and comparing it to that of one from qa-beta, I noticed that these fields were not present in the token.

I built mocks locally and pushed it up to quay.io/jdupuy/mocks and used that in my ephemeral namespace to check this PR. Ping me if you'd like to see it.

This PR is adding those fields to the client mapper and keycloak user definition, so that they will be returned in the JWT token.

Also adding and applying pre-commit.

skarekrow commented 3 years ago

<3 precommit, looks innocent enough to me. I'll let @bsquizz stamp it.

bsquizz commented 3 years ago

Yeah the Jenkins job is expecting to see some junit tests results. It won't find any yet ;)