Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade master to the current wrensec-parent #48

Merged
merged 24 commits into from
Dec 5, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
ad91981
Upgrade dependencies and fix unit tests.
pavelhoral Jul 23, 2021
7fc366b
Add GitHub Action configuration.
pavelhoral Jul 29, 2021
bcc983f
Fix invalid property expansion in JSON string when building on Windows.
pavelhoral Jul 31, 2021
a306c1a
Upgrade to Wren:DS build.
pavelhoral Nov 19, 2022
2b1794a
Fix NodeJS / PhantomJS build.
pavelhoral Nov 19, 2022
6ed43f0
Upgrade Node.js and npm to the latest LTS version
fyrbach Nov 4, 2022
7b8fcae
Upgrade wrensec-parent
fyrbach Dec 1, 2022
030ec22
Remove persistit dependency mentions
fyrbach Dec 1, 2022
193c54d
Downgrade checkstyle plugin to fix build on Java 8
fyrbach Dec 1, 2022
7eb09d4
Remove unsed pgpWhitelistArtifact property
fyrbach Dec 1, 2022
a282761
Replace forgerock-guice-* by wrensec-guice-*
fyrbach Dec 2, 2022
658f45d
Use audit-handler-* from Wren Security Commons
fyrbach Dec 2, 2022
023b411
Use forgerock-util from Wren Security Commons
fyrbach Dec 1, 2022
9ca732c
Use forgerock-test-utils from Wren Security Commons
fyrbach Dec 1, 2022
b7eb6e8
Use json-resource from Wren Security Commons
fyrbach Dec 1, 2022
cff0026
Use forgerock-jaspi-* from Wren Security Commons
fyrbach Dec 1, 2022
ebca1c6
Replace forgerock-guava-* by wrensec-guava-*
fyrbach Dec 1, 2022
be0d277
Use json-web-token from Wren Security Commons
fyrbach Dec 1, 2022
2d577b4
Use i18n-* from Wren Security Commons
fyrbach Dec 1, 2022
cc2111f
Use forgerock-selfservice-* from Wren Security Commons
fyrbach Dec 1, 2022
cca3623
Use api-descriptor from Wren Security Commons
fyrbach Dec 1, 2022
44f6c93
Use authz-framework from Wren Security Commons
fyrbach Dec 1, 2022
eea1cb8
Use chf-* from Wren Security Commons
fyrbach Dec 1, 2022
b90ef1b
Upgrade Wren:DS dependency
fyrbach Dec 1, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
25 changes: 25 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Build

on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
java: [8]
name: "Java ${{ matrix.java }} build"
steps:
- uses: actions/checkout@v2
- name: Set up JDK
uses: actions/setup-java@v1
with:
java-version: ${{ matrix.java }}
- name: Cache Maven packages
uses: actions/cache@v2
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- name: Run the Maven verify phase
run: mvn -B verify --file pom.xml
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
target/
dependency-reduced-pom.xml
openam-ui/openam-ui-ria/npm-debug.log.*
test-output/

# Editor generated files
*.iml
.idea/
.project
.settings
.classpath
15 changes: 8 additions & 7 deletions openam-audit/openam-audit-configuration/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
* information: "Portions copyright [year] [name of copyright owner]".
*
* Copyright 2014-2016 ForgeRock AS.
* Portions copyright 2022 Wren Security
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
Expand Down Expand Up @@ -40,27 +41,27 @@
<artifactId>openam-core</artifactId>
</dependency>
<dependency>
<groupId>org.forgerock.commons</groupId>
<groupId>org.wrensecurity.commons</groupId>
<artifactId>forgerock-audit-handler-csv</artifactId>
</dependency>
<dependency>
<groupId>org.forgerock.commons</groupId>
<groupId>org.wrensecurity.commons</groupId>
<artifactId>forgerock-audit-handler-syslog</artifactId>
</dependency>
<dependency>
<groupId>org.forgerock.commons</groupId>
<groupId>org.wrensecurity.commons</groupId>
<artifactId>forgerock-audit-handler-jdbc</artifactId>
</dependency>
<dependency>
<groupId>org.forgerock.commons</groupId>
<groupId>org.wrensecurity.commons</groupId>
<artifactId>forgerock-audit-handler-elasticsearch</artifactId>
</dependency>
<dependency>
<groupId>org.forgerock.commons</groupId>
<groupId>org.wrensecurity.commons</groupId>
<artifactId>forgerock-audit-handler-splunk</artifactId>
</dependency>
<dependency>
<groupId>org.forgerock.commons</groupId>
<groupId>org.wrensecurity.commons</groupId>
<artifactId>forgerock-audit-handler-jms</artifactId>
</dependency>
<dependency>
Expand All @@ -81,4 +82,4 @@
</dependency>
</dependencies>

