From a7b86aac3a929357a6ec563b0d1e218c9e8337a1 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 9 Sep 2024 17:19:11 -0700 Subject: [PATCH] fix(deps): update person directory to v1.8.16 (#2280) * fix(deps): update person directory to v1.8.16 * fix(deps): update person directory to v1.8.16 * Refactored code to match person-directory changes. * fix(deps): update person directory to v1.8.16 * Refactored code to match person-directory changes. --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Bill Smith --- gradle.properties | 2 +- .../portlets/lookup/PersonLookupHelperImpl.java | 15 ++++++++------- .../swapper/AttributeSwapperHelperImpl.java | 6 +++--- .../lookup/PersonLookupHelperImplTest.java | 2 +- .../portal/events/PortalEventFactoryImpl.java | 2 +- .../portal/events/tincan/LrsActorService.java | 2 +- .../portal/groups/PersonDirNameFinder.java | 2 +- .../searchers/PersonDirectorySearcher.java | 2 +- .../dao/EntityPersonAttributesGroupStore.java | 2 +- .../groups/smartldap/SmartLdapGroupStore.java | 2 +- .../ImpersonationStatusPersonAttributeDao.java | 7 ++++--- .../LocalAccountPersonAttributeDao.java | 7 ++++--- .../persondir/PortalRootPersonAttributeDao.java | 17 +++++++++-------- ...personationStatusPersonAttributeDaoTest.java | 5 +++-- .../PersonDirectoryUserInfoService.java | 5 +++-- .../services/RequestAttributeServiceImpl.java | 3 ++- ...inMappingTransformerConfigurationSource.java | 2 +- .../RequestAttributeServiceImplTest.java | 2 +- .../portal/security/oauth/IdTokenFactory.java | 2 +- .../apereo/portal/services/PersonService.java | 2 +- .../UserAttributesTargetProviderImpl.java | 2 +- .../apereo/portal/services/Authentication.java | 2 +- .../soffit/AuthorizationHeaderProvider.java | 2 +- 23 files changed, 51 insertions(+), 44 deletions(-) diff --git a/gradle.properties b/gradle.properties index d448fb8c507..de2e6078242 100644 --- a/gradle.properties +++ b/gradle.properties @@ -92,7 +92,7 @@ luceneVersion=8.11.2 nodejsVersion=20.15.1 oauthVersion=20100527 orgJsonVersion=20240303 -personDirectoryVersion=1.8.11 +personDirectoryVersion=1.8.16 plutoVersion=2.1.0-M3 resourceServerVersion=1.3.1 slf4jVersion=1.7.36 diff --git a/uPortal-api/uPortal-api-internal/src/main/java/org/apereo/portal/portlets/lookup/PersonLookupHelperImpl.java b/uPortal-api/uPortal-api-internal/src/main/java/org/apereo/portal/portlets/lookup/PersonLookupHelperImpl.java index 483edbf37a7..4696c10f660 100644 --- a/uPortal-api/uPortal-api-internal/src/main/java/org/apereo/portal/portlets/lookup/PersonLookupHelperImpl.java +++ b/uPortal-api/uPortal-api-internal/src/main/java/org/apereo/portal/portlets/lookup/PersonLookupHelperImpl.java @@ -128,7 +128,7 @@ public Set getQueryAttributes(ExternalContext externalContext) { // Otherwise provide all available attributes from the IPersonAttributeDao else { final Set availableAttributes = - this.personAttributeDao.getAvailableQueryAttributes(); + this.personAttributeDao.getAvailableQueryAttributes(null); queryAttributes = new TreeSet<>(availableAttributes); } @@ -164,7 +164,8 @@ public Set getDisplayAttributes(ExternalContext externalContext) { } // Otherwise provide all available attributes from the IPersonAttributes else { - displayAttributes = new TreeSet<>(personAttributeDao.getPossibleUserAttributeNames()); + displayAttributes = + new TreeSet<>(personAttributeDao.getPossibleUserAttributeNames(null)); } // Remove any excluded attributes @@ -186,7 +187,7 @@ public IPersonAttributes getSelf(ExternalContext externalContext) { final PortletRequest portletRequest = (PortletRequest) externalContext.getNativeRequest(); final String username = portletRequest.getRemoteUser(); - return this.personAttributeDao.getPerson(username); + return this.personAttributeDao.getPerson(username, null); } /* (non-Javadoc) @@ -226,7 +227,7 @@ public List searchForPeople( } // get the set of people matching the search query - final Set people = this.personAttributeDao.getPeople(inUseQuery); + final Set people = this.personAttributeDao.getPeople(inUseQuery, null); if (people == null) { return Collections.emptyList(); } @@ -389,7 +390,7 @@ public IPersonAttributes findPerson(final IPerson searcher, final String usernam final Set permittedAttributes = getPermittedAttributes(principal); // get the set of people matching the search query - final IPersonAttributes person = this.personAttributeDao.getPerson(username); + final IPersonAttributes person = this.personAttributeDao.getPerson(username, null); if (person == null) { logger.info("No user found with username matching " + username); @@ -421,7 +422,7 @@ protected IAuthorizationPrincipal getPrincipalForUser(final IPerson person) { * @return */ protected Set getPermittedAttributes(final IAuthorizationPrincipal principal) { - final Set attributeNames = personAttributeDao.getPossibleUserAttributeNames(); + final Set attributeNames = personAttributeDao.getPossibleUserAttributeNames(null); return getPermittedAttributes(principal, attributeNames); } @@ -464,7 +465,7 @@ protected Set getPermittedOwnAttributes( // The permttedOwnAttributes collection includes all the generallyPermittedAttributes final Set result = new HashSet<>(generallyPermittedAttributes); - for (String attr : personAttributeDao.getPossibleUserAttributeNames()) { + for (String attr : personAttributeDao.getPossibleUserAttributeNames(null)) { if (principal.hasPermission( IPermission.PORTAL_USERS, IPermission.VIEW_OWN_USER_ATTRIBUTE_ACTIVITY, attr)) { result.add(attr); diff --git a/uPortal-api/uPortal-api-internal/src/main/java/org/apereo/portal/portlets/swapper/AttributeSwapperHelperImpl.java b/uPortal-api/uPortal-api-internal/src/main/java/org/apereo/portal/portlets/swapper/AttributeSwapperHelperImpl.java index 2610ea85a09..cb88ba12348 100644 --- a/uPortal-api/uPortal-api-internal/src/main/java/org/apereo/portal/portlets/swapper/AttributeSwapperHelperImpl.java +++ b/uPortal-api/uPortal-api-internal/src/main/java/org/apereo/portal/portlets/swapper/AttributeSwapperHelperImpl.java @@ -100,7 +100,7 @@ public Set getSwappableAttributes(ExternalContext externalContext) { } else { // If no prefs try the 'possibleUserAttributeNames' from the IPersonAttributeDao final Set possibleAttributes = - this.portalRootPersonAttributeDao.getPossibleUserAttributeNames(); + this.portalRootPersonAttributeDao.getPossibleUserAttributeNames(null); if (possibleAttributes != null) { swappableAttributes = new TreeSet(possibleAttributes); } @@ -135,7 +135,7 @@ public Set getSwappableAttributes(ExternalContext externalContext) { public IPersonAttributes getOriginalUserAttributes(String uid) { final IPersonAttributeDao delegatePersonAttributeDao = this.portalRootPersonAttributeDao.getDelegatePersonAttributeDao(); - return delegatePersonAttributeDao.getPerson(uid); + return delegatePersonAttributeDao.getPerson(uid, null); } /* (non-Javadoc) @@ -146,7 +146,7 @@ public void populateSwapRequest( ExternalContext externalContext, AttributeSwapRequest attributeSwapRequest) { final Principal currentUser = externalContext.getCurrentUser(); final String uid = currentUser.getName(); - final IPersonAttributes person = this.portalRootPersonAttributeDao.getPerson(uid); + final IPersonAttributes person = this.portalRootPersonAttributeDao.getPerson(uid, null); final Map currentAttributes = attributeSwapRequest.getCurrentAttributes(); diff --git a/uPortal-api/uPortal-api-internal/src/test/java/org/apereo/portal/portlets/lookup/PersonLookupHelperImplTest.java b/uPortal-api/uPortal-api-internal/src/test/java/org/apereo/portal/portlets/lookup/PersonLookupHelperImplTest.java index 3d8c6cc87fd..f969be64c71 100644 --- a/uPortal-api/uPortal-api-internal/src/test/java/org/apereo/portal/portlets/lookup/PersonLookupHelperImplTest.java +++ b/uPortal-api/uPortal-api-internal/src/test/java/org/apereo/portal/portlets/lookup/PersonLookupHelperImplTest.java @@ -41,7 +41,7 @@ public void init() { // Must make the superclass use our collection of attribute names IPersonAttributeDao personAttributeDao = mock(IPersonAttributeDao.class); - when(personAttributeDao.getPossibleUserAttributeNames()).thenReturn(ALL_ATTRIBUTES); + when(personAttributeDao.getPossibleUserAttributeNames(null)).thenReturn(ALL_ATTRIBUTES); setPersonAttributeDao(personAttributeDao); principal = mock(IAuthorizationPrincipal.class); diff --git a/uPortal-events/src/main/java/org/apereo/portal/events/PortalEventFactoryImpl.java b/uPortal-events/src/main/java/org/apereo/portal/events/PortalEventFactoryImpl.java index aa25bee1557..41fa1e45e95 100644 --- a/uPortal-events/src/main/java/org/apereo/portal/events/PortalEventFactoryImpl.java +++ b/uPortal-events/src/main/java/org/apereo/portal/events/PortalEventFactoryImpl.java @@ -787,7 +787,7 @@ protected Set getGroupsForUser(IPerson person) { protected Map> getAttributesForUser(IPerson person) { final IPersonAttributes personAttributes = - this.personAttributeDao.getPerson(person.getUserName()); + this.personAttributeDao.getPerson(person.getUserName(), null); final Map> attributes = new LinkedHashMap>(); diff --git a/uPortal-events/src/main/java/org/apereo/portal/events/tincan/LrsActorService.java b/uPortal-events/src/main/java/org/apereo/portal/events/tincan/LrsActorService.java index 52a697de94b..df127d6c0fd 100644 --- a/uPortal-events/src/main/java/org/apereo/portal/events/tincan/LrsActorService.java +++ b/uPortal-events/src/main/java/org/apereo/portal/events/tincan/LrsActorService.java @@ -64,7 +64,7 @@ public LrsActor getLrsActor(String userName) { final String email; final String name; - final IPersonAttributes person = personAttributeDao.getPerson(userName); + final IPersonAttributes person = personAttributeDao.getPerson(userName, null); if (person == null) { email = userName; name = userName + "@example.com"; diff --git a/uPortal-groups/uPortal-groups-core/src/main/java/org/apereo/portal/groups/PersonDirNameFinder.java b/uPortal-groups/uPortal-groups-core/src/main/java/org/apereo/portal/groups/PersonDirNameFinder.java index 475b6428a0d..5dd1c98522f 100644 --- a/uPortal-groups/uPortal-groups-core/src/main/java/org/apereo/portal/groups/PersonDirNameFinder.java +++ b/uPortal-groups/uPortal-groups-core/src/main/java/org/apereo/portal/groups/PersonDirNameFinder.java @@ -69,7 +69,7 @@ public Class getType() { */ private String primGetName(String key) { String name = key; - final IPersonAttributes personAttributes = this.paDao.getPerson(name); + final IPersonAttributes personAttributes = this.paDao.getPerson(name, null); if (personAttributes != null) { Object displayName = personAttributes.getAttributeValue("displayName"); String displayNameStr = ""; diff --git a/uPortal-groups/uPortal-groups-local/src/main/java/org/apereo/portal/groups/local/searchers/PersonDirectorySearcher.java b/uPortal-groups/uPortal-groups-local/src/main/java/org/apereo/portal/groups/local/searchers/PersonDirectorySearcher.java index 56bdf0151a7..444ca567826 100644 --- a/uPortal-groups/uPortal-groups-local/src/main/java/org/apereo/portal/groups/local/searchers/PersonDirectorySearcher.java +++ b/uPortal-groups/uPortal-groups-local/src/main/java/org/apereo/portal/groups/local/searchers/PersonDirectorySearcher.java @@ -57,7 +57,7 @@ public EntityIdentifier[] searchForEntities(String query, SearchMethod method) final String usernameAttribute = this.usernameAttributeProvider.getUsernameAttribute(); final Map queryMap = Collections.singletonMap(usernameAttribute, query); - final Set results = this.personAttributeDao.getPeople(queryMap); + final Set results = this.personAttributeDao.getPeople(queryMap, null); // create an array of EntityIdentifiers from the search results final List entityIdentifiers = new ArrayList<>(results.size()); for (final IPersonAttributes personAttributes : results) { diff --git a/uPortal-groups/uPortal-groups-pags/src/main/java/org/apereo/portal/groups/pags/dao/EntityPersonAttributesGroupStore.java b/uPortal-groups/uPortal-groups-pags/src/main/java/org/apereo/portal/groups/pags/dao/EntityPersonAttributesGroupStore.java index b3b1c65a98a..105cd57e5d3 100644 --- a/uPortal-groups/uPortal-groups-pags/src/main/java/org/apereo/portal/groups/pags/dao/EntityPersonAttributesGroupStore.java +++ b/uPortal-groups/uPortal-groups-pags/src/main/java/org/apereo/portal/groups/pags/dao/EntityPersonAttributesGroupStore.java @@ -138,7 +138,7 @@ public boolean contains(IEntityGroup group, IGroupMember member) { try { final IPersonAttributeDao pa = PersonAttributeDaoLocator.getPersonAttributeDao(); - final IPersonAttributes personAttributes = pa.getPerson(member.getKey()); + final IPersonAttributes personAttributes = pa.getPerson(member.getKey(), null); if (personAttributes != null) { final RestrictedPerson rp = PersonFactory.createRestrictedPerson(); diff --git a/uPortal-groups/uPortal-groups-smartldap/src/main/java/org/apereo/portal/groups/smartldap/SmartLdapGroupStore.java b/uPortal-groups/uPortal-groups-smartldap/src/main/java/org/apereo/portal/groups/smartldap/SmartLdapGroupStore.java index e3fba451438..8155b7fbeae 100644 --- a/uPortal-groups/uPortal-groups-smartldap/src/main/java/org/apereo/portal/groups/smartldap/SmartLdapGroupStore.java +++ b/uPortal-groups/uPortal-groups-smartldap/src/main/java/org/apereo/portal/groups/smartldap/SmartLdapGroupStore.java @@ -279,7 +279,7 @@ public Iterator findParentGroups(IGroupMember gm) throws GroupsException { private Object[] getPersonGroupMemberKeys(IGroupMember gm) { Object[] keys = null; EntityIdentifier ei = gm.getUnderlyingEntityIdentifier(); - IPersonAttributes attr = personAttributeDao.getPerson(ei.getKey()); + IPersonAttributes attr = personAttributeDao.getPerson(ei.getKey(), null); if (attr != null && attr.getAttributes() != null && !attr.getAttributes().isEmpty()) { IPerson p = PersonFactory.createPerson(); p.setAttributes(attr.getAttributes()); diff --git a/uPortal-persondir/src/main/java/org/apereo/portal/persondir/ImpersonationStatusPersonAttributeDao.java b/uPortal-persondir/src/main/java/org/apereo/portal/persondir/ImpersonationStatusPersonAttributeDao.java index f5a23e03e58..bbf7a058222 100644 --- a/uPortal-persondir/src/main/java/org/apereo/portal/persondir/ImpersonationStatusPersonAttributeDao.java +++ b/uPortal-persondir/src/main/java/org/apereo/portal/persondir/ImpersonationStatusPersonAttributeDao.java @@ -23,6 +23,7 @@ import org.apereo.portal.security.IPersonManager; import org.apereo.portal.security.IdentitySwapperManager; import org.apereo.portal.url.IPortalRequestUtils; +import org.apereo.services.persondir.IPersonAttributeDaoFilter; import org.apereo.services.persondir.IPersonAttributes; import org.apereo.services.persondir.support.AbstractDefaultAttributePersonAttributeDao; import org.apereo.services.persondir.support.CaseInsensitiveNamedPersonImpl; @@ -49,7 +50,7 @@ public class ImpersonationStatusPersonAttributeDao * attributes in queries. */ @Override - public Set getAvailableQueryAttributes() { + public Set getAvailableQueryAttributes(IPersonAttributeDaoFilter filter) { final IUsernameAttributeProvider usernameAttributeProvider = super.getUsernameAttributeProvider(); return Collections.singleton(usernameAttributeProvider.getUsernameAttribute()); @@ -57,7 +58,7 @@ public Set getAvailableQueryAttributes() { @Override public Set getPeopleWithMultivaluedAttributes( - Map> query) { + Map> query, IPersonAttributeDaoFilter filter) { Set result = null; // default (per spec?) @@ -100,7 +101,7 @@ public Set getPeopleWithMultivaluedAttributes( * may be available. */ @Override - public Set getPossibleUserAttributeNames() { + public Set getPossibleUserAttributeNames(IPersonAttributeDaoFilter filter) { return null; } } diff --git a/uPortal-persondir/src/main/java/org/apereo/portal/persondir/LocalAccountPersonAttributeDao.java b/uPortal-persondir/src/main/java/org/apereo/portal/persondir/LocalAccountPersonAttributeDao.java index aa2ec4b8d4b..18d61838c64 100644 --- a/uPortal-persondir/src/main/java/org/apereo/portal/persondir/LocalAccountPersonAttributeDao.java +++ b/uPortal-persondir/src/main/java/org/apereo/portal/persondir/LocalAccountPersonAttributeDao.java @@ -25,6 +25,7 @@ import java.util.Set; import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.Validate; +import org.apereo.services.persondir.IPersonAttributeDaoFilter; import org.apereo.services.persondir.IPersonAttributes; import org.apereo.services.persondir.support.AbstractDefaultAttributePersonAttributeDao; import org.apereo.services.persondir.support.AttributeNamedPersonImpl; @@ -128,7 +129,7 @@ public void setUnmappedUsernameAttribute(String userNameAttribute) { * @return Set */ @Override - public Set getPossibleUserAttributeNames() { + public Set getPossibleUserAttributeNames(IPersonAttributeDaoFilter filter) { final Set names = new HashSet(); names.addAll(this.possibleUserAttributes); names.addAll(localAccountDao.getCurrentAttributeNames()); @@ -144,7 +145,7 @@ public Set getPossibleUserAttributeNames() { * @return Set */ @Override - public Set getAvailableQueryAttributes() { + public Set getAvailableQueryAttributes(IPersonAttributeDaoFilter filter) { if (this.queryAttributeMapping == null) { return Collections.emptySet(); } @@ -157,7 +158,7 @@ public Set getAvailableQueryAttributes() { */ @Override public final Set getPeopleWithMultivaluedAttributes( - Map> query) { + Map> query, IPersonAttributeDaoFilter filter) { Validate.notNull(query, "query may not be null."); // Generate the query to pass to the subclass diff --git a/uPortal-persondir/src/main/java/org/apereo/portal/persondir/PortalRootPersonAttributeDao.java b/uPortal-persondir/src/main/java/org/apereo/portal/persondir/PortalRootPersonAttributeDao.java index 1bed2b30520..88b2a7e9f4c 100644 --- a/uPortal-persondir/src/main/java/org/apereo/portal/persondir/PortalRootPersonAttributeDao.java +++ b/uPortal-persondir/src/main/java/org/apereo/portal/persondir/PortalRootPersonAttributeDao.java @@ -24,6 +24,7 @@ import org.apache.commons.lang.Validate; import org.apache.commons.lang3.StringUtils; import org.apereo.services.persondir.IPersonAttributeDao; +import org.apereo.services.persondir.IPersonAttributeDaoFilter; import org.apereo.services.persondir.IPersonAttributes; import org.apereo.services.persondir.support.AbstractFlatteningPersonAttributeDao; import org.apereo.services.persondir.support.IUsernameAttributeProvider; @@ -108,9 +109,9 @@ public void removeUserAttributeOverride(String uid) { * is unknown */ @Override - public IPersonAttributes getPerson(String uid) { + public IPersonAttributes getPerson(String uid, IPersonAttributeDaoFilter filter) { - final IPersonAttributes result = delegatePersonAttributeDao.getPerson(uid); + final IPersonAttributes result = delegatePersonAttributeDao.getPerson(uid, null); if (result == null) { // Nothing we can do with that return null; @@ -125,9 +126,9 @@ public IPersonAttributes getPerson(String uid) { */ @Override public Set getPeopleWithMultivaluedAttributes( - Map> query) { + Map> query, IPersonAttributeDaoFilter filter) { final Set people = - delegatePersonAttributeDao.getPeopleWithMultivaluedAttributes(query); + delegatePersonAttributeDao.getPeopleWithMultivaluedAttributes(query, filter); if (people == null) { return null; } @@ -147,13 +148,13 @@ public Set getPeopleWithMultivaluedAttributes( } @Override - public Set getPossibleUserAttributeNames() { - return delegatePersonAttributeDao.getPossibleUserAttributeNames(); + public Set getPossibleUserAttributeNames(IPersonAttributeDaoFilter filter) { + return delegatePersonAttributeDao.getPossibleUserAttributeNames(filter); } @Override - public Set getAvailableQueryAttributes() { - return delegatePersonAttributeDao.getAvailableQueryAttributes(); + public Set getAvailableQueryAttributes(IPersonAttributeDaoFilter filter) { + return delegatePersonAttributeDao.getAvailableQueryAttributes(filter); } /** diff --git a/uPortal-persondir/src/test/java/org/apereo/portal/persondir/ImpersonationStatusPersonAttributeDaoTest.java b/uPortal-persondir/src/test/java/org/apereo/portal/persondir/ImpersonationStatusPersonAttributeDaoTest.java index 12134b6fe28..cf57ef55595 100644 --- a/uPortal-persondir/src/test/java/org/apereo/portal/persondir/ImpersonationStatusPersonAttributeDaoTest.java +++ b/uPortal-persondir/src/test/java/org/apereo/portal/persondir/ImpersonationStatusPersonAttributeDaoTest.java @@ -75,7 +75,7 @@ public void setup() throws Exception { @Test public void testGetAvailableQueryAttributes() { Set attributes = - impersonationStatusPersonAttributeDao.getAvailableQueryAttributes(); + impersonationStatusPersonAttributeDao.getAvailableQueryAttributes(null); assertNotNull(attributes); String attribute = attributes.iterator().next(); assertEquals(attribute, "attrs"); @@ -84,7 +84,8 @@ public void testGetAvailableQueryAttributes() { @Test public void testGetPeopleWithMultivaluedAttributes() { Set attributes = - impersonationStatusPersonAttributeDao.getPeopleWithMultivaluedAttributes(query); + impersonationStatusPersonAttributeDao.getPeopleWithMultivaluedAttributes( + query, null); assertNotNull(attributes); IPersonAttributes personAttributes = attributes.iterator().next(); String uname = personAttributes.getName(); diff --git a/uPortal-rendering/src/main/java/org/apereo/portal/portlet/container/services/PersonDirectoryUserInfoService.java b/uPortal-rendering/src/main/java/org/apereo/portal/portlet/container/services/PersonDirectoryUserInfoService.java index a07a5bf9968..678a0dcd862 100644 --- a/uPortal-rendering/src/main/java/org/apereo/portal/portlet/container/services/PersonDirectoryUserInfoService.java +++ b/uPortal-rendering/src/main/java/org/apereo/portal/portlet/container/services/PersonDirectoryUserInfoService.java @@ -123,7 +123,8 @@ protected Map getUserInfo( String remoteUser, HttpServletRequest httpServletRequest, IPortletWindow portletWindow) throws PortletContainerException { // Get the list of user attributes the portal knows about the user - final IPersonAttributes personAttributes = this.personAttributeDao.getPerson(remoteUser); + final IPersonAttributes personAttributes = + this.personAttributeDao.getPerson(remoteUser, null); if (personAttributes == null) { return Collections.emptyMap(); } @@ -139,7 +140,7 @@ protected Map getUserInfo( * Using the Map of portal user attributes and a List of expected attributes generate the * USER_INFO map for the portlet * - * @param portalUserAttributes All the attributes the portal knows about the user + * @param personAttributes All the attributes the portal knows about the user * @param expectedUserAttributes The attributes the portlet expects to get * @return The Map to use for the USER_INFO attribute */ diff --git a/uPortal-rendering/src/main/java/org/apereo/portal/portlet/container/services/RequestAttributeServiceImpl.java b/uPortal-rendering/src/main/java/org/apereo/portal/portlet/container/services/RequestAttributeServiceImpl.java index b1df963e371..8d05dab4a50 100644 --- a/uPortal-rendering/src/main/java/org/apereo/portal/portlet/container/services/RequestAttributeServiceImpl.java +++ b/uPortal-rendering/src/main/java/org/apereo/portal/portlet/container/services/RequestAttributeServiceImpl.java @@ -97,7 +97,8 @@ public Object getAttribute( */ protected Map> getMultiValuedUserInfoMap( String remoteUser, List expectedUserAttributes) { - final IPersonAttributes personAttributes = this.personAttributeDao.getPerson(remoteUser); + final IPersonAttributes personAttributes = + this.personAttributeDao.getPerson(remoteUser, null); if (personAttributes == null) { return Collections.emptyMap(); } diff --git a/uPortal-rendering/src/main/java/org/apereo/portal/rendering/xslt/UserAttributeSkinMappingTransformerConfigurationSource.java b/uPortal-rendering/src/main/java/org/apereo/portal/rendering/xslt/UserAttributeSkinMappingTransformerConfigurationSource.java index 20f683d7ec1..786cce90ec7 100644 --- a/uPortal-rendering/src/main/java/org/apereo/portal/rendering/xslt/UserAttributeSkinMappingTransformerConfigurationSource.java +++ b/uPortal-rendering/src/main/java/org/apereo/portal/rendering/xslt/UserAttributeSkinMappingTransformerConfigurationSource.java @@ -70,7 +70,7 @@ protected String getSkinName(HttpServletRequest request) { final IUserInstance userInstance = this.userInstanceManager.getUserInstance(request); final IPerson person = userInstance.getPerson(); final IPersonAttributes personAttrs = - this.personAttributeDao.getPerson(person.getUserName()); + this.personAttributeDao.getPerson(person.getUserName(), null); if (personAttrs == null) { logger.debug( "No user attributes found for {} no skin override will be done", diff --git a/uPortal-rendering/src/test/java/org/apereo/portal/portlet/container/services/RequestAttributeServiceImplTest.java b/uPortal-rendering/src/test/java/org/apereo/portal/portlet/container/services/RequestAttributeServiceImplTest.java index ef625ad6aa3..6da3a461456 100644 --- a/uPortal-rendering/src/test/java/org/apereo/portal/portlet/container/services/RequestAttributeServiceImplTest.java +++ b/uPortal-rendering/src/test/java/org/apereo/portal/portlet/container/services/RequestAttributeServiceImplTest.java @@ -75,7 +75,7 @@ public void testControl() { when(portletDefinition.getPortletDefinitionId()).thenReturn(portletDefinitionId); IPersonAttributeDao personAttributeDao = mock(IPersonAttributeDao.class); - when(personAttributeDao.getPerson("username")).thenReturn(personAttributes); + when(personAttributeDao.getPerson("username", null)).thenReturn(personAttributes); IPortletWindowRegistry portletWindowRegistry = mock(IPortletWindowRegistry.class); when(portletWindowRegistry.convertPortletWindow(httpServletRequest, plutoPortletWindow)) diff --git a/uPortal-security/uPortal-security-core/src/main/java/org/apereo/portal/security/oauth/IdTokenFactory.java b/uPortal-security/uPortal-security-core/src/main/java/org/apereo/portal/security/oauth/IdTokenFactory.java index 6ffd72d8268..4ee6065c7d6 100644 --- a/uPortal-security/uPortal-security-core/src/main/java/org/apereo/portal/security/oauth/IdTokenFactory.java +++ b/uPortal-security/uPortal-security-core/src/main/java/org/apereo/portal/security/oauth/IdTokenFactory.java @@ -286,7 +286,7 @@ public String createUserInfo( .setExpiration(expires) .setIssuedAt(now); - final IPersonAttributes person = personAttributeDao.getPerson(username); + final IPersonAttributes person = personAttributeDao.getPerson(username, null); // Attribute mappings mappings.stream() diff --git a/uPortal-security/uPortal-security-core/src/main/java/org/apereo/portal/services/PersonService.java b/uPortal-security/uPortal-security-core/src/main/java/org/apereo/portal/services/PersonService.java index a40236a86d2..cf663ee5dd9 100644 --- a/uPortal-security/uPortal-security-core/src/main/java/org/apereo/portal/services/PersonService.java +++ b/uPortal-security/uPortal-security-core/src/main/java/org/apereo/portal/services/PersonService.java @@ -41,7 +41,7 @@ public IPerson getPerson(String username) { final IPerson result = new PersonImpl(); result.setAttribute(IPerson.USERNAME, username); result.setID(userIdentityStore.getPortalUserId(username)); - result.setAttributes(personAttributeDao.getPerson(username).getAttributes()); + result.setAttributes(personAttributeDao.getPerson(username, null).getAttributes()); return result; } } diff --git a/uPortal-security/uPortal-security-permissions/src/main/java/org/apereo/portal/permission/target/UserAttributesTargetProviderImpl.java b/uPortal-security/uPortal-security-permissions/src/main/java/org/apereo/portal/permission/target/UserAttributesTargetProviderImpl.java index 18546dba14b..18b32575c27 100644 --- a/uPortal-security/uPortal-security-permissions/src/main/java/org/apereo/portal/permission/target/UserAttributesTargetProviderImpl.java +++ b/uPortal-security/uPortal-security-permissions/src/main/java/org/apereo/portal/permission/target/UserAttributesTargetProviderImpl.java @@ -37,7 +37,7 @@ public IPermissionTarget getTarget(String key) { @Override public Collection searchTargets(String term) { term = term.toLowerCase(); - final Set attributes = personAttributeDao.getAvailableQueryAttributes(); + final Set attributes = personAttributeDao.getAvailableQueryAttributes(null); final List matches = new ArrayList(); for (String attribute : attributes) { if (attribute.toLowerCase().contains(term)) { diff --git a/uPortal-security/uPortal-security-services/src/main/java/org/apereo/portal/services/Authentication.java b/uPortal-security/uPortal-security-services/src/main/java/org/apereo/portal/services/Authentication.java index 7dc85f15ec2..bf3c4758e7d 100644 --- a/uPortal-security/uPortal-security-services/src/main/java/org/apereo/portal/services/Authentication.java +++ b/uPortal-security/uPortal-security-services/src/main/java/org/apereo/portal/services/Authentication.java @@ -224,7 +224,7 @@ else if (addInfo instanceof Map) { } final IPersonAttributes personAttributes = - this.personAttributeDao.getPerson(username); + this.personAttributeDao.getPerson(username, null); if (log.isDebugEnabled()) { log.debug( diff --git a/uPortal-soffit/uPortal-soffit-connector/src/main/java/org/apereo/portal/soffit/AuthorizationHeaderProvider.java b/uPortal-soffit/uPortal-soffit-connector/src/main/java/org/apereo/portal/soffit/AuthorizationHeaderProvider.java index 9f6d5f4f723..8d5ceaaf188 100644 --- a/uPortal-soffit/uPortal-soffit-connector/src/main/java/org/apereo/portal/soffit/AuthorizationHeaderProvider.java +++ b/uPortal-soffit/uPortal-soffit-connector/src/main/java/org/apereo/portal/soffit/AuthorizationHeaderProvider.java @@ -66,7 +66,7 @@ public Header createHeader(RenderRequest renderRequest, RenderResponse renderRes // Attributes final Map> attributes = new HashMap<>(); - final IPersonAttributes person = personAttributeDao.getPerson(username); + final IPersonAttributes person = personAttributeDao.getPerson(username, null); if (person != null) { for (Entry> y : person.getAttributes().entrySet()) { final List values = new ArrayList<>();