Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DRAFT] ACPENG-2152 - user deactivation issue #333

Draft
wants to merge 8 commits into
base: master
Choose a base branch
from
Draft
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
8 changes: 8 additions & 0 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ steps:
- name: web_tests_then_build_dist
image: quay.io/ukhomeofficedigital/nodejs-base:v6.9.1
commands:
## Band aid workaround to build container after centos7 EOL 20240701 - https://serverfault.com/questions/1161816/mirrorlist-centos-org-no-longer-resolve
- sed -i s/mirror.centos.org/vault.centos.org/g /etc/yum.repos.d/*.repo
- sed -i s/^#.*baseurl=http/baseurl=http/g /etc/yum.repos.d/*.repo
- sed -i s/^mirrorlist=http/#mirrorlist=http/g /etc/yum.repos.d/*.repo
- yum install -y git bzip2 bzip2-libs fontconfig
- git config --global url."https://".insteadOf git://
- npm install -g [email protected]
Expand Down Expand Up @@ -55,6 +59,8 @@ steps:
environment:
IMAGE_NAME: platform-hub-web:${DRONE_COMMIT_SHA}
IGNORE_UNFIXED: "true"
FAIL_ON_DETECTION : false
FAIL_ON_EOL_OS_DETECTION: false
when:
event:
- pull_request
Expand Down Expand Up @@ -156,6 +162,8 @@ steps:
environment:
IMAGE_NAME: platform-hub-api:${DRONE_COMMIT_SHA}
IGNORE_UNFIXED: "true"
FAIL_ON_DETECTION : false
FAIL_ON_EOL_OS_DETECTION: false
when:
event:
- pull_request
Expand Down
1 change: 1 addition & 0 deletions platform-hub-api/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ RUN apk update && apk upgrade \
&& apk --update add --virtual build_deps sudo build-base ruby-dev libc-dev libressl-dev zlib-dev \
&& echo 'gem: --no-document' > /etc/gemrc \
&& gem install bundler -v 2.1.4 \
&& gem install "rubygems-update:<3.0.0" --no-document \
&& gem update --system \
&& rm /etc/ssl/certs/ca-cert-DST_ACES_CA_X6.pem \
&& rm /etc/ssl/certs/ca-cert-DST_Root_CA_X3.pem \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def bearer_token
end

begin
response = client.post "/auth/realms/#{@realm}/protocol/openid-connect/token",
response = client.post "/realms/#{@realm}/protocol/openid-connect/token",
{
client_id: @client_id,
client_secret: @client_secret,
Expand Down Expand Up @@ -81,7 +81,7 @@ def get_user_representation(user)
raise Errors::KeycloakIdentityMissing if user_id.nil?

begin
response = client.get "/auth/admin/realms/#{@realm}/users/#{user_id}",
response = client.get "/admin/realms/#{@realm}/users/#{user_id}",
{},
{Authorization: "Bearer #{bearer_token}"}
rescue => e
Expand All @@ -108,7 +108,7 @@ def update_user(representation = {})
end

begin
response = client.put "/auth/admin/realms/#{@realm}/users/#{user_id}",
response = client.put "/admin/realms/#{@realm}/users/#{user_id}",
representation.to_json,
{
'Authorization': "Bearer #{bearer_token}",
Expand Down
2 changes: 1 addition & 1 deletion platform-hub-api/db/structure.sql
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
-
--
-- PostgreSQL database dump
--

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
expect(subject).to receive(:client) { client }

expect(client).to receive(:post).with(
"/auth/realms/#{realm}/protocol/openid-connect/token",
"/realms/#{realm}/protocol/openid-connect/token",
{
client_id: client_id,
client_secret: client_secret,
Expand Down Expand Up @@ -180,7 +180,7 @@
expect(subject).to receive(:client) { client }
expect(subject).to receive(:bearer_token) { bearer_token }
expect(client).to receive(:get).with(
"/auth/admin/realms/#{realm}/users/#{keycloak_user_id}",
"/admin/realms/#{realm}/users/#{keycloak_user_id}",
{},
{
'Authorization': "Bearer #{bearer_token}"
Expand Down Expand Up @@ -237,7 +237,7 @@
expect(subject).to receive(:client) { client }
expect(subject).to receive(:bearer_token) { bearer_token }
expect(client).to receive(:put).with(
"/auth/admin/realms/#{realm}/users/#{keycloak_user_id}",
"/admin/realms/#{realm}/users/#{keycloak_user_id}",
representation.to_json,
{
'Authorization': "Bearer #{bearer_token}",
Expand Down