</project>
</project>
9 changes: 5 additions & 4 deletions openam-audit/openam-audit-context/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
* information: "Portions copyright [year] [name of copyright owner]".
*
* Copyright 2014-2016 ForgeRock AS.
* Portions copyright 2022 Wren Security
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
Expand All @@ -32,11 +33,11 @@

<dependencies>
<dependency>
<groupId>org.forgerock.commons</groupId>
<groupId>org.wrensecurity.commons</groupId>
<artifactId>forgerock-util</artifactId>
</dependency>
<dependency>
<groupId>org.forgerock.commons</groupId>
<groupId>org.wrensecurity.commons</groupId>
<artifactId>forgerock-audit-core</artifactId>
</dependency>
<dependency>
Expand All @@ -50,8 +51,8 @@
<classifier>no_aop</classifier>
</dependency>
<dependency>
<groupId>org.forgerock.commons</groupId>
<artifactId>forgerock-guice-core</artifactId>
<groupId>org.wrensecurity.commons</groupId>
<artifactId>wrensec-guice-core</artifactId>
</dependency>
<dependency>
<groupId>org.easytesting</groupId>
Expand Down
11 changes: 6 additions & 5 deletions openam-audit/openam-audit-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
* information: "Portions copyright [year] [name of copyright owner]".
*
* Copyright 2014-2016 ForgeRock AS.
* Portions copyright 2022 Wren Security
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
Expand Down Expand Up @@ -40,7 +41,7 @@
<artifactId>openam-i18n</artifactId>
</dependency>
<dependency>
<groupId>org.forgerock.commons</groupId>
<groupId>org.wrensecurity.commons</groupId>
<artifactId>forgerock-audit-core</artifactId>
</dependency>
<dependency>
Expand All @@ -58,19 +59,19 @@
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.forgerock.commons</groupId>
<groupId>org.wrensecurity.commons</groupId>
<artifactId>forgerock-test-utils</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.forgerock.commons</groupId>
<groupId>org.wrensecurity.commons</groupId>
<artifactId>json-resource</artifactId>
<type>test-jar</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.forgerock.commons</groupId>
<artifactId>forgerock-guice-test</artifactId>
<groupId>org.wrensecurity.commons</groupId>
<artifactId>wrensec-guice-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
Expand Down
3 changes: 2 additions & 1 deletion openam-audit/openam-audit-rest/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
* information: "Portions copyright [year] [name of copyright owner]".
*
* Copyright 2015-2016 ForgeRock AS.
* Portions copyright 2022 Wren Security
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
Expand All @@ -31,7 +32,7 @@

<dependencies>
<dependency>
<groupId>org.forgerock.commons</groupId>
<groupId>org.wrensecurity.commons</groupId>
<artifactId>forgerock-audit-core</artifactId>
</dependency>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
* information: "Portions copyright [year] [name of copyright owner]".
*
* Copyright 2016 ForgeRock AS.
* Portions copyright 2022 Wren Security
*/

package org.forgerock.openam.authentication.modules.amster;
Expand All @@ -23,7 +24,7 @@
import javax.security.auth.callback.Callback;
import javax.security.auth.login.LoginException;

import org.forgerock.guava.common.annotations.VisibleForTesting;
import org.wrensecurity.guava.common.annotations.VisibleForTesting;
import org.forgerock.openam.authentication.modules.common.AuthLoginModule;
import org.forgerock.openam.core.CoreWrapper;

