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

Treat user authorities as roles #13

Merged
merged 2 commits into from
May 23, 2016

Conversation

bkmeneguello
Copy link
Contributor

This is useful in combination with other plugins, like LDAP Authentication to treat groups as roles.
Also I've added two tests. One covering the basic working flow and another to check if authorities are being treated as roles.

return true;
}
}
} catch (Exception e) {}
Copy link
Member

Choose a reason for hiding this comment

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

There should be logging at least

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure. I just preserved the original behaviour of doing nothing when the role verification fails. But I admit that using Exception is too wide. I'll narrow it. You sure logging could be a good idea?

@oleg-nenashev
Copy link
Member

@bkmeneguello
Hi Bruno,

I'm aware about the performance impact of the change. The change is going to embedded user loading from security realms and sequential role checks for every SID missing in the group. Since it's a common case for the fine-grain security, the overall calculation time may seriously degrade.

Have you evaluated it?

@@ -77,6 +77,24 @@
<version>1.14</version>
<type>jar</type>
</dependency>
<dependency>
Copy link
Member

Choose a reason for hiding this comment

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

wrong intend

Copy link
Member

Choose a reason for hiding this comment

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

It would be better to solve architectural issues before rat-holing into this topic...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed. Thanks!

@bkmeneguello bkmeneguello force-pushed the authority-as-role branch 2 times, most recently from 49aeab5 to f95cc99 Compare November 3, 2015 16:20
@bkmeneguello
Copy link
Contributor Author

@oleg-nenashev So do you had reviewed my last comments?
I'm using this changed plugin a while in my company and didn't noticed any performance issues. Whe have near 40 users and 60 JOBs with project and general roles.
Do you have any attention point that I should consider in particular?
Thanks.

@bkmeneguello
Copy link
Contributor Author

Ok, today I got what you mean. My server become unusable because of a new LDAP ACL that caused slowness.
I'll implement that cache.

@oleg-nenashev
Copy link
Member

@bkmeneguello
Sorry for the missing response. I'm quite busy with personal TODOs, so my responses may be seriously delayed. Don't hesitate to ping me

@bkmeneguello
Copy link
Contributor Author

@oleg-nenashev I've implemented the cache, a simple solution. In your opinion the cache parameters (max-size, ttl and concurrency) should be parameterized in a view? These entire feature should be an opt-in?
Thanks

@bkmeneguello
Copy link
Contributor Author

bump?

@oleg-nenashev
Copy link
Member

@bkmeneguello Thanks for the reminder. I was extremely busy with some personal things, but hopefully I'll be able to process incoming PRs on this NY break


private final Cache<String, UserDetails> cache = CacheBuilder.newBuilder()
.softValues()
.maximumSize(100)
Copy link
Member

Choose a reason for hiding this comment

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

Needs to be a global configuration/system property. 100 is a good default value, but I can imagine installation requiring more users

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok. But this value of 100 is the cache size. Just the 100 LRU entries will be cached.

@bkmeneguello
Copy link
Contributor Author

@oleg-nenashev do you agree with my last replies?

@oleg-nenashev
Copy link
Member

@bkmeneguello
Sorry, missed the responses. I hope to review it on this weekend

@bkmeneguello
Copy link
Contributor Author

Thanks!

@bkmeneguello
Copy link
Contributor Author

@oleg-nenashev pls, did you had time to review this PR?

@oleg-nenashev oleg-nenashev self-assigned this Apr 24, 2016
@oleg-nenashev
Copy link
Member

@bkmeneguello
Sorry for the delay. I've manually tested it today, looks good to me. I hope to find some time to finally make a release on the next week

@bkmeneguello
Copy link
Contributor Author

Thanks!

@oleg-nenashev
Copy link
Member

Looking for the issue to reference it during the merge. It exists AFAIK.
🐌

@oleg-nenashev oleg-nenashev merged commit d957f8f into jenkinsci:master May 23, 2016
@oleg-nenashev
Copy link
Member

Caused performance regressions, hence the feature will be partially disabled in #18

@bkmeneguello
Copy link
Contributor Author

absolutely ok

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants