Skip to content

Commit

Permalink
prod equivalent
Browse files Browse the repository at this point in the history
  • Loading branch information
fsantaniello-heigvd committed Jun 10, 2024
1 parent 6bffcf1 commit a4bbac6
Show file tree
Hide file tree
Showing 9 changed files with 80 additions and 265 deletions.
86 changes: 31 additions & 55 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -134,12 +134,8 @@

<jakarta.version>10.0.0</jakarta.version>

<shiro.version>1.13.0</shiro.version>
<pac4jVersion>6.0.2</pac4jVersion>
<bujiVersion>9.0.1</bujiVersion>
<jakartaPac4jVersion>8.0.1</jakartaPac4jVersion>

<payara.version>6.2024.5</payara.version>
<shiro.version>1.12.0</shiro.version>
<payara.version>6.2023.9</payara.version>

<junit.version>4.13.1</junit.version>
<arquillian.version>1.7.1.Final</arquillian.version>
Expand Down Expand Up @@ -177,28 +173,28 @@
<arquillian-suite-extension.version>1.2.2</arquillian-suite-extension.version>


<maven-clean-plugin.version>3.3.2</maven-clean-plugin.version>
<maven-compiler-plugin.version>3.13.0</maven-compiler-plugin.version>
<spotbugs-maven-plugin.version>4.8.5.0</spotbugs-maven-plugin.version>
<findsecbugs-plugin.version>1.13.0</findsecbugs-plugin.version>
<maven-jar-plugin.version>3.4.1</maven-jar-plugin.version>
<maven-war-plugin.version>3.4.0</maven-war-plugin.version>
<maven-dependency-plugin.version>3.6.1</maven-dependency-plugin.version>
<maven-resources-plugin.version>3.3.1</maven-resources-plugin.version>
<maven-source-plugin.version>3.3.1</maven-source-plugin.version>
<maven-javadoc-plugin.version>3.6.3</maven-javadoc-plugin.version>
<maven-surefire-plugin.version>3.2.5</maven-surefire-plugin.version>
<maven-project-info-reports-plugin.version>3.5.0</maven-project-info-reports-plugin.version>
<maven-site-plugin.version>3.12.1</maven-site-plugin.version>
<jacoco-maven-plugin.version>0.8.12</jacoco-maven-plugin.version>
<maven-clean-plugin.version>3.1.0</maven-clean-plugin.version>
<maven-compiler-plugin.version>3.8.1</maven-compiler-plugin.version>
<spotbugs-maven-plugin.version>4.0.0</spotbugs-maven-plugin.version>
<findsecbugs-plugin.version>1.9.0</findsecbugs-plugin.version>
<maven-jar-plugin.version>3.2.0</maven-jar-plugin.version>
<maven-war-plugin.version>3.3.2</maven-war-plugin.version>
<maven-dependency-plugin.version>3.1.2</maven-dependency-plugin.version>
<maven-resources-plugin.version>3.1.0</maven-resources-plugin.version>
<maven-source-plugin.version>3.2.1</maven-source-plugin.version>
<maven-javadoc-plugin.version>3.2.0</maven-javadoc-plugin.version>
<maven-surefire-plugin.version>3.0.0-M5</maven-surefire-plugin.version>
<maven-project-info-reports-plugin.version>3.0.0</maven-project-info-reports-plugin.version>
<maven-site-plugin.version>3.9.0</maven-site-plugin.version>
<jacoco-maven-plugin.version>0.8.10</jacoco-maven-plugin.version>
<jdepend-maven-plugin.version>2.0</jdepend-maven-plugin.version>
<maven-pmd-plugin.version>3.21.0</maven-pmd-plugin.version>
<maven-scm-publish-plugin.version>3.2.1</maven-scm-publish-plugin.version>
<maven-checkstyle-plugin.version>3.3.1</maven-checkstyle-plugin.version>
<maven-jxr-plugin.version>3.3.2</maven-jxr-plugin.version>
<license-maven-plugin.version>4.5</license-maven-plugin.version>
<exec-maven-plugin.version>3.2.0</exec-maven-plugin.version>
<maven-project-info-reports-plugin.version>3.5.0</maven-project-info-reports-plugin.version>
<maven-scm-publish-plugin.version>3.0.0</maven-scm-publish-plugin.version>
<maven-checkstyle-plugin.version>3.1.1</maven-checkstyle-plugin.version>
<maven-jxr-plugin.version>3.0.0</maven-jxr-plugin.version>
<license-maven-plugin.version>3.0</license-maven-plugin.version>
<exec-maven-plugin.version>3.0.0</exec-maven-plugin.version>
<maven-project-info-reports-plugin.version>3.0.0</maven-project-info-reports-plugin.version>

