From 655c9dc16ad17c661ae2ebba323f4a08ef15d862 Mon Sep 17 00:00:00 2001 From: Gabriel BONDAZ Date: Tue, 4 May 2021 17:10:59 +0200 Subject: [PATCH 1/9] Add IDCIKeycloakSecurityBundle recipe --- .../1.0/config/packages/idci_keycloak_security.yaml | 6 ++++++ idci/keycloak-security-bundle/1.0/manifest.json | 8 ++++++++ 2 files changed, 14 insertions(+) create mode 100644 idci/keycloak-security-bundle/1.0/config/packages/idci_keycloak_security.yaml create mode 100644 idci/keycloak-security-bundle/1.0/manifest.json diff --git a/idci/keycloak-security-bundle/1.0/config/packages/idci_keycloak_security.yaml b/idci/keycloak-security-bundle/1.0/config/packages/idci_keycloak_security.yaml new file mode 100644 index 00000000..be690667 --- /dev/null +++ b/idci/keycloak-security-bundle/1.0/config/packages/idci_keycloak_security.yaml @@ -0,0 +1,6 @@ +idci_keycloak_security: + server_url: 'http://localhost:8080/auth' + realm: 'MyRealm' + client_id: 'my-client' + client_secret: 'my-client-secret' + default_target_path: 'app_home' \ No newline at end of file diff --git a/idci/keycloak-security-bundle/1.0/manifest.json b/idci/keycloak-security-bundle/1.0/manifest.json new file mode 100644 index 00000000..8e84a044 --- /dev/null +++ b/idci/keycloak-security-bundle/1.0/manifest.json @@ -0,0 +1,8 @@ +{ + "bundles": { + "IDCI\\Bundle\\KeycloakSecurityBundle\\": ["all"] + }, + "copy-from-recipe": { + "config/": "%CONFIG_DIR%/" + } +} From 69b52b7fd8acdf45c1c972d20237b12b0eef212a Mon Sep 17 00:00:00 2001 From: Gabriel BONDAZ Date: Tue, 4 May 2021 17:13:31 +0200 Subject: [PATCH 2/9] Change client id default value --- .../1.0/config/packages/idci_keycloak_security.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/idci/keycloak-security-bundle/1.0/config/packages/idci_keycloak_security.yaml b/idci/keycloak-security-bundle/1.0/config/packages/idci_keycloak_security.yaml index be690667..7cf1feaf 100644 --- a/idci/keycloak-security-bundle/1.0/config/packages/idci_keycloak_security.yaml +++ b/idci/keycloak-security-bundle/1.0/config/packages/idci_keycloak_security.yaml @@ -1,6 +1,6 @@ idci_keycloak_security: server_url: 'http://localhost:8080/auth' realm: 'MyRealm' - client_id: 'my-client' + client_id: 'my-client-id' client_secret: 'my-client-secret' default_target_path: 'app_home' \ No newline at end of file From ba0bc770d5842fe727fd5d667f1578ad2615899d Mon Sep 17 00:00:00 2001 From: Gabriel BONDAZ Date: Tue, 4 May 2021 17:18:30 +0200 Subject: [PATCH 3/9] Add end blank line --- .../1.0/config/packages/idci_keycloak_security.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/idci/keycloak-security-bundle/1.0/config/packages/idci_keycloak_security.yaml b/idci/keycloak-security-bundle/1.0/config/packages/idci_keycloak_security.yaml index 7cf1feaf..9ca9dd1a 100644 --- a/idci/keycloak-security-bundle/1.0/config/packages/idci_keycloak_security.yaml +++ b/idci/keycloak-security-bundle/1.0/config/packages/idci_keycloak_security.yaml @@ -3,4 +3,4 @@ idci_keycloak_security: realm: 'MyRealm' client_id: 'my-client-id' client_secret: 'my-client-secret' - default_target_path: 'app_home' \ No newline at end of file + default_target_path: 'app_home' From 722c8f0dd0e38db385ebede6e253f42297d615ef Mon Sep 17 00:00:00 2001 From: Gabriel BONDAZ Date: Tue, 4 May 2021 18:14:45 +0200 Subject: [PATCH 4/9] Add route configuration --- .../1.0/config/routes/idci_keycloak_security.yaml | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 idci/keycloak-security-bundle/1.0/config/routes/idci_keycloak_security.yaml diff --git a/idci/keycloak-security-bundle/1.0/config/routes/idci_keycloak_security.yaml b/idci/keycloak-security-bundle/1.0/config/routes/idci_keycloak_security.yaml new file mode 100644 index 00000000..73b95ea7 --- /dev/null +++ b/idci/keycloak-security-bundle/1.0/config/routes/idci_keycloak_security.yaml @@ -0,0 +1,3 @@ +IDCIKeycloakSecurityBundle: + resource: "@IDCIKeycloakSecurityBundle/Resources/config/routing.yaml" + prefix: / \ No newline at end of file From 5171f2b2b232183a062025866534e750cb8867c3 Mon Sep 17 00:00:00 2001 From: Gabriel BONDAZ Date: Tue, 4 May 2021 18:15:52 +0200 Subject: [PATCH 5/9] Add missing end blank line --- .../1.0/config/routes/idci_keycloak_security.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/idci/keycloak-security-bundle/1.0/config/routes/idci_keycloak_security.yaml b/idci/keycloak-security-bundle/1.0/config/routes/idci_keycloak_security.yaml index 73b95ea7..0772a50e 100644 --- a/idci/keycloak-security-bundle/1.0/config/routes/idci_keycloak_security.yaml +++ b/idci/keycloak-security-bundle/1.0/config/routes/idci_keycloak_security.yaml @@ -1,3 +1,3 @@ IDCIKeycloakSecurityBundle: resource: "@IDCIKeycloakSecurityBundle/Resources/config/routing.yaml" - prefix: / \ No newline at end of file + prefix: / From 00034980325336beab0dca54ecc244343c4436cb Mon Sep 17 00:00:00 2001 From: Gabriel BONDAZ Date: Tue, 4 May 2021 18:39:52 +0200 Subject: [PATCH 6/9] Fix wrong bundle path --- idci/keycloak-security-bundle/1.0/manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/idci/keycloak-security-bundle/1.0/manifest.json b/idci/keycloak-security-bundle/1.0/manifest.json index 8e84a044..78d14f91 100644 --- a/idci/keycloak-security-bundle/1.0/manifest.json +++ b/idci/keycloak-security-bundle/1.0/manifest.json @@ -1,6 +1,6 @@ { "bundles": { - "IDCI\\Bundle\\KeycloakSecurityBundle\\": ["all"] + "IDCI\\Bundle\\KeycloakSecurityBundle": ["all"] }, "copy-from-recipe": { "config/": "%CONFIG_DIR%/" From c5699a079cf63ce2194e898bad9f3cdeb677835b Mon Sep 17 00:00:00 2001 From: Gabriel BONDAZ Date: Tue, 4 May 2021 18:43:41 +0200 Subject: [PATCH 7/9] Fix wrong bundle path --- idci/keycloak-security-bundle/1.0/manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/idci/keycloak-security-bundle/1.0/manifest.json b/idci/keycloak-security-bundle/1.0/manifest.json index 78d14f91..bf0cecb5 100644 --- a/idci/keycloak-security-bundle/1.0/manifest.json +++ b/idci/keycloak-security-bundle/1.0/manifest.json @@ -1,6 +1,6 @@ { "bundles": { - "IDCI\\Bundle\\KeycloakSecurityBundle": ["all"] + "IDCI\\Bundle\\KeycloakSecurityBundle\\IDCIKeycloakSecurityBundle": ["all"] }, "copy-from-recipe": { "config/": "%CONFIG_DIR%/" From 08c5363374ab72502f8f7c6b6dc90daf91469dc3 Mon Sep 17 00:00:00 2001 From: Gabriel BONDAZ Date: Tue, 4 May 2021 18:51:39 +0200 Subject: [PATCH 8/9] Change realm var name --- .../1.0/config/packages/idci_keycloak_security.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/idci/keycloak-security-bundle/1.0/config/packages/idci_keycloak_security.yaml b/idci/keycloak-security-bundle/1.0/config/packages/idci_keycloak_security.yaml index 9ca9dd1a..9562de18 100644 --- a/idci/keycloak-security-bundle/1.0/config/packages/idci_keycloak_security.yaml +++ b/idci/keycloak-security-bundle/1.0/config/packages/idci_keycloak_security.yaml @@ -1,6 +1,6 @@ idci_keycloak_security: server_url: 'http://localhost:8080/auth' - realm: 'MyRealm' + realm: 'realm-name' client_id: 'my-client-id' client_secret: 'my-client-secret' default_target_path: 'app_home' From 8a44ac8f2e58cf7b4a8b44dbebbfdefd114e3d5e Mon Sep 17 00:00:00 2001 From: Gabriel BONDAZ Date: Tue, 11 May 2021 18:12:56 +0200 Subject: [PATCH 9/9] Setup env vars --- .../1.0/config/packages/idci_keycloak_security.yaml | 11 +++++++---- idci/keycloak-security-bundle/1.0/manifest.json | 8 ++++++++ 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/idci/keycloak-security-bundle/1.0/config/packages/idci_keycloak_security.yaml b/idci/keycloak-security-bundle/1.0/config/packages/idci_keycloak_security.yaml index 9562de18..76d2186a 100644 --- a/idci/keycloak-security-bundle/1.0/config/packages/idci_keycloak_security.yaml +++ b/idci/keycloak-security-bundle/1.0/config/packages/idci_keycloak_security.yaml @@ -1,6 +1,9 @@ idci_keycloak_security: - server_url: 'http://localhost:8080/auth' - realm: 'realm-name' - client_id: 'my-client-id' - client_secret: 'my-client-secret' + server_url: '%env(resolve:KEYCLOAK_SERVER_BASE_URL)%/auth' + server_public_url: '%env(resolve:KEYCLOAK_SERVER_PUBLIC_BASE_URL)%/auth' + server_private_url: '%env(resolve:KEYCLOAK_SERVER_PRIVATE_BASE_URL)%/auth' + realm: '%env(resolve:KEYCLOAK_REALM)%' + client_id: '%env(resolve:KEYCLOAK_CLIENT_ID)%' + client_secret: '%env(resolve:KEYCLOAK_CLIENT_SECRET)%' default_target_path: 'app_home' + ssl_verification: true diff --git a/idci/keycloak-security-bundle/1.0/manifest.json b/idci/keycloak-security-bundle/1.0/manifest.json index bf0cecb5..12aa2e35 100644 --- a/idci/keycloak-security-bundle/1.0/manifest.json +++ b/idci/keycloak-security-bundle/1.0/manifest.json @@ -4,5 +4,13 @@ }, "copy-from-recipe": { "config/": "%CONFIG_DIR%/" + }, + "env": { + "KEYCLOAK_SERVER_BASE_URL": "http://keycloak:8080", + "KEYCLOAK_SERVER_PUBLIC_BASE_URL": "${KEYCLOAK_SERVER_BASE_URL}", + "KEYCLOAK_SERVER_PRIVATE_BASE_URL": "${KEYCLOAK_SERVER_BASE_URL}", + "KEYCLOAK_REALM": "", + "KEYCLOAK_CLIENT_ID": "", + "KEYCLOAK_CLIENT_SECRET": "" } }