Skip to content

Commit df0f2f1

Browse files
authored
Merge pull request #48 from orchitech/feature/upgrade-deps
Upgrade master to the current wrensec-parent
2 parents 8cd54e5 + b90ef1b commit df0f2f1

File tree

409 files changed

+19351
-1718
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

409 files changed

+19351
-1718
lines changed

.github/workflows/build.yml

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Build
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
build:
7+
runs-on: ubuntu-latest
8+
strategy:
9+
matrix:
10+
java: [8]
11+
name: "Java ${{ matrix.java }} build"
12+
steps:
13+
- uses: actions/checkout@v2
14+
- name: Set up JDK
15+
uses: actions/setup-java@v1
16+
with:
17+
java-version: ${{ matrix.java }}
18+
- name: Cache Maven packages
19+
uses: actions/cache@v2
20+
with:
21+
path: ~/.m2
22+
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
23+
restore-keys: ${{ runner.os }}-m2
24+
- name: Run the Maven verify phase
25+
run: mvn -B verify --file pom.xml

.gitignore

+4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
target/
22
dependency-reduced-pom.xml
33
openam-ui/openam-ui-ria/npm-debug.log.*
4+
test-output/
45

56
# Editor generated files
67
*.iml
78
.idea/
9+
.project
10+
.settings
11+
.classpath

openam-audit/openam-audit-configuration/pom.xml

+8-7
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
* information: "Portions copyright [year] [name of copyright owner]".
1414
*
1515
* Copyright 2014-2016 ForgeRock AS.
16+
* Portions copyright 2022 Wren Security
1617
-->
1718
<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">
1819
<parent>
@@ -40,27 +41,27 @@
4041
<artifactId>openam-core</artifactId>
4142
</dependency>
4243
<dependency>
43-
<groupId>org.forgerock.commons</groupId>
44+
<groupId>org.wrensecurity.commons</groupId>
4445
<artifactId>forgerock-audit-handler-csv</artifactId>
4546
</dependency>
4647
<dependency>
47-
<groupId>org.forgerock.commons</groupId>
48+
<groupId>org.wrensecurity.commons</groupId>
4849
<artifactId>forgerock-audit-handler-syslog</artifactId>
4950
</dependency>
5051
<dependency>
51-
<groupId>org.forgerock.commons</groupId>
52+
<groupId>org.wrensecurity.commons</groupId>
5253
<artifactId>forgerock-audit-handler-jdbc</artifactId>
5354
</dependency>
5455
<dependency>
55-
<groupId>org.forgerock.commons</groupId>
56+
<groupId>org.wrensecurity.commons</groupId>
5657
<artifactId>forgerock-audit-handler-elasticsearch</artifactId>
5758
</dependency>
5859
<dependency>
59-
<groupId>org.forgerock.commons</groupId>
60+
<groupId>org.wrensecurity.commons</groupId>
6061
<artifactId>forgerock-audit-handler-splunk</artifactId>
6162
</dependency>
6263
<dependency>
63-
<groupId>org.forgerock.commons</groupId>
64+
<groupId>org.wrensecurity.commons</groupId>
6465
<artifactId>forgerock-audit-handler-jms</artifactId>
6566
</dependency>
6667
<dependency>
@@ -81,4 +82,4 @@
8182
</dependency>
8283
</dependencies>
8384

84-
</project>
85+
</project>

openam-audit/openam-audit-context/pom.xml

+5-4
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
* information: "Portions copyright [year] [name of copyright owner]".
1414
*
1515
* Copyright 2014-2016 ForgeRock AS.
16+
* Portions copyright 2022 Wren Security
1617
-->
1718
<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">
1819
<parent>
@@ -32,11 +33,11 @@
3233

3334
<dependencies>
3435
<dependency>
35-
<groupId>org.forgerock.commons</groupId>
36+
<groupId>org.wrensecurity.commons</groupId>
3637
<artifactId>forgerock-util</artifactId>
3738
</dependency>
3839
<dependency>
39-
<groupId>org.forgerock.commons</groupId>
40+
<groupId>org.wrensecurity.commons</groupId>
4041
<artifactId>forgerock-audit-core</artifactId>
4142
</dependency>
4243
<dependency>
@@ -50,8 +51,8 @@
5051
<classifier>no_aop</classifier>
5152
</dependency>
5253
<dependency>
53-
<groupId>org.forgerock.commons</groupId>
54-
<artifactId>forgerock-guice-core</artifactId>
54+
<groupId>org.wrensecurity.commons</groupId>
55+
<artifactId>wrensec-guice-core</artifactId>
5556
</dependency>
5657
<dependency>
5758
<groupId>org.easytesting</groupId>