<github.global.server>github</github.global.server>

Expand Down Expand Up @@ -229,28 +225,6 @@

<dependencyManagement>
<dependencies>
<dependency>
<groupId>io.buji</groupId>
<artifactId>buji-pac4j</artifactId>
<version>${bujiVersion}</version>
</dependency>
<dependency>
<groupId>org.pac4j</groupId>
<artifactId>jakartaee-pac4j</artifactId>
<version>${jakartaPac4jVersion}</version>
</dependency>

<dependency>
<groupId>org.pac4j</groupId>
<artifactId>pac4j-jakartaee</artifactId>
<version>${pac4jVersion}</version>
</dependency>
<dependency>
<groupId>org.pac4j</groupId>
<artifactId>pac4j-oidc</artifactId>
<version>${pac4jVersion}</version>
</dependency>

<!-- Import dep from payara -->
<dependency>
<groupId>fish.payara.api</groupId>
Expand Down Expand Up @@ -439,13 +413,6 @@
<type>jar</type>
</dependency>

<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>${commons-lang3.version}</version>
<type>jar</type>
</dependency>

<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
Expand Down Expand Up @@ -553,6 +520,15 @@
<scope>test</scope>
</dependency>

<!-- required by arq-suite-ext -->
<dependency>
<groupId>commons-lang</groupId>
<artifactId>commons-lang</artifactId>
<version>2.6</version>
<type>jar</type>
<scope>test</scope>
</dependency>

<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
Expand Down
1 change: 1 addition & 0 deletions wegas-app/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@
<dependency>
<groupId>fish.payara.api</groupId>
<artifactId>payara-api</artifactId>
<version>${payara.version}</version>
<scope>provided</scope>
</dependency>

Expand Down
74 changes: 39 additions & 35 deletions wegas-app/src/main/webapp/WEB-INF/shiro.ini
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ sessionManager.globalSessionTimeout = 3600000

# For shiro >= 1.7.0
# Explicit url rewriting must be set in order to work with special chars (File management needs that)
sessionManager.sessionIdUrlRewritingEnabled = false
sessionManager.sessionIdUrlRewritingEnabled = true
invalidRequest = org.apache.shiro.web.filter.InvalidRequestFilter
invalidRequest.blockNonAscii = false

Expand Down Expand Up @@ -61,11 +61,11 @@ aaiRealm = com.wegas.core.security.aai.AaiRealm
aaiRealm.credentialsMatcher = $aaiCredentialsMatcher

#pac4j Realm
pac4jRealm = com.wegas.core.security.oidc.Pac4jOidcWegasRealm
pac4jRealm.credentialsMatcher = $aaiCredentialsMatcher
#pac4jRealm = com.wegas.core.security.oidc.Pac4jOidcWegasRealm
#pac4jRealm.credentialsMatcher = $aaiCredentialsMatcher

# Assign realms to security manager
securityManager.realms = $jpaRealm, $guestRealm, $pac4jRealm, $aaiRealm, $jpaTokenRealm
securityManager.realms = $jpaRealm, $guestRealm, $aaiRealm, $jpaTokenRealm

srm = com.wegas.core.security.util.ShiroRememberManager
securityManager.rememberMeManager = $srm
Expand All @@ -83,51 +83,55 @@ roles.unauthorizedUrl = /wegas-app/jsf/error/accessdenied.html
# Redirect logout to logout page
logout.redirectUrl = /

oidcConfig = com.wegas.core.security.oidc.WegasOidcConfiguration
oidcClient = com.wegas.core.security.oidc.WegasOidcClient
oidcClient.configuration = $oidcConfig
#oidcConfig = com.wegas.core.security.oidc.WegasOidcConfiguration
#oidcClient = com.wegas.core.security.oidc.WegasOidcClient
#oidcClient.configuration = $oidcConfig

