Skip to content

Commit

Permalink
Merge branch 'dev' into #343_suggest_change_and_log
Browse files Browse the repository at this point in the history
# Conflicts:
#	pom.xml
#	registry-ws/pom.xml
  • Loading branch information
marcos-lg committed May 17, 2021
2 parents 236ed3a + fea95bb commit 3399241
Show file tree
Hide file tree
Showing 24 changed files with 55 additions and 37 deletions.
12 changes: 9 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@

<groupId>org.gbif.registry</groupId>
<artifactId>registry-parent</artifactId>
<version>3.59-SNAPSHOT</version>
<version>3.60-SNAPSHOT</version>
<name>GBIF Registry Parent</name>
<description>GBIF Registry project</description>

<scm>
<connection>scm:git:git@github.com:gbif/registry.git</connection>
<url>https://github.com/gbif/registry</url>
<developerConnection>scm:git:git@github.com:gbif/registry.git</developerConnection>
<tag>HEAD</tag>
<tag>registry-parent-3.59</tag>
</scm>

<repositories>
Expand Down Expand Up @@ -82,6 +82,7 @@
<spring-cloud-openfeign.version>2.2.6.RELEASE</spring-cloud-openfeign.version>
<spring-cloud-zookeeper.version>2.2.4.RELEASE</spring-cloud-zookeeper.version>
<mybatis-spring-boot-starter.version>2.0.1</mybatis-spring-boot-starter.version>
<springdoc-openapi-ui.version>1.5.8</springdoc-openapi-ui.version>
<spring-cloud-sleuth.version>2.2.8.RELEASE</spring-cloud-sleuth.version>

<!-- GBIF -->
Expand All @@ -91,7 +92,7 @@
<gbif-common-ws.version>1.15</gbif-common-ws.version>
<gbif-directory.version>1.10</gbif-directory.version>
<gbif-doi.version>2.14</gbif-doi.version>
<gbif-download-query-tools.version>1.41</gbif-download-query-tools.version>
<gbif-download-query-tools.version>1.42</gbif-download-query-tools.version>
<gbif-httputils.version>0.10</gbif-httputils.version>
<gbif-metrics.version>1.0</gbif-metrics.version>
<gbif-parsers.version>0.36</gbif-parsers.version>
Expand Down Expand Up @@ -222,6 +223,11 @@
<artifactId>spring-cloud-starter-sleuth</artifactId>
<version>${spring-cloud-sleuth.version}</version>
</dependency>
<dependency>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-ui</artifactId>
<version>${springdoc-openapi-ui.version}</version>
</dependency>

<!-- GBIF dependencies -->
<dependency>
Expand Down
2 changes: 1 addition & 1 deletion registry-cli/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>org.gbif.registry</groupId>
<artifactId>registry-parent</artifactId>
<version>3.59-SNAPSHOT</version>
<version>3.60-SNAPSHOT</version>
</parent>

<artifactId>registry-cli</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion registry-directory/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<artifactId>registry-parent</artifactId>
<groupId>org.gbif.registry</groupId>
<version>3.59-SNAPSHOT</version>
<version>3.60-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion registry-doi/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<artifactId>registry-parent</artifactId>
<groupId>org.gbif.registry</groupId>
<version>3.59-SNAPSHOT</version>
<version>3.60-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion registry-domain/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<artifactId>registry-parent</artifactId>
<groupId>org.gbif.registry</groupId>
<version>3.59-SNAPSHOT</version>
<version>3.60-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion registry-events/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<artifactId>registry-parent</artifactId>
<groupId>org.gbif.registry</groupId>
<version>3.59-SNAPSHOT</version>
<version>3.60-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
4 changes: 2 additions & 2 deletions registry-examples/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
<parent>
<artifactId>registry-parent</artifactId>
<groupId>org.gbif.registry</groupId>
<version>3.59-SNAPSHOT</version>
<version>3.60-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

<artifactId>registry-examples</artifactId>
<version>3.59-SNAPSHOT</version>
<version>3.60-SNAPSHOT</version>

<packaging>jar</packaging>

