-
Notifications
You must be signed in to change notification settings - Fork 95
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
OicUserProperty
was discarded after saving the user config page
#332
Conversation
@@ -1,7 +1,5 @@ | |||
OicLogoutAction.OicLogout = Oic Logout | |||
|
|||
OicUserProperty.OpenIdConnectUserProperty = OpenID Connect user property |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
never displayed
assertEquals( | ||
"User should still be in 2 groups", 2, user.getAuthorities().size()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Before fix, failed with
java.lang.AssertionError: User should still be in 2 groups expected:<2> but was:<0>
at org.junit.Assert.fail(Assert.java:89)
at org.junit.Assert.failNotEquals(Assert.java:835)
at org.junit.Assert.assertEquals(Assert.java:647)
at org.jenkinsci.plugins.oic.PluginTest.testOicUserPropertyDescriptor(PluginTest.java:1270)
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #332 +/- ##
============================================
- Coverage 73.35% 73.15% -0.21%
+ Complexity 211 209 -2
============================================
Files 10 10
Lines 882 879 -3
Branches 124 124
============================================
- Hits 647 643 -4
- Misses 172 173 +1
Partials 63 63 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
If you log in with OIDC with a groups field defined, then go to your user config page and create an API token, then use that API token to run the CLI command
who-am-i
, your groups are listed as expected. But if you then Save the same page and try the CLI command again, you are shown as having no groups. This is because saving the page wiped out theOicUserProperty
. AFAICT this has been broken since #12. The corrected idiom can be seen inLastGrantedAuthoritiesProperty
in core, a very similar property. Actually we could probably use that instead ofOicUserProperty
by merely callingSecurityListener.fireLoggedIn
; I did not try that yet.