openam-audit/openam-audit-core/pom.xml

+6-5
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
* information: "Portions copyright [year] [name of copyright owner]".
1414
*
1515
* Copyright 2014-2016 ForgeRock AS.
16+
* Portions copyright 2022 Wren Security
1617
-->
1718
<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">
1819
<parent>
@@ -40,7 +41,7 @@
4041
<artifactId>openam-i18n</artifactId>
4142
</dependency>
4243
<dependency>
43-
<groupId>org.forgerock.commons</groupId>
44+
<groupId>org.wrensecurity.commons</groupId>
4445
<artifactId>forgerock-audit-core</artifactId>
4546
</dependency>
4647
<dependency>
@@ -58,19 +59,19 @@
5859
<scope>test</scope>
5960
</dependency>
6061
<dependency>
61-
<groupId>org.forgerock.commons</groupId>
62+
<groupId>org.wrensecurity.commons</groupId>
6263
<artifactId>forgerock-test-utils</artifactId>
6364
<scope>test</scope>
6465
</dependency>
6566
<dependency>
66-
<groupId>org.forgerock.commons</groupId>
67+
<groupId>org.wrensecurity.commons</groupId>
6768
<artifactId>json-resource</artifactId>
6869
<type>test-jar</type>
6970
<scope>test</scope>
7071
</dependency>
7172
<dependency>
72-
<groupId>org.forgerock.commons</groupId>
73-
<artifactId>forgerock-guice-test</artifactId>
73+
<groupId>org.wrensecurity.commons</groupId>
74+
<artifactId>wrensec-guice-test</artifactId>
7475
<scope>test</scope>
7576
</dependency>
7677
</dependencies>

openam-audit/openam-audit-rest/pom.xml

+2-1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
* information: "Portions copyright [year] [name of copyright owner]".
1414
*
1515
* Copyright 2015-2016 ForgeRock AS.
16+
* Portions copyright 2022 Wren Security
1617
-->
1718
<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">
1819
<parent>
@@ -31,7 +32,7 @@
3132

3233
<dependencies>
3334
<dependency>
34-
<groupId>org.forgerock.commons</groupId>
35+
<groupId>org.wrensecurity.commons</groupId>
3536
<artifactId>forgerock-audit-core</artifactId>
3637
</dependency>
3738
<dependency>

openam-authentication/openam-auth-amster/src/main/java/org/forgerock/openam/authentication/modules/amster/AmsterAuthLoginModule.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
* information: "Portions copyright [year] [name of copyright owner]".
1313
*
1414
* Copyright 2016 ForgeRock AS.
15+
* Portions copyright 2022 Wren Security
1516
*/
1617

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

26-
import org.forgerock.guava.common.annotations.VisibleForTesting;
27+
import org.wrensecurity.guava.common.annotations.VisibleForTesting;
2728
import org.forgerock.openam.authentication.modules.common.AuthLoginModule;
2829
import org.forgerock.openam.core.CoreWrapper;
2930

openam-authentication/openam-auth-common/pom.xml

+3-2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
* information: "Portions copyright [year] [name of copyright owner]".
1414
*
1515
* Copyright 2013-2016 ForgeRock AS.
16+
* Portions copyright 2022 Wren Security
1617
-->
1718
<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">
1819
<modelVersion>4.0.0</modelVersion>
@@ -32,7 +33,7 @@
3233

3334
<dependencies>
3435
<dependency>
35-
<groupId>org.forgerock.commons</groupId>
36+
<groupId>org.wrensecurity.commons</groupId>
3637
<artifactId>forgerock-jaspi-runtime</artifactId>
3738
</dependency>
3839
<dependency>
@@ -50,7 +51,7 @@
5051
</dependency>
5152
<dependency>
5253
<groupId>org.mockito</groupId>
53-
<artifactId>mockito-all</artifactId>
54+
<artifactId>mockito-core</artifactId>
5455
</dependency>
5556
</dependencies>
5657

openam-authentication/openam-auth-common/src/test/java/org/forgerock/openam/authentication/modules/common/JaspiAuthLoginModulePAPTest.java

