Skip to content

Commit 19c5c00

Browse files
k-wallSamBarker
authored andcommitted
Fix misspelt Fortanix env vars and secrets causing failures on CI's main pipeline (kroxylicious#1808)
Signed-off-by: Keith Wall <[email protected]> Signed-off-by: Sam Barker <[email protected]>
1 parent 34aaaca commit 19c5c00

File tree

4 files changed

+14
-10
lines changed

4 files changed

+14
-10
lines changed

.github/workflows/maven.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,9 @@ jobs:
6666
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6767
# These variables/secrets support the Fortanix/KMS integration tests. If the secrets are absent, the
6868
# tests will be skipped.
69-
KROYXLICIOUS_KMS_FORTANIX_API_ENDPOINT: ${{ vars.KROYXLICIOUS_KMS_FORTANIX_API_ENDPOINT }}
70-
KROYXLICIOUS_KMS_FORTANIX_ADMIN_API_KEY: ${{ secrets.KROYXLICIOUS_KMS_FORTANIX_ADMIN_API_KEY }}
71-
KROYXLICIOUS_KMS_FORTANIX_API_KEY: ${{ secrets.KROYXLICIOUS_KMS_FORTANIX_API_KEY }}
69+
KROXYLICIOUS_KMS_FORTANIX_API_ENDPOINT: ${{ vars.KROXYLICIOUS_KMS_FORTANIX_API_ENDPOINT }}
70+
KROXYLICIOUS_KMS_FORTANIX_ADMIN_API_KEY: ${{ secrets.KROXYLICIOUS_KMS_FORTANIX_ADMIN_API_KEY }}
71+
KROXYLICIOUS_KMS_FORTANIX_API_KEY: ${{ secrets.KROXYLICIOUS_KMS_FORTANIX_API_KEY }}
7272
run: mvn -B clean verify -Pci -Djapicmp.skip=${REFERENCE_RELEASE_UNPUBLISHED}
7373
- name: 'Build Kroxylicious maven project on main with Sonar'
7474
if: github.event_name == 'push' && github.ref_name == 'main' && env.SONAR_TOKEN_SET == 'true'

kroxylicious-kms-provider-fortanix-dsm-test-support/src/main/java/io/kroxylicious/kms/provider/fortanix/dsm/FortanixDsmKmsTestKmsFacade.java

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
import java.util.Map;
1717
import java.util.Optional;
1818
import java.util.UUID;
19+
import java.util.function.Predicate;
1920

2021
import org.slf4j.Logger;
2122
import org.slf4j.LoggerFactory;
@@ -73,12 +74,15 @@ class FortanixDsmKmsTestKmsFacade implements TestKmsFacade<Config, String, Forta
7374
private static final String TEST_RUN_INSTANCE_ID_METADATA_KEY = "testInstance";
7475
private static final ObjectMapper OBJECT_MAPPER = new ObjectMapper();
7576
@SuppressWarnings("OptionalUsedAsFieldOrParameterType")
76-
private static final Optional<URI> KROXYLICIOUS_KMS_FORTANIX_API_ENDPOINT = Optional.ofNullable(System.getenv().get("KROXYLICIOUS_KMS_FORTANIX_API_ENDPOINT"))
77-
.map(URI::create);
77+
private static final Optional<URI> KROXYLICIOUS_KMS_FORTANIX_API_ENDPOINT = Optional.ofNullable(System.getenv().get("KROXYLICIOUS_KMS_FORTANIX_API_ENDPOINT")).filter(
78+
Predicate.not(String::isEmpty)).map(URI::create);
7879
@SuppressWarnings("OptionalUsedAsFieldOrParameterType")
79-
private static final Optional<String> KROXYLICIOUS_KMS_FORTANIX_ADMIN_API_KEY = Optional.ofNullable(System.getenv().get("KROXYLICIOUS_KMS_FORTANIX_ADMIN_API_KEY"));
80+
private static final Optional<String> KROXYLICIOUS_KMS_FORTANIX_ADMIN_API_KEY = Optional.ofNullable(System.getenv().get("KROXYLICIOUS_KMS_FORTANIX_ADMIN_API_KEY"))
81+
.filter(
82+
Predicate.not(String::isEmpty));
8083
@SuppressWarnings("OptionalUsedAsFieldOrParameterType")
81-
private static final Optional<String> KROXYLICIOUS_KMS_FORTANIX_API_KEY = Optional.ofNullable(System.getenv().get("KROXYLICIOUS_KMS_FORTANIX_API_KEY"));
84+
private static final Optional<String> KROXYLICIOUS_KMS_FORTANIX_API_KEY = Optional.ofNullable(System.getenv().get("KROXYLICIOUS_KMS_FORTANIX_API_KEY")).filter(
85+
Predicate.not(String::isEmpty));
8286

8387
private static final TypeReference<List<KeyResponse>> KEY_LIST_RESPONSE_RESPONSE = new TypeReference<>() {
8488
};

kroxylicious-kms-provider-fortanix-dsm/DEV_GUIDE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ If you don't have a Fortanix DSM SaaS account, create a trial account. Create
1515
It is the former that we use. Copy the single string "API Key". Use those values to set the two API_KEY environment variables.
1616

1717
Once you've done these steps you can run the the io.kroxylicious.kms.service.KmsIT and io.kroxylicious.proxy.encryption.RecordEncryptionFilterIT.
18-
The integration test will execute the Fortanix KMS integration. You can set `KROYXLICIOUS_KMS_FACADE_CLASS_NAME_FILTER` to `.*Fortanix.*` so that
18+
The integration test will execute the Fortanix KMS integration. You can set `KROXYLICIOUS_KMS_FACADE_CLASS_NAME_FILTER` to `.*Fortanix.*` so that
1919
only the integrations for the other KMS providers are skipped.
2020

2121
## CLI

kroxylicious-kms-test-support/src/main/java/io/kroxylicious/kms/service/TestKmsFacadeInvocationContextProvider.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,15 @@
3030
/**
3131
* Junit Context Provider providing available {@link TestKmsFacade}s to integration tests.
3232
* <br/>
33-
* The variable {@code KROYXLICIOUS_KMS_FACADE_CLASS_NAME_FILTER} is a regular expression that limits the facades available
33+
* The variable {@code KROXYLICIOUS_KMS_FACADE_CLASS_NAME_FILTER} is a regular expression that limits the facades available
3434
* to the test. It matches against the facade class name.
3535
*/
3636
public class TestKmsFacadeInvocationContextProvider implements TestTemplateInvocationContextProvider, ParameterResolver {
3737

3838
private static final ExtensionContext.Namespace STORE_NAMESPACE = ExtensionContext.Namespace.create("TEST_KMS");
3939
private static final String FACADE_FACTORIES = "KMS_FACADE_FACTORIES";
4040

41-
private static final Pattern FACADE_CLASS_NAME_FILTER = Optional.ofNullable(System.getenv("KROYXLICIOUS_KMS_FACADE_CLASS_NAME_FILTER")).map(Pattern::compile)
41+
private static final Pattern FACADE_CLASS_NAME_FILTER = Optional.ofNullable(System.getenv("KROXYLICIOUS_KMS_FACADE_CLASS_NAME_FILTER")).map(Pattern::compile)
4242
.orElse(Pattern.compile(".*"));
4343

4444
@Override

0 commit comments

Comments
 (0)