Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions config/local/caching-service.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
spring.profiles.active: debug,diag

apiml:
service:
port: 10025
banner: console
security:
x509:
certificatesUrl: https://localhost:10010/gateway/certificates
jgroups:
bind:
port: 7600
address: localhost
caching:
storage:
mode: infinispan
infinispan:
initialHosts: localhost[7099]

management:
endpoints:
web:
exposure:
include: "*"

logging:
pattern: '%d{yyyy-MM-dd HH:mm:ss.SSS,UTC} <%blue(${logbackServiceName}):%magenta(%thread):${PID:}> %X{userid:-} %clr(%-5level) %cyan(\(%logger{15}\)) %msg%n'
1 change: 0 additions & 1 deletion integration-tests/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,6 @@ task runAllIntegrationTestsNormal(type: Test) {
'SAFAuthTest',
'HATest',
'ChaoticHATest',
'NotAttlsTest',
'OidcOauth2Test',
'MultipleRegistrationsTest',
'HealthEndpointProtectionDisabledTest',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,9 @@ class WhenCalledWithInvalidAuthentication {
@MethodSource("org.zowe.apiml.functional.caching.CachingAuthenticationTest#publicUrls")
void publicEndpointIsAccessible(String endpoint) {
given()
.when()
.when()
.get(caching_url + endpoint)
.then()
.then()
.statusCode(HttpStatus.OK.value());
}

Expand All @@ -96,60 +96,61 @@ void givenUntrustedCert_cachingApiEndpointsAreInaccessible() {
given()
.config(SslContext.selfSignedUntrusted)
.header(CERT_HEADER_NAME, "value")
.when()
.when()
.get(caching_url + CACHING_PATH)
.then()
.then()
.statusCode(HttpStatus.FORBIDDEN.value());
}

@Test
void givenNoCertificateAndHeader_cachingApiEndpointsAreInaccessible() {
given()
.header(CERT_HEADER_NAME, "value")
.when()
.when()
.get(caching_url + CACHING_PATH)
.then()
.then()
.statusCode(HttpStatus.FORBIDDEN.value());
}

@Test
void givenCertificateButNoHeader_cachingApiEndpointsAreInaccessible() {

given()
.config(SslContext.clientCertApiml)
.when()
.get(caching_url + CACHING_PATH)
.then()
.statusCode(HttpStatus.UNAUTHORIZED.value());
}

@Test
void givenNoCertificateAndNoHeader_cachingApiEndpointsAreInaccessible() {
given()
.when()
.when()
.get(caching_url + CACHING_PATH)
.then()
.then()
.statusCode(HttpStatus.FORBIDDEN.value());
}
}

@Nested
class WhenCalledWithValidAuthentication {

@Test
void givenCertificateButNoHeader_cachingApiEndpointsIsAccessible() {
given()
.config(SslContext.clientCertApiml)
.when()
.get(caching_url + CACHING_PATH)
.then()
.statusCode(HttpStatus.OK.value());
}

@Test
void cachingApiEndpointsAccessible() {
given()
.config(SslContext.clientCertApiml)
.header(CLIENT_CERT_HEADER, clientCertValue)
.when()
.when()
.get(caching_url + CACHING_PATH)
.then()
.then()
.statusCode(HttpStatus.OK.value());
}
}

}

private void clearSsl() {
RestAssured.config = RestAssured.config().sslConfig(SSLConfig.sslConfig());
RestAssured.useRelaxedHTTPSValidation();
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,5 @@ void allClustersAreAvailable() {
.then()
.body("name", hasItems("GATEWAY", "DISCOVERY","APICATALOG"));
}

}
Loading