Skip to content

Commit

Permalink
without auth
Browse files Browse the repository at this point in the history
  • Loading branch information
ramueSVA committed Apr 2, 2024
1 parent 965c2f1 commit 217464e
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public enum Preprod {
EHRBASE("https://ehrbase.crr.pre-prod.num-codex.de/ehrbase/management/health/readiness"),
FHIR_BRIDGE("https://fhir-bridge.crr.pre-prod.num-codex.de/fhir-bridge/actuator/health/readiness"),
FE("https://pre-prod.num-codex.de/home"),
KEYCLOAK("https://keycloak.pre-prod.num-codex.de/auth");
KEYCLOAK("https://keycloak.pre-prod.num-codex.de");
private String URL;
}

Expand All @@ -27,7 +27,7 @@ public enum Prod {
EHRBASE("https://ehrbase.crr.num-codex.de/ehrbase/management/health/readiness"),
FHIR_BRIDGE("https://fhir-bridge.crr.num-codex.de/fhir-bridge/actuator/health/readiness"),
FE("https://num-codex.de/"),
KEYCLOAK("https://keycloak.crr.num-codex.de/auth");
KEYCLOAK("https://keycloak.crr.num-codex.de");
private String URL;
}

Expand All @@ -38,7 +38,7 @@ public enum Dev {
EHRBASE("https://ehrbase.crr.dev.num-codex.de/ehrbase/management/health/readiness"),
FHIR_BRIDGE("https://fhir-bridge.crr.dev.num-codex.de/fhir-bridge/actuator/health/readiness"),
FE("https://dev.num-codex.de/"),
KEYCLOAK("https://keycloak.dev.num-codex.de/auth");
KEYCLOAK("https://keycloak.dev.num-codex.de");
private String URL;
}

