#4399 - Fix JPA and Serialization for new JPA versions (new eclipse envs)
3 files deleted
2 files added
43 files modified
| .. | .. |
|---|
| 1 | | -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
|---|
| 2 | | - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
|---|
| 3 | | - |
|---|
| 4 | | - <name>SeCuris-Server</name> |
|---|
| 5 | | - <groupId>net.curisit</groupId> |
|---|
| 6 | | - <artifactId>securis-server</artifactId> |
|---|
| 7 | | - <version>2.0.1</version> |
|---|
| 8 | | - <modelVersion>4.0.0</modelVersion> |
|---|
| 9 | | - |
|---|
| 10 | | - <description>CurisTEC Server Licenses</description> |
|---|
| 11 | | - |
|---|
| 12 | | - <organization> |
|---|
| 13 | | - <name>CURISTEC</name> |
|---|
| 14 | | - </organization> |
|---|
| 1 | +<project xmlns="http://maven.apache.org/POM/4.0.0" |
|---|
| 2 | + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
|---|
| 3 | + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
|---|
| 4 | + |
|---|
| 5 | + <modelVersion>4.0.0</modelVersion> |
|---|
| 6 | + <groupId>net.curisit</groupId> |
|---|
| 7 | + <artifactId>securis-server</artifactId> |
|---|
| 8 | + <version>2.0.1</version> |
|---|
| 9 | + <name>SeCuris-Server</name> |
|---|
| 15 | 10 | |
|---|
| 16 | | - <properties> |
|---|
| 17 | | - <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> |
|---|
| 18 | | - <curisit.theme>default</curisit.theme> |
|---|
| 19 | | - <maven.version>3.10.0</maven.version> |
|---|
| 20 | | - <maven.resources.overwrite>true</maven.resources.overwrite> |
|---|
| 21 | | - <maven.compiler.debug>true</maven.compiler.debug> |
|---|
| 22 | | - <maven.compiler.source>21</maven.compiler.source> |
|---|
| 23 | | - <maven.compiler.target>21</maven.compiler.target> |
|---|
| 24 | | - <maven-assembly-plugin.version>3.4.2</maven-assembly-plugin.version> |
|---|
| 11 | + <properties> |
|---|
| 12 | + <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> |
|---|
| 13 | + <maven.compiler.source>21</maven.compiler.source> |
|---|
| 14 | + <maven.compiler.target>21</maven.compiler.target> |
|---|
| 15 | + <resteasy.version>6.2.4.Final</resteasy.version> |
|---|
| 16 | + <hibernate.version>5.6.15.Final</hibernate.version> |
|---|
| 17 | + <jakarta.persistence.version>3.1.0</jakarta.persistence.version> |
|---|
| 18 | + <jakarta.servlet.version>6.0.0</jakarta.servlet.version> |
|---|
| 19 | + <jakarta.cdi.version>4.0.1</jakarta.cdi.version> |
|---|
| 20 | + <log4j.version>2.18.0</log4j.version> |
|---|
| 21 | + </properties> |
|---|
| 25 | 22 | |
|---|
| 26 | | - <curistec.internal.version>3.3.0</curistec.internal.version> |
|---|
| 27 | | - <securis.version>1.3.1</securis.version> |
|---|
| 23 | + <dependencies> |
|---|
| 24 | + <!-- Internas --> |
|---|
| 25 | + <dependency> |
|---|
| 26 | + <groupId>net.curisit</groupId> |
|---|
| 27 | + <artifactId>securis-client</artifactId> |
|---|
| 28 | + <version>1.3.1</version> |
|---|
| 29 | + </dependency> |
|---|
| 28 | 30 | |
|---|
| 29 | | - <log4j.version>2.18.0</log4j.version> |
|---|
| 30 | | - <hibernate.version>4.3.6.Final</hibernate.version> |
|---|
| 31 | | - |
|---|
| 32 | | - <javax.servlet.version>3.1.0</javax.servlet.version> |
|---|
| 33 | | - <jboss.version>3.0.13.Final</jboss.version> |
|---|
| 34 | | - <jboss-weld.version>2.2.9.Final</jboss-weld.version> |
|---|
| 35 | | - <jboss-jandex.version>1.2.2.Final</jboss-jandex.version> |
|---|
| 36 | | - |
|---|
| 37 | | - <commons-cli.version>1.2</commons-cli.version> |
|---|
| 38 | | - <lang.version>2.6</lang.version> |
|---|
| 39 | | - <lang3.version>3.17.0</lang3.version> |
|---|
| 40 | | - <io.version>2.17.0</io.version> |
|---|
| 41 | | - <httpclient.version>4.5.6</httpclient.version> |
|---|
| 42 | | - <httpmime.version>4.4.1</httpmime.version> |
|---|
| 43 | | - <jackson.version>2.14.1</jackson.version> |
|---|
| 44 | | - </properties> |
|---|
| 45 | | - |
|---|
| 46 | | - <dependencies> |
|---|
| 31 | + <!-- RESTEasy 6 - Jakarta EE 10 --> |
|---|
| 32 | + <dependency> |
|---|
| 33 | + <groupId>org.jboss.resteasy</groupId> |
|---|
| 34 | + <artifactId>resteasy-core</artifactId> |
|---|
| 35 | + <version>${resteasy.version}</version> |
|---|
| 36 | + </dependency> |
|---|
| 37 | + <dependency> |
|---|
| 38 | + <groupId>org.jboss.resteasy</groupId> |
|---|
| 39 | + <artifactId>resteasy-servlet-initializer</artifactId> |
|---|
| 40 | + <version>${resteasy.version}</version> |
|---|
| 41 | + </dependency> |
|---|
| 47 | 42 | <dependency> |
|---|
| 48 | | - <groupId>net.curisit.integrity</groupId> |
|---|
| 49 | | - <artifactId>commons-curis</artifactId> |
|---|
| 50 | | - <version>${curistec.internal.version}</version> |
|---|
| 51 | | - <exclusions> |
|---|
| 52 | | - <exclusion> |
|---|
| 53 | | - <groupId>org.apache.logging.log4j</groupId> |
|---|
| 54 | | - <artifactId>log4j-core</artifactId> |
|---|
| 55 | | - </exclusion> |
|---|
| 56 | | - <exclusion> |
|---|
| 57 | | - <artifactId>jackson-core</artifactId> |
|---|
| 58 | | - <groupId>com.fasterxml.jackson.core</groupId> |
|---|
| 59 | | - </exclusion> |
|---|
| 60 | | - <exclusion> |
|---|
| 61 | | - <artifactId>jackson-databind</artifactId> |
|---|
| 62 | | - <groupId>com.fasterxml.jackson.core</groupId> |
|---|
| 63 | | - </exclusion> |
|---|
| 64 | | - </exclusions> |
|---|
| 43 | + <groupId>org.jboss.resteasy</groupId> |
|---|
| 44 | + <artifactId>resteasy-multipart-provider</artifactId> |
|---|
| 45 | + <version>${resteasy.version}</version> |
|---|
| 65 | 46 | </dependency> |
|---|
| 47 | + <dependency> |
|---|
| 48 | + <groupId>org.jboss.resteasy</groupId> |
|---|
| 49 | + <artifactId>resteasy-jackson2-provider</artifactId> |
|---|
| 50 | + <version>${resteasy.version}</version> |
|---|
| 51 | + </dependency> |
|---|
| 66 | 52 | <dependency> |
|---|
| 67 | | - <groupId>net.curisit</groupId> |
|---|
| 68 | | - <artifactId>securis-client</artifactId> |
|---|
| 69 | | - <version>${securis.version}</version> |
|---|
| 70 | | - <exclusions> |
|---|
| 71 | | - <exclusion> |
|---|
| 72 | | - <artifactId>jackson-databind</artifactId> |
|---|
| 73 | | - <groupId>com.fasterxml.jackson.core</groupId> |
|---|
| 74 | | - </exclusion> |
|---|
| 75 | | - </exclusions> |
|---|
| 76 | | - </dependency> |
|---|
| 77 | | - |
|---|
| 78 | | - <dependency> |
|---|
| 79 | | - <groupId>org.apache.logging.log4j</groupId> |
|---|
| 80 | | - <artifactId>log4j-web</artifactId> |
|---|
| 81 | | - <version>${log4j.version}</version> |
|---|
| 82 | | - </dependency> |
|---|
| 83 | | - <dependency> |
|---|
| 84 | | - <groupId>org.hibernate</groupId> |
|---|
| 85 | | - <artifactId>hibernate-entitymanager</artifactId> |
|---|
| 86 | | - <version>${hibernate.version}</version> |
|---|
| 87 | | - </dependency> |
|---|
| 88 | | - <dependency> |
|---|
| 89 | | - <groupId>org.apache.httpcomponents</groupId> |
|---|
| 90 | | - <artifactId>httpclient</artifactId> |
|---|
| 91 | | - <version>${httpclient.version}</version> |
|---|
| 92 | | - </dependency> |
|---|
| 93 | | - <dependency> |
|---|
| 94 | | - <groupId>org.apache.httpcomponents</groupId> |
|---|
| 95 | | - <artifactId>httpmime</artifactId> |
|---|
| 96 | | - <version>${httpmime.version}</version> |
|---|
| 97 | | - </dependency> |
|---|
| 98 | | - <dependency> |
|---|
| 99 | | - <groupId>commons-lang</groupId> |
|---|
| 100 | | - <artifactId>commons-lang</artifactId> |
|---|
| 101 | | - <version>${lang.version}</version> |
|---|
| 102 | | - </dependency> |
|---|
| 103 | | - <dependency> |
|---|
| 104 | | - <groupId>javax.enterprise</groupId> |
|---|
| 105 | | - <artifactId>cdi-api</artifactId> |
|---|
| 106 | | - <version>1.2</version> |
|---|
| 107 | | - <scope>provided</scope> |
|---|
| 108 | | - </dependency> |
|---|
| 109 | | - <dependency> |
|---|
| 110 | | - <groupId>javax.servlet</groupId> |
|---|
| 111 | | - <artifactId>javax.servlet-api</artifactId> |
|---|
| 112 | | - <version>${javax.servlet.version}</version> |
|---|
| 113 | | - <scope>provided</scope> |
|---|
| 114 | | - </dependency> |
|---|
| 115 | | - <dependency> |
|---|
| 116 | | - <groupId>org.jboss.resteasy</groupId> |
|---|
| 117 | | - <artifactId>resteasy-multipart-provider</artifactId> |
|---|
| 118 | | - <version>${jboss.version}</version> |
|---|
| 119 | | - </dependency> |
|---|
| 120 | | - <dependency> |
|---|
| 121 | | - <groupId>org.jboss.resteasy</groupId> |
|---|
| 122 | | - <artifactId>resteasy-jaxrs</artifactId> |
|---|
| 123 | | - <version>${jboss.version}</version> |
|---|
| 124 | | - </dependency> |
|---|
| 125 | | - <dependency> |
|---|
| 126 | | - <groupId>org.jboss.weld.servlet</groupId> |
|---|
| 127 | | - <artifactId>weld-servlet</artifactId> |
|---|
| 128 | | - <version>${jboss-weld.version}</version> |
|---|
| 129 | | - </dependency> |
|---|
| 130 | | - <dependency> |
|---|
| 131 | | - <groupId>org.jboss</groupId> |
|---|
| 132 | | - <artifactId>jandex</artifactId> |
|---|
| 133 | | - <version>${jboss-jandex.version}</version> |
|---|
| 134 | | - </dependency> |
|---|
| 135 | | - <dependency> |
|---|
| 136 | | - <groupId>org.jboss.resteasy</groupId> |
|---|
| 137 | | - <artifactId>resteasy-jackson2-provider</artifactId> |
|---|
| 138 | | - <version>${jboss.version}</version> |
|---|
| 139 | | - <exclusions> |
|---|
| 140 | | - <exclusion> |
|---|
| 141 | | - <artifactId>jackson-core</artifactId> |
|---|
| 142 | | - <groupId>com.fasterxml.jackson.core</groupId> |
|---|
| 143 | | - </exclusion> |
|---|
| 144 | | - <exclusion> |
|---|
| 145 | | - <artifactId>jackson-databind</artifactId> |
|---|
| 146 | | - <groupId>com.fasterxml.jackson.core</groupId> |
|---|
| 147 | | - </exclusion> |
|---|
| 148 | | - </exclusions> |
|---|
| 149 | | - </dependency> |
|---|
| 53 | + <groupId>org.apache.httpcomponents</groupId> |
|---|
| 54 | + <artifactId>httpmime</artifactId> |
|---|
| 55 | + <version>4.5.13</version> |
|---|
| 56 | + </dependency> |
|---|
| 150 | 57 | |
|---|
| 151 | 58 | <dependency> |
|---|
| 152 | | - <groupId>org.jboss.resteasy</groupId> |
|---|
| 153 | | - <artifactId>resteasy-cdi</artifactId> |
|---|
| 154 | | - <version>${jboss.version}</version> |
|---|
| 59 | + <groupId>org.apache.commons</groupId> |
|---|
| 60 | + <artifactId>commons-lang3</artifactId> |
|---|
| 61 | + <version>3.12.0</version> |
|---|
| 155 | 62 | </dependency> |
|---|
| 156 | | - <dependency> |
|---|
| 157 | | - <groupId>com.fasterxml.jackson.jaxrs</groupId> |
|---|
| 158 | | - <artifactId>jackson-jaxrs-json-provider</artifactId> |
|---|
| 159 | | - <version>${jackson.version}</version> |
|---|
| 160 | | - </dependency> |
|---|
| 161 | | - <dependency> |
|---|
| 162 | | - <groupId>com.fasterxml.jackson.core</groupId> |
|---|
| 163 | | - <artifactId>jackson-annotations</artifactId> |
|---|
| 164 | | - <version>${jackson.version}</version> |
|---|
| 165 | | - </dependency> |
|---|
| 166 | | - </dependencies> |
|---|
| 167 | | - |
|---|
| 168 | | - <build> |
|---|
| 169 | | - <plugins> |
|---|
| 170 | | - <plugin> |
|---|
| 171 | | - <groupId>org.apache.maven.plugins</groupId> |
|---|
| 172 | | - <artifactId>maven-compiler-plugin</artifactId> |
|---|
| 173 | | - <version>${maven.version}</version> |
|---|
| 174 | | - <configuration> |
|---|
| 175 | | - <source>${maven.compiler.source}</source> |
|---|
| 176 | | - <target>${maven.compiler.target}</target> |
|---|
| 177 | | - <encoding>${project.build.sourceEncoding}</encoding> |
|---|
| 178 | | - <debug>true</debug> |
|---|
| 179 | | - <showDeprecation>true</showDeprecation> |
|---|
| 180 | | - <showWarnings>true</showWarnings> |
|---|
| 181 | | - </configuration> |
|---|
| 182 | | - </plugin> |
|---|
| 183 | | - <plugin> |
|---|
| 184 | | - <artifactId>maven-assembly-plugin</artifactId> |
|---|
| 185 | | - <version>${maven-assembly-plugin.version}</version> |
|---|
| 186 | | - <configuration> |
|---|
| 187 | | - <formats> |
|---|
| 188 | | - <format>zip</format> |
|---|
| 189 | | - <format>tar.gz</format> |
|---|
| 190 | | - </formats> |
|---|
| 191 | | - <descriptors> |
|---|
| 192 | | - <descriptor>etc/build/pro/mvn_descriptor.xml</descriptor> |
|---|
| 193 | | - </descriptors> |
|---|
| 194 | | - <appendAssemblyId>false</appendAssemblyId> |
|---|
| 195 | | - </configuration> |
|---|
| 196 | | - </plugin> |
|---|
| 197 | | - </plugins> |
|---|
| 198 | | - </build> |
|---|
| 199 | | - |
|---|
| 200 | | - <repositories> |
|---|
| 201 | | - <repository> |
|---|
| 202 | | - <id>internal</id> |
|---|
| 203 | | - <name>CurisIT Repository</name> |
|---|
| 204 | | - <url>http://archiva.curisit.net/archiva/repository/internal</url> |
|---|
| 205 | | - </repository> |
|---|
| 206 | | - <repository> |
|---|
| 207 | | - <id>curistec</id> |
|---|
| 208 | | - <name>CurisTec Corporate Repository</name> |
|---|
| 209 | | - <url>http://archiva.curisit.net/archiva/repository/internal/</url> |
|---|
| 210 | | - <layout>default</layout> |
|---|
| 211 | | - </repository> |
|---|
| 212 | | - <repository> |
|---|
| 213 | | - <id>curistecSnapshot</id> |
|---|
| 214 | | - <name>CurisTec Snapshots</name> |
|---|
| 215 | | - <url>http://archiva.curisit.net/archiva/repository/snapshots/</url> |
|---|
| 216 | | - <layout>default</layout> |
|---|
| 217 | | - </repository> |
|---|
| 218 | | - </repositories> |
|---|
| 219 | 63 | |
|---|
| 64 | + <!-- Jakarta EE APIs --> |
|---|
| 65 | + <dependency> |
|---|
| 66 | + <groupId>jakarta.persistence</groupId> |
|---|
| 67 | + <artifactId>jakarta.persistence-api</artifactId> |
|---|
| 68 | + <version>${jakarta.persistence.version}</version> |
|---|
| 69 | + </dependency> |
|---|
| 70 | + <dependency> |
|---|
| 71 | + <groupId>jakarta.servlet</groupId> |
|---|
| 72 | + <artifactId>jakarta.servlet-api</artifactId> |
|---|
| 73 | + <version>${jakarta.servlet.version}</version> |
|---|
| 74 | + <scope>provided</scope> |
|---|
| 75 | + </dependency> |
|---|
| 76 | + <dependency> |
|---|
| 77 | + <groupId>jakarta.enterprise</groupId> |
|---|
| 78 | + <artifactId>jakarta.enterprise.cdi-api</artifactId> |
|---|
| 79 | + <version>${jakarta.cdi.version}</version> |
|---|
| 80 | + <scope>provided</scope> |
|---|
| 81 | + </dependency> |
|---|
| 82 | + |
|---|
| 83 | + <!-- Hibernate 5 compatible con Jakarta Persistence --> |
|---|
| 84 | + <dependency> |
|---|
| 85 | + <groupId>org.hibernate</groupId> |
|---|
| 86 | + <artifactId>hibernate-core</artifactId> |
|---|
| 87 | + <version>${hibernate.version}</version> |
|---|
| 88 | + </dependency> |
|---|
| 89 | + |
|---|
| 90 | + <!-- Logging --> |
|---|
| 91 | + <dependency> |
|---|
| 92 | + <groupId>org.apache.logging.log4j</groupId> |
|---|
| 93 | + <artifactId>log4j-core</artifactId> |
|---|
| 94 | + <version>${log4j.version}</version> |
|---|
| 95 | + </dependency> |
|---|
| 96 | + <dependency> |
|---|
| 97 | + <groupId>org.apache.logging.log4j</groupId> |
|---|
| 98 | + <artifactId>log4j-api</artifactId> |
|---|
| 99 | + <version>${log4j.version}</version> |
|---|
| 100 | + </dependency> |
|---|
| 101 | + <dependency> |
|---|
| 102 | + <groupId>org.apache.logging.log4j</groupId> |
|---|
| 103 | + <artifactId>log4j-web</artifactId> |
|---|
| 104 | + <version>${log4j.version}</version> |
|---|
| 105 | + </dependency> |
|---|
| 106 | + |
|---|
| 107 | + <dependency> |
|---|
| 108 | + <groupId>com.google.inject</groupId> |
|---|
| 109 | + <artifactId>guice</artifactId> |
|---|
| 110 | + <version>5.1.0</version> |
|---|
| 111 | + </dependency> |
|---|
| 112 | + |
|---|
| 113 | + </dependencies> |
|---|
| 114 | + |
|---|
| 115 | + <build> |
|---|
| 116 | + <plugins> |
|---|
| 117 | + <plugin> |
|---|
| 118 | + <groupId>org.apache.maven.plugins</groupId> |
|---|
| 119 | + <artifactId>maven-compiler-plugin</artifactId> |
|---|
| 120 | + <version>3.10.0</version> |
|---|
| 121 | + <configuration> |
|---|
| 122 | + <source>${maven.compiler.source}</source> |
|---|
| 123 | + <target>${maven.compiler.target}</target> |
|---|
| 124 | + <encoding>${project.build.sourceEncoding}</encoding> |
|---|
| 125 | + </configuration> |
|---|
| 126 | + </plugin> |
|---|
| 127 | + </plugins> |
|---|
| 128 | + </build> |
|---|
| 129 | + |
|---|
| 130 | + <repositories> |
|---|
| 131 | + <repository> |
|---|
| 132 | + <id>central</id> |
|---|
| 133 | + <url>https://repo.maven.apache.org/maven2</url> |
|---|
| 134 | + </repository> |
|---|
| 135 | + </repositories> |
|---|
| 220 | 136 | </project> |
|---|
| .. | .. |
|---|
| 1 | +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
|---|
| 2 | + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
|---|
| 3 | + |
|---|
| 4 | + <name>SeCuris-Server</name> |
|---|
| 5 | + <groupId>net.curisit</groupId> |
|---|
| 6 | + <artifactId>securis-server</artifactId> |
|---|
| 7 | + <version>2.0.1</version> |
|---|
| 8 | + <modelVersion>4.0.0</modelVersion> |
|---|
| 9 | + |
|---|
| 10 | + <description>CurisTEC Server Licenses</description> |
|---|
| 11 | + |
|---|
| 12 | + <organization> |
|---|
| 13 | + <name>CURISTEC</name> |
|---|
| 14 | + </organization> |
|---|
| 15 | + |
|---|
| 16 | + <properties> |
|---|
| 17 | + <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> |
|---|
| 18 | + <curisit.theme>default</curisit.theme> |
|---|
| 19 | + <maven.version>3.10.0</maven.version> |
|---|
| 20 | + <maven.resources.overwrite>true</maven.resources.overwrite> |
|---|
| 21 | + <maven.compiler.debug>true</maven.compiler.debug> |
|---|
| 22 | + <maven.compiler.source>11</maven.compiler.source> |
|---|
| 23 | + <maven.compiler.target>11</maven.compiler.target> |
|---|
| 24 | + <maven-assembly-plugin.version>3.4.2</maven-assembly-plugin.version> |
|---|
| 25 | + |
|---|
| 26 | + <curistec.internal.version>3.3.0</curistec.internal.version> |
|---|
| 27 | + <securis.version>1.3.1</securis.version> |
|---|
| 28 | + |
|---|
| 29 | + <log4j.version>2.18.0</log4j.version> |
|---|
| 30 | + <hibernate.version>4.3.6.Final</hibernate.version> |
|---|
| 31 | + |
|---|
| 32 | + <javax.servlet.version>3.1.0</javax.servlet.version> |
|---|
| 33 | + <jboss.version>3.0.24.Final</jboss.version> |
|---|
| 34 | + <jboss-weld.version>2.2.9.Final</jboss-weld.version> |
|---|
| 35 | + <jboss-jandex.version>1.2.2.Final</jboss-jandex.version> |
|---|
| 36 | + |
|---|
| 37 | + <commons-cli.version>1.2</commons-cli.version> |
|---|
| 38 | + <lang.version>2.6</lang.version> |
|---|
| 39 | + <lang3.version>3.17.0</lang3.version> |
|---|
| 40 | + <io.version>2.17.0</io.version> |
|---|
| 41 | + <httpclient.version>4.5.6</httpclient.version> |
|---|
| 42 | + <httpmime.version>4.4.1</httpmime.version> |
|---|
| 43 | + <jackson.version>2.14.1</jackson.version> |
|---|
| 44 | + </properties> |
|---|
| 45 | + |
|---|
| 46 | + <dependencies> |
|---|
| 47 | + <dependency> |
|---|
| 48 | + <groupId>net.curisit.integrity</groupId> |
|---|
| 49 | + <artifactId>commons-curis</artifactId> |
|---|
| 50 | + <version>${curistec.internal.version}</version> |
|---|
| 51 | + <exclusions> |
|---|
| 52 | + <exclusion> |
|---|
| 53 | + <groupId>org.apache.logging.log4j</groupId> |
|---|
| 54 | + <artifactId>log4j-core</artifactId> |
|---|
| 55 | + </exclusion> |
|---|
| 56 | + <exclusion> |
|---|
| 57 | + <artifactId>jackson-core</artifactId> |
|---|
| 58 | + <groupId>com.fasterxml.jackson.core</groupId> |
|---|
| 59 | + </exclusion> |
|---|
| 60 | + <exclusion> |
|---|
| 61 | + <artifactId>jackson-databind</artifactId> |
|---|
| 62 | + <groupId>com.fasterxml.jackson.core</groupId> |
|---|
| 63 | + </exclusion> |
|---|
| 64 | + </exclusions> |
|---|
| 65 | + </dependency> |
|---|
| 66 | + <dependency> |
|---|
| 67 | + <groupId>net.curisit</groupId> |
|---|
| 68 | + <artifactId>securis-client</artifactId> |
|---|
| 69 | + <version>${securis.version}</version> |
|---|
| 70 | + <exclusions> |
|---|
| 71 | + <exclusion> |
|---|
| 72 | + <artifactId>jackson-databind</artifactId> |
|---|
| 73 | + <groupId>com.fasterxml.jackson.core</groupId> |
|---|
| 74 | + </exclusion> |
|---|
| 75 | + </exclusions> |
|---|
| 76 | + </dependency> |
|---|
| 77 | + |
|---|
| 78 | + <dependency> |
|---|
| 79 | + <groupId>org.apache.logging.log4j</groupId> |
|---|
| 80 | + <artifactId>log4j-core</artifactId> |
|---|
| 81 | + <version>${log4j.version}</version> |
|---|
| 82 | + </dependency> |
|---|
| 83 | + <dependency> |
|---|
| 84 | + <groupId>org.apache.logging.log4j</groupId> |
|---|
| 85 | + <artifactId>log4j-api</artifactId> |
|---|
| 86 | + <version>${log4j.version}</version> |
|---|
| 87 | + </dependency> |
|---|
| 88 | + <dependency> |
|---|
| 89 | + <groupId>org.apache.logging.log4j</groupId> |
|---|
| 90 | + <artifactId>log4j-web</artifactId> |
|---|
| 91 | + <version>${log4j.version}</version> |
|---|
| 92 | + </dependency> |
|---|
| 93 | + <dependency> |
|---|
| 94 | + <groupId>org.hibernate</groupId> |
|---|
| 95 | + <artifactId>hibernate-entitymanager</artifactId> |
|---|
| 96 | + <version>${hibernate.version}</version> |
|---|
| 97 | + </dependency> |
|---|
| 98 | + <dependency> |
|---|
| 99 | + <groupId>org.apache.httpcomponents</groupId> |
|---|
| 100 | + <artifactId>httpclient</artifactId> |
|---|
| 101 | + <version>${httpclient.version}</version> |
|---|
| 102 | + </dependency> |
|---|
| 103 | + <dependency> |
|---|
| 104 | + <groupId>org.apache.httpcomponents</groupId> |
|---|
| 105 | + <artifactId>httpmime</artifactId> |
|---|
| 106 | + <version>${httpmime.version}</version> |
|---|
| 107 | + </dependency> |
|---|
| 108 | + <dependency> |
|---|
| 109 | + <groupId>commons-lang</groupId> |
|---|
| 110 | + <artifactId>commons-lang</artifactId> |
|---|
| 111 | + <version>${lang.version}</version> |
|---|
| 112 | + </dependency> |
|---|
| 113 | + <dependency> |
|---|
| 114 | + <groupId>javax.enterprise</groupId> |
|---|
| 115 | + <artifactId>cdi-api</artifactId> |
|---|
| 116 | + <version>1.2</version> |
|---|
| 117 | + <scope>provided</scope> |
|---|
| 118 | + </dependency> |
|---|
| 119 | + <dependency> |
|---|
| 120 | + <groupId>javax.servlet</groupId> |
|---|
| 121 | + <artifactId>javax.servlet-api</artifactId> |
|---|
| 122 | + <version>${javax.servlet.version}</version> |
|---|
| 123 | + <scope>provided</scope> |
|---|
| 124 | + </dependency> |
|---|
| 125 | + <dependency> |
|---|
| 126 | + <groupId>org.jboss.resteasy</groupId> |
|---|
| 127 | + <artifactId>resteasy-multipart-provider</artifactId> |
|---|
| 128 | + <version>${jboss.version}</version> |
|---|
| 129 | + </dependency> |
|---|
| 130 | + <dependency> |
|---|
| 131 | + <groupId>org.jboss.resteasy</groupId> |
|---|
| 132 | + <artifactId>resteasy-jaxrs</artifactId> |
|---|
| 133 | + <version>${jboss.version}</version> |
|---|
| 134 | + </dependency> |
|---|
| 135 | + <dependency> |
|---|
| 136 | + <groupId>org.jboss.resteasy</groupId> |
|---|
| 137 | + <artifactId>resteasy-servlet</artifactId> |
|---|
| 138 | + <version>${jboss.version}</version> |
|---|
| 139 | + </dependency> |
|---|
| 140 | + <dependency> |
|---|
| 141 | + <groupId>org.jboss.resteasy</groupId> |
|---|
| 142 | + <artifactId>resteasy-servlet-initializer</artifactId> |
|---|
| 143 | + <version>${jboss.version}</version> |
|---|
| 144 | + </dependency> <dependency> |
|---|
| 145 | + <groupId>org.jboss.weld.servlet</groupId> |
|---|
| 146 | + <artifactId>weld-servlet</artifactId> |
|---|
| 147 | + <version>${jboss-weld.version}</version> |
|---|
| 148 | + </dependency> |
|---|
| 149 | + <dependency> |
|---|
| 150 | + <groupId>org.jboss</groupId> |
|---|
| 151 | + <artifactId>jandex</artifactId> |
|---|
| 152 | + <version>${jboss-jandex.version}</version> |
|---|
| 153 | + </dependency> |
|---|
| 154 | + <dependency> |
|---|
| 155 | + <groupId>org.jboss.resteasy</groupId> |
|---|
| 156 | + <artifactId>resteasy-jackson2-provider</artifactId> |
|---|
| 157 | + <version>${jboss.version}</version> |
|---|
| 158 | + <exclusions> |
|---|
| 159 | + <exclusion> |
|---|
| 160 | + <artifactId>jackson-core</artifactId> |
|---|
| 161 | + <groupId>com.fasterxml.jackson.core</groupId> |
|---|
| 162 | + </exclusion> |
|---|
| 163 | + <exclusion> |
|---|
| 164 | + <artifactId>jackson-databind</artifactId> |
|---|
| 165 | + <groupId>com.fasterxml.jackson.core</groupId> |
|---|
| 166 | + </exclusion> |
|---|
| 167 | + </exclusions> |
|---|
| 168 | + </dependency> |
|---|
| 169 | + |
|---|
| 170 | + <dependency> |
|---|
| 171 | + <groupId>org.jboss.resteasy</groupId> |
|---|
| 172 | + <artifactId>resteasy-cdi</artifactId> |
|---|
| 173 | + <version>${jboss.version}</version> |
|---|
| 174 | + </dependency> |
|---|
| 175 | + <dependency> |
|---|
| 176 | + <groupId>com.fasterxml.jackson.jaxrs</groupId> |
|---|
| 177 | + <artifactId>jackson-jaxrs-json-provider</artifactId> |
|---|
| 178 | + <version>${jackson.version}</version> |
|---|
| 179 | + </dependency> |
|---|
| 180 | + <dependency> |
|---|
| 181 | + <groupId>com.fasterxml.jackson.core</groupId> |
|---|
| 182 | + <artifactId>jackson-annotations</artifactId> |
|---|
| 183 | + <version>${jackson.version}</version> |
|---|
| 184 | + </dependency> |
|---|
| 185 | + <dependency> |
|---|
| 186 | + <groupId>jakarta.servlet</groupId> |
|---|
| 187 | + <artifactId>jakarta.servlet-api</artifactId> |
|---|
| 188 | + <version>5.0.0</version> |
|---|
| 189 | + <scope>provided</scope> |
|---|
| 190 | + </dependency> |
|---|
| 191 | + </dependencies> |
|---|
| 192 | + |
|---|
| 193 | + <build> |
|---|
| 194 | + <plugins> |
|---|
| 195 | + <plugin> |
|---|
| 196 | + <groupId>org.apache.maven.plugins</groupId> |
|---|
| 197 | + <artifactId>maven-compiler-plugin</artifactId> |
|---|
| 198 | + <version>${maven.version}</version> |
|---|
| 199 | + <configuration> |
|---|
| 200 | + <source>${maven.compiler.source}</source> |
|---|
| 201 | + <target>${maven.compiler.target}</target> |
|---|
| 202 | + <encoding>${project.build.sourceEncoding}</encoding> |
|---|
| 203 | + <debug>true</debug> |
|---|
| 204 | + <showDeprecation>true</showDeprecation> |
|---|
| 205 | + <showWarnings>true</showWarnings> |
|---|
| 206 | + </configuration> |
|---|
| 207 | + </plugin> |
|---|
| 208 | + <plugin> |
|---|
| 209 | + <artifactId>maven-assembly-plugin</artifactId> |
|---|
| 210 | + <version>${maven-assembly-plugin.version}</version> |
|---|
| 211 | + <configuration> |
|---|
| 212 | + <formats> |
|---|
| 213 | + <format>zip</format> |
|---|
| 214 | + <format>tar.gz</format> |
|---|
| 215 | + </formats> |
|---|
| 216 | + <descriptors> |
|---|
| 217 | + <descriptor>etc/build/pro/mvn_descriptor.xml</descriptor> |
|---|
| 218 | + </descriptors> |
|---|
| 219 | + <appendAssemblyId>false</appendAssemblyId> |
|---|
| 220 | + </configuration> |
|---|
| 221 | + </plugin> |
|---|
| 222 | + </plugins> |
|---|
| 223 | + </build> |
|---|
| 224 | + |
|---|
| 225 | + <repositories> |
|---|
| 226 | + <repository> |
|---|
| 227 | + <id>internal</id> |
|---|
| 228 | + <name>CurisIT Repository</name> |
|---|
| 229 | + <url>http://archiva.curisit.net/archiva/repository/internal</url> |
|---|
| 230 | + </repository> |
|---|
| 231 | + <repository> |
|---|
| 232 | + <id>curistec</id> |
|---|
| 233 | + <name>CurisTec Corporate Repository</name> |
|---|
| 234 | + <url>http://archiva.curisit.net/archiva/repository/internal/</url> |
|---|
| 235 | + <layout>default</layout> |
|---|
| 236 | + </repository> |
|---|
| 237 | + <repository> |
|---|
| 238 | + <id>curistecSnapshot</id> |
|---|
| 239 | + <name>CurisTec Snapshots</name> |
|---|
| 240 | + <url>http://archiva.curisit.net/archiva/repository/snapshots/</url> |
|---|
| 241 | + <layout>default</layout> |
|---|
| 242 | + </repository> |
|---|
| 243 | + <repository> |
|---|
| 244 | + <id>jboss-public</id> |
|---|
| 245 | + <url>https://repository.jboss.org/nexus/content/groups/public/</url> |
|---|
| 246 | + </repository> |
|---|
| 247 | + </repositories> |
|---|
| 248 | + |
|---|
| 249 | +</project> |
|---|
| .. | .. |
|---|
| 3 | 3 | import java.io.IOException; |
|---|
| 4 | 4 | import java.security.Principal; |
|---|
| 5 | 5 | |
|---|
| 6 | | -import javax.enterprise.context.ApplicationScoped; |
|---|
| 7 | | -import javax.servlet.Filter; |
|---|
| 8 | | -import javax.servlet.FilterChain; |
|---|
| 9 | | -import javax.servlet.FilterConfig; |
|---|
| 10 | | -import javax.servlet.ServletException; |
|---|
| 11 | | -import javax.servlet.ServletRequest; |
|---|
| 12 | | -import javax.servlet.ServletResponse; |
|---|
| 13 | | -import javax.servlet.annotation.WebFilter; |
|---|
| 14 | | -import javax.servlet.http.HttpServletRequest; |
|---|
| 15 | | -import javax.servlet.http.HttpServletRequestWrapper; |
|---|
| 6 | +import jakarta.enterprise.context.ApplicationScoped; |
|---|
| 7 | +import jakarta.servlet.Filter; |
|---|
| 8 | +import jakarta.servlet.FilterChain; |
|---|
| 9 | +import jakarta.servlet.FilterConfig; |
|---|
| 10 | +import jakarta.servlet.ServletException; |
|---|
| 11 | +import jakarta.servlet.ServletRequest; |
|---|
| 12 | +import jakarta.servlet.ServletResponse; |
|---|
| 13 | +import jakarta.servlet.annotation.WebFilter; |
|---|
| 14 | +import jakarta.servlet.http.HttpServletRequest; |
|---|
| 15 | +import jakarta.servlet.http.HttpServletRequestWrapper; |
|---|
| 16 | 16 | |
|---|
| 17 | 17 | import org.apache.logging.log4j.LogManager; |
|---|
| 18 | 18 | import org.apache.logging.log4j.Logger; |
|---|
| .. | .. |
|---|
| 1 | 1 | package net.curisit.securis; |
|---|
| 2 | 2 | |
|---|
| 3 | | -import javax.persistence.EntityManager; |
|---|
| 4 | | -import javax.servlet.http.HttpServletRequest; |
|---|
| 5 | | -import javax.ws.rs.ForbiddenException; |
|---|
| 6 | | -import javax.ws.rs.core.Context; |
|---|
| 7 | | -import javax.ws.rs.core.MediaType; |
|---|
| 8 | | -import javax.ws.rs.core.Response; |
|---|
| 9 | | -import javax.ws.rs.core.Response.Status; |
|---|
| 10 | | -import javax.ws.rs.core.SecurityContext; |
|---|
| 11 | | -import javax.ws.rs.ext.ExceptionMapper; |
|---|
| 12 | | -import javax.ws.rs.ext.Provider; |
|---|
| 3 | +import jakarta.persistence.EntityManager; |
|---|
| 4 | +import jakarta.servlet.http.HttpServletRequest; |
|---|
| 5 | +import jakarta.ws.rs.ForbiddenException; |
|---|
| 6 | +import jakarta.ws.rs.core.Context; |
|---|
| 7 | +import jakarta.ws.rs.core.MediaType; |
|---|
| 8 | +import jakarta.ws.rs.core.Response; |
|---|
| 9 | +import jakarta.ws.rs.core.Response.Status; |
|---|
| 10 | +import jakarta.ws.rs.core.SecurityContext; |
|---|
| 11 | +import jakarta.ws.rs.ext.ExceptionMapper; |
|---|
| 12 | +import jakarta.ws.rs.ext.Provider; |
|---|
| 13 | 13 | |
|---|
| 14 | 14 | import org.apache.logging.log4j.LogManager; |
|---|
| 15 | 15 | import org.apache.logging.log4j.Logger; |
|---|
| .. | .. |
|---|
| 2 | 2 | |
|---|
| 3 | 3 | import java.io.IOException; |
|---|
| 4 | 4 | |
|---|
| 5 | | -import javax.enterprise.context.ApplicationScoped; |
|---|
| 6 | | -import javax.servlet.Filter; |
|---|
| 7 | | -import javax.servlet.FilterChain; |
|---|
| 8 | | -import javax.servlet.FilterConfig; |
|---|
| 9 | | -import javax.servlet.ServletException; |
|---|
| 10 | | -import javax.servlet.ServletRequest; |
|---|
| 11 | | -import javax.servlet.ServletResponse; |
|---|
| 12 | | -import javax.servlet.annotation.WebFilter; |
|---|
| 13 | | -import javax.servlet.http.HttpServletRequest; |
|---|
| 14 | | -import javax.servlet.http.HttpServletResponse; |
|---|
| 5 | +import jakarta.enterprise.context.ApplicationScoped; |
|---|
| 6 | +import jakarta.servlet.Filter; |
|---|
| 7 | +import jakarta.servlet.FilterChain; |
|---|
| 8 | +import jakarta.servlet.FilterConfig; |
|---|
| 9 | +import jakarta.servlet.ServletException; |
|---|
| 10 | +import jakarta.servlet.ServletRequest; |
|---|
| 11 | +import jakarta.servlet.ServletResponse; |
|---|
| 12 | +import jakarta.servlet.annotation.WebFilter; |
|---|
| 13 | +import jakarta.servlet.http.HttpServletRequest; |
|---|
| 14 | +import jakarta.servlet.http.HttpServletResponse; |
|---|
| 15 | 15 | |
|---|
| 16 | 16 | import org.apache.logging.log4j.LogManager; |
|---|
| 17 | 17 | import org.apache.logging.log4j.Logger; |
|---|
| .. | .. |
|---|
| 2 | 2 | |
|---|
| 3 | 3 | import java.io.IOException; |
|---|
| 4 | 4 | |
|---|
| 5 | | -import javax.enterprise.context.ApplicationScoped; |
|---|
| 6 | | -import javax.servlet.Filter; |
|---|
| 7 | | -import javax.servlet.FilterChain; |
|---|
| 8 | | -import javax.servlet.FilterConfig; |
|---|
| 9 | | -import javax.servlet.ServletException; |
|---|
| 10 | | -import javax.servlet.ServletRequest; |
|---|
| 11 | | -import javax.servlet.ServletResponse; |
|---|
| 12 | | -import javax.servlet.annotation.WebFilter; |
|---|
| 13 | | -import javax.servlet.http.HttpServletRequest; |
|---|
| 14 | | -import javax.servlet.http.HttpServletResponse; |
|---|
| 5 | +import jakarta.enterprise.context.ApplicationScoped; |
|---|
| 6 | +import jakarta.servlet.Filter; |
|---|
| 7 | +import jakarta.servlet.FilterChain; |
|---|
| 8 | +import jakarta.servlet.FilterConfig; |
|---|
| 9 | +import jakarta.servlet.ServletException; |
|---|
| 10 | +import jakarta.servlet.ServletRequest; |
|---|
| 11 | +import jakarta.servlet.ServletResponse; |
|---|
| 12 | +import jakarta.servlet.annotation.WebFilter; |
|---|
| 13 | +import jakarta.servlet.http.HttpServletRequest; |
|---|
| 14 | +import jakarta.servlet.http.HttpServletResponse; |
|---|
| 15 | 15 | |
|---|
| 16 | 16 | import org.apache.logging.log4j.LogManager; |
|---|
| 17 | 17 | import org.apache.logging.log4j.Logger; |
|---|
| .. | .. |
|---|
| 3 | 3 | import java.util.HashSet;
|
|---|
| 4 | 4 | import java.util.Set;
|
|---|
| 5 | 5 |
|
|---|
| 6 | | -import javax.ws.rs.ApplicationPath;
|
|---|
| 7 | | -import javax.ws.rs.core.Application;
|
|---|
| 6 | +import jakarta.ws.rs.ApplicationPath;
|
|---|
| 7 | +import jakarta.ws.rs.core.Application;
|
|---|
| 8 | 8 |
|
|---|
| 9 | 9 | import net.curisit.securis.ioc.RequestsInterceptor;
|
|---|
| 10 | 10 | import net.curisit.securis.services.ApiResource;
|
|---|
| .. | .. |
|---|
| 4 | 4 | import java.util.Date; |
|---|
| 5 | 5 | import java.util.Set; |
|---|
| 6 | 6 | |
|---|
| 7 | | -import javax.persistence.CascadeType; |
|---|
| 8 | | -import javax.persistence.Column; |
|---|
| 9 | | -import javax.persistence.Entity; |
|---|
| 10 | | -import javax.persistence.FetchType; |
|---|
| 11 | | -import javax.persistence.GeneratedValue; |
|---|
| 12 | | -import javax.persistence.Id; |
|---|
| 13 | | -import javax.persistence.JoinColumn; |
|---|
| 14 | | -import javax.persistence.JoinTable; |
|---|
| 15 | | -import javax.persistence.ManyToMany; |
|---|
| 16 | | -import javax.persistence.NamedQueries; |
|---|
| 17 | | -import javax.persistence.NamedQuery; |
|---|
| 18 | | -import javax.persistence.OneToMany; |
|---|
| 19 | | -import javax.persistence.Table; |
|---|
| 7 | +import jakarta.persistence.CascadeType; |
|---|
| 8 | +import jakarta.persistence.Column; |
|---|
| 9 | +import jakarta.persistence.Entity; |
|---|
| 10 | +import jakarta.persistence.FetchType; |
|---|
| 11 | +import jakarta.persistence.GeneratedValue; |
|---|
| 12 | +import jakarta.persistence.Id; |
|---|
| 13 | +import jakarta.persistence.JoinColumn; |
|---|
| 14 | +import jakarta.persistence.JoinTable; |
|---|
| 15 | +import jakarta.persistence.ManyToMany; |
|---|
| 16 | +import jakarta.persistence.NamedQueries; |
|---|
| 17 | +import jakarta.persistence.NamedQuery; |
|---|
| 18 | +import jakarta.persistence.OneToMany; |
|---|
| 19 | +import jakarta.persistence.Table; |
|---|
| 20 | 20 | |
|---|
| 21 | 21 | import org.apache.logging.log4j.LogManager; |
|---|
| 22 | 22 | import org.apache.logging.log4j.Logger; |
|---|
| .. | .. |
|---|
| 4 | 4 | import java.util.Date; |
|---|
| 5 | 5 | import java.util.Objects; |
|---|
| 6 | 6 | |
|---|
| 7 | | -import javax.persistence.Column; |
|---|
| 8 | | -import javax.persistence.Entity; |
|---|
| 9 | | -import javax.persistence.Id; |
|---|
| 10 | | -import javax.persistence.JoinColumn; |
|---|
| 11 | | -import javax.persistence.ManyToOne; |
|---|
| 12 | | -import javax.persistence.NamedQueries; |
|---|
| 13 | | -import javax.persistence.NamedQuery; |
|---|
| 14 | | -import javax.persistence.Table; |
|---|
| 7 | +import jakarta.persistence.Column; |
|---|
| 8 | +import jakarta.persistence.Entity; |
|---|
| 9 | +import jakarta.persistence.Id; |
|---|
| 10 | +import jakarta.persistence.JoinColumn; |
|---|
| 11 | +import jakarta.persistence.ManyToOne; |
|---|
| 12 | +import jakarta.persistence.NamedQueries; |
|---|
| 13 | +import jakarta.persistence.NamedQuery; |
|---|
| 14 | +import jakarta.persistence.Table; |
|---|
| 15 | 15 | |
|---|
| 16 | 16 | import org.apache.logging.log4j.LogManager; |
|---|
| 17 | 17 | import org.apache.logging.log4j.Logger; |
|---|
| .. | .. |
|---|
| 3 | 3 | import java.io.Serializable; |
|---|
| 4 | 4 | import java.util.Date; |
|---|
| 5 | 5 | |
|---|
| 6 | | -import javax.persistence.Column; |
|---|
| 7 | | -import javax.persistence.Entity; |
|---|
| 8 | | -import javax.persistence.EntityManager; |
|---|
| 9 | | -import javax.persistence.Id; |
|---|
| 10 | | -import javax.persistence.JoinColumn; |
|---|
| 11 | | -import javax.persistence.ManyToOne; |
|---|
| 12 | | -import javax.persistence.Table; |
|---|
| 6 | +import jakarta.persistence.Column; |
|---|
| 7 | +import jakarta.persistence.Entity; |
|---|
| 8 | +import jakarta.persistence.EntityManager; |
|---|
| 9 | +import jakarta.persistence.Id; |
|---|
| 10 | +import jakarta.persistence.JoinColumn; |
|---|
| 11 | +import jakarta.persistence.ManyToOne; |
|---|
| 12 | +import jakarta.persistence.Table; |
|---|
| 13 | 13 | |
|---|
| 14 | 14 | import net.curisit.integrity.commons.Utils; |
|---|
| 15 | 15 | |
|---|
| .. | .. |
|---|
| 6 | 6 | import java.util.List; |
|---|
| 7 | 7 | import java.util.Map; |
|---|
| 8 | 8 | |
|---|
| 9 | | -import javax.persistence.Column; |
|---|
| 10 | | -import javax.persistence.Entity; |
|---|
| 11 | | -import javax.persistence.EntityListeners; |
|---|
| 12 | | -import javax.persistence.EntityManager; |
|---|
| 13 | | -import javax.persistence.FetchType; |
|---|
| 14 | | -import javax.persistence.GeneratedValue; |
|---|
| 15 | | -import javax.persistence.Id; |
|---|
| 16 | | -import javax.persistence.JoinColumn; |
|---|
| 17 | | -import javax.persistence.ManyToOne; |
|---|
| 18 | | -import javax.persistence.NamedQueries; |
|---|
| 19 | | -import javax.persistence.NamedQuery; |
|---|
| 20 | | -import javax.persistence.NoResultException; |
|---|
| 21 | | -import javax.persistence.OneToMany; |
|---|
| 22 | | -import javax.persistence.Table; |
|---|
| 23 | | -import javax.persistence.TypedQuery; |
|---|
| 9 | +import jakarta.persistence.Column; |
|---|
| 10 | +import jakarta.persistence.Entity; |
|---|
| 11 | +import jakarta.persistence.EntityListeners; |
|---|
| 12 | +import jakarta.persistence.EntityManager; |
|---|
| 13 | +import jakarta.persistence.FetchType; |
|---|
| 14 | +import jakarta.persistence.GeneratedValue; |
|---|
| 15 | +import jakarta.persistence.Id; |
|---|
| 16 | +import jakarta.persistence.JoinColumn; |
|---|
| 17 | +import jakarta.persistence.ManyToOne; |
|---|
| 18 | +import jakarta.persistence.NamedQueries; |
|---|
| 19 | +import jakarta.persistence.NamedQuery; |
|---|
| 20 | +import jakarta.persistence.NoResultException; |
|---|
| 21 | +import jakarta.persistence.OneToMany; |
|---|
| 22 | +import jakarta.persistence.Table; |
|---|
| 23 | +import jakarta.persistence.TypedQuery; |
|---|
| 24 | 24 | |
|---|
| 25 | 25 | import org.apache.logging.log4j.LogManager; |
|---|
| 26 | 26 | import org.apache.logging.log4j.Logger; |
|---|
| .. | .. |
|---|
| 3 | 3 | import java.io.Serializable; |
|---|
| 4 | 4 | import java.util.Date; |
|---|
| 5 | 5 | |
|---|
| 6 | | -import javax.persistence.Column; |
|---|
| 7 | | -import javax.persistence.Entity; |
|---|
| 8 | | -import javax.persistence.GeneratedValue; |
|---|
| 9 | | -import javax.persistence.Id; |
|---|
| 10 | | -import javax.persistence.JoinColumn; |
|---|
| 11 | | -import javax.persistence.ManyToOne; |
|---|
| 12 | | -import javax.persistence.NamedQueries; |
|---|
| 13 | | -import javax.persistence.NamedQuery; |
|---|
| 14 | | -import javax.persistence.Table; |
|---|
| 6 | +import jakarta.persistence.Column; |
|---|
| 7 | +import jakarta.persistence.Entity; |
|---|
| 8 | +import jakarta.persistence.GeneratedValue; |
|---|
| 9 | +import jakarta.persistence.Id; |
|---|
| 10 | +import jakarta.persistence.JoinColumn; |
|---|
| 11 | +import jakarta.persistence.ManyToOne; |
|---|
| 12 | +import jakarta.persistence.NamedQueries; |
|---|
| 13 | +import jakarta.persistence.NamedQuery; |
|---|
| 14 | +import jakarta.persistence.Table; |
|---|
| 15 | 15 | |
|---|
| 16 | 16 | import com.fasterxml.jackson.annotation.JsonAutoDetect; |
|---|
| 17 | 17 | import com.fasterxml.jackson.annotation.JsonIgnore; |
|---|
| .. | .. |
|---|
| 4 | 4 | import java.util.Date; |
|---|
| 5 | 5 | import java.util.Set; |
|---|
| 6 | 6 | |
|---|
| 7 | | -import javax.persistence.CascadeType; |
|---|
| 8 | | -import javax.persistence.Column; |
|---|
| 9 | | -import javax.persistence.Entity; |
|---|
| 10 | | -import javax.persistence.FetchType; |
|---|
| 11 | | -import javax.persistence.GeneratedValue; |
|---|
| 12 | | -import javax.persistence.Id; |
|---|
| 13 | | -import javax.persistence.JoinColumn; |
|---|
| 14 | | -import javax.persistence.ManyToOne; |
|---|
| 15 | | -import javax.persistence.NamedQueries; |
|---|
| 16 | | -import javax.persistence.NamedQuery; |
|---|
| 17 | | -import javax.persistence.OneToMany; |
|---|
| 18 | | -import javax.persistence.Table; |
|---|
| 7 | +import jakarta.persistence.CascadeType; |
|---|
| 8 | +import jakarta.persistence.Column; |
|---|
| 9 | +import jakarta.persistence.Entity; |
|---|
| 10 | +import jakarta.persistence.FetchType; |
|---|
| 11 | +import jakarta.persistence.GeneratedValue; |
|---|
| 12 | +import jakarta.persistence.Id; |
|---|
| 13 | +import jakarta.persistence.JoinColumn; |
|---|
| 14 | +import jakarta.persistence.ManyToOne; |
|---|
| 15 | +import jakarta.persistence.NamedQueries; |
|---|
| 16 | +import jakarta.persistence.NamedQuery; |
|---|
| 17 | +import jakarta.persistence.OneToMany; |
|---|
| 18 | +import jakarta.persistence.Table; |
|---|
| 19 | 19 | |
|---|
| 20 | 20 | import org.apache.logging.log4j.LogManager; |
|---|
| 21 | 21 | import org.apache.logging.log4j.Logger; |
|---|
| .. | .. |
|---|
| 3 | 3 | import java.io.Serializable; |
|---|
| 4 | 4 | import java.util.Objects; |
|---|
| 5 | 5 | |
|---|
| 6 | | -import javax.persistence.Column; |
|---|
| 7 | | -import javax.persistence.Entity; |
|---|
| 8 | | -import javax.persistence.Id; |
|---|
| 9 | | -import javax.persistence.JoinColumn; |
|---|
| 10 | | -import javax.persistence.ManyToOne; |
|---|
| 11 | | -import javax.persistence.NamedQueries; |
|---|
| 12 | | -import javax.persistence.NamedQuery; |
|---|
| 13 | | -import javax.persistence.Table; |
|---|
| 6 | +import jakarta.persistence.Column; |
|---|
| 7 | +import jakarta.persistence.Entity; |
|---|
| 8 | +import jakarta.persistence.Id; |
|---|
| 9 | +import jakarta.persistence.JoinColumn; |
|---|
| 10 | +import jakarta.persistence.ManyToOne; |
|---|
| 11 | +import jakarta.persistence.NamedQueries; |
|---|
| 12 | +import jakarta.persistence.NamedQuery; |
|---|
| 13 | +import jakarta.persistence.Table; |
|---|
| 14 | 14 | |
|---|
| 15 | 15 | import com.fasterxml.jackson.annotation.JsonAutoDetect; |
|---|
| 16 | 16 | import com.fasterxml.jackson.annotation.JsonBackReference; |
|---|
| .. | .. |
|---|
| 6 | 6 | import java.util.List; |
|---|
| 7 | 7 | import java.util.Set; |
|---|
| 8 | 8 | |
|---|
| 9 | | -import javax.persistence.CascadeType; |
|---|
| 10 | | -import javax.persistence.Column; |
|---|
| 11 | | -import javax.persistence.Entity; |
|---|
| 12 | | -import javax.persistence.FetchType; |
|---|
| 13 | | -import javax.persistence.GeneratedValue; |
|---|
| 14 | | -import javax.persistence.Id; |
|---|
| 15 | | -import javax.persistence.JoinColumn; |
|---|
| 16 | | -import javax.persistence.JoinTable; |
|---|
| 17 | | -import javax.persistence.ManyToMany; |
|---|
| 18 | | -import javax.persistence.ManyToOne; |
|---|
| 19 | | -import javax.persistence.NamedQueries; |
|---|
| 20 | | -import javax.persistence.NamedQuery; |
|---|
| 21 | | -import javax.persistence.OneToMany; |
|---|
| 22 | | -import javax.persistence.Table; |
|---|
| 9 | +import jakarta.persistence.CascadeType; |
|---|
| 10 | +import jakarta.persistence.Column; |
|---|
| 11 | +import jakarta.persistence.Entity; |
|---|
| 12 | +import jakarta.persistence.FetchType; |
|---|
| 13 | +import jakarta.persistence.GeneratedValue; |
|---|
| 14 | +import jakarta.persistence.Id; |
|---|
| 15 | +import jakarta.persistence.JoinColumn; |
|---|
| 16 | +import jakarta.persistence.JoinTable; |
|---|
| 17 | +import jakarta.persistence.ManyToMany; |
|---|
| 18 | +import jakarta.persistence.ManyToOne; |
|---|
| 19 | +import jakarta.persistence.NamedQueries; |
|---|
| 20 | +import jakarta.persistence.NamedQuery; |
|---|
| 21 | +import jakarta.persistence.OneToMany; |
|---|
| 22 | +import jakarta.persistence.Table; |
|---|
| 23 | 23 | |
|---|
| 24 | 24 | import org.apache.logging.log4j.LogManager; |
|---|
| 25 | 25 | import org.apache.logging.log4j.Logger; |
|---|
| .. | .. |
|---|
| 7 | 7 | import java.util.Map; |
|---|
| 8 | 8 | import java.util.Set; |
|---|
| 9 | 9 | |
|---|
| 10 | | -import javax.persistence.CascadeType; |
|---|
| 11 | | -import javax.persistence.Column; |
|---|
| 12 | | -import javax.persistence.Entity; |
|---|
| 13 | | -import javax.persistence.FetchType; |
|---|
| 14 | | -import javax.persistence.GeneratedValue; |
|---|
| 15 | | -import javax.persistence.Id; |
|---|
| 16 | | -import javax.persistence.JoinColumn; |
|---|
| 17 | | -import javax.persistence.ManyToOne; |
|---|
| 18 | | -import javax.persistence.NamedQueries; |
|---|
| 19 | | -import javax.persistence.NamedQuery; |
|---|
| 20 | | -import javax.persistence.OneToMany; |
|---|
| 21 | | -import javax.persistence.Table; |
|---|
| 10 | +import jakarta.persistence.CascadeType; |
|---|
| 11 | +import jakarta.persistence.Column; |
|---|
| 12 | +import jakarta.persistence.Entity; |
|---|
| 13 | +import jakarta.persistence.FetchType; |
|---|
| 14 | +import jakarta.persistence.GeneratedValue; |
|---|
| 15 | +import jakarta.persistence.Id; |
|---|
| 16 | +import jakarta.persistence.JoinColumn; |
|---|
| 17 | +import jakarta.persistence.ManyToOne; |
|---|
| 18 | +import jakarta.persistence.NamedQueries; |
|---|
| 19 | +import jakarta.persistence.NamedQuery; |
|---|
| 20 | +import jakarta.persistence.OneToMany; |
|---|
| 21 | +import jakarta.persistence.Table; |
|---|
| 22 | 22 | |
|---|
| 23 | 23 | import org.hibernate.annotations.Type; |
|---|
| 24 | 24 | |
|---|
| .. | .. |
|---|
| 3 | 3 | import java.io.Serializable; |
|---|
| 4 | 4 | import java.util.Objects; |
|---|
| 5 | 5 | |
|---|
| 6 | | -import javax.persistence.Column; |
|---|
| 7 | | -import javax.persistence.Entity; |
|---|
| 8 | | -import javax.persistence.Id; |
|---|
| 9 | | -import javax.persistence.JoinColumn; |
|---|
| 10 | | -import javax.persistence.ManyToOne; |
|---|
| 11 | | -import javax.persistence.NamedQueries; |
|---|
| 12 | | -import javax.persistence.NamedQuery; |
|---|
| 13 | | -import javax.persistence.Table; |
|---|
| 6 | +import jakarta.persistence.Column; |
|---|
| 7 | +import jakarta.persistence.Entity; |
|---|
| 8 | +import jakarta.persistence.Id; |
|---|
| 9 | +import jakarta.persistence.JoinColumn; |
|---|
| 10 | +import jakarta.persistence.ManyToOne; |
|---|
| 11 | +import jakarta.persistence.NamedQueries; |
|---|
| 12 | +import jakarta.persistence.NamedQuery; |
|---|
| 13 | +import jakarta.persistence.Table; |
|---|
| 14 | 14 | |
|---|
| 15 | 15 | import com.fasterxml.jackson.annotation.JsonAutoDetect; |
|---|
| 16 | 16 | import com.fasterxml.jackson.annotation.JsonIgnore; |
|---|
| .. | .. |
|---|
| 9 | 9 | import java.util.Set; |
|---|
| 10 | 10 | import java.util.stream.Collectors; |
|---|
| 11 | 11 | |
|---|
| 12 | | -import javax.persistence.Column; |
|---|
| 13 | | -import javax.persistence.Entity; |
|---|
| 14 | | -import javax.persistence.Id; |
|---|
| 15 | | -import javax.persistence.JoinColumn; |
|---|
| 16 | | -import javax.persistence.JoinTable; |
|---|
| 17 | | -import javax.persistence.ManyToMany; |
|---|
| 18 | | -import javax.persistence.NamedQueries; |
|---|
| 19 | | -import javax.persistence.NamedQuery; |
|---|
| 20 | | -import javax.persistence.Table; |
|---|
| 12 | +import jakarta.persistence.Column; |
|---|
| 13 | +import jakarta.persistence.Entity; |
|---|
| 14 | +import jakarta.persistence.Id; |
|---|
| 15 | +import jakarta.persistence.JoinColumn; |
|---|
| 16 | +import jakarta.persistence.JoinTable; |
|---|
| 17 | +import jakarta.persistence.ManyToMany; |
|---|
| 18 | +import jakarta.persistence.NamedQueries; |
|---|
| 19 | +import jakarta.persistence.NamedQuery; |
|---|
| 20 | +import jakarta.persistence.Table; |
|---|
| 21 | 21 | |
|---|
| 22 | 22 | import com.fasterxml.jackson.annotation.JsonAutoDetect; |
|---|
| 23 | 23 | import com.fasterxml.jackson.annotation.JsonIgnore; |
|---|
| .. | .. |
|---|
| 7 | 7 | import java.sql.Types; |
|---|
| 8 | 8 | |
|---|
| 9 | 9 | import org.hibernate.HibernateException; |
|---|
| 10 | | -import org.hibernate.engine.spi.SessionImplementor; |
|---|
| 10 | +import org.hibernate.engine.spi.SharedSessionContractImplementor; |
|---|
| 11 | 11 | import org.hibernate.usertype.UserType; |
|---|
| 12 | 12 | |
|---|
| 13 | 13 | public abstract class PersistentEnumUserType<T extends CodedEnum> implements UserType { |
|---|
| .. | .. |
|---|
| 58 | 58 | } |
|---|
| 59 | 59 | |
|---|
| 60 | 60 | @Override |
|---|
| 61 | | - public Object nullSafeGet(ResultSet rs, String[] names, SessionImplementor session, Object owner) throws HibernateException, SQLException { |
|---|
| 61 | + public Object nullSafeGet(ResultSet rs, String[] names, SharedSessionContractImplementor session, Object owner) |
|---|
| 62 | + throws HibernateException, SQLException { |
|---|
| 62 | 63 | String code = rs.getString(names[0]); |
|---|
| 63 | 64 | for (CodedEnum en : returnedClass().getEnumConstants()) { |
|---|
| 64 | 65 | if (en.getCode().equals(code)) { |
|---|
| .. | .. |
|---|
| 69 | 70 | } |
|---|
| 70 | 71 | |
|---|
| 71 | 72 | @Override |
|---|
| 72 | | - public void nullSafeSet(PreparedStatement st, Object value, int index, SessionImplementor session) throws HibernateException, SQLException { |
|---|
| 73 | | - st.setString(index, value == null ? null : ((CodedEnum) value).getCode()); |
|---|
| 73 | + public void nullSafeSet(PreparedStatement st, Object value, int index, SharedSessionContractImplementor session) |
|---|
| 74 | + throws HibernateException, SQLException { |
|---|
| 75 | + if (value == null) { |
|---|
| 76 | + st.setNull(index, java.sql.Types.VARCHAR); |
|---|
| 77 | + } else { |
|---|
| 78 | + st.setString(index, ((CodedEnum) value).getCode()); |
|---|
| 79 | + } |
|---|
| 74 | 80 | } |
|---|
| 75 | 81 | |
|---|
| 76 | 82 | } |
|---|
| .. | .. |
|---|
| 2 | 2 | |
|---|
| 3 | 3 | import java.util.Date; |
|---|
| 4 | 4 | |
|---|
| 5 | | -import javax.enterprise.context.ApplicationScoped; |
|---|
| 6 | | -import javax.inject.Inject; |
|---|
| 7 | | -import javax.persistence.EntityManager; |
|---|
| 5 | +import jakarta.enterprise.context.ApplicationScoped; |
|---|
| 6 | +import jakarta.inject.Inject; |
|---|
| 7 | +import jakarta.persistence.EntityManager; |
|---|
| 8 | 8 | |
|---|
| 9 | 9 | import net.curisit.integrity.commons.Utils; |
|---|
| 10 | 10 | import net.curisit.securis.db.Settings; |
|---|
| .. | .. |
|---|
| 5 | 5 | import java.lang.annotation.RetentionPolicy; |
|---|
| 6 | 6 | import java.lang.annotation.Target; |
|---|
| 7 | 7 | |
|---|
| 8 | | -import javax.interceptor.InterceptorBinding; |
|---|
| 8 | +import jakarta.interceptor.InterceptorBinding; |
|---|
| 9 | 9 | |
|---|
| 10 | 10 | @Target({ |
|---|
| 11 | 11 | ElementType.METHOD, ElementType.TYPE |
|---|
| .. | .. |
|---|
| 1 | 1 | package net.curisit.securis.ioc; |
|---|
| 2 | 2 | |
|---|
| 3 | | -import javax.enterprise.context.ApplicationScoped; |
|---|
| 4 | | -import javax.persistence.EntityManager; |
|---|
| 5 | | -import javax.persistence.EntityManagerFactory; |
|---|
| 3 | +import jakarta.enterprise.context.ApplicationScoped; |
|---|
| 4 | +import jakarta.persistence.EntityManager; |
|---|
| 5 | +import jakarta.persistence.EntityManagerFactory; |
|---|
| 6 | +import jakarta.persistence.Persistence; |
|---|
| 6 | 7 | |
|---|
| 7 | 8 | import org.apache.logging.log4j.LogManager; |
|---|
| 8 | 9 | import org.apache.logging.log4j.Logger; |
|---|
| .. | .. |
|---|
| 13 | 14 | @SuppressWarnings("unused") |
|---|
| 14 | 15 | private static final Logger log = LogManager.getLogger(EntityManagerProvider.class); |
|---|
| 15 | 16 | |
|---|
| 16 | | - private final EntityManagerFactory entityManagerFactory = javax.persistence.Persistence.createEntityManagerFactory("localdb"); |
|---|
| 17 | + private final EntityManagerFactory entityManagerFactory = Persistence.createEntityManagerFactory("localdb"); |
|---|
| 17 | 18 | |
|---|
| 18 | 19 | public EntityManager getEntityManager() { |
|---|
| 19 | 20 | return entityManagerFactory.createEntityManager(); |
|---|
| .. | .. |
|---|
| 5 | 5 | import java.util.List; |
|---|
| 6 | 6 | import java.util.Set; |
|---|
| 7 | 7 | |
|---|
| 8 | | -import javax.annotation.Priority; |
|---|
| 9 | | -import javax.inject.Inject; |
|---|
| 10 | | -import javax.persistence.EntityManager; |
|---|
| 11 | | -import javax.servlet.http.HttpServletRequest; |
|---|
| 12 | | -import javax.servlet.http.HttpServletResponse; |
|---|
| 13 | | -import javax.ws.rs.Priorities; |
|---|
| 14 | | -import javax.ws.rs.WebApplicationException; |
|---|
| 15 | | -import javax.ws.rs.container.ContainerRequestContext; |
|---|
| 16 | | -import javax.ws.rs.container.ContainerRequestFilter; |
|---|
| 17 | | -import javax.ws.rs.core.Context; |
|---|
| 18 | | -import javax.ws.rs.core.Response; |
|---|
| 19 | | -import javax.ws.rs.core.Response.Status; |
|---|
| 20 | | -import javax.ws.rs.ext.Provider; |
|---|
| 21 | | -import javax.ws.rs.ext.WriterInterceptor; |
|---|
| 22 | | -import javax.ws.rs.ext.WriterInterceptorContext; |
|---|
| 8 | +import jakarta.annotation.Priority; |
|---|
| 9 | +import jakarta.inject.Inject; |
|---|
| 10 | +import jakarta.persistence.EntityManager; |
|---|
| 11 | +import jakarta.servlet.http.HttpServletRequest; |
|---|
| 12 | +import jakarta.servlet.http.HttpServletResponse; |
|---|
| 13 | +import jakarta.ws.rs.Priorities; |
|---|
| 14 | +import jakarta.ws.rs.WebApplicationException; |
|---|
| 15 | +import jakarta.ws.rs.container.ContainerRequestContext; |
|---|
| 16 | +import jakarta.ws.rs.container.ContainerRequestFilter; |
|---|
| 17 | +import jakarta.ws.rs.container.ResourceInfo; |
|---|
| 18 | +import jakarta.ws.rs.core.Context; |
|---|
| 19 | +import jakarta.ws.rs.core.Response; |
|---|
| 20 | +import jakarta.ws.rs.core.Response.Status; |
|---|
| 21 | +import jakarta.ws.rs.ext.Provider; |
|---|
| 22 | +import jakarta.ws.rs.ext.WriterInterceptor; |
|---|
| 23 | +import jakarta.ws.rs.ext.WriterInterceptorContext; |
|---|
| 23 | 24 | |
|---|
| 24 | 25 | import org.apache.logging.log4j.LogManager; |
|---|
| 25 | 26 | import org.apache.logging.log4j.Logger; |
|---|
| 26 | | -import org.jboss.resteasy.core.Dispatcher; |
|---|
| 27 | | -import org.jboss.resteasy.core.ResourceMethodInvoker; |
|---|
| 28 | | -import org.jboss.resteasy.core.ServerResponse; |
|---|
| 29 | | -import org.jboss.resteasy.spi.Failure; |
|---|
| 30 | | -import org.jboss.resteasy.spi.HttpRequest; |
|---|
| 31 | | -import org.jboss.resteasy.spi.ResteasyProviderFactory; |
|---|
| 32 | 27 | |
|---|
| 33 | 28 | import net.curisit.securis.db.User; |
|---|
| 34 | 29 | import net.curisit.securis.security.BasicSecurityContext; |
|---|
| .. | .. |
|---|
| 39 | 34 | @Provider |
|---|
| 40 | 35 | @Priority(Priorities.AUTHENTICATION) |
|---|
| 41 | 36 | public class RequestsInterceptor implements ContainerRequestFilter, WriterInterceptor { |
|---|
| 37 | + |
|---|
| 42 | 38 | private static final Logger LOG = LogManager.getLogger(RequestsInterceptor.class); |
|---|
| 43 | 39 | |
|---|
| 44 | 40 | @Context |
|---|
| .. | .. |
|---|
| 47 | 43 | @Context |
|---|
| 48 | 44 | private HttpServletRequest servletRequest; |
|---|
| 49 | 45 | |
|---|
| 46 | + @Context |
|---|
| 47 | + private ResourceInfo resourceInfo; |
|---|
| 48 | + |
|---|
| 50 | 49 | @Inject |
|---|
| 51 | 50 | private CacheTTL cache; |
|---|
| 52 | 51 | |
|---|
| 53 | 52 | @Inject |
|---|
| 54 | 53 | private TokenHelper tokenHelper; |
|---|
| 55 | 54 | |
|---|
| 56 | | - @Context |
|---|
| 57 | | - private Dispatcher dispatcher; |
|---|
| 58 | | - |
|---|
| 59 | 55 | @Inject |
|---|
| 60 | 56 | private EntityManagerProvider emProvider; |
|---|
| 61 | 57 | |
|---|
| 58 | + private static final String EM_CONTEXT_PROPERTY = "curisit.entitymanager"; |
|---|
| 59 | + |
|---|
| 62 | 60 | @Override |
|---|
| 63 | | - public void filter(ContainerRequestContext containerRequestContext) throws IOException { |
|---|
| 61 | + public void filter(ContainerRequestContext requestContext) throws IOException { |
|---|
| 64 | 62 | EntityManager em = emProvider.getEntityManager(); |
|---|
| 65 | 63 | LOG.debug("GETTING EM: {}", em); |
|---|
| 66 | 64 | |
|---|
| 67 | | - ResteasyProviderFactory.pushContext(EntityManager.class, em); |
|---|
| 65 | + // Guardamos el EntityManager en el contexto para recuperación posterior |
|---|
| 66 | + requestContext.setProperty(EM_CONTEXT_PROPERTY, em); |
|---|
| 68 | 67 | |
|---|
| 69 | | - ResourceMethodInvoker methodInvoker = (ResourceMethodInvoker) containerRequestContext.getProperty("org.jboss.resteasy.core.ResourceMethodInvoker"); |
|---|
| 70 | | - Method method = methodInvoker.getMethod(); |
|---|
| 68 | + Method method = resourceInfo.getResourceMethod(); |
|---|
| 71 | 69 | |
|---|
| 72 | | - LOG.debug("Stored in context, em: {}, {}", em, method.toGenericString()); |
|---|
| 73 | | - |
|---|
| 74 | | - boolean next = checkSecurableMethods(containerRequestContext, method); |
|---|
| 75 | | - if (next) { |
|---|
| 76 | | - prepareTransaction(containerRequestContext, method, em); |
|---|
| 70 | + if (checkSecurableMethods(requestContext, method)) { |
|---|
| 71 | + if (method.isAnnotationPresent(EnsureTransaction.class)) { |
|---|
| 72 | + LOG.debug("Beginning transaction"); |
|---|
| 73 | + em.getTransaction().begin(); |
|---|
| 74 | + } |
|---|
| 77 | 75 | } |
|---|
| 78 | 76 | } |
|---|
| 79 | 77 | |
|---|
| 80 | | - private void prepareTransaction(ContainerRequestContext containerRequestContext, Method method, EntityManager em) { |
|---|
| 78 | + private boolean checkSecurableMethods(ContainerRequestContext ctx, Method method) { |
|---|
| 79 | + if (!method.isAnnotationPresent(Securable.class)) return true; |
|---|
| 81 | 80 | |
|---|
| 82 | | - if (method.isAnnotationPresent(EnsureTransaction.class)) { |
|---|
| 83 | | - LOG.debug("Beginning a new transaction"); |
|---|
| 84 | | - em.getTransaction().begin(); |
|---|
| 85 | | - } |
|---|
| 86 | | - } |
|---|
| 87 | | - |
|---|
| 88 | | - private boolean checkSecurableMethods(ContainerRequestContext containerRequestContext, Method method) { |
|---|
| 89 | | - if (!method.isAnnotationPresent(Securable.class)) { |
|---|
| 90 | | - return true; |
|---|
| 91 | | - } |
|---|
| 92 | 81 | String token = servletRequest.getHeader(TokenHelper.TOKEN_HEADER_PÀRAM); |
|---|
| 93 | 82 | if (token == null || !tokenHelper.isTokenValid(token)) { |
|---|
| 94 | | - LOG.warn("Access denied, Token not valid: {} for method: {}::{}", token, method.getDeclaringClass(), method.getName()); |
|---|
| 95 | | - containerRequestContext.abortWith(Response.status(Status.UNAUTHORIZED).build()); |
|---|
| 83 | + LOG.warn("Access denied, invalid token"); |
|---|
| 84 | + ctx.abortWith(Response.status(Status.UNAUTHORIZED).build()); |
|---|
| 96 | 85 | return false; |
|---|
| 97 | | - } else { |
|---|
| 98 | | - Securable securable = method.getAnnotation(Securable.class); |
|---|
| 99 | | - // If roles == 0 we only need to validate the token |
|---|
| 100 | | - String username = tokenHelper.extractUserFromToken(token); |
|---|
| 101 | | - int userRoles = getUserRoles(username); |
|---|
| 102 | | - if (securable.roles() != 0 && (securable.roles() & userRoles) == 0) { |
|---|
| 103 | | - LOG.warn("Method {} requires roles: {}, but user {} hasn't got them", method.getName(), securable.roles(), username); |
|---|
| 104 | | - containerRequestContext.abortWith(Response.status(Status.UNAUTHORIZED).build()); |
|---|
| 105 | | - return false; |
|---|
| 106 | | - } |
|---|
| 107 | | - Set<Integer> orgs = getUserOrganizations(username); |
|---|
| 108 | | - Set<Integer> apps = getUserApplications(username); |
|---|
| 109 | | - |
|---|
| 110 | | - BasicSecurityContext scw = new BasicSecurityContext(username, userRoles, servletRequest.isSecure()); |
|---|
| 111 | | - scw.setOrganizationsIds(orgs); |
|---|
| 112 | | - scw.setApplicationsIds(apps); |
|---|
| 113 | | - containerRequestContext.setSecurityContext(scw); |
|---|
| 114 | | - // Next line provide injection in resource methods |
|---|
| 115 | | - ResteasyProviderFactory.pushContext(BasicSecurityContext.class, scw); |
|---|
| 116 | | - LOG.debug("Added custom SecurityContext for user {}, orgs: {}", username, orgs); |
|---|
| 117 | 86 | } |
|---|
| 87 | + |
|---|
| 88 | + String username = tokenHelper.extractUserFromToken(token); |
|---|
| 89 | + int roles = getUserRoles(username); |
|---|
| 90 | + Securable securable = method.getAnnotation(Securable.class); |
|---|
| 91 | + |
|---|
| 92 | + if (securable.roles() != 0 && (securable.roles() & roles) == 0) { |
|---|
| 93 | + LOG.warn("User {} lacks required roles for method {}", username, method.getName()); |
|---|
| 94 | + ctx.abortWith(Response.status(Status.UNAUTHORIZED).build()); |
|---|
| 95 | + return false; |
|---|
| 96 | + } |
|---|
| 97 | + |
|---|
| 98 | + BasicSecurityContext sc = new BasicSecurityContext(username, roles, servletRequest.isSecure()); |
|---|
| 99 | + sc.setOrganizationsIds(getUserOrganizations(username)); |
|---|
| 100 | + sc.setApplicationsIds(getUserApplications(username)); |
|---|
| 101 | + ctx.setSecurityContext(sc); |
|---|
| 118 | 102 | return true; |
|---|
| 119 | | - |
|---|
| 120 | | - } |
|---|
| 121 | | - |
|---|
| 122 | | - private Set<Integer> getUserOrganizations(String username) { |
|---|
| 123 | | - @SuppressWarnings("unchecked") |
|---|
| 124 | | - Set<Integer> userOrgs = cache.get("orgs_" + username, Set.class); |
|---|
| 125 | | - if (userOrgs == null) { |
|---|
| 126 | | - EntityManager em = ResteasyProviderFactory.getContextData(EntityManager.class); |
|---|
| 127 | | - |
|---|
| 128 | | - // Theorically this shouldn't be never null, but just in case... |
|---|
| 129 | | - User user = em.find(User.class, username); |
|---|
| 130 | | - if (user != null) { |
|---|
| 131 | | - userOrgs = user.getAllOrgsIds(); |
|---|
| 132 | | - // We store user orgs in cache only for one hour |
|---|
| 133 | | - cache.set("orgs_" + username, userOrgs, 3600); |
|---|
| 134 | | - } |
|---|
| 135 | | - } |
|---|
| 136 | | - |
|---|
| 137 | | - return userOrgs; |
|---|
| 138 | | - } |
|---|
| 139 | | - |
|---|
| 140 | | - private Set<Integer> getUserApplications(String username) { |
|---|
| 141 | | - @SuppressWarnings("unchecked") |
|---|
| 142 | | - Set<Integer> userApps = cache.get("apps_" + username, Set.class); |
|---|
| 143 | | - if (userApps == null) { |
|---|
| 144 | | - EntityManager em = ResteasyProviderFactory.getContextData(EntityManager.class); |
|---|
| 145 | | - |
|---|
| 146 | | - // Theorically this shouldn't be never null, but just in case... |
|---|
| 147 | | - User user = em.find(User.class, username); |
|---|
| 148 | | - if (user != null) { |
|---|
| 149 | | - userApps = user.getAllAppsIds(); |
|---|
| 150 | | - // We store user orgs in cache only for one hour |
|---|
| 151 | | - cache.set("apps_" + username, userApps, 3600); |
|---|
| 152 | | - } |
|---|
| 153 | | - } |
|---|
| 154 | | - |
|---|
| 155 | | - return userApps; |
|---|
| 156 | 103 | } |
|---|
| 157 | 104 | |
|---|
| 158 | 105 | private int getUserRoles(String username) { |
|---|
| 159 | | - if (username == null) { |
|---|
| 160 | | - return 0; |
|---|
| 161 | | - } |
|---|
| 162 | | - Integer userRoles = cache.get("roles_" + username, Integer.class); |
|---|
| 163 | | - if (userRoles == null) { |
|---|
| 164 | | - EntityManager em = ResteasyProviderFactory.getContextData(EntityManager.class); |
|---|
| 106 | + if (username == null) return 0; |
|---|
| 107 | + Integer cached = cache.get("roles_" + username, Integer.class); |
|---|
| 108 | + if (cached != null) return cached; |
|---|
| 165 | 109 | |
|---|
| 166 | | - User user = em.find(User.class, username); |
|---|
| 167 | | - if (user != null) { |
|---|
| 168 | | - userRoles = 0; |
|---|
| 169 | | - List<Integer> roles = user.getRoles(); |
|---|
| 170 | | - if (roles != null) { |
|---|
| 171 | | - for (Integer rol : roles) { |
|---|
| 172 | | - userRoles += rol; |
|---|
| 173 | | - } |
|---|
| 174 | | - } |
|---|
| 175 | | - // We store user roles in cache only for one hour |
|---|
| 176 | | - cache.set("roles_" + username, userRoles, 3600); |
|---|
| 177 | | - cache.set("orgs_" + username, user.getOrgsIds(), 3600); |
|---|
| 178 | | - } |
|---|
| 110 | + EntityManager em = emProvider.getEntityManager(); |
|---|
| 111 | + User user = em.find(User.class, username); |
|---|
| 112 | + int roles = 0; |
|---|
| 113 | + if (user != null) { |
|---|
| 114 | + List<Integer> r = user.getRoles(); |
|---|
| 115 | + if (r != null) for (Integer role : r) roles += role; |
|---|
| 116 | + cache.set("roles_" + username, roles, 3600); |
|---|
| 117 | + cache.set("orgs_" + username, user.getOrgsIds(), 3600); |
|---|
| 179 | 118 | } |
|---|
| 180 | | - return userRoles == null ? 0 : userRoles.intValue(); |
|---|
| 119 | + return roles; |
|---|
| 181 | 120 | } |
|---|
| 182 | 121 | |
|---|
| 183 | | - // @Override |
|---|
| 184 | | - public ServerResponse preProcess(HttpRequest request, ResourceMethodInvoker method) throws Failure, WebApplicationException { |
|---|
| 185 | | - return null; |
|---|
| 122 | + private Set<Integer> getUserOrganizations(String username) { |
|---|
| 123 | + Set<Integer> cached = cache.get("orgs_" + username, Set.class); |
|---|
| 124 | + if (cached != null) return cached; |
|---|
| 125 | + User user = emProvider.getEntityManager().find(User.class, username); |
|---|
| 126 | + if (user != null) { |
|---|
| 127 | + Set<Integer> result = user.getAllOrgsIds(); |
|---|
| 128 | + cache.set("orgs_" + username, result, 3600); |
|---|
| 129 | + return result; |
|---|
| 130 | + } |
|---|
| 131 | + return Set.of(); |
|---|
| 132 | + } |
|---|
| 133 | + |
|---|
| 134 | + private Set<Integer> getUserApplications(String username) { |
|---|
| 135 | + Set<Integer> cached = cache.get("apps_" + username, Set.class); |
|---|
| 136 | + if (cached != null) return cached; |
|---|
| 137 | + User user = emProvider.getEntityManager().find(User.class, username); |
|---|
| 138 | + if (user != null) { |
|---|
| 139 | + Set<Integer> result = user.getAllAppsIds(); |
|---|
| 140 | + cache.set("apps_" + username, result, 3600); |
|---|
| 141 | + return result; |
|---|
| 142 | + } |
|---|
| 143 | + return Set.of(); |
|---|
| 186 | 144 | } |
|---|
| 187 | 145 | |
|---|
| 188 | 146 | @Override |
|---|
| 189 | 147 | public void aroundWriteTo(WriterInterceptorContext context) throws IOException, WebApplicationException { |
|---|
| 190 | 148 | context.proceed(); |
|---|
| 191 | | - EntityManager em = ResteasyProviderFactory.getContextData(EntityManager.class); |
|---|
| 149 | + |
|---|
| 150 | + EntityManager em = (EntityManager) context.getProperty(EM_CONTEXT_PROPERTY); |
|---|
| 151 | + if (em == null) return; |
|---|
| 152 | + |
|---|
| 192 | 153 | try { |
|---|
| 193 | | - if (em != null && em.getTransaction().isActive()) { |
|---|
| 154 | + if (em.getTransaction().isActive()) { |
|---|
| 194 | 155 | if (servletResponse.getStatus() == Status.OK.getStatusCode()) { |
|---|
| 195 | 156 | em.getTransaction().commit(); |
|---|
| 196 | | - LOG.debug("COMMIT"); |
|---|
| 157 | + LOG.debug("Transaction committed"); |
|---|
| 197 | 158 | } else { |
|---|
| 198 | | - // This code is never executed if there is an error the |
|---|
| 199 | | - // filter chain is broken |
|---|
| 200 | 159 | em.getTransaction().rollback(); |
|---|
| 201 | | - LOG.debug("ROLLBACK"); |
|---|
| 160 | + LOG.debug("Transaction rolled back"); |
|---|
| 202 | 161 | } |
|---|
| 203 | 162 | } |
|---|
| 204 | 163 | } finally { |
|---|
| 205 | 164 | if (em.isOpen()) { |
|---|
| 206 | | - LOG.debug("CLOSING EM: {}, trans: {}", em, em.isJoinedToTransaction()); |
|---|
| 207 | 165 | try { |
|---|
| 208 | 166 | em.close(); |
|---|
| 209 | | - } catch (Exception ex) { |
|---|
| 210 | | - ex.printStackTrace(); |
|---|
| 211 | | - LOG.error("Error closing EM: {}, {}", em, ex); |
|---|
| 167 | + } catch (Exception e) { |
|---|
| 168 | + LOG.error("Error closing EntityManager", e); |
|---|
| 212 | 169 | } |
|---|
| 213 | 170 | } |
|---|
| 214 | 171 | } |
|---|
| 215 | 172 | } |
|---|
| 216 | | - |
|---|
| 217 | 173 | } |
|---|
| .. | .. |
|---|
| 7 | 7 | import java.util.List; |
|---|
| 8 | 8 | import java.util.Properties; |
|---|
| 9 | 9 | |
|---|
| 10 | | -import javax.enterprise.context.ApplicationScoped; |
|---|
| 11 | | -import javax.inject.Named; |
|---|
| 12 | | -import javax.ws.rs.core.UriBuilder; |
|---|
| 13 | | -import javax.ws.rs.core.UriBuilderException; |
|---|
| 10 | +import jakarta.enterprise.context.ApplicationScoped; |
|---|
| 11 | +import jakarta.inject.Named; |
|---|
| 12 | +import jakarta.ws.rs.core.UriBuilder; |
|---|
| 13 | +import jakarta.ws.rs.core.UriBuilderException; |
|---|
| 14 | 14 | |
|---|
| 15 | 15 | import org.apache.logging.log4j.LogManager; |
|---|
| 16 | 16 | import org.apache.logging.log4j.Logger; |
|---|
| .. | .. |
|---|
| 4 | 4 | import java.util.Map; |
|---|
| 5 | 5 | import java.util.Set; |
|---|
| 6 | 6 | |
|---|
| 7 | | -import javax.ws.rs.core.SecurityContext; |
|---|
| 7 | +import jakarta.ws.rs.core.SecurityContext; |
|---|
| 8 | 8 | |
|---|
| 9 | 9 | import net.curisit.integrity.commons.Utils; |
|---|
| 10 | 10 | import net.curisit.securis.db.User; |
|---|
| .. | .. |
|---|
| 4 | 4 | import java.util.Date; |
|---|
| 5 | 5 | import java.util.List; |
|---|
| 6 | 6 | |
|---|
| 7 | | -import javax.inject.Inject; |
|---|
| 8 | | -import javax.persistence.EntityManager; |
|---|
| 9 | | -import javax.persistence.NoResultException; |
|---|
| 10 | | -import javax.ws.rs.Consumes; |
|---|
| 11 | | -import javax.ws.rs.GET; |
|---|
| 12 | | -import javax.ws.rs.HeaderParam; |
|---|
| 13 | | -import javax.ws.rs.POST; |
|---|
| 14 | | -import javax.ws.rs.Path; |
|---|
| 15 | | -import javax.ws.rs.Produces; |
|---|
| 16 | | -import javax.ws.rs.core.Context; |
|---|
| 17 | | -import javax.ws.rs.core.MediaType; |
|---|
| 18 | | -import javax.ws.rs.core.Response; |
|---|
| 7 | +import jakarta.inject.Inject; |
|---|
| 8 | +import jakarta.persistence.EntityManager; |
|---|
| 9 | +import jakarta.persistence.NoResultException; |
|---|
| 10 | +import jakarta.ws.rs.Consumes; |
|---|
| 11 | +import jakarta.ws.rs.GET; |
|---|
| 12 | +import jakarta.ws.rs.HeaderParam; |
|---|
| 13 | +import jakarta.ws.rs.POST; |
|---|
| 14 | +import jakarta.ws.rs.Path; |
|---|
| 15 | +import jakarta.ws.rs.Produces; |
|---|
| 16 | +import jakarta.ws.rs.core.Context; |
|---|
| 17 | +import jakarta.ws.rs.core.MediaType; |
|---|
| 18 | +import jakarta.ws.rs.core.Response; |
|---|
| 19 | 19 | |
|---|
| 20 | | -import org.apache.commons.lang.time.DateUtils; |
|---|
| 20 | +import org.apache.commons.lang3.time.DateUtils; |
|---|
| 21 | 21 | import org.apache.logging.log4j.LogManager; |
|---|
| 22 | 22 | import org.apache.logging.log4j.Logger; |
|---|
| 23 | 23 | import org.jboss.resteasy.plugins.providers.multipart.MultipartFormDataInput; |
|---|
| .. | .. |
|---|
| 6 | 6 | import java.util.Map; |
|---|
| 7 | 7 | import java.util.Set; |
|---|
| 8 | 8 | |
|---|
| 9 | | -import javax.annotation.security.RolesAllowed; |
|---|
| 10 | | -import javax.inject.Inject; |
|---|
| 11 | | -import javax.persistence.EntityManager; |
|---|
| 12 | | -import javax.persistence.TypedQuery; |
|---|
| 13 | | -import javax.servlet.http.HttpServletRequest; |
|---|
| 14 | | -import javax.ws.rs.Consumes; |
|---|
| 15 | | -import javax.ws.rs.DELETE; |
|---|
| 16 | | -import javax.ws.rs.GET; |
|---|
| 17 | | -import javax.ws.rs.HeaderParam; |
|---|
| 18 | | -import javax.ws.rs.POST; |
|---|
| 19 | | -import javax.ws.rs.PUT; |
|---|
| 20 | | -import javax.ws.rs.Path; |
|---|
| 21 | | -import javax.ws.rs.PathParam; |
|---|
| 22 | | -import javax.ws.rs.Produces; |
|---|
| 23 | | -import javax.ws.rs.core.Context; |
|---|
| 24 | | -import javax.ws.rs.core.MediaType; |
|---|
| 25 | | -import javax.ws.rs.core.Response; |
|---|
| 26 | | -import javax.ws.rs.core.Response.Status; |
|---|
| 9 | +import jakarta.annotation.security.RolesAllowed; |
|---|
| 10 | +import jakarta.inject.Inject; |
|---|
| 11 | +import jakarta.persistence.EntityManager; |
|---|
| 12 | +import jakarta.persistence.TypedQuery; |
|---|
| 13 | +import jakarta.servlet.http.HttpServletRequest; |
|---|
| 14 | +import jakarta.ws.rs.Consumes; |
|---|
| 15 | +import jakarta.ws.rs.DELETE; |
|---|
| 16 | +import jakarta.ws.rs.GET; |
|---|
| 17 | +import jakarta.ws.rs.HeaderParam; |
|---|
| 18 | +import jakarta.ws.rs.POST; |
|---|
| 19 | +import jakarta.ws.rs.PUT; |
|---|
| 20 | +import jakarta.ws.rs.Path; |
|---|
| 21 | +import jakarta.ws.rs.PathParam; |
|---|
| 22 | +import jakarta.ws.rs.Produces; |
|---|
| 23 | +import jakarta.ws.rs.core.Context; |
|---|
| 24 | +import jakarta.ws.rs.core.MediaType; |
|---|
| 25 | +import jakarta.ws.rs.core.Response; |
|---|
| 26 | +import jakarta.ws.rs.core.Response.Status; |
|---|
| 27 | 27 | |
|---|
| 28 | 28 | import org.apache.logging.log4j.LogManager; |
|---|
| 29 | 29 | import org.apache.logging.log4j.Logger; |
|---|
| .. | .. |
|---|
| 5 | 5 | import java.util.HashMap; |
|---|
| 6 | 6 | import java.util.Map; |
|---|
| 7 | 7 | |
|---|
| 8 | | -import javax.enterprise.context.ApplicationScoped; |
|---|
| 9 | | -import javax.inject.Inject; |
|---|
| 10 | | -import javax.persistence.EntityManager; |
|---|
| 11 | | -import javax.servlet.http.HttpServletRequest; |
|---|
| 12 | | -import javax.ws.rs.GET; |
|---|
| 13 | | -import javax.ws.rs.HeaderParam; |
|---|
| 14 | | -import javax.ws.rs.POST; |
|---|
| 15 | | -import javax.ws.rs.Path; |
|---|
| 16 | | -import javax.ws.rs.PathParam; |
|---|
| 17 | | -import javax.ws.rs.Produces; |
|---|
| 18 | | -import javax.ws.rs.QueryParam; |
|---|
| 19 | | -import javax.ws.rs.core.Context; |
|---|
| 20 | | -import javax.ws.rs.core.MediaType; |
|---|
| 21 | | -import javax.ws.rs.core.Response; |
|---|
| 22 | | -import javax.ws.rs.core.Response.Status; |
|---|
| 23 | | -import javax.ws.rs.core.UriBuilder; |
|---|
| 8 | +import jakarta.enterprise.context.ApplicationScoped; |
|---|
| 9 | +import jakarta.inject.Inject; |
|---|
| 10 | +import jakarta.persistence.EntityManager; |
|---|
| 11 | +import jakarta.servlet.http.HttpServletRequest; |
|---|
| 12 | +import jakarta.ws.rs.GET; |
|---|
| 13 | +import jakarta.ws.rs.HeaderParam; |
|---|
| 14 | +import jakarta.ws.rs.POST; |
|---|
| 15 | +import jakarta.ws.rs.Path; |
|---|
| 16 | +import jakarta.ws.rs.PathParam; |
|---|
| 17 | +import jakarta.ws.rs.Produces; |
|---|
| 18 | +import jakarta.ws.rs.QueryParam; |
|---|
| 19 | +import jakarta.ws.rs.core.Context; |
|---|
| 20 | +import jakarta.ws.rs.core.MediaType; |
|---|
| 21 | +import jakarta.ws.rs.core.Response; |
|---|
| 22 | +import jakarta.ws.rs.core.Response.Status; |
|---|
| 23 | +import jakarta.ws.rs.core.UriBuilder; |
|---|
| 24 | 24 | |
|---|
| 25 | 25 | import org.apache.logging.log4j.LogManager; |
|---|
| 26 | 26 | import org.apache.logging.log4j.Logger; |
|---|
| .. | .. |
|---|
| 6 | 6 | import java.util.Date; |
|---|
| 7 | 7 | import java.util.List; |
|---|
| 8 | 8 | |
|---|
| 9 | | -import javax.inject.Inject; |
|---|
| 10 | | -import javax.persistence.EntityManager; |
|---|
| 11 | | -import javax.persistence.TypedQuery; |
|---|
| 12 | | -import javax.ws.rs.Consumes; |
|---|
| 13 | | -import javax.ws.rs.DELETE; |
|---|
| 14 | | -import javax.ws.rs.DefaultValue; |
|---|
| 15 | | -import javax.ws.rs.FormParam; |
|---|
| 16 | | -import javax.ws.rs.GET; |
|---|
| 17 | | -import javax.ws.rs.POST; |
|---|
| 18 | | -import javax.ws.rs.PUT; |
|---|
| 19 | | -import javax.ws.rs.Path; |
|---|
| 20 | | -import javax.ws.rs.PathParam; |
|---|
| 21 | | -import javax.ws.rs.Produces; |
|---|
| 22 | | -import javax.ws.rs.QueryParam; |
|---|
| 23 | | -import javax.ws.rs.core.Context; |
|---|
| 24 | | -import javax.ws.rs.core.MediaType; |
|---|
| 25 | | -import javax.ws.rs.core.Response; |
|---|
| 26 | | -import javax.ws.rs.core.Response.Status; |
|---|
| 9 | +import jakarta.inject.Inject; |
|---|
| 10 | +import jakarta.persistence.EntityManager; |
|---|
| 11 | +import jakarta.persistence.TypedQuery; |
|---|
| 12 | +import jakarta.ws.rs.Consumes; |
|---|
| 13 | +import jakarta.ws.rs.DELETE; |
|---|
| 14 | +import jakarta.ws.rs.DefaultValue; |
|---|
| 15 | +import jakarta.ws.rs.FormParam; |
|---|
| 16 | +import jakarta.ws.rs.GET; |
|---|
| 17 | +import jakarta.ws.rs.POST; |
|---|
| 18 | +import jakarta.ws.rs.PUT; |
|---|
| 19 | +import jakarta.ws.rs.Path; |
|---|
| 20 | +import jakarta.ws.rs.PathParam; |
|---|
| 21 | +import jakarta.ws.rs.Produces; |
|---|
| 22 | +import jakarta.ws.rs.QueryParam; |
|---|
| 23 | +import jakarta.ws.rs.core.Context; |
|---|
| 24 | +import jakarta.ws.rs.core.MediaType; |
|---|
| 25 | +import jakarta.ws.rs.core.Response; |
|---|
| 26 | +import jakarta.ws.rs.core.Response.Status; |
|---|
| 27 | 27 | |
|---|
| 28 | 28 | import org.apache.commons.io.IOUtils; |
|---|
| 29 | 29 | import org.apache.commons.lang3.ObjectUtils; |
|---|
| .. | .. |
|---|
| 6 | 6 | import java.util.Set; |
|---|
| 7 | 7 | import java.util.stream.Collectors; |
|---|
| 8 | 8 | |
|---|
| 9 | | -import javax.annotation.security.RolesAllowed; |
|---|
| 10 | | -import javax.inject.Inject; |
|---|
| 11 | | -import javax.persistence.EntityManager; |
|---|
| 12 | | -import javax.persistence.TypedQuery; |
|---|
| 13 | | -import javax.servlet.http.HttpServletRequest; |
|---|
| 14 | | -import javax.ws.rs.Consumes; |
|---|
| 15 | | -import javax.ws.rs.DELETE; |
|---|
| 16 | | -import javax.ws.rs.GET; |
|---|
| 17 | | -import javax.ws.rs.HeaderParam; |
|---|
| 18 | | -import javax.ws.rs.POST; |
|---|
| 19 | | -import javax.ws.rs.PUT; |
|---|
| 20 | | -import javax.ws.rs.Path; |
|---|
| 21 | | -import javax.ws.rs.PathParam; |
|---|
| 22 | | -import javax.ws.rs.Produces; |
|---|
| 23 | | -import javax.ws.rs.core.Context; |
|---|
| 24 | | -import javax.ws.rs.core.MediaType; |
|---|
| 25 | | -import javax.ws.rs.core.Response; |
|---|
| 26 | | -import javax.ws.rs.core.Response.Status; |
|---|
| 9 | +import jakarta.annotation.security.RolesAllowed; |
|---|
| 10 | +import jakarta.inject.Inject; |
|---|
| 11 | +import jakarta.persistence.EntityManager; |
|---|
| 12 | +import jakarta.persistence.TypedQuery; |
|---|
| 13 | +import jakarta.servlet.http.HttpServletRequest; |
|---|
| 14 | +import jakarta.ws.rs.Consumes; |
|---|
| 15 | +import jakarta.ws.rs.DELETE; |
|---|
| 16 | +import jakarta.ws.rs.GET; |
|---|
| 17 | +import jakarta.ws.rs.HeaderParam; |
|---|
| 18 | +import jakarta.ws.rs.POST; |
|---|
| 19 | +import jakarta.ws.rs.PUT; |
|---|
| 20 | +import jakarta.ws.rs.Path; |
|---|
| 21 | +import jakarta.ws.rs.PathParam; |
|---|
| 22 | +import jakarta.ws.rs.Produces; |
|---|
| 23 | +import jakarta.ws.rs.core.Context; |
|---|
| 24 | +import jakarta.ws.rs.core.MediaType; |
|---|
| 25 | +import jakarta.ws.rs.core.Response; |
|---|
| 26 | +import jakarta.ws.rs.core.Response.Status; |
|---|
| 27 | 27 | |
|---|
| 28 | 28 | import org.apache.logging.log4j.LogManager; |
|---|
| 29 | 29 | import org.apache.logging.log4j.Logger; |
|---|
| .. | .. |
|---|
| 5 | 5 | import java.util.List; |
|---|
| 6 | 6 | import java.util.Set; |
|---|
| 7 | 7 | |
|---|
| 8 | | -import javax.annotation.security.RolesAllowed; |
|---|
| 9 | | -import javax.enterprise.context.RequestScoped; |
|---|
| 10 | | -import javax.persistence.EntityManager; |
|---|
| 11 | | -import javax.persistence.TypedQuery; |
|---|
| 12 | | -import javax.servlet.http.HttpServletRequest; |
|---|
| 13 | | -import javax.ws.rs.Consumes; |
|---|
| 14 | | -import javax.ws.rs.DELETE; |
|---|
| 15 | | -import javax.ws.rs.GET; |
|---|
| 16 | | -import javax.ws.rs.HeaderParam; |
|---|
| 17 | | -import javax.ws.rs.POST; |
|---|
| 18 | | -import javax.ws.rs.PUT; |
|---|
| 19 | | -import javax.ws.rs.Path; |
|---|
| 20 | | -import javax.ws.rs.PathParam; |
|---|
| 21 | | -import javax.ws.rs.Produces; |
|---|
| 22 | | -import javax.ws.rs.core.Context; |
|---|
| 23 | | -import javax.ws.rs.core.MediaType; |
|---|
| 24 | | -import javax.ws.rs.core.Response; |
|---|
| 25 | | -import javax.ws.rs.core.Response.Status; |
|---|
| 8 | +import jakarta.annotation.security.RolesAllowed; |
|---|
| 9 | +import jakarta.enterprise.context.RequestScoped; |
|---|
| 10 | +import jakarta.persistence.EntityManager; |
|---|
| 11 | +import jakarta.persistence.TypedQuery; |
|---|
| 12 | +import jakarta.servlet.http.HttpServletRequest; |
|---|
| 13 | +import jakarta.ws.rs.Consumes; |
|---|
| 14 | +import jakarta.ws.rs.DELETE; |
|---|
| 15 | +import jakarta.ws.rs.GET; |
|---|
| 16 | +import jakarta.ws.rs.HeaderParam; |
|---|
| 17 | +import jakarta.ws.rs.POST; |
|---|
| 18 | +import jakarta.ws.rs.PUT; |
|---|
| 19 | +import jakarta.ws.rs.Path; |
|---|
| 20 | +import jakarta.ws.rs.PathParam; |
|---|
| 21 | +import jakarta.ws.rs.Produces; |
|---|
| 22 | +import jakarta.ws.rs.core.Context; |
|---|
| 23 | +import jakarta.ws.rs.core.MediaType; |
|---|
| 24 | +import jakarta.ws.rs.core.Response; |
|---|
| 25 | +import jakarta.ws.rs.core.Response.Status; |
|---|
| 26 | 26 | |
|---|
| 27 | 27 | import org.apache.logging.log4j.LogManager; |
|---|
| 28 | 28 | import org.apache.logging.log4j.Logger; |
|---|
| .. | .. |
|---|
| 7 | 7 | import java.util.List; |
|---|
| 8 | 8 | import java.util.Set; |
|---|
| 9 | 9 | |
|---|
| 10 | | -import javax.annotation.security.RolesAllowed; |
|---|
| 11 | | -import javax.inject.Inject; |
|---|
| 12 | | -import javax.persistence.EntityManager; |
|---|
| 13 | | -import javax.persistence.TypedQuery; |
|---|
| 14 | | -import javax.ws.rs.Consumes; |
|---|
| 15 | | -import javax.ws.rs.DELETE; |
|---|
| 16 | | -import javax.ws.rs.FormParam; |
|---|
| 17 | | -import javax.ws.rs.GET; |
|---|
| 18 | | -import javax.ws.rs.POST; |
|---|
| 19 | | -import javax.ws.rs.PUT; |
|---|
| 20 | | -import javax.ws.rs.Path; |
|---|
| 21 | | -import javax.ws.rs.PathParam; |
|---|
| 22 | | -import javax.ws.rs.Produces; |
|---|
| 23 | | -import javax.ws.rs.core.Context; |
|---|
| 24 | | -import javax.ws.rs.core.MediaType; |
|---|
| 25 | | -import javax.ws.rs.core.MultivaluedMap; |
|---|
| 26 | | -import javax.ws.rs.core.Response; |
|---|
| 27 | | -import javax.ws.rs.core.Response.Status; |
|---|
| 28 | | -import javax.ws.rs.core.UriInfo; |
|---|
| 10 | +import jakarta.annotation.security.RolesAllowed; |
|---|
| 11 | +import jakarta.inject.Inject; |
|---|
| 12 | +import jakarta.persistence.EntityManager; |
|---|
| 13 | +import jakarta.persistence.TypedQuery; |
|---|
| 14 | +import jakarta.ws.rs.Consumes; |
|---|
| 15 | +import jakarta.ws.rs.DELETE; |
|---|
| 16 | +import jakarta.ws.rs.FormParam; |
|---|
| 17 | +import jakarta.ws.rs.GET; |
|---|
| 18 | +import jakarta.ws.rs.POST; |
|---|
| 19 | +import jakarta.ws.rs.PUT; |
|---|
| 20 | +import jakarta.ws.rs.Path; |
|---|
| 21 | +import jakarta.ws.rs.PathParam; |
|---|
| 22 | +import jakarta.ws.rs.Produces; |
|---|
| 23 | +import jakarta.ws.rs.core.Context; |
|---|
| 24 | +import jakarta.ws.rs.core.MediaType; |
|---|
| 25 | +import jakarta.ws.rs.core.MultivaluedMap; |
|---|
| 26 | +import jakarta.ws.rs.core.Response; |
|---|
| 27 | +import jakarta.ws.rs.core.Response.Status; |
|---|
| 28 | +import jakarta.ws.rs.core.UriInfo; |
|---|
| 29 | 29 | |
|---|
| 30 | 30 | import org.apache.logging.log4j.LogManager; |
|---|
| 31 | 31 | import org.apache.logging.log4j.Logger; |
|---|
| .. | .. |
|---|
| 5 | 5 | import java.util.List; |
|---|
| 6 | 6 | import java.util.Set; |
|---|
| 7 | 7 | |
|---|
| 8 | | -import javax.annotation.security.RolesAllowed; |
|---|
| 9 | | -import javax.enterprise.context.RequestScoped; |
|---|
| 10 | | -import javax.inject.Inject; |
|---|
| 11 | | -import javax.persistence.EntityManager; |
|---|
| 12 | | -import javax.persistence.PersistenceException; |
|---|
| 13 | | -import javax.persistence.TypedQuery; |
|---|
| 14 | | -import javax.servlet.http.HttpServletRequest; |
|---|
| 15 | | -import javax.ws.rs.Consumes; |
|---|
| 16 | | -import javax.ws.rs.DELETE; |
|---|
| 17 | | -import javax.ws.rs.FormParam; |
|---|
| 18 | | -import javax.ws.rs.GET; |
|---|
| 19 | | -import javax.ws.rs.HeaderParam; |
|---|
| 20 | | -import javax.ws.rs.POST; |
|---|
| 21 | | -import javax.ws.rs.PUT; |
|---|
| 22 | | -import javax.ws.rs.Path; |
|---|
| 23 | | -import javax.ws.rs.PathParam; |
|---|
| 24 | | -import javax.ws.rs.Produces; |
|---|
| 25 | | -import javax.ws.rs.QueryParam; |
|---|
| 26 | | -import javax.ws.rs.core.Context; |
|---|
| 27 | | -import javax.ws.rs.core.MediaType; |
|---|
| 28 | | -import javax.ws.rs.core.Response; |
|---|
| 29 | | -import javax.ws.rs.core.Response.Status; |
|---|
| 8 | +import jakarta.annotation.security.RolesAllowed; |
|---|
| 9 | +import jakarta.enterprise.context.RequestScoped; |
|---|
| 10 | +import jakarta.inject.Inject; |
|---|
| 11 | +import jakarta.persistence.EntityManager; |
|---|
| 12 | +import jakarta.persistence.PersistenceException; |
|---|
| 13 | +import jakarta.persistence.TypedQuery; |
|---|
| 14 | +import jakarta.servlet.http.HttpServletRequest; |
|---|
| 15 | +import jakarta.ws.rs.Consumes; |
|---|
| 16 | +import jakarta.ws.rs.DELETE; |
|---|
| 17 | +import jakarta.ws.rs.FormParam; |
|---|
| 18 | +import jakarta.ws.rs.GET; |
|---|
| 19 | +import jakarta.ws.rs.HeaderParam; |
|---|
| 20 | +import jakarta.ws.rs.POST; |
|---|
| 21 | +import jakarta.ws.rs.PUT; |
|---|
| 22 | +import jakarta.ws.rs.Path; |
|---|
| 23 | +import jakarta.ws.rs.PathParam; |
|---|
| 24 | +import jakarta.ws.rs.Produces; |
|---|
| 25 | +import jakarta.ws.rs.QueryParam; |
|---|
| 26 | +import jakarta.ws.rs.core.Context; |
|---|
| 27 | +import jakarta.ws.rs.core.MediaType; |
|---|
| 28 | +import jakarta.ws.rs.core.Response; |
|---|
| 29 | +import jakarta.ws.rs.core.Response.Status; |
|---|
| 30 | 30 | |
|---|
| 31 | 31 | import org.apache.logging.log4j.LogManager; |
|---|
| 32 | 32 | import org.apache.logging.log4j.Logger; |
|---|
| .. | .. |
|---|
| 9 | 9 | import java.util.Map; |
|---|
| 10 | 10 | import java.util.Set; |
|---|
| 11 | 11 | |
|---|
| 12 | | -import javax.enterprise.context.ApplicationScoped; |
|---|
| 13 | | -import javax.inject.Inject; |
|---|
| 14 | | -import javax.persistence.EntityManager; |
|---|
| 15 | | -import javax.persistence.TypedQuery; |
|---|
| 12 | +import jakarta.enterprise.context.ApplicationScoped; |
|---|
| 13 | +import jakarta.inject.Inject; |
|---|
| 14 | +import jakarta.persistence.EntityManager; |
|---|
| 15 | +import jakarta.persistence.TypedQuery; |
|---|
| 16 | 16 | |
|---|
| 17 | 17 | import org.apache.commons.io.FileUtils; |
|---|
| 18 | 18 | import org.apache.logging.log4j.LogManager; |
|---|
| .. | .. |
|---|
| 7 | 7 | import java.util.Set; |
|---|
| 8 | 8 | import java.util.stream.Collectors; |
|---|
| 9 | 9 | |
|---|
| 10 | | -import javax.enterprise.context.ApplicationScoped; |
|---|
| 11 | | -import javax.persistence.EntityManager; |
|---|
| 12 | | -import javax.persistence.TypedQuery; |
|---|
| 10 | +import jakarta.enterprise.context.ApplicationScoped; |
|---|
| 11 | +import jakarta.persistence.EntityManager; |
|---|
| 12 | +import jakarta.persistence.TypedQuery; |
|---|
| 13 | 13 | |
|---|
| 14 | 14 | import org.apache.logging.log4j.LogManager; |
|---|
| 15 | 15 | import org.apache.logging.log4j.Logger; |
|---|
| .. | .. |
|---|
| 1 | 1 | package net.curisit.securis.services.helpers; |
|---|
| 2 | 2 | |
|---|
| 3 | | -import javax.enterprise.context.ApplicationScoped; |
|---|
| 4 | | -import javax.persistence.EntityManager; |
|---|
| 5 | | -import javax.ws.rs.core.Response.Status; |
|---|
| 3 | +import jakarta.enterprise.context.ApplicationScoped; |
|---|
| 4 | +import jakarta.persistence.EntityManager; |
|---|
| 5 | +import jakarta.ws.rs.core.Response.Status; |
|---|
| 6 | 6 | |
|---|
| 7 | 7 | import net.curisit.securis.db.User; |
|---|
| 8 | 8 | import net.curisit.securis.security.BasicSecurityContext; |
|---|
| .. | .. |
|---|
| 6 | 6 | import java.util.List; |
|---|
| 7 | 7 | import java.util.Map; |
|---|
| 8 | 8 | |
|---|
| 9 | | -import javax.enterprise.context.ApplicationScoped; |
|---|
| 10 | | -import javax.inject.Inject; |
|---|
| 9 | +import jakarta.enterprise.context.ApplicationScoped; |
|---|
| 10 | +import jakarta.inject.Inject; |
|---|
| 11 | 11 | |
|---|
| 12 | 12 | import org.apache.logging.log4j.LogManager; |
|---|
| 13 | 13 | import org.apache.logging.log4j.Logger; |
|---|
| .. | .. |
|---|
| 14 | 14 | import java.util.concurrent.Executor; |
|---|
| 15 | 15 | import java.util.concurrent.Executors; |
|---|
| 16 | 16 | |
|---|
| 17 | | -import javax.enterprise.context.ApplicationScoped; |
|---|
| 17 | +import jakarta.enterprise.context.ApplicationScoped; |
|---|
| 18 | 18 | |
|---|
| 19 | 19 | import net.curisit.securis.SeCurisException; |
|---|
| 20 | 20 | import net.curisit.securis.services.exception.SeCurisServiceException; |
|---|
| .. | .. |
|---|
| 5 | 5 | import java.io.PrintWriter; |
|---|
| 6 | 6 | import java.util.zip.GZIPOutputStream; |
|---|
| 7 | 7 | |
|---|
| 8 | | -import javax.servlet.ServletOutputStream; |
|---|
| 9 | | -import javax.servlet.WriteListener; |
|---|
| 10 | | -import javax.servlet.http.HttpServletResponse; |
|---|
| 11 | | -import javax.servlet.http.HttpServletResponseWrapper; |
|---|
| 8 | +import jakarta.servlet.ServletOutputStream; |
|---|
| 9 | +import jakarta.servlet.WriteListener; |
|---|
| 10 | +import jakarta.servlet.http.HttpServletResponse; |
|---|
| 11 | +import jakarta.servlet.http.HttpServletResponseWrapper; |
|---|
| 12 | 12 | |
|---|
| 13 | 13 | public class GZipServletResponseWrapper extends HttpServletResponseWrapper { |
|---|
| 14 | 14 | |
|---|
| .. | .. |
|---|
| 7 | 7 | import java.security.NoSuchAlgorithmException; |
|---|
| 8 | 8 | import java.util.Date; |
|---|
| 9 | 9 | |
|---|
| 10 | | -import javax.enterprise.context.ApplicationScoped; |
|---|
| 11 | | -import javax.inject.Inject; |
|---|
| 10 | +import jakarta.enterprise.context.ApplicationScoped; |
|---|
| 11 | +import jakarta.inject.Inject; |
|---|
| 12 | 12 | |
|---|
| 13 | 13 | import net.curisit.integrity.commons.Utils; |
|---|
| 14 | 14 | import net.curisit.securis.services.ApiResource; |
|---|
| .. | .. |
|---|
| 16 | 16 | import org.apache.commons.lang3.StringUtils; |
|---|
| 17 | 17 | import org.apache.logging.log4j.LogManager; |
|---|
| 18 | 18 | import org.apache.logging.log4j.Logger; |
|---|
| 19 | | -import org.jboss.resteasy.util.Base64; |
|---|
| 19 | + |
|---|
| 20 | +import java.util.Base64; |
|---|
| 21 | +import java.nio.charset.StandardCharsets; |
|---|
| 20 | 22 | |
|---|
| 21 | 23 | @ApplicationScoped |
|---|
| 22 | 24 | public class TokenHelper { |
|---|
| .. | .. |
|---|
| 47 | 49 | return generateToken(user, new Date()); |
|---|
| 48 | 50 | } |
|---|
| 49 | 51 | |
|---|
| 52 | + ; |
|---|
| 53 | + |
|---|
| 50 | 54 | public String generateToken(String user, Date date) { |
|---|
| 51 | 55 | try { |
|---|
| 52 | 56 | String secret = generateSecret(user, date); |
|---|
| 53 | | - StringBuffer sb = new StringBuffer(); |
|---|
| 57 | + StringBuilder sb = new StringBuilder(); |
|---|
| 54 | 58 | sb.append(secret); |
|---|
| 55 | 59 | sb.append(' '); |
|---|
| 56 | 60 | sb.append(user); |
|---|
| 57 | 61 | sb.append(' '); |
|---|
| 58 | 62 | sb.append(Utils.toIsoFormat(date)); |
|---|
| 59 | | - return Base64.encodeBytes(sb.toString().getBytes("utf-8")); |
|---|
| 63 | + |
|---|
| 64 | + // Codificación estándar con UTF-8 |
|---|
| 65 | + return Base64.getEncoder().encodeToString(sb.toString().getBytes(StandardCharsets.UTF_8)); |
|---|
| 66 | + |
|---|
| 60 | 67 | } catch (NoSuchAlgorithmException e) { |
|---|
| 61 | 68 | LOG.error("Error generating SHA-256 hash", e); |
|---|
| 62 | 69 | } catch (UnsupportedEncodingException e) { |
|---|
| .. | .. |
|---|
| 86 | 93 | */ |
|---|
| 87 | 94 | public boolean isTokenValid(String token) { |
|---|
| 88 | 95 | try { |
|---|
| 89 | | - String tokenDecoded = new String(Base64.decode(token)); |
|---|
| 96 | + String tokenDecoded = new String(Base64.getDecoder().decode(token), StandardCharsets.UTF_8); |
|---|
| 90 | 97 | String[] parts = StringUtils.split(tokenDecoded, ' '); |
|---|
| 91 | 98 | if (parts == null || parts.length < 3) { |
|---|
| 92 | 99 | return false; |
|---|
| .. | .. |
|---|
| 114 | 121 | if (token == null) { |
|---|
| 115 | 122 | return null; |
|---|
| 116 | 123 | } |
|---|
| 117 | | - String tokenDecoded = new String(Base64.decode(token)); |
|---|
| 124 | + String tokenDecoded = new String(Base64.getDecoder().decode(token), StandardCharsets.UTF_8); |
|---|
| 118 | 125 | String[] parts = StringUtils.split(tokenDecoded, ' '); |
|---|
| 119 | 126 | if (parts == null || parts.length < 3) { |
|---|
| 120 | 127 | return null; |
|---|
| 121 | 128 | } |
|---|
| 122 | 129 | String user = parts[1]; |
|---|
| 123 | 130 | return user; |
|---|
| 124 | | - } catch (IOException e) { |
|---|
| 131 | + } catch (Exception e) { |
|---|
| 125 | 132 | LOG.error("Error decoding Base64 token", e); |
|---|
| 126 | 133 | } |
|---|
| 127 | 134 | return null; |
|---|
| .. | .. |
|---|
| 129 | 136 | |
|---|
| 130 | 137 | public Date extractDateCreationFromToken(String token) { |
|---|
| 131 | 138 | try { |
|---|
| 132 | | - String tokenDecoded = new String(Base64.decode(token)); |
|---|
| 139 | + String tokenDecoded = new String(Base64.getDecoder().decode(token), StandardCharsets.UTF_8); |
|---|
| 133 | 140 | String[] parts = StringUtils.split(tokenDecoded, ' '); |
|---|
| 134 | 141 | if (parts == null || parts.length < 3) { |
|---|
| 135 | 142 | return null; |
|---|
| 136 | 143 | } |
|---|
| 137 | 144 | Date date = Utils.toDateFromIso(parts[2]); |
|---|
| 138 | 145 | return date; |
|---|
| 139 | | - } catch (IOException e) { |
|---|
| 146 | + } catch (Exception e) { |
|---|
| 140 | 147 | LOG.error("Error decoding Base64 token", e); |
|---|
| 141 | 148 | } |
|---|
| 142 | 149 | return null; |
|---|
| .. | .. |
|---|
| 148 | 155 | // OTk3ODRiMzY5NzQ5MWI5NmYyZGQyODRiYjY2ZTU2YzdmMTZjYzM3YTY3N2ExM2M3ODI2MjU5ZTMzOTIyYjUzNSBfY2xpZW50IDE5NzAtMDEtMDFUMDA6NTk6NTkuOTk5KzAxMDA= |
|---|
| 149 | 156 | String t = new TokenHelper().generateToken("_client", new Date(-1)); |
|---|
| 150 | 157 | System.out.println("client token: " + t); |
|---|
| 151 | | - System.out.println("client token: " + new String(Base64.decode(t))); |
|---|
| 158 | + System.out.println("client token: " + new String(Base64.getDecoder().decode(t), StandardCharsets.UTF_8)); |
|---|
| 152 | 159 | |
|---|
| 153 | 160 | System.out.println("is valid client token: " + new TokenHelper().isTokenValid(t)); |
|---|
| 154 | 161 | } |
|---|
deleted file mode 100644| .. | .. |
|---|
| 1 | | -create database securis CHARACTER SET utf8 COLLATE utf8_bin; |
|---|
| 2 | | -create user securis@localhost identified by 'securis'; |
|---|
| 3 | | -grant all on securis.* to securis@localhost; |
|---|
| 4 | | -#Update passwords |
|---|
| 5 | | -flush privileges; |
|---|
deleted file mode 100644| .. | .. |
|---|
| 1 | | -delete from user; |
|---|
| 2 | | - |
|---|
| 3 | | -#Password: securis |
|---|
| 4 | | -insert into user (username, password, roles, first_name, last_name, creation_timestamp) values ('admin', '64f170fd736a2d4658fa87abde12043009d2554636c397032d57d71aea8556e9', 2, 'Administrator', null, now()); |
|---|
| 5 | | -insert into user (username, password, roles, first_name, last_name, creation_timestamp) values ('_client', '64f170fd736a2d4658fa87abde12043009d2554636c397032d57d71aea8556e9', 128, 'SeCuris client user', null, now()); |
|---|
deleted file mode 100644| .. | .. |
|---|
| 1 | | - |
|---|
| 2 | | -drop table IF EXISTS settings; |
|---|
| 3 | | -CREATE TABLE IF NOT EXISTS settings ( |
|---|
| 4 | | - `key` VARCHAR(100) NOT NULL , |
|---|
| 5 | | - value VARCHAR(2000) NULL , |
|---|
| 6 | | - modification_timestamp TIMESTAMP NOT NULL default now(), |
|---|
| 7 | | - PRIMARY KEY (``key``) ); |
|---|
| 8 | | - |
|---|
| 9 | | -drop table IF EXISTS user; |
|---|
| 10 | | -CREATE TABLE IF NOT EXISTS user ( |
|---|
| 11 | | - username VARCHAR(45) NOT NULL , |
|---|
| 12 | | - password VARCHAR(256) NULL , |
|---|
| 13 | | - roles INT NOT NULL default 0, |
|---|
| 14 | | - first_name VARCHAR(100) NULL , |
|---|
| 15 | | - last_name VARCHAR(100) NULL , |
|---|
| 16 | | - last_login TIMESTAMP NULL , |
|---|
| 17 | | - lang VARCHAR(10) NULL , |
|---|
| 18 | | - email VARCHAR(150) NULL , |
|---|
| 19 | | - creation_timestamp TIMESTAMP NOT NULL default now(), |
|---|
| 20 | | - modification_timestamp TIMESTAMP NULL , |
|---|
| 21 | | - PRIMARY KEY (username)); |
|---|
| 22 | | - |
|---|
| 23 | | -drop table IF EXISTS application; |
|---|
| 24 | | -CREATE TABLE IF NOT EXISTS application ( |
|---|
| 25 | | - id INT NOT NULL auto_increment, |
|---|
| 26 | | - code VARCHAR(4) NOT NULL , |
|---|
| 27 | | - name VARCHAR(45) NOT NULL , |
|---|
| 28 | | - license_filename VARCHAR(100) NOT NULL , |
|---|
| 29 | | - description VARCHAR(500) NULL , |
|---|
| 30 | | - creation_timestamp TIMESTAMP NOT NULL default now(), |
|---|
| 31 | | - PRIMARY KEY (id)); |
|---|
| 32 | | - |
|---|
| 33 | | -drop table IF EXISTS application_metadata; |
|---|
| 34 | | -CREATE TABLE IF NOT EXISTS application_metadata ( |
|---|
| 35 | | - application_id INT NOT NULL , |
|---|
| 36 | | - `key` VARCHAR(100) NOT NULL , |
|---|
| 37 | | - value VARCHAR(512) NULL , |
|---|
| 38 | | - mandatory BOOLEAN NOT NULL default true, |
|---|
| 39 | | - creation_timestamp TIMESTAMP NULL default now(), |
|---|
| 40 | | - PRIMARY KEY (application_id, `key`)); |
|---|
| 41 | | - |
|---|
| 42 | | - |
|---|
| 43 | | -drop table IF EXISTS license_type; |
|---|
| 44 | | -CREATE TABLE IF NOT EXISTS license_type ( |
|---|
| 45 | | - id INT NOT NULL auto_increment, |
|---|
| 46 | | - code VARCHAR(10) NOT NULL , |
|---|
| 47 | | - name VARCHAR(45) NOT NULL , |
|---|
| 48 | | - description VARCHAR(100) NULL , |
|---|
| 49 | | - application_id INT NULL , |
|---|
| 50 | | - creation_timestamp TIMESTAMP NOT NULL default now(), |
|---|
| 51 | | - PRIMARY KEY (id)); |
|---|
| 52 | | - |
|---|
| 53 | | -drop table IF EXISTS licensetype_metadata; |
|---|
| 54 | | -CREATE TABLE IF NOT EXISTS licensetype_metadata ( |
|---|
| 55 | | - license_type_id INT NOT NULL , |
|---|
| 56 | | - `key` VARCHAR(100) NOT NULL , |
|---|
| 57 | | - value VARCHAR(512) NULL , |
|---|
| 58 | | - mandatory BOOLEAN NOT NULL default true, |
|---|
| 59 | | - PRIMARY KEY (license_type_id, `key`)); |
|---|
| 60 | | - |
|---|
| 61 | | -drop table IF EXISTS organization; |
|---|
| 62 | | -CREATE TABLE IF NOT EXISTS organization ( |
|---|
| 63 | | - id INT NOT NULL auto_increment, |
|---|
| 64 | | - code VARCHAR(10) NOT NULL , |
|---|
| 65 | | - name VARCHAR(45) NOT NULL , |
|---|
| 66 | | - description VARCHAR(100) NULL , |
|---|
| 67 | | - org_parent_id INT NULL , |
|---|
| 68 | | - creation_timestamp TIMESTAMP NOT NULL default now(), |
|---|
| 69 | | - PRIMARY KEY (id)); |
|---|
| 70 | | - |
|---|
| 71 | | -drop table IF EXISTS user_organization; |
|---|
| 72 | | -CREATE TABLE IF NOT EXISTS user_organization ( |
|---|
| 73 | | - username VARCHAR(45) NOT NULL, |
|---|
| 74 | | - organization_id INT NOT NULL, |
|---|
| 75 | | - PRIMARY KEY (username, organization_id)); |
|---|
| 76 | | - |
|---|
| 77 | | -drop table IF EXISTS user_application; |
|---|
| 78 | | -CREATE TABLE IF NOT EXISTS user_application ( |
|---|
| 79 | | - username VARCHAR(45) NOT NULL, |
|---|
| 80 | | - application_id INT NOT NULL, |
|---|
| 81 | | - PRIMARY KEY (username, application_id)); |
|---|
| 82 | | - |
|---|
| 83 | | - |
|---|
| 84 | | -drop table IF EXISTS pack; |
|---|
| 85 | | -CREATE TABLE IF NOT EXISTS pack ( |
|---|
| 86 | | - id INT NOT NULL auto_increment, |
|---|
| 87 | | - code VARCHAR(50) NOT NULL , |
|---|
| 88 | | - num_licenses INT NOT NULL , |
|---|
| 89 | | - init_valid_date DATE NOT NULL, |
|---|
| 90 | | - end_valid_date DATE NOT NULL, |
|---|
| 91 | | - status VARCHAR(2) NOT NULL default 'CR', |
|---|
| 92 | | - comments VARCHAR(1024) NULL , |
|---|
| 93 | | - license_type_id INT NOT NULL, |
|---|
| 94 | | - organization_id INT NOT NULL, |
|---|
| 95 | | - license_preactivation BOOLEAN NOT NULL DEFAULT true, |
|---|
| 96 | | - preactivation_valid_period INT NOT NULL DEFAULT 7, |
|---|
| 97 | | - renew_valid_period INT NOT NULL DEFAULT 30, |
|---|
| 98 | | - created_by varchar(45) NULL , |
|---|
| 99 | | - creation_timestamp TIMESTAMP NOT NULL default now(), |
|---|
| 100 | | - frozen BOOLEAN NOT NULL default false, |
|---|
| 101 | | - PRIMARY KEY (id)); |
|---|
| 102 | | - |
|---|
| 103 | | -drop table IF EXISTS pack_metadata; |
|---|
| 104 | | -CREATE TABLE IF NOT EXISTS pack_metadata ( |
|---|
| 105 | | - pack_id INT NOT NULL , |
|---|
| 106 | | - `key` VARCHAR(100) NOT NULL , |
|---|
| 107 | | - value VARCHAR(512) NULL , |
|---|
| 108 | | - readonly BOOlEAN NOT NULL default false, |
|---|
| 109 | | - mandatory BOOLEAN NOT NULL default true, |
|---|
| 110 | | - PRIMARY KEY (pack_id, `key`)); |
|---|
| 111 | | - |
|---|
| 112 | | - |
|---|
| 113 | | -drop table IF EXISTS license; |
|---|
| 114 | | -CREATE TABLE IF NOT EXISTS license ( |
|---|
| 115 | | - id INT NOT NULL auto_increment, |
|---|
| 116 | | - code VARCHAR(100) NOT NULL , |
|---|
| 117 | | - activation_code VARCHAR(100) NULL , |
|---|
| 118 | | - code_suffix INT NULL , |
|---|
| 119 | | - request_data VARCHAR(1024) NULL , |
|---|
| 120 | | - request_data_hash VARCHAR(64) NULL , |
|---|
| 121 | | - license_data VARCHAR(2048) NULL , |
|---|
| 122 | | - pack_id INT NOT NULL, |
|---|
| 123 | | - full_name VARCHAR(150) NULL, |
|---|
| 124 | | - email VARCHAR(100) NULL, |
|---|
| 125 | | - comments VARCHAR(1024) NULL , |
|---|
| 126 | | - creation_timestamp TIMESTAMP NOT NULL default now(), |
|---|
| 127 | | - modification_timestamp TIMESTAMP NULL , |
|---|
| 128 | | - last_access_timestamp TIMESTAMP NULL , |
|---|
| 129 | | - expiration_date TIMESTAMP NULL , |
|---|
| 130 | | - cancelled_by varchar(45) NULL , |
|---|
| 131 | | - created_by varchar(45) NULL , |
|---|
| 132 | | - status VARCHAR(2) NOT NULL default 'CR', |
|---|
| 133 | | - metadata_obsolete BOOLEAN NOT NULL default false, |
|---|
| 134 | | - PRIMARY KEY (id), |
|---|
| 135 | | - index(request_data_hash, pack_id)); |
|---|
| 136 | | - |
|---|
| 137 | | -drop table IF EXISTS license_history; |
|---|
| 138 | | -CREATE TABLE IF NOT EXISTS license_history ( |
|---|
| 139 | | - id INT NOT NULL auto_increment, |
|---|
| 140 | | - license_id INT NOT NULL, |
|---|
| 141 | | - username VARCHAR(45) NOT NULL, |
|---|
| 142 | | - creation_timestamp TIMESTAMP NOT NULL default now(), |
|---|
| 143 | | - action VARCHAR(40) , |
|---|
| 144 | | - comments VARCHAR(512) , |
|---|
| 145 | | - PRIMARY KEY (id)); |
|---|
| 146 | | - |
|---|
| 147 | | - |
|---|
| 148 | | -drop table IF EXISTS blocked_request; |
|---|
| 149 | | -CREATE TABLE IF NOT EXISTS blocked_request ( |
|---|
| 150 | | - hash VARCHAR(64) NOT NULL , |
|---|
| 151 | | - request_data VARCHAR(1024) NULL , |
|---|
| 152 | | - blocked_by varchar(45) NULL , |
|---|
| 153 | | - creation_timestamp TIMESTAMP NOT NULL default now(), |
|---|
| 154 | | - PRIMARY KEY (hash)); |
|---|
| 155 | | - |
|---|
| .. | .. |
|---|
| 1 | | -// Place your settings in this file to overwrite default and user settings. |
|---|
| 2 | 1 | { |
|---|
| 3 | 2 | "typescript.tsdk": "./node_modules/typescript/lib", |
|---|
| 4 | 3 | "files.exclude": { |
|---|
| .. | .. |
|---|
| 1 | +Manifest-Version: 1.0
|
|---|
| 2 | +Class-Path:
|
|---|
| 3 | +
|
|---|
| .. | .. |
|---|
| 66 | 66 | <filter> |
|---|
| 67 | 67 | <filter-name>Resteasy</filter-name> |
|---|
| 68 | 68 | <filter-class> |
|---|
| 69 | | - org.jboss.resteasy.plugins.server.servlet.FilterDispatcher |
|---|
| 69 | + org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher |
|---|
| 70 | 70 | </filter-class> |
|---|
| 71 | 71 | <init-param> |
|---|
| 72 | 72 | <param-name>javax.ws.rs.Application</param-name> |
|---|
| .. | .. |
|---|
| 1 | 1 | { |
|---|
| 2 | | -"": "", |
|---|
| 3 | | -"": "" |
|---|
| 2 | + "field.code": "Code", |
|---|
| 3 | + "field.num_licenses": "Num. licenses", |
|---|
| 4 | + "field.num_available": "Available licenses", |
|---|
| 5 | + "field.pack": "Pack", |
|---|
| 6 | + "field.id": "ID", |
|---|
| 7 | + "field.init_valid_date": "Init valid date", |
|---|
| 8 | + "field.end_valid_date": "End valid date", |
|---|
| 9 | + "field.license_preactivation": "License preactivation", |
|---|
| 10 | + "field.license_type_id": "License type", |
|---|
| 11 | + "field.organization_id": "Organization", |
|---|
| 12 | + "field.application_id": "Application", |
|---|
| 13 | + "field.licensetype_code": "License type", |
|---|
| 14 | + "field.organization_name": "Organization", |
|---|
| 15 | + "field.preactivation_valid_period": "Preactivation valid period", |
|---|
| 16 | + "field.renew_valid_period": "Renew valid period", |
|---|
| 17 | + "field.application_name": "Application name", |
|---|
| 18 | + "field.activation_code": "Activation code", |
|---|
| 19 | + "field.status": "Status", |
|---|
| 20 | + "field.metadata": "Metadata", |
|---|
| 21 | + "field.key": "Parameter", |
|---|
| 22 | + "field.value": "Value", |
|---|
| 23 | + "field.username": "Username", |
|---|
| 24 | + "field.password": "Password", |
|---|
| 25 | + "field.first_name": "Firstname", |
|---|
| 26 | + "field.last_name": "Lastname", |
|---|
| 27 | + "field.created_by": "Created by", |
|---|
| 28 | + "field.creation_date": "Creation date", |
|---|
| 29 | + "field.expiration_date": "Expiration date", |
|---|
| 30 | + "field.request_data": "Request data", |
|---|
| 31 | + "field.full_name": "Fullname", |
|---|
| 32 | + "field.email": "Email", |
|---|
| 33 | + "field.lastLogin": "Last login", |
|---|
| 34 | + "field.creation_timestamp": "Creation timestamp", |
|---|
| 35 | + "field.comments": "Comments", |
|---|
| 36 | + "field.mandatory": "Required", |
|---|
| 37 | + "field.org_parent_id": "Parent organization", |
|---|
| 38 | + "field.name": "Name", |
|---|
| 39 | + "field.frozen": "Frozen", |
|---|
| 40 | + "field.license_filename": "License filename", |
|---|
| 41 | + "field.description": "Description", |
|---|
| 42 | + "pack.status.CR": "Created", |
|---|
| 43 | + "pack.status.AC": "Active", |
|---|
| 44 | + "pack.status.OH": "On Hold", |
|---|
| 45 | + "pack.status.EX": "Expired", |
|---|
| 46 | + "pack.status.CA": "Cancelled", |
|---|
| 47 | + "license.status.CR": "Created", |
|---|
| 48 | + "license.status.AC": "Active", |
|---|
| 49 | + "license.status.PA": "Pre-active", |
|---|
| 50 | + "license.status.RE": "Requested", |
|---|
| 51 | + "license.status.EX": "Expired", |
|---|
| 52 | + "license.status.BL": "Blocked", |
|---|
| 53 | + "license.status.CA": "Cancelled", |
|---|
| 54 | + "menu.packs": "Packs", |
|---|
| 55 | + "menu.packs.description": "Packs to manage licenses", |
|---|
| 56 | + "menu.applications": "Applications", |
|---|
| 57 | + "menu.applications.description": "Applications", |
|---|
| 58 | + "menu.license_types": "License types", |
|---|
| 59 | + "menu.license_types.description": "License types", |
|---|
| 60 | + "menu.organizations": "Organizations", |
|---|
| 61 | + "menu.organizations.description": "Organizations", |
|---|
| 62 | + "menu.users": "Users", |
|---|
| 63 | + "menu.users.description": "Users", |
|---|
| 64 | + "": "" |
|---|
| 4 | 65 | } |
|---|
| .. | .. |
|---|
| 1 | 1 | { |
|---|
| 2 | | -"": "", |
|---|
| 3 | | -"": "" |
|---|
| 2 | + "field.code": "Code", |
|---|
| 3 | + "field.num_licenses": "Num. licenses", |
|---|
| 4 | + "field.num_available": "Available licenses", |
|---|
| 5 | + "field.pack": "Pack", |
|---|
| 6 | + "field.id": "ID", |
|---|
| 7 | + "field.init_valid_date": "Init valid date", |
|---|
| 8 | + "field.end_valid_date": "End valid date", |
|---|
| 9 | + "field.license_preactivation": "License preactivation", |
|---|
| 10 | + "field.license_type_id": "License type", |
|---|
| 11 | + "field.organization_id": "Organization", |
|---|
| 12 | + "field.application_id": "Application", |
|---|
| 13 | + "field.licensetype_code": "License type", |
|---|
| 14 | + "field.organization_name": "Organization", |
|---|
| 15 | + "field.preactivation_valid_period": "Preactivation valid period", |
|---|
| 16 | + "field.renew_valid_period": "Renew valid period", |
|---|
| 17 | + "field.application_name": "Application name", |
|---|
| 18 | + "field.activation_code": "Activation code", |
|---|
| 19 | + "field.status": "Status", |
|---|
| 20 | + "field.metadata": "Metadata", |
|---|
| 21 | + "field.key": "Parameter", |
|---|
| 22 | + "field.value": "Value", |
|---|
| 23 | + "field.username": "Username", |
|---|
| 24 | + "field.password": "Password", |
|---|
| 25 | + "field.first_name": "Firstname", |
|---|
| 26 | + "field.last_name": "Lastname", |
|---|
| 27 | + "field.created_by": "Created by", |
|---|
| 28 | + "field.creation_date": "Creation date", |
|---|
| 29 | + "field.expiration_date": "Expiration date", |
|---|
| 30 | + "field.request_data": "Request data", |
|---|
| 31 | + "field.full_name": "Fullname", |
|---|
| 32 | + "field.email": "Email", |
|---|
| 33 | + "field.lastLogin": "Last login", |
|---|
| 34 | + "field.creation_timestamp": "Creation timestamp", |
|---|
| 35 | + "field.comments": "Comments", |
|---|
| 36 | + "field.mandatory": "Required", |
|---|
| 37 | + "field.org_parent_id": "Parent organization", |
|---|
| 38 | + "field.name": "Name", |
|---|
| 39 | + "field.frozen": "Frozen", |
|---|
| 40 | + "field.license_filename": "License filename", |
|---|
| 41 | + "field.description": "Description", |
|---|
| 42 | + "pack.status.CR": "Created", |
|---|
| 43 | + "pack.status.AC": "Active", |
|---|
| 44 | + "pack.status.OH": "On Hold", |
|---|
| 45 | + "pack.status.EX": "Expired", |
|---|
| 46 | + "pack.status.CA": "Cancelled", |
|---|
| 47 | + "license.status.CR": "Created", |
|---|
| 48 | + "license.status.AC": "Active", |
|---|
| 49 | + "license.status.PA": "Pre-active", |
|---|
| 50 | + "license.status.RE": "Requested", |
|---|
| 51 | + "license.status.EX": "Expired", |
|---|
| 52 | + "license.status.BL": "Blocked", |
|---|
| 53 | + "license.status.CA": "Cancelled", |
|---|
| 54 | + "menu.packs": "Packs", |
|---|
| 55 | + "menu.packs.description": "Packs to manage licenses", |
|---|
| 56 | + "menu.applications": "Applications", |
|---|
| 57 | + "menu.applications.description": "Applications", |
|---|
| 58 | + "menu.license_types": "License types", |
|---|
| 59 | + "menu.license_types.description": "License types", |
|---|
| 60 | + "menu.organizations": "Organizations", |
|---|
| 61 | + "menu.organizations.description": "Organizations", |
|---|
| 62 | + "menu.users": "Users", |
|---|
| 63 | + "menu.users.description": "Users", |
|---|
| 64 | + "": "" |
|---|
| 4 | 65 | } |
|---|