aligned to hello-world-sg4-service

This commit is contained in:
Alfredo Oliviero 2024-02-26 18:02:00 +01:00
parent d6257cf520
commit c016637b38
10 changed files with 109 additions and 34 deletions

4
.vscode/launch.json vendored
View File

@ -10,7 +10,7 @@
"projectName": "identity-manager",
"request": "attach",
"hostName": "localhost",
"port": 4954
}
"port": 5005
}
]
}

View File

@ -3,7 +3,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
# Changelog for Identity Manager Service
## [v1.0.0-SNAPSHOT]
## [v0.0.1-SNAPSHOT]
- First Version
- First Prototype

View File

@ -1,7 +1,8 @@
#FROM d4science/smartgears-distribution:4.0.0-SNAPSHOT-java11-tomcat9
FROM smartgears-distribution:4.0.0-java11-tomcat9-devel
FROM d4science/smartgears-distribution:4.0.0-SNAPSHOT-java11-tomcat9
#FROM smartgears-distribution:4.0.0-java11-tomcat9-devel
COPY ./docker/logback.xml /etc/
COPY ./docker/container.ini /etc/
COPY ./target/idm.war /tomcat/webapps/
# EXPOSE 8080
EXPOSE 8080

5
buildImageAndStart.sh Executable file
View File

@ -0,0 +1,5 @@
mvn clean package
NAME=idm
docker build -t $NAME .
docker run -p 8080:8080 $NAME

8
buildImageAndStartWithDebug.sh Executable file
View File

@ -0,0 +1,8 @@
mvn clean package
NAME=idm
PORT=8080
DEBUG_PORT=5005
docker build -t $NAME .
docker run -p $PORT:8080 -p $DEBUG_PORT:5005 -e JAVA_TOOL_OPTIONS="-agentlib:jdwp=transport=dt_socket,address=*:5005,server=y,suspend=y" $NAME

View File

@ -1,6 +1,7 @@
[node]
mode = online
hostname = alfredo-idm-service-dev
mode = offline
hostname = myhostname.isti.cnr.it
#hostname = alfredo-idm-service-dev
protocol= http
port = 8080
infrastructure = gcube
@ -19,8 +20,6 @@ location = pisa
factory = org.gcube.smartgears.security.defaults.DefaultAuthorizationProviderFactory
factory.endpoint = https://accounts.dev.d4science.org/auth/realms/d4science/protocol/openid-connect/token
credentials.class = org.gcube.smartgears.security.SimpleCredentials
credentials.clientID = alfredo-idm-service-dev
credentials.clientID = node-whn-test-uno-d-d4s.d4science.org
#credentials.clientID = alfredo-idm-service-dev
credentials.secret = 979bd3bc-5cc4-11ec-bf63-0242ac130002
; credentials.clientID = node-whn-test-uno-d-d4s.d4science.org
; credentials.secret = 979bd3bc-5cc4-11ec-bf63-0242ac130002

View File

@ -5,6 +5,11 @@
</encoder>
</appender>
<logger name="org.gcube.service.idm" level="DEBUG" />
<logger name="org.gcube.service.rest" level="DEBUG" />
<logger name="org.gcube.smartgears" level="DEBUG" />
<!--
<logger name="org.gcube" level="DEBUG" />
<logger name="org.gcube.smartgears" level="TRACE" />
<logger name="org.gcube.smartgears.handlers" level="TRACE" />
@ -14,6 +19,7 @@
<logger name="org.gcube.common.core.publisher.is.legacy" level="TRACE" />
<logger name="org.gcube.data.access" level="TRACE" />
<logger name="org.gcube.data.access.storagehub.handlers" level="DEBUG" />
-->
<root level="WARN">
<appender-ref ref="STDOUT" />

View File

