Skip to content

Commit

Permalink
IDAM 9.6-RC1 (#1115)
Browse files Browse the repository at this point in the history
  • Loading branch information
kremi authored Apr 8, 2024
1 parent 66e6f09 commit 36694ff
Show file tree
Hide file tree
Showing 12 changed files with 669 additions and 487 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# renovate: datasource=github-releases depName=microsoft/ApplicationInsights-Java
ARG APP_INSIGHTS_AGENT_VERSION=3.4.18
ARG APP_INSIGHTS_AGENT_VERSION=3.5.1

# Application image
FROM hmctspublic.azurecr.io/base/java:21-distroless
Expand Down
12 changes: 6 additions & 6 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ allprojects {
}
implementation libs.bundles.applicationinsights

implementation group: 'com.squareup.okio', name: 'okio', version: '3.7.0'
implementation group: 'com.squareup.okio', name: 'okio', version: '3.9.0'

implementation group: 'org.springframework.boot', name: 'spring-boot-starter-actuator'
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-web'
Expand Down Expand Up @@ -141,17 +141,17 @@ allprojects {
implementation group: 'org.apache.httpcomponents', name: 'httpclient'
implementation group: 'org.apache.httpcomponents', name: 'httpcore'
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-tomcat'
implementation group: 'org.apache.tomcat.embed', name: 'tomcat-embed-jasper', version: '9.0.84'
implementation group: 'org.apache.tomcat.embed', name: 'tomcat-embed-core', version: '9.0.84'
implementation group: 'org.apache.tomcat.embed', name: 'tomcat-embed-websocket', version: '10.1.17'
implementation group: 'org.pitest', name: 'pitest', version: '1.15.3'
implementation group: 'org.apache.tomcat.embed', name: 'tomcat-embed-jasper', version: '9.0.87'
implementation group: 'org.apache.tomcat.embed', name: 'tomcat-embed-core', version: '9.0.87'
implementation group: 'org.apache.tomcat.embed', name: 'tomcat-embed-websocket', version: '10.1.20'
implementation group: 'org.pitest', name: 'pitest', version: '1.15.8'
implementation group: 'info.solidsoft.gradle.pitest', name: 'gradle-pitest-plugin', version: '1.15.0'
implementation group: 'org.owasp.encoder', name: 'encoder-jsp', version: '1.2.3'
implementation (group: 'org.codehaus.sonar-plugins', name: 'sonar-pitest-plugin', version: '0.5') {
exclude module: 'junit'
}

testImplementation 'com.github.hmcts:fortify-client:1.3.0:all'
testImplementation 'com.github.hmcts:fortify-client:1.4.1:all'
testCompileOnly("org.projectlombok:lombok")
testAnnotationProcessor("org.projectlombok:lombok")
testImplementation('pl.pragmatists:JUnitParams:1.1.1') {
Expand Down
4 changes: 2 additions & 2 deletions charts/idam-web-public/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ apiVersion: v2
appVersion: "1.0"
description: A Helm chart for CFT IDAM Public Web-App
name: idam-web-public
version: 0.3.0
version: 0.4.0
dependencies:
- name: java
version: ~5.0.0
version: ~5.2.0
repository: https://hmctspublic.azurecr.io/helm/v1/repo/
maintainers:
- name: CFT IDAM Team
Expand Down
12 changes: 8 additions & 4 deletions charts/idam-web-public/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,14 @@ java:
ENDPOINTS_ENABLED: true
SSL_VERIFICATION_ENABLED: true
GA_TRACKING_ID: ''
autoscaling:
enabled: true
maxReplicas: 4
targetCPUUtilizationPercentage: 80

cpuRequests: '1000m'
cpuLimits: '2500m'
memoryRequests: '1024Mi'
cpuRequests: '60m'
cpuLimits: '100m'
memoryRequests: '1536Mi'
memoryLimits: '2048Mi'

devmemoryRequests: '768Mi'
Expand All @@ -55,4 +59,4 @@ global:
securityContext:
sysctls:
- name: net.ipv4.tcp_retries2
value: "3"
value: "3"
14 changes: 7 additions & 7 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
[versions]
api-spec = "4.0.6"
commons-io = "2.15.1"
api-spec = "4.0.8"
commons-io = "2.16.0"
commons-text = "1.11.0"
commons-fileupload = "1.5"
feign = "13.1"
feign = "13.2.1"
feign-form = "3.8.0"
findbugs = "3.0.2"
guava = "33.0.0-jre"
guava = "33.1.0-jre"
snakeyaml = "2.2"
spring-boot = "2.7.18"
spring-cloud = "3.1.9"
spring-security-oauth2 = "2.5.2.RELEASE"
spring-security-oauth2-autoconfigure = "2.6.8"
reform-logging = "6.0.1"
reform-logging = "6.1.4"

[libraries]
reform-java-logging = { module = "com.github.hmcts.java-logging:logging", version.ref = "reform-logging"}
Expand All @@ -35,7 +35,7 @@ feign = ["feign-jackson", "feign-okhttp", "spring-cloud-openfeign"]
jmh = { id = "me.champeau.jmh", version = "0.7.2" }
spring = { id = "io.spring.dependency-management", version = "1.1.4" }
spring-framework = { id = "org.springframework.boot", version.ref = "spring-boot" }
owasp = { id = "org.owasp.dependencycheck", version = "9.0.9" }
sonarqube = { id = "org.sonarqube", version = "4.4.1.3373" }
owasp = { id = "org.owasp.dependencycheck", version = "9.1.0" }
sonarqube = { id = "org.sonarqube", version = "5.0.0.4638" }
pitest = { id = "info.solidsoft.pitest", version = "1.15.0" }
git-properties = { id = "com.gorylenko.gradle-git-properties", version = "2.4.1" }
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-all.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
20 changes: 10 additions & 10 deletions gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if %ERRORLEVEL% equ 0 goto execute

echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
echo. 1>&2
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2

goto fail

Expand All @@ -57,11 +57,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe

if exist "%JAVA_EXE%" goto execute

echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
echo. 1>&2
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2

goto fail

Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"devDependencies": {
"chai": "^4.4.1",
"codeceptjs": "^3.0.4",
"electron": "^28.0.0",
"electron": "^29.0.0",
"deep-equal-in-any-order": "^2.0.0",
"jwt-decode": "^3.1.2",
"mocha-junit-reporter": "^2.0.0",
Expand All @@ -18,7 +18,7 @@
"nightmare": "^3.0.2",
"node-fetch": "^2.6.1",
"notifications-node-client": "^8.0.0",
"pa11y": "^6.0.0",
"pa11y": "^8.0.0",
"proxy-agent": "^6.0.0",
"puppeteer": "^21.5.2",
"webdriverio": "^8.0.0",
Expand All @@ -29,6 +29,6 @@
"test:crossbrowser": "runSauceLabsTests.sh"
},
"resolutions": {
"electron": "^28.0.0"
"electron": "^29.0.0"
}
}
10 changes: 10 additions & 0 deletions src/test/js/login_user_functional_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ const testSuitePrefix = randomData.getRandomAlphabeticString();
const serviceName = randomData.getRandomServiceName(testSuitePrefix);
const serviceClientSecret = randomData.getRandomClientSecret();
const userPassword = randomData.getRandomUserPassword();
const largeCookieValue = randomData.getRandomTextFor11KB();

BeforeSuite(async ({ I }) => {
randomUserFirstName = randomData.getRandomUserName(testSuitePrefix);
Expand All @@ -41,6 +42,15 @@ AfterSuite(async ({ I }) => {
Scenario('@functional @login As a citizen user I can login with spaces in uppercase email', async ({ I }) => {
const loginUrl = `${TestData.WEB_PUBLIC_URL}/login?redirect_uri=${TestData.SERVICE_REDIRECT_URI}&client_id=${serviceName}`;
I.amOnPage(loginUrl);
const [page] = await I.getCurrentPage()

//Set around 11 kb of cookie
page.setCookie({
name: 'cookieName',
value: largeCookieValue,
path: '/', // Add path parameter if necessary
expires: Math.floor(Date.now() / 1000) + 60 * 60, // Example expiration time (1 hour from now)
});
I.waitForText('Cookies on hmcts-access.service.gov.uk');
await I.runAccessibilityTest();
I.click('Accept additional cookies');
Expand Down
10 changes: 10 additions & 0 deletions src/test/js/shared/random_data.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,15 @@ function randomAlphabeticString(length = 10) {
return randomString
}

function createRandomString(length) {
const chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
let result = "";
for (let i = 0; i < length; i++) {
result += chars.charAt(Math.floor(Math.random() * chars.length));
}
return result;
}

function generatePassword(passwordLength) {
const numberChars = "0123456789";
const upperChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
Expand Down Expand Up @@ -44,6 +53,7 @@ module.exports = {
getRandomEmailAddress: () => randomString() + "@mailtest.gov.uk",
getRandomUserPassword: () => generatePassword(12),
getRandomClientSecret: () => generatePassword(12),
getRandomTextFor11KB: () => createRandomString(1112150),
getRandomUserName: (testSuitePrefix) => testBasePrefix + testSuitePrefix + "USER" + randomAlphabeticString(),
getRandomRoleName: (testSuitePrefix) => testBasePrefix + testSuitePrefix + "ROLE_" + randomString(),
getRandomServiceName: (testSuitePrefix) => testBasePrefix + testSuitePrefix + "SERVICE_" + randomString(),
Expand Down
Loading

0 comments on commit 36694ff

Please sign in to comment.