Expand Down
5 changes: 3 additions & 2 deletions openam-authentication/openam-auth-common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
* information: "Portions copyright [year] [name of copyright owner]".
*
* Copyright 2013-2016 ForgeRock AS.
* Portions copyright 2022 Wren Security
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
Expand All @@ -32,7 +33,7 @@

<dependencies>
<dependency>
<groupId>org.forgerock.commons</groupId>
<groupId>org.wrensecurity.commons</groupId>
<artifactId>forgerock-jaspi-runtime</artifactId>
</dependency>
<dependency>
Expand All @@ -50,7 +51,7 @@
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
<artifactId>mockito-core</artifactId>
</dependency>
</dependencies>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,32 +12,33 @@
* information: "Portions copyright [year] [name of copyright owner]".
*
* Copyright 2013-2016 ForgeRock AS.
* Portions Copyright 2021 Wren Security.
*/

package org.forgerock.openam.authentication.modules.common;

import static org.mockito.BDDMockito.doThrow;
import static org.mockito.BDDMockito.*;
import static org.mockito.Mockito.eq;
import static org.mockito.Mockito.isNull;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.ArgumentMatchers.isNull;
import static org.mockito.BDDMockito.given;
import static org.mockito.Mockito.doThrow;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.verifyZeroInteractions;
import static org.testng.AssertJUnit.*;
import static org.testng.AssertJUnit.assertEquals;
import static org.testng.AssertJUnit.assertTrue;

import java.util.HashMap;
import java.util.Map;

import javax.security.auth.callback.CallbackHandler;
import javax.security.auth.message.AuthException;
import javax.security.auth.message.AuthStatus;
import javax.security.auth.message.MessageInfo;
import javax.security.auth.message.module.ServerAuthModule;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.mockito.Matchers;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;

Expand Down Expand Up @@ -92,7 +93,7 @@ public void shouldCallOnLoginSuccessAndThrowAuthenticationExceptionWhenAuthExcep
HttpServletResponse response = mock(HttpServletResponse.class);
SSOToken ssoToken = mock(SSOToken.class);

doThrow(AuthException.class).when(jaspiAuthWrapper).initialize((CallbackHandler) isNull(), eq(config));
doThrow(AuthException.class).when(jaspiAuthWrapper).initialize(isNull(), eq(config));

//When
boolean exceptionCaught = false;
Expand All @@ -105,8 +106,8 @@ public void shouldCallOnLoginSuccessAndThrowAuthenticationExceptionWhenAuthExcep
}

//Then
verify(jaspiAuthWrapper).initialize(any(CallbackHandler.class), eq(config));
verify(jaspiAuthWrapper, never()).secureResponse(Matchers.<MessageInfo>anyObject());
verify(jaspiAuthWrapper).initialize(any(), eq(config));
verify(jaspiAuthWrapper, never()).secureResponse(any());
assertTrue(exceptionCaught);
assertEquals(exception.getErrorCode(), "authFailed");
}
Expand All @@ -120,16 +121,16 @@ public void shouldCallOnLoginSuccessWhenSecureResponseReturnsSendSuccess() throw
HttpServletResponse response = mock(HttpServletResponse.class);
SSOToken ssoToken = mock(SSOToken.class);

given(jaspiAuthWrapper.secureResponse(Matchers.<MessageInfo>anyObject()))
given(jaspiAuthWrapper.secureResponse(any()))
.willReturn(AuthStatus.SEND_SUCCESS);

//When
jaspiPostAuthPlugin.onLoginSuccess(requestParamsMap, request, response, ssoToken);

//Then
verify(jaspiAuthWrapper).initialize(any(CallbackHandler.class), eq(config));
verify(jaspiAuthWrapper).initialize(any(), eq(config));
assertTrue(onLoginSuccessMethodCalled);
verify(jaspiAuthWrapper).secureResponse(Matchers.<MessageInfo>anyObject());
verify(jaspiAuthWrapper).secureResponse(any());
}

@Test
Expand All @@ -142,7 +143,7 @@ public void shouldCallOnLoginSuccessWhenSecureResponseReturnsSendFailure() throw
HttpServletResponse response = mock(HttpServletResponse.class);
SSOToken ssoToken = mock(SSOToken.class);

