Skip to content

Commit

Permalink
Merge branch 'master' into getCustomSchemaFix
Browse files Browse the repository at this point in the history
  • Loading branch information
hborisov authored Mar 1, 2024
2 parents e70594c + d2d2f61 commit e04bec9
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 9 deletions.
4 changes: 4 additions & 0 deletions scimono-server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -84,18 +84,22 @@
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-junit-jupiter</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-params</artifactId>
<scope>test</scope>
</dependency>

<dependency>
Expand Down
3 changes: 2 additions & 1 deletion scimono-server/src/main/java/com/sap/scimono/api/Groups.java
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,11 @@ public Groups(@Context Application appContext, @Context UriInfo uriInfo) {
// @formatter:off
public Response getGroup(@PathParam("id") final String groupId,
@QueryParam(ATTRIBUTES_PARAM) final String attributes,
@QueryParam(FILTER_PARAM) final String filter,
@QueryParam(EXCLUDED_ATTRIBUTES_PARAM) final String excludedAttributes) {
// @formatter:on
logger.trace("Reading group {}", groupId);
Group groupFromDb = groupAPI.getGroup(groupId, RequestedResourceAttributesParser.parse(attributes, excludedAttributes));
Group groupFromDb = groupAPI.getGroup(groupId, RequestedResourceAttributesParser.parse(attributes, excludedAttributes), filter);

if (groupFromDb == null) {
throw new ResourceNotFoundException(RESOURCE_TYPE_GROUP, groupId);
Expand Down
3 changes: 2 additions & 1 deletion scimono-server/src/main/java/com/sap/scimono/api/Users.java
Original file line number Diff line number Diff line change
Expand Up @@ -118,11 +118,12 @@ public Response getMe(@Context final SecurityContext sec) {
@Path("{id}")
// @formatter:off
public Response getUser(@PathParam("id") final String userId,
@QueryParam(FILTER_PARAM) final String filter,
@QueryParam(ATTRIBUTES_PARAM) final String attributes,
@QueryParam(EXCLUDED_ATTRIBUTES_PARAM) final String excludedAttributes) {
// @formatter:on
logger.trace("Reading user {}", userId);
User userFromDb = usersAPI.getUser(userId, RequestedResourceAttributesParser.parse(attributes, excludedAttributes));
User userFromDb = usersAPI.getUser(userId, RequestedResourceAttributesParser.parse(attributes, excludedAttributes), filter);

if (userFromDb == null) {
throw new ResourceNotFoundException(RESOURCE_TYPE_USER, userId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,30 @@

public interface GroupsCallback {
/**
* @param groupId, unique group id
* @param groupId unique group id of the requested group
* @return the group with the specified groupId or null if no such group exists
*/
Group getGroup(final String groupId);

/**
* @param groupId unique group id of the requested group
* @param additionalAttributes additional attributes to be returned or excluded from the response
* @return the group with the specified groupId or null if no such group exists
*/
default Group getGroup(String groupId, RequestedResourceAttributes additionalAttributes) {
return getGroup(groupId);
}

/**
* @param groupId unique group id of the requested group
* @param additionalAttributes additional attributes to be returned or excluded from the response
* @param filter value of the filter query parameter
* @return the group with the specified groupId or null if no such group exists
*/
default Group getGroup(String groupId, RequestedResourceAttributes additionalAttributes, String filter) {
return getGroup(groupId, additionalAttributes);
}

/**
* Returns a page of groups (limited by {@link SCIMConfigurationCallback#getMaxResourcesPerPage()}),
* taking into account the specified filter and paging parameters.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import javax.ws.rs.WebApplicationException;
import javax.ws.rs.core.Response;

import com.sap.scimono.entity.schema.Attribute;
import com.sap.scimono.entity.schema.Schema;

import java.util.List;
Expand Down Expand Up @@ -37,9 +36,4 @@ public boolean isValidSchemaName(String schemaName) {
throw new WebApplicationException(Response.Status.NOT_IMPLEMENTED);
}

@Override
public Attribute getAttribute(String path) {
throw new WebApplicationException(Response.Status.NOT_IMPLEMENTED);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,15 @@ default User getUser(String userId, RequestedResourceAttributes additionalAttrib
return getUser(userId);
}

/**
* @param additionalAttributes additional attributes to be returned of excluded from the response
* @param filter value of the filter query parameter
* @return the user with the specified userId or null if no such user exists
*/
default User getUser(String userId, RequestedResourceAttributes additionalAttributes, final String filter) {
return getUser(userId, additionalAttributes);
}

/**
* Returns a page of users (limited by {@link SCIMConfigurationCallback#getMaxResourcesPerPage()}),
* taking into account the specified filter and paging parameters.
Expand Down

0 comments on commit e04bec9

Please sign in to comment.