-
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
Compatibility with Jenkins clustered setup #288
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #288 +/- ##
============================================
+ Coverage 71.90% 72.54% +0.63%
+ Complexity 194 187 -7
============================================
Files 9 9
Lines 744 743 -1
Branches 124 116 -8
============================================
+ Hits 535 539 +4
+ Misses 150 146 -4
+ Partials 59 58 -1 ☔ View full report in Codecov by Sentry. |
That's more Jenkinsfu than I can comfortably process. Where can I get more information about stapler and HA requierements ? |
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
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.
Similar to jenkinsci/jenkins#8557 and (more distantly) jenkinsci/stapler#493.
@@ -119,7 +120,8 @@ | |||
* @author Steve Arch | |||
*/ | |||
@SuppressWarnings("deprecation") | |||
public class OicSecurityRealm extends SecurityRealm { | |||
public class OicSecurityRealm extends SecurityRealm implements Serializable { |
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.
Perhaps cleaner to make nested classes static
?
I think the simplest summary is that in general https://jakarta.ee/specifications/platform/9/apidocs/jakarta/servlet/http/httpsession#setAttribute-java.lang.String-java.lang.Object- should be called with |
OicSession
is stored in HTTP session so must be serializable. As it is,OicSecurityRealm
must also beSerializable
since it defines a non-static inner class extendingOicSession
.AuthorizationCodeFlow
is not serializable, so instead of storing it directly inOicSession
, it is now provided on every call fromOicSecurityRealm
(commenceLogin
,finishLogin
onSuccess
).Removed
do
prefix fromOicSession#doCommenceLogin
,OicSession#doFinishLogin
to clarify that these methods are not being called by Stapler, but through direct java calls.These changes allow to use this plugin as security realm when running a clustered Jenkins instance (where sessions are serialized) such as when using CloudBees CI with High Availability.
Testing done
Submitter checklist