@ -1,6 +1,8 @@
name: idm
group: DataAccess
group: org.gcube.service
version: 1.0.0
description: Identity Manager Service
excludes:
- path: /excluded
- path: /guest
- path: /api-docs/*

View File

@ -9,10 +9,10 @@
A gcube service - smartgears 4
</description>
<servlet>
<servlet-name>org.gcube.idm.IdentityManagerResourceInitializer</servlet-name>
<servlet-name>org.gcube.service.idm.IdM</servlet-name>
</servlet>
<servlet-mapping>
<servlet-name>org.gcube.idm.IdentityManagerResourceInitializer</servlet-name>
<url-pattern>/idm/*</url-pattern>
<servlet-name>org.gcube.service.idm.IdM</servlet-name>
<url-pattern>/*</url-pattern>
</servlet-mapping>
</web-app>

88
pom.xml
View File

@ -2,24 +2,33 @@
xmlns:xsi="https://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="https://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.gcube.idm</groupId>
<artifactId>idm</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>
<name>Identity Manager Smargears</name>
<description>Identity Manager Smargears Service</description>
<parent>
<groupId>org.gcube.tools</groupId>
<artifactId>maven-parent</artifactId>
<version>1.2.0</version>
</parent>
<groupId>org.gcube.idm</groupId>
<artifactId>identity-manager</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>war</packaging>
<name>identity-manager</name>
<description>Identity Manager Smargears Service</description>
<properties>
<java.version>11</java.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
<webappDirectory>
${project.basedir}${file.separator}gcube${file.separator}extra-resources${file.separator}WEB-INF</webappDirectory>
<maven.compiler.source>${java.version}</maven.compiler.source>
<maven.compiler.target>${java.version}</maven.compiler.target>
<!-- OPTIONAL. for authorization-control-library -->
<aspectj-plugin.version>1.14.0</aspectj-plugin.version>
<!-- OPTIONAL. for enunciate -->
<enunciate.version>2.14.0</enunciate.version>
</properties>
@ -43,17 +52,25 @@
</dependencies>
</dependencyManagement>
<dependencies>
<!-- smartgears -->
<dependency>
<groupId>org.gcube.core</groupId>
<artifactId>common-smartgears</artifactId>
</dependency>
<dependency>
<groupId>org.gcube.common</groupId>
<artifactId>common-security</artifactId>
</dependency>
<dependency>
<groupId>org.gcube.common</groupId>
<artifactId>authorization-control-library</artifactId>
</dependency>
<dependency>
<groupId>org.gcube.core</groupId>
<artifactId>common-smartgears-app</artifactId>
</dependency>
<!-- jersey -->
<dependency>
<groupId>javax.ws.rs</groupId>
@ -63,11 +80,18 @@
<groupId>org.glassfish.jersey.containers</groupId>
<artifactId>jersey-container-servlet</artifactId>
</dependency>
<!-- https://mvnrepository.com/artifact/org.glassfish.jersey.inject/jersey-cdi2-se -->
<dependency>
<groupId>org.glassfish.jersey.inject</groupId>
<artifactId>jersey-cdi2-se</artifactId>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.0.1</version>
</dependency>
<!-- add jackson as json provider -->
<dependency>
<groupId>org.glassfish.jersey.media</groupId>
@ -110,7 +134,10 @@
<build>
<finalName>${project.artifactId}</finalName>
<plugins>
<plugin>
<!-- OPTIONAL generate the war in a different folder, to mount deploy on docker
container -->
<!-- <plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.3</version>
@ -118,6 +145,32 @@
<warName>identity-manager</warName>
<outputDirectory>tomcat/webapps</outputDirectory>
</configuration>
</plugin> -->
<!-- OPTIONAL. authorization-control-library: add this plugin if you want to use gcube
authorization control funzionalities -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>aspectj-maven-plugin</artifactId>
<version>${aspectj-plugin.version}</version>
<configuration>
<complianceLevel>11</complianceLevel>
<source>11</source>
<target>11</target>
<aspectLibraries>
<aspectLibrary>
<groupId>org.gcube.common</groupId>
<artifactId>authorization-control-library</artifactId>
</aspectLibrary>
</aspectLibraries>
</configuration>
<executions>
<execution>
<goals>
<goal>compile</goal>
</goals>
</execution>
</executions>
</plugin>
<!-- Sphinx plugin'
@ -142,9 +195,8 @@
</executions>
</plugin> -->
<!-- Enunciate Maven plugin -->
<plugin>
<!-- <plugin>
<groupId>com.webcohesion.enunciate</groupId>
<artifactId>enunciate-maven-plugin</artifactId>
<version>${enunciate.version}</version>
@ -156,10 +208,11 @@
</goals>
</execution>
</executions>
</plugin>
</plugin> -->
<!-- Copy Enunciate Documentation from your-application/api-docs
into your war -->
<plugin>
<!-- <plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<executions>
@ -183,7 +236,8 @@
</configuration>
</execution>
</executions>
</plugin>
</plugin> -->
</plugins>
</build>