+23-22
Original file line numberDiff line numberDiff line change
@@ -12,32 +12,33 @@
1212
* information: "Portions copyright [year] [name of copyright owner]".
1313
*
1414
* Copyright 2013-2016 ForgeRock AS.
15+
* Portions Copyright 2021 Wren Security.
1516
*/
1617

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

19-
import static org.mockito.BDDMockito.doThrow;
20-
import static org.mockito.BDDMockito.*;
21-
import static org.mockito.Mockito.eq;
22-
import static org.mockito.Mockito.isNull;
20+
import static org.mockito.ArgumentMatchers.any;
21+
import static org.mockito.ArgumentMatchers.eq;
22+
import static org.mockito.ArgumentMatchers.isNull;
23+
import static org.mockito.BDDMockito.given;
24+
import static org.mockito.Mockito.doThrow;
2325
import static org.mockito.Mockito.mock;
2426
import static org.mockito.Mockito.never;
2527
import static org.mockito.Mockito.verify;
2628
import static org.mockito.Mockito.verifyZeroInteractions;
27-
import static org.testng.AssertJUnit.*;
29+
import static org.testng.AssertJUnit.assertEquals;
30+
import static org.testng.AssertJUnit.assertTrue;
2831

2932
import java.util.HashMap;
3033
import java.util.Map;
3134

32-
import javax.security.auth.callback.CallbackHandler;
3335
import javax.security.auth.message.AuthException;
3436
import javax.security.auth.message.AuthStatus;
3537
import javax.security.auth.message.MessageInfo;
3638
import javax.security.auth.message.module.ServerAuthModule;
3739
import javax.servlet.http.HttpServletRequest;
3840
import javax.servlet.http.HttpServletResponse;
3941

40-
import org.mockito.Matchers;
4142
import org.testng.annotations.BeforeMethod;
4243
import org.testng.annotations.Test;
4344

@@ -92,7 +93,7 @@ public void shouldCallOnLoginSuccessAndThrowAuthenticationExceptionWhenAuthExcep
9293
HttpServletResponse response = mock(HttpServletResponse.class);
9394
SSOToken ssoToken = mock(SSOToken.class);
9495

95-
doThrow(AuthException.class).when(jaspiAuthWrapper).initialize((CallbackHandler) isNull(), eq(config));
96+
doThrow(AuthException.class).when(jaspiAuthWrapper).initialize(isNull(), eq(config));
9697

9798
//When
9899
boolean exceptionCaught = false;
@@ -105,8 +106,8 @@ public void shouldCallOnLoginSuccessAndThrowAuthenticationExceptionWhenAuthExcep
105106
}
106107

107108
//Then
108-
verify(jaspiAuthWrapper).initialize(any(CallbackHandler.class), eq(config));
109-
verify(jaspiAuthWrapper, never()).secureResponse(Matchers.<MessageInfo>anyObject());
109+
verify(jaspiAuthWrapper).initialize(any(), eq(config));
110+
verify(jaspiAuthWrapper, never()).secureResponse(any());
110111
assertTrue(exceptionCaught);
111112
assertEquals(exception.getErrorCode(), "authFailed");
112113
}
@@ -120,16 +121,16 @@ public void shouldCallOnLoginSuccessWhenSecureResponseReturnsSendSuccess() throw
120121
HttpServletResponse response = mock(HttpServletResponse.class);
121122
SSOToken ssoToken = mock(SSOToken.class);
122123

123-
given(jaspiAuthWrapper.secureResponse(Matchers.<MessageInfo>anyObject()))
124+
given(jaspiAuthWrapper.secureResponse(any()))
124125
.willReturn(AuthStatus.SEND_SUCCESS);
125126

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

129130
//Then
130-
verify(jaspiAuthWrapper).initialize(any(CallbackHandler.class), eq(config));
131+
verify(jaspiAuthWrapper).initialize(any(), eq(config));
131132
assertTrue(onLoginSuccessMethodCalled);
132-
verify(jaspiAuthWrapper).secureResponse(Matchers.<MessageInfo>anyObject());
133+
verify(jaspiAuthWrapper).secureResponse(any());
133134
}
134135

135136
@Test
@@ -142,7 +143,7 @@ public void shouldCallOnLoginSuccessWhenSecureResponseReturnsSendFailure() throw
142143
HttpServletResponse response = mock(HttpServletResponse.class);
143144
SSOToken ssoToken = mock(SSOToken.class);
144145

