Skip to content

Easily discover groups in authorization plugins #1527

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

Merged
merged 2 commits into from
Apr 28, 2017

Conversation

tulinkry
Copy link
Contributor

@tulinkry tulinkry commented Apr 10, 2017

This expects the #1525 to be merged as it already implements the new interface.

This change moves the responsibility of a group discovery

  • which repositories are under this group (even indirectly)
  • which projects are under this group (even indirectly)
  • descendant groups
  • parent groups

to the opengrok code and the plugin can just call the new methods if it wants to add all subgroups/repositories/.. to the allowed set.

@tulinkry tulinkry self-assigned this Apr 10, 2017
@tulinkry tulinkry changed the title Auth plugins discovery Easily discover groups in authorization plugins Apr 10, 2017
@tulinkry tulinkry force-pushed the auth-plugins-discovery branch from b089edb to fd73308 Compare April 10, 2017 14:17
*/
public Set<Project> getAllProjects() {
Set<Project> projectsTmp = new TreeSet<>();
for (Project p : getRepositories()) {
Copy link
Member

Choose a reason for hiding this comment

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

the getRepositories() name is confusing to me as it clashes with the Repository object.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agree however I couldn't think of a better name for the projet-repository type (listed on the main page under the search form). Do you have better idea?

Copy link
Member

Choose a reason for hiding this comment

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

If I understand it correctly, the repositories contains projects with at least one Repository (according to populateGroups() so maybe it shall be named projectsWithRepo or such ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

filed #1553

}

private void discoverGroup(String group, HttpServletRequest request, Set<String> descendants) {
private void discoverGroup(String group, HttpServletRequest request) {
Copy link
Member

Choose a reason for hiding this comment

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

javadoc would be nice

Copy link
Contributor Author

Choose a reason for hiding this comment

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

added

@tulinkry tulinkry force-pushed the auth-plugins-discovery branch from fd73308 to 8adb7a6 Compare April 28, 2017 12:55
@tulinkry tulinkry merged commit 3dfa965 into oracle:master Apr 28, 2017
@tulinkry tulinkry deleted the auth-plugins-discovery branch April 28, 2017 13:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants