diff --git a/.gitea/workflows/deploy_in_prod.yml b/.gitea/workflows/deploy_in_prod.yml
new file mode 100644
index 0000000..7367f7c
--- /dev/null
+++ b/.gitea/workflows/deploy_in_prod.yml
@@ -0,0 +1,41 @@
+name: Deploy Production Server
+
+# Only run the workflow when a PR is merged on main and closed
+on:
+ pull_request:
+ types:
+ - closed
+ branches:
+ - 'master'
+
+# Here we check that the PR was correctly merged to main
+jobs:
+ if_merged:
+ if: github.event.pull_request.merged == true
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v4
+
+ - name: Set up JDK 17
+ uses: actions/setup-java@v4
+ with:
+ java-version: '17'
+ distribution: 'graalvm'
+ cache: 'maven'
+
+ - name: Build site
+ run: |
+ cp vite.env src/main/webapp/.env
+ cd src/main/webapp
+ npm install
+ npm run build
+ cd ../../..
+ rm -rf src/main/resources/META-INF/resources
+ mkdir -p src/main/resources/META-INF/
+ mv dist src/main/resources/META-INF/resources
+
+ - name: Build application
+ run: |
+ cp ../vite.env src/main/webapp/.env
+ chmod 740 mvnw
+ ./mvnw package -Pnative -DskipTests
\ No newline at end of file
diff --git a/pom.xml b/pom.xml
index 6c3aafc..609c526 100644
--- a/pom.xml
+++ b/pom.xml
@@ -109,6 +109,32 @@
io.quarkus
quarkus-websockets
+
+
+ net.sf.jmimemagic
+ jmimemagic
+ 0.1.3
+
+
+
+ io.quarkus
+ quarkus-smallrye-openapi
+
+
+ io.quarkus
+ quarkus-swagger-ui
+
+
+
+ io.quarkus
+ quarkus-cache
+
+
+
+ com.github.librepdf
+ openpdf
+ 2.0.3
+
diff --git a/src/main/java/fr/titionfire/ExampleResource.java b/src/main/java/fr/titionfire/ExampleResource.java
index 617736e..cc432e7 100644
--- a/src/main/java/fr/titionfire/ExampleResource.java
+++ b/src/main/java/fr/titionfire/ExampleResource.java
@@ -2,6 +2,7 @@ package fr.titionfire;
import io.quarkus.oidc.IdToken;
import io.quarkus.oidc.RefreshToken;
+import io.quarkus.oidc.UserInfo;
import io.quarkus.security.identity.SecurityIdentity;
import jakarta.inject.Inject;
import jakarta.ws.rs.GET;
@@ -30,6 +31,9 @@ public class ExampleResource {
@IdToken
JsonWebToken idToken;
+ @Inject
+ UserInfo userInfo;
+
/**
* Injection point for the Access Token issued by the OpenID Connect Provider
*/
@@ -59,7 +63,8 @@ public class ExampleResource {
.append("")
.append("");
-
+ System.out.println(idToken);
+ System.out.println(accessToken);
Object userName = this.idToken.getClaim("preferred_username");
if (userName != null) {
@@ -69,25 +74,17 @@ public class ExampleResource {
response.append("- username: ").append(this.idToken.toString()).append("
");
}
- Object scopes = this.accessToken.getClaim("scope");
+ /*Object scopes = this.accessToken.getClaim("scope");
if (scopes != null) {
response.append("- scopes: ").append(scopes.toString()).append("
");
}
- if (scopes != null) {
- response.append("- scopes: ").append(this.accessToken.toString()).append("
");
- }
+ response.append("- scopes: ").append(this.accessToken.toString()).append("
");
+ response.append("- scopes: ").append(this.accessToken.getClaim("user_groups").toString()).append("
");*/
- if (scopes != null) {
- response.append("- scopes: ").append(this.accessToken.getClaim("user_groups").toString()).append("
");
- }
-
- if (scopes != null) {
- response.append("- getRoles: ").append(this.securityIdentity.getRoles()).append("
");
- }
-
+ response.append("- getRoles: ").append(this.securityIdentity.getRoles()).append("
");
response.append("- refresh_token: ").append(refreshToken.getToken() != null).append("
");
return response.append("
").append("").append("