Skip to content

Commit

Permalink
Maintenance (#820)
Browse files Browse the repository at this point in the history
- Updates Abort-Mission (lib and plugin) version to 5.0.0
- Updates Docker tests to use JDK 17
- Removes unused dependency metadata
- Stops using the buildDir Gradle reference
- Stops using a deprecated method in a Docker test
- Updates readme

{patch}

Signed-off-by: Esta Nagy <nagyesta@gmail.com>
  • Loading branch information
nagyesta authored Jan 2, 2024
1 parent 67aa550 commit b5fdfaa
Show file tree
Hide file tree
Showing 7 changed files with 59 additions and 1,043 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ alternative for the cases when using a real Key Vault is not practical or imposs

## Recommended use

### Warning!

> [!WARNING]
> Lowkey Vault is NOT intended as an [Azure Key Vault](https://azure.microsoft.com/en-us/services/key-vault/) replacement. Please do not attempt using it instead of the real service in production as it is not using any security measures to keep your secrets safe.
### Valid use-cases
Expand Down Expand Up @@ -53,7 +52,8 @@ I have an app using Azure Key Vault and:

### Docker

Note: a complex example is available [here](https://github.com/nagyesta/lowkey-vault-example-docker)
> [!NOTE]
> A complex example is available [here](https://github.com/nagyesta/lowkey-vault-example-docker)
1. Pull the most recent version from ```nagyesta/lowkey-vault```
- You can find a list of all the available tags [here](https://hub.docker.com/r/nagyesta/lowkey-vault/tags)
Expand Down
12 changes: 6 additions & 6 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,10 @@ configure(subprojects.findAll({
jacocoTestReport {
reports {
xml.required.set(true)
xml.outputLocation.set(file("$buildDir/reports/jacoco/report.xml"))
xml.outputLocation.set(layout.buildDirectory.file("reports/jacoco/report.xml").get().getAsFile())
csv.required.set(false)
html.required.set(true)
html.outputLocation.set(file("$buildDir/reports/jacoco/html"))
html.outputLocation.set(layout.buildDirectory.dir("reports/jacoco/html").get().getAsFile())
}
}

Expand All @@ -94,8 +94,8 @@ configure(subprojects.findAll({
}

jacocoTestCoverageVerification {
inputs.file(file("${buildDir}/reports/jacoco/report.xml") as String)
outputs.file(file("${buildDir}/reports/jacoco/jacocoTestCoverageVerification") as String)
inputs.file(layout.buildDirectory.file("reports/jacoco/report.xml").get().getAsFile())
outputs.file(layout.buildDirectory.file("reports/jacoco/jacocoTestCoverageVerification").get().getAsFile())

violationRules {
rule {
Expand Down Expand Up @@ -134,13 +134,13 @@ configure(subprojects.findAll({
}
}
doLast {
file("${buildDir}/reports/jacoco/jacocoTestCoverageVerification").write("Passed")
layout.buildDirectory.file("reports/jacoco/jacocoTestCoverageVerification").get().getAsFile().write("Passed")
}
}
jar.dependsOn check

tasks.withType(Checkstyle).configureEach {
configProperties = [base_dir: rootDir.toString(), cache_file: file("${buildDir}/checkstyle/cacheFile")]
configProperties = [base_dir: rootDir.toString(), cache_file: layout.buildDirectory.file("checkstyle/cacheFile").get().getAsFile()]
reports {
xml.required.set(false)
html.required.set(true)
Expand Down
4 changes: 2 additions & 2 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ testcontainers = "1.19.3"
cucumber = "7.15.0"
mockitoCore = "5.8.0"
jupiter = "5.10.1"
abortMission = "4.2.122"
abortMission = "5.0.0"
checkstyle = "10.12.2"
jacoco = "0.8.10"
jacksonBom = { strictly = "2.16.1" }
jackson = { strictly = "2.16.1" }
openApiUi = "2.3.0"

abortMissionPlugin = "4.1.46"
abortMissionPlugin = "5.0.0"
dockerPlugin = "0.35.0"
indexScanPlugin = "2.6.2"
lombokPlugin = "8.4"
Expand Down
1,057 changes: 36 additions & 1,021 deletions gradle/verification-metadata.xml

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion lowkey-vault-app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ java {
}

test {
outputs.file(file("$buildDir/reports/abort-mission/abort-mission-report.json"))
outputs.file(layout.buildDirectory.file("reports/abort-mission/abort-mission-report.json").get().getAsFile())
useJUnitPlatform()
systemProperty("junit.jupiter.extensions.autodetection.enabled", true)
systemProperty("junit.jupiter.execution.parallel.enabled", true)
Expand Down
18 changes: 9 additions & 9 deletions lowkey-vault-docker/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -33,19 +33,19 @@ dependencies {
}

java {
sourceCompatibility = JavaVersion.VERSION_11
sourceCompatibility = JavaVersion.VERSION_17
toolchain {
languageVersion = JavaLanguageVersion.of(11)
languageVersion = JavaLanguageVersion.of(17)
}
withJavadocJar()
withSourcesJar()
}

tasks.register('copyAppJar', Copy.class) {
inputs.file(rootProject.project(":lowkey-vault-app").tasks.named("bootJar").get().outputs.files.singleFile)
outputs.file("${buildDir}/app/lowkey-vault.jar")
outputs.file(layout.buildDirectory.file("app/lowkey-vault.jar").get().getAsFile())
from rootProject.project(":lowkey-vault-app").tasks.named("bootJar").get().outputs.files.singleFile
into file("${buildDir}/app/")
into layout.buildDirectory.dir("app/").get().getAsFile()
rename {
'lowkey-vault.jar'
}
Expand All @@ -57,11 +57,11 @@ docker {
name "lowkey-vault:${rootProject.version}"
tag 'dockerNagyesta', "nagyesta/lowkey-vault:${rootProject.version}"
dockerfile file('src/docker/Dockerfile')
files file("${buildDir}/app/lowkey-vault.jar")
files layout.buildDirectory.file("app/lowkey-vault.jar").get().getAsFile()
pull true
noCache true
}
tasks.dockerPrepare.inputs.file("${buildDir}/app/lowkey-vault.jar")
tasks.dockerPrepare.inputs.file(layout.buildDirectory.file("app/lowkey-vault.jar").get().getAsFile())
tasks.dockerPrepare.dependsOn copyAppJar
clean.mustRunAfter dockerClean

Expand All @@ -80,12 +80,12 @@ tasks.dockerRun.dependsOn tasks.docker

test {
inputs.file(rootProject.project(":lowkey-vault-app").tasks.named("bootJar").get().outputs.files.singleFile)
outputs.file(file("$buildDir/reports/abort-mission/abort-mission-report.json"))
outputs.dir(file("$buildDir/reports/cucumber"))
outputs.file(layout.buildDirectory.file("reports/abort-mission/abort-mission-report.json").get().getAsFile())
outputs.dir(layout.buildDirectory.dir("reports/cucumber").get().getAsFile())
systemProperty("cucumber.execution.parallel.enabled", System.getProperty("test.parallel"))
systemProperty("cucumber.filter.tags", "not @ignore")
useTestNG {
systemProperty("abort-mission.report.directory", file("${buildDir}/reports/abort-mission/"))
systemProperty("abort-mission.report.directory", layout.buildDirectory.dir("reports/abort-mission/").get().getAsFile())
systemProperty("abort-mission.force.abort.evaluators", rootProject.ext.dockerAbortGroups)
systemProperty("abort-mission.suppress.abort.evaluators", rootProject.ext.dockerSuppressGroups)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,8 @@ public byte[] getThumbprint(final X509Certificate certificate) throws CryptoExce
messageDigest.update(certificate.getEncoded());
return messageDigest.digest();
} catch (final Exception e) {
throw new CryptoException("Failed to calculate thumbprint for certificate: " + certificate.getSubjectDN().getName(), e);
throw new CryptoException("Failed to calculate thumbprint for certificate: "
+ certificate.getSubjectX500Principal().getName(), e);
}
}

Expand Down

0 comments on commit b5fdfaa

Please sign in to comment.