wegasRememberMeAuthGenerator = com.wegas.core.security.oidc.WegasRememberMeAuthGenerator
oidcClient.authorizationGenerator = $wegasRememberMeAuthGenerator
#wegasRememberMeAuthGenerator = com.wegas.core.security.oidc.WegasRememberMeAuthGenerator
#oidcClient.authorizationGenerator = $wegasRememberMeAuthGenerator


clients.clients = $oidcClient
#clients.clients = $oidcClient

oidcSecurityFilter = org.pac4j.jee.filter.SecurityFilter
#oidcSecurityFilter = org.pac4j.jee.filter.SecurityFilter
# $config is defined in pac4j
oidcSecurityFilter.config = $config
oidcSecurityFilter.clients = WegasOidcClient
#oidcSecurityFilter.config = $config
#oidcSecurityFilter.clients = WegasOidcClient

callbackFilter = org.pac4j.jee.filter.CallbackFilter
callbackFilter.config = $config
callbackFilter.renewSession = false
#callbackFilter = org.pac4j.jee.filter.CallbackFilter
#callbackFilter.config = $config
#callbackFilter.renewSession = false

[urls]
#logout
#/logout=logout
#/logout.html=anon

/index.html=anon
/aai-login.html=anon
/**/*.html=authc
#/index.html=anon
#/aai-login.html=anon
#/**/*.html=authc
/game.html=authc
/edit.html=authc
/host.html=authc
/game-play.html=authc

# Login API calls
/rest/Editor/User/Current=anon
/rest/User/Account/Current=anon
/rest/User/AuthMethod/**=anon
/rest/User/Authenticate=anon
/rest/Pusher/ApplicationKey=anon
/rest/User/DefaultAuthMethod=anon
/rest/User/Signup=anon
/rest/Extended/User/Account/AaiConfig=anon
/rest/User/AaiLogin=anon
/rest/Oidc/Login=oidcSecurityFilter

/rest/Oidc/Callback=callbackFilter


/rest/**=authc
/openapi/**=authc
#/rest/Editor/User/Current=anon
#/rest/User/Account/Current=anon
#/rest/User/AuthMethod/**=anon
#/rest/User/Authenticate=anon
#/rest/Pusher/ApplicationKey=anon
#/rest/User/DefaultAuthMethod=anon
#/rest/User/Signup=anon
#/rest/Extended/User/Account/AaiConfig=anon
#/rest/User/AaiLogin=anon
#/rest/Oidc/Login=oidcSecurityFilter

#/rest/Oidc/Callback=callbackFilter


#/rest/**=authc
#/openapi/**=authc

# force ssl for login page
#/login.html=ssl[8443], authc
Expand Down
40 changes: 8 additions & 32 deletions wegas-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,33 +43,6 @@


<dependencies>
<dependency>
<groupId>io.buji</groupId>
<artifactId>buji-pac4j</artifactId>
<exclusions>
<exclusion>
<groupId>org.pac4j</groupId>
<artifactId>pac4j-javaee</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.shiro</groupId>
<artifactId>shiro-web</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.pac4j</groupId>
<artifactId>jakartaee-pac4j</artifactId>
</dependency>

<dependency>
<groupId>org.pac4j</groupId>
<artifactId>pac4j-jakartaee</artifactId>
</dependency>
<dependency>
<groupId>org.pac4j</groupId>
<artifactId>pac4j-oidc</artifactId>
</dependency>
<dependency>
<groupId>ch.albasim.wegas</groupId>
<artifactId>wegas-annotations</artifactId>
Expand Down Expand Up @@ -225,6 +198,13 @@
</exclusions>
</dependency>

<!-- required by arq-suite-ext -->
<dependency>
<groupId>commons-lang</groupId>
<artifactId>commons-lang</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
Expand Down Expand Up @@ -258,11 +238,6 @@
<artifactId>commons-text</artifactId>
</dependency>

<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
</dependency>

<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
Expand Down Expand Up @@ -290,6 +265,7 @@
<dependency>
<groupId>fish.payara.api</groupId>
<artifactId>payara-api</artifactId>
<version>${payara.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
Expand Down
Loading

0 comments on commit a4bbac6

Please sign in to comment.