145-
given(jaspiAuthWrapper.secureResponse(Matchers.<MessageInfo>anyObject()))
146+
given(jaspiAuthWrapper.secureResponse(any()))
146147
.willReturn(AuthStatus.SEND_FAILURE);
147148

148149
//When
@@ -156,9 +157,9 @@ public void shouldCallOnLoginSuccessWhenSecureResponseReturnsSendFailure() throw
156157
}
157158

158159
//Then
159-
verify(jaspiAuthWrapper).initialize(any(CallbackHandler.class), eq(config));
160+
verify(jaspiAuthWrapper).initialize(any(), eq(config));
160161
assertTrue(onLoginSuccessMethodCalled);
161-
verify(jaspiAuthWrapper).secureResponse(Matchers.<MessageInfo>anyObject());
162+
verify(jaspiAuthWrapper).secureResponse(any());
162163
assertTrue(exceptionCaught);
163164
assertEquals(exception.getErrorCode(), "authFailed");
164165
}
@@ -173,7 +174,7 @@ public void shouldCallOnLoginSuccessWhenSecureResponseReturnsSendContinue() thro
173174
HttpServletResponse response = mock(HttpServletResponse.class);
174175
SSOToken ssoToken = mock(SSOToken.class);
175176

176-
given(jaspiAuthWrapper.secureResponse(Matchers.<MessageInfo>anyObject()))
177+
given(jaspiAuthWrapper.secureResponse(any()))
177178
.willReturn(AuthStatus.SEND_CONTINUE);
178179

179180
//When
@@ -187,9 +188,9 @@ public void shouldCallOnLoginSuccessWhenSecureResponseReturnsSendContinue() thro
187188
}
188189

189190
//Then
190-
verify(jaspiAuthWrapper).initialize(any(CallbackHandler.class), eq(config));
191+
verify(jaspiAuthWrapper).initialize(any(), eq(config));
191192
assertTrue(onLoginSuccessMethodCalled);
192-
verify(jaspiAuthWrapper).secureResponse(Matchers.<MessageInfo>anyObject());
193+
verify(jaspiAuthWrapper).secureResponse(any());
193194
assertTrue(exceptionCaught);
194195
assertEquals(exception.getErrorCode(), "authFailed");
195196
}
@@ -203,7 +204,7 @@ public void shouldCallOnLoginSuccessWhenSecureResponseReturnsElse() throws Authe
203204
HttpServletResponse response = mock(HttpServletResponse.class);
204205
SSOToken ssoToken = mock(SSOToken.class);
205206

206-
given(jaspiAuthWrapper.secureResponse(Matchers.<MessageInfo>anyObject()))
207+
given(jaspiAuthWrapper.secureResponse(any()))
207208
.willReturn(AuthStatus.SUCCESS);
208209

209210
//When
@@ -217,9 +218,9 @@ public void shouldCallOnLoginSuccessWhenSecureResponseReturnsElse() throws Authe
217218
}
218219

219220
//Then
220-
verify(jaspiAuthWrapper).initialize(any(CallbackHandler.class), eq(config));
221+
verify(jaspiAuthWrapper).initialize(any(), eq(config));
221222
assertTrue(onLoginSuccessMethodCalled);
222-
verify(jaspiAuthWrapper).secureResponse(Matchers.<MessageInfo>anyObject());
223+
verify(jaspiAuthWrapper).secureResponse(any());
223224
assertTrue(exceptionCaught);
224225
assertEquals(exception.getErrorCode(), "authFailed");
225226
}

openam-authentication/openam-auth-common/src/test/java/org/forgerock/openam/authentication/modules/common/JaspiAuthLoginModuleTest.java

+2
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
* information: "Portions copyright [year] [name of copyright owner]".
1313
*
1414
* Copyright 2013-2016 ForgeRock AS.
15+
* Portions Copyright 2017-2021 Wren Security.
1516
*/
1617

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

7980
AMLoginModuleBinder amLoginModuleBinder = mock(AMLoginModuleBinder.class);
81+
when(amLoginModuleBinder.getCallbackHandler()).thenReturn(mock(CallbackHandler.class));
8082

8183
jaspiAuthLoginModule.setAMLoginModule(amLoginModuleBinder);
8284

openam-authentication/openam-auth-device-id/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
</dependency>
4444
<dependency>
4545
<groupId>org.mockito</groupId>
46-
<artifactId>mockito-all</artifactId>
46+
<artifactId>mockito-core</artifactId>
4747
</dependency>
4848
</dependencies>
4949
</project>

0 commit comments

Comments
 (0)