given(jaspiAuthWrapper.secureResponse(Matchers.<MessageInfo>anyObject()))
given(jaspiAuthWrapper.secureResponse(any()))
.willReturn(AuthStatus.SEND_FAILURE);

//When
Expand All @@ -156,9 +157,9 @@ public void shouldCallOnLoginSuccessWhenSecureResponseReturnsSendFailure() throw
}

//Then
verify(jaspiAuthWrapper).initialize(any(CallbackHandler.class), eq(config));
verify(jaspiAuthWrapper).initialize(any(), eq(config));
assertTrue(onLoginSuccessMethodCalled);
verify(jaspiAuthWrapper).secureResponse(Matchers.<MessageInfo>anyObject());
verify(jaspiAuthWrapper).secureResponse(any());
assertTrue(exceptionCaught);
assertEquals(exception.getErrorCode(), "authFailed");
}
Expand All @@ -173,7 +174,7 @@ public void shouldCallOnLoginSuccessWhenSecureResponseReturnsSendContinue() thro
HttpServletResponse response = mock(HttpServletResponse.class);
SSOToken ssoToken = mock(SSOToken.class);

given(jaspiAuthWrapper.secureResponse(Matchers.<MessageInfo>anyObject()))
given(jaspiAuthWrapper.secureResponse(any()))
.willReturn(AuthStatus.SEND_CONTINUE);

//When
Expand All @@ -187,9 +188,9 @@ public void shouldCallOnLoginSuccessWhenSecureResponseReturnsSendContinue() thro
}

//Then
verify(jaspiAuthWrapper).initialize(any(CallbackHandler.class), eq(config));
verify(jaspiAuthWrapper).initialize(any(), eq(config));
assertTrue(onLoginSuccessMethodCalled);
verify(jaspiAuthWrapper).secureResponse(Matchers.<MessageInfo>anyObject());
verify(jaspiAuthWrapper).secureResponse(any());
assertTrue(exceptionCaught);
assertEquals(exception.getErrorCode(), "authFailed");
}
Expand All @@ -203,7 +204,7 @@ public void shouldCallOnLoginSuccessWhenSecureResponseReturnsElse() throws Authe
HttpServletResponse response = mock(HttpServletResponse.class);
SSOToken ssoToken = mock(SSOToken.class);

given(jaspiAuthWrapper.secureResponse(Matchers.<MessageInfo>anyObject()))
given(jaspiAuthWrapper.secureResponse(any()))
.willReturn(AuthStatus.SUCCESS);

//When
Expand All @@ -217,9 +218,9 @@ public void shouldCallOnLoginSuccessWhenSecureResponseReturnsElse() throws Authe
}

//Then
verify(jaspiAuthWrapper).initialize(any(CallbackHandler.class), eq(config));
verify(jaspiAuthWrapper).initialize(any(), eq(config));
assertTrue(onLoginSuccessMethodCalled);
verify(jaspiAuthWrapper).secureResponse(Matchers.<MessageInfo>anyObject());
verify(jaspiAuthWrapper).secureResponse(any());
assertTrue(exceptionCaught);
assertEquals(exception.getErrorCode(), "authFailed");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
* information: "Portions copyright [year] [name of copyright owner]".
*
* Copyright 2013-2016 ForgeRock AS.
* Portions Copyright 2017-2021 Wren Security.
*/

package org.forgerock.openam.authentication.modules.common;
Expand Down Expand Up @@ -77,6 +78,7 @@ protected boolean process(MessageInfo messageInfo, Subject clientSubject, Callba
};

AMLoginModuleBinder amLoginModuleBinder = mock(AMLoginModuleBinder.class);
when(amLoginModuleBinder.getCallbackHandler()).thenReturn(mock(CallbackHandler.class));

jaspiAuthLoginModule.setAMLoginModule(amLoginModuleBinder);

Expand Down
2 changes: 1 addition & 1 deletion openam-authentication/openam-auth-device-id/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
<artifactId>mockito-core</artifactId>
</dependency>
</dependencies>
</project>
Loading