Expand Down
2 changes: 1 addition & 1 deletion registry-identity/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<artifactId>registry-parent</artifactId>
<groupId>org.gbif.registry</groupId>
<version>3.59-SNAPSHOT</version>
<version>3.60-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion registry-integration-tests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<artifactId>registry-parent</artifactId>
<groupId>org.gbif.registry</groupId>
<version>3.59-SNAPSHOT</version>
<version>3.60-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import org.gbif.registry.identity.model.UserModelMutationResult;
import org.gbif.registry.identity.mybatis.IdentitySuretyTestHelper;
import org.gbif.registry.search.test.EsManageServer;
import org.gbif.registry.security.UserRoles;
import org.gbif.registry.ws.it.fixtures.RequestTestFixture;
import org.gbif.registry.ws.it.fixtures.UserTestFixture;
import org.gbif.ws.client.filter.SimplePrincipalProvider;
Expand Down Expand Up @@ -120,6 +121,7 @@ public void testCreateUser() throws Exception {
.getSignedRequest(TEST_ADMIN, "/admin/user/search",
ImmutableMap.<String,String>builder()
.put("role", UserRole.USER.name())
.put("1", TEST_ADMIN)
.build())
.andExpect(status().isOk());
PagingResponse<UserAdminView> adminUsers = requestTestFixture.extractJsonResponse(result, new TypeReference<PagingResponse<UserAdminView>>() { });
Expand Down Expand Up @@ -332,7 +334,10 @@ public void testUserEditorRights() throws Exception {
ResultActions rightsSearchResult =requestTestFixture
.getSignedRequest(TEST_ADMIN, "/admin/user/search",
ImmutableMap.<String,String>builder()
.put("editorRightsOn", key.toString()).build())
.put("editorRightsOn", key.toString())
.put("role", UserRoles.USER_ROLE)
.put("q", USERNAME)
.build())
.andExpect(status().isOk());
PagingResponse<UserAdminView> editorUsers = requestTestFixture.extractJsonResponse(rightsSearchResult, new TypeReference<PagingResponse<UserAdminView>>() { });
assertTrue(editorUsers.getCount() == 1);
Expand Down
2 changes: 1 addition & 1 deletion registry-mail/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<artifactId>registry-parent</artifactId>
<groupId>org.gbif.registry</groupId>
<version>3.59-SNAPSHOT</version>
<version>3.60-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion registry-messaging/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<artifactId>registry-parent</artifactId>
<groupId>org.gbif.registry</groupId>
<version>3.59-SNAPSHOT</version>
<version>3.60-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion registry-metadata/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<artifactId>registry-parent</artifactId>
<groupId>org.gbif.registry</groupId>
<version>3.59-SNAPSHOT</version>
<version>3.60-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion registry-metasync/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<artifactId>registry-parent</artifactId>
<groupId>org.gbif.registry</groupId>
<version>3.59-SNAPSHOT</version>
<version>3.60-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion registry-oaipmh/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<artifactId>registry-parent</artifactId>
<groupId>org.gbif.registry</groupId>
<version>3.59-SNAPSHOT</version>
<version>3.60-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion registry-persistence/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<artifactId>registry-parent</artifactId>
<groupId>org.gbif.registry</groupId>
<version>3.59-SNAPSHOT</version>
<version>3.60-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,7 @@
</sql>

<sql id="SIMPLE_SEARCH">
WHERE
u.last_name ILIKE '%' || #{query} || '%' OR
u.last_name ILIKE '%' || #{query} || '%' OR
u.first_name ILIKE '%' || #{query} || '%' OR
u.email ILIKE '%' || #{query} || '%' OR
u.username ILIKE '%' || #{query} || '%'
Expand All @@ -75,10 +74,12 @@
#{item}
</foreach>
</if>
<if test="roles != null" >
WHERE roles @> #{roles,jdbcType=OTHER,typeHandler=org.gbif.registry.persistence.mapper.handler.UserRoleTypeHandler}
</if>
<if test="query != null" > <include refid="SIMPLE_SEARCH"/> </if>
<where>
<if test="query != null" > <include refid="SIMPLE_SEARCH"/> </if>
<if test="roles != null" >
AND roles @> #{roles,jdbcType=OTHER,typeHandler=org.gbif.registry.persistence.mapper.handler.UserRoleTypeHandler}
</if>
</where>
ORDER BY u.last_name, u.first_name, u.username
<if test="page != null" >
LIMIT #{page.limit} OFFSET #{page.offset}
Expand All @@ -87,15 +88,18 @@

<select id="count" resultType="Integer" parameterType="map">
SELECT COUNT(*)
FROM public.user u <if test="query != null" > <include refid="SIMPLE_SEARCH"/> </if>
FROM public.user u
<if test="editorRightsOn != null" >
JOIN editor_rights er ON er.username = u.username AND er.key IN <foreach item="item" index="index" collection="editorRightsOn" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="roles != null" >
WHERE roles @> #{roles,jdbcType=OTHER,typeHandler=org.gbif.registry.persistence.mapper.handler.UserRoleTypeHandler}
</if>
<where>
<if test="query != null" > <include refid="SIMPLE_SEARCH"/> </if>
<if test="roles != null" >
AND roles @> #{roles,jdbcType=OTHER,typeHandler=org.gbif.registry.persistence.mapper.handler.UserRoleTypeHandler}
</if>
</where>
</select>

<insert id="create" parameterType="org.gbif.api.model.common.GbifUser" useGeneratedKeys="true" keyProperty="key">
Expand Down
2 changes: 1 addition & 1 deletion registry-pipelines/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<artifactId>registry-parent</artifactId>
<groupId>org.gbif.registry</groupId>
<version>3.59-SNAPSHOT</version>
<version>3.60-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion registry-search/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<artifactId>registry-parent</artifactId>
<groupId>org.gbif.registry</groupId>
<version>3.59-SNAPSHOT</version>
<version>3.60-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion registry-security/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<artifactId>registry-parent</artifactId>
<groupId>org.gbif.registry</groupId>
<version>3.59-SNAPSHOT</version>
<version>3.60-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion registry-service/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<artifactId>registry-parent</artifactId>
<groupId>org.gbif.registry</groupId>
<version>3.59-SNAPSHOT</version>
<version>3.60-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion registry-surety/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<artifactId>registry-parent</artifactId>
<groupId>org.gbif.registry</groupId>
<version>3.59-SNAPSHOT</version>
<version>3.60-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion registry-ws-client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<artifactId>registry-parent</artifactId>
<groupId>org.gbif.registry</groupId>
<version>3.59-SNAPSHOT</version>
<version>3.60-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
7 changes: 5 additions & 2 deletions registry-ws/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>org.gbif.registry</groupId>
<artifactId>registry-parent</artifactId>
<version>3.59-SNAPSHOT</version>
<version>3.60-SNAPSHOT</version>
</parent>
<artifactId>registry-ws</artifactId>
<name>GBIF Registry Webservices</name>
Expand All @@ -15,7 +15,6 @@
</properties>

<dependencies>

<!-- Spring dependencies -->
<dependency>
<groupId>org.springframework.boot</groupId>
Expand Down Expand Up @@ -72,6 +71,10 @@
<groupId>de.codecentric</groupId>
<artifactId>spring-boot-admin-starter-client</artifactId>
</dependency>
<dependency>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-ui</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-sleuth</artifactId>
Expand Down

0 comments on commit 3399241

Please sign in to comment.