Expand All @@ -49,7 +49,7 @@ public enum Staging {
EHRBASE("https://ehrbase.crr.staging.num-codex.de/ehrbase/management/health/readiness"),
FHIR_BRIDGE("https://fhir-bridge.crr.staging.num-codex.de/fhir-bridge/actuator/health/readiness"),
FE("https://staging.num-codex.de/"),
KEYCLOAK("https://keycloak.staging.num-codex.de/auth");
KEYCLOAK("https://keycloak.staging.num-codex.de");
private String URL;
}
}
2 changes: 1 addition & 1 deletion src/main/resources/application-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ userstore:
swagger:
oauth2:
token-uri: ${KEYCLOAK_CANONICAL_URL}/realms/${KEYCLOAK_REALM}/protocol/openid-connect/token
auth-uri: ${KEYCLOAK_CANONICAL_URL}/realms/${KEYCLOAK_REALM}/protocol/openid-connect/auth
auth-uri: ${KEYCLOAK_CANONICAL_URL}/realms/${KEYCLOAK_REALM}/protocol/openid-connect
client-name: ${SWAGGER_OAUTH2_CLIENT-NAME}
client-secret: ${SWAGGER_OAUTH2_CLIENT-NAME}

Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/application-local.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ spring:
swagger:
oauth2:
token-uri: ${keycloak.url}/realms/crr/protocol/openid-connect/token
auth-uri: ${keycloak.url}/realms/crr/protocol/openid-connect/auth
auth-uri: ${keycloak.url}/realms/crr/protocol/openid-connect
client-name: numPortalWebapp
client-secret: numPortalWebapp

Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ springdoc:
swagger:
oauth2:
token-uri: ${keycloak.url}/realms/Num/protocol/openid-connect/token
auth-uri: ${keycloak.url}/realms/Num/protocol/openid-connect/auth
auth-uri: ${keycloak.url}/realms/Num/protocol/openid-connect
client-name: num-portal-webapp
client-secret: num-portal-webapp

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@ public class AdminControllerIT extends IntegrationTest {
roles = {STUDY_COORDINATOR})
public void shouldCreateUserOnFirstLoginSuccessfully() throws Exception {
stubFor(
WireMock.get("/auth/admin/realms/Num/users/b59e5edb-3121-4e0a-8ccb-af6798207a79")
WireMock.get("/admin/realms/Num/users/b59e5edb-3121-4e0a-8ccb-af6798207a79")
.willReturn(okJson(
"{\"id\": \"b59e5edb-3121-4e0a-8ccb-af6798207a79\",\"username\": \"new-user\"}")));
stubFor(WireMock.get("/auth/admin/realms/Num/users/b59e5edb-3121-4e0a-8ccb-af6798207a79/role-mappings/realm")
stubFor(WireMock.get("/admin/realms/Num/users/b59e5edb-3121-4e0a-8ccb-af6798207a79/role-mappings/realm")
.willReturn(okJson("[{\"id\":\"12345-2f04-4356-8f34-12345\",\"name\":\"STUDY_COORDINATOR\",\"composite\":false,\"clientRole\":false,\"containerId\":\"Num\"}]")));
mockMvc
.perform(
Expand All @@ -65,7 +65,7 @@ public void shouldCreateUserOnFirstLoginSuccessfully() throws Exception {
roles = {SUPER_ADMIN, ORGANIZATION_ADMIN})
public void shouldApproveUserSuccessfully() {
stubFor(
WireMock.get("/auth/admin/realms/Num/users/b59e5edb-3121-4e0a-8ccb-af6798207a73")
WireMock.get("/admin/realms/Num/users/b59e5edb-3121-4e0a-8ccb-af6798207a73")
.willReturn(okJson(
"{\"id\": \"b59e5edb-3121-4e0a-8ccb-af6798207a73\",\"username\": \"new-user\", \"firstname\":\"John\", \"email\": \"[email protected]\"}")));
mockMvc
Expand All @@ -81,11 +81,11 @@ public void shouldApproveUserSuccessfully() {
@WithMockNumUser(roles = {SUPER_ADMIN})
public void shouldUpdateUserStatusSuccessfully() {
stubFor(
WireMock.get("/auth/admin/realms/Num/users/b59e5edb-3121-4e0a-8ccb-af6798207a73")
WireMock.get("/admin/realms/Num/users/b59e5edb-3121-4e0a-8ccb-af6798207a73")
.willReturn(okJson(
"{\"id\": \"b59e5edb-3121-4e0a-8ccb-af6798207a73\",\"username\": \"new-user\", \"firstname\":\"John\", \"email\": \"[email protected]\", \"enabled\": \"true\"}")));
stubFor(WireMock.put("/auth/admin/realms/Num/users/b59e5edb-3121-4e0a-8ccb-af6798207a73").willReturn(okJson("[]")));
stubFor(WireMock.get("/auth/admin/realms/Num/users/b59e5edb-3121-4e0a-8ccb-af6798207a73/role-mappings/realm")
stubFor(WireMock.put("/admin/realms/Num/users/b59e5edb-3121-4e0a-8ccb-af6798207a73").willReturn(okJson("[]")));
stubFor(WireMock.get("/admin/realms/Num/users/b59e5edb-3121-4e0a-8ccb-af6798207a73/role-mappings/realm")
.willReturn(okJson("[{\"id\":\"12345-2f04-1156-8f34-12345\",\"name\":\"RESEARCHER\",\"composite\":false,\"clientRole\":false,\"containerId\":\"Num\"}]")));
mockMvc
.perform(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@ public abstract class IntegrationTest {

public static final String UNAUTHORIZED_USER_ID = "b59e5edb-3121-4e0a-8ccb-af6798207a73";
private static final String IDENTITY_PROVIDER_URL =
"/auth/realms/Num/protocol/openid-connect/certs";
"/realms/Num/protocol/openid-connect/certs";
private static final String IDENTITY_PROVIDER_TOKEN_ENDPOINT =
"/auth/realms/Num/protocol/openid-connect/token";
private static final String USER_ENDPOINT_USER1 = "/auth/admin/realms/Num/users/user1";
private static final String USER_ENDPOINT_USER2 = "/auth/admin/realms/Num/users/user2";
"/realms/Num/protocol/openid-connect/token";
private static final String USER_ENDPOINT_USER1 = "/admin/realms/Num/users/user1";
private static final String USER_ENDPOINT_USER2 = "/admin/realms/Num/users/user2";
private static final String USER_ENDPOINT_ALL_APPROVERS =
"/auth/admin/realms/Num/roles/STUDY_APPROVER/users";
"/admin/realms/Num/roles/STUDY_APPROVER/users";
private static final String EHR_BASE_URL = "/ehrbase/rest/openehr/v1/definition/template/adl1.4/";

@ClassRule
Expand Down Expand Up @@ -75,9 +75,9 @@ public void setup() {
.willReturn(
okJson(
"[{\"template_id\": \"IDCR - Immunisation summary.v0\",\"concept\": \"IDCR - Immunisation summary.v0\",\"archetype_id\": \"openEHR-EHR-COMPOSITION.health_summary.v1\",\"created_timestamp\": \"2020-11-25T16:19:37.812Z\"}]")));
stubFor(WireMock.get("/auth/admin/realms/Num/roles/SUPER_ADMIN/users").willReturn(okJson("[]")));
stubFor(WireMock.get("/admin/realms/Num/roles/SUPER_ADMIN/users").willReturn(okJson("[]")));
stubFor(
WireMock.get("/auth/admin/realms/Num/users/b59e5edb-3121-4e0a-8ccb-af6798207a72")
WireMock.get("/admin/realms/Num/users/b59e5edb-3121-4e0a-8ccb-af6798207a72")
.willReturn(okJson(
"{\"id\": \"b59e5edb-3121-4e0a-8ccb-af6798207a72\",\"username\": \"admin-user\", \"firstname\":\"Admin\", \"email\": \"[email protected]\"}")));
}
Expand Down
2 changes: 1 addition & 1 deletion src/test/resources/application-itest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ spring:
swagger:
oauth2:
token-uri: ${keycloak.url}/realms/Num/protocol/openid-connect/token
auth-uri: ${keycloak.url}/realms/Num/protocol/openid-connect/auth
auth-uri: ${keycloak.url}/realms/Num/protocol/openid-connect
client-name: numPortalWebapp
client-secret: numPortalWebapp

Expand Down
2 changes: 1 addition & 1 deletion src/test/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ spring:
swagger:
oauth2:
token-uri: ${keycloak.url}/realms/Num/protocol/openid-connect/token
auth-uri: ${keycloak.url}/realms/Num/protocol/openid-connect/auth
auth-uri: ${keycloak.url}/realms/Num/protocol/openid-connect
client-name: numPortalWebapp
client-secret: numPortalWebapp

Expand Down

0 comments on commit 217464e

Please sign in to comment.