Get list of groups for user in Crucible / Fisheye 2.7

Anonymouslemming October 9, 2011

Hi all,

I'm trying to implement a custom authenticator for Fisheye 2.7 as described at http://confluence.atlassian.com/display/FISHEYE/Custom+Authentication .

Our previous solution used com.cenqua.fisheye.AppConfig to get the list of groups for a user as follows:

List<String> groups = AppConfig.getsConfig().getUserManager().getGroupsForUser(user);

This appears to be deprecated now. What is the correct way to get a list of groups for a specified user in newer versions of fisheye / crucible ?

I've checked the java docs at http://docs.atlassian.com/fisheye-crucible/latest/javadoc/com/cenqua/fisheye/ and below that I can only find user/plugin/ - there is no sign of the AppConfig class that we saw in previous versions of this software.

1 answer

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

1 vote
TimP
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 10, 2011

Hi Anonymouslemming,

The method that is deprecated is RootConfig.getUserManager(), as we prefer internal components to have dependencies wired vire Spring rather than using static lookups. However, we don't currently support autowiring custom FishEyeAuthenticator classes.

I'd recommend using the SpringContext to get a reference to the UserManager, e.g:

UserManager userManager = SpringContext.getComponentByClass(UserManager.class);
List<String> groups = userManager.getGroupsForUser(user);

It would probably be worthwhile caching the UserManager reference on your authenticator for better performance.

cheers,

Tim

Anonymouslemming October 10, 2011

Thanks for responding :)

I can't find any API documentation for the AppConfig class at all - does this exist somewhere for 2.7 ? Or should I be ignoring all of this and not just the RootConfig.getUserManager ?

I'll give this a try with wiring the SpringContext bits into my plugin and see how that goes and update this answer :)

Thanks,

Wayne

TimP
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 10, 2011

Hi again Wayne,

These days FishEye has a formal API for external developers to code against, which doesn't include AppConfig or RootConfig or (unfortunately) any mechanism for resolving what groups a user belongs to.

I've raised https://jira.atlassian.com/browse/FE-3773 to address this, but in the meantime I think using SpringContext directly is the least brittle solution, as RootConfig.getUserManager() is deprecated and a likely candidate for removal.

Best of luck! Let me know how you go.

cheers,

Tim

TimP
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 10, 2011

Out of curiosity, can I ask why you need a list of groups / what authentication system you're integrating with?

Anonymouslemming October 10, 2011

Thanks for raising the Jira - I'll watch that :)

We're authenticating against CA siteminder.

We use the groups to decide whether or not a user has permissions to access a repo.

On a periodical basis, we look at the users in Fisheye and update the accounts so that they are added to all of the groups in Fisheye that they belong to in LDAP. Our users have a self-service solution for LDAP with delegated control, so by their assigned manager adding them to an LDAP group, they get access to the relevant parts of Crucible. To reconcile these groups, we need to get a list of the groups for a user, rather than trying to readd all of the groups each time.

TAGS
AUG Leaders

Atlassian Community Events