Skip to content

Commit

Permalink
fix: add org_id to the options
Browse files Browse the repository at this point in the history
When we register a domain, we need to specify the org_id for the generated
identity; the org_id we use here must match the org_id used when generating the
tocken or the operation will fail with sign mismatching.

This change add a second option to specify the ORG_ID to be used for the
identity.

Signed-off-by: Alejandro Visiedo <[email protected]>
  • Loading branch information
avisiedo committed Sep 21, 2023
1 parent 6c061b7 commit aecb0e9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 4 additions & 1 deletion test/scripts/ephe-domains-register.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,17 @@ function error {

TOKEN="$1"
[ "${TOKEN}" != "" ] || error "TOKEN is empty"
ORG_ID="$2"
[ "${ORG_ID}" != "" ] || error "ORG_ID is empty"


export NAMESPACE="$(oc project -q)"
CREDS="$( oc get secrets/env-${NAMESPACE}-keycloak -o jsonpath='{.data.defaultUsername}' | base64 -d )"
CREDS="${CREDS}:$( oc get secrets/env-${NAMESPACE}-keycloak -o jsonpath='{.data.defaultPassword}' | base64 -d )"
export CREDS

unset X_RH_IDENTITY
export X_RH_FAKE_IDENTITY="$( ./tools/bin/xrhidgen -org-id 12345 system -cn "6f324116-b3d2-11ed-8a37-482ae3863d30" -cert-type system | base64 -w0 )"
export X_RH_FAKE_IDENTITY="$( ./tools/bin/xrhidgen -org-id "${ORG_ID}" system -cn "6f324116-b3d2-11ed-8a37-482ae3863d30" -cert-type system | base64 -w0 )"
export X_RH_IDM_REGISTRATION_TOKEN="${TOKEN}"
export X_RH_IDM_VERSION='{"ipa-hcc": "0.9", "ipa": "4.10.0-8.el9_1", "os-release-id": "rhel", "os-release-version-id": "9.1"}'
BASE_URL="https://$( oc get routes -l app=idmsvc-backend -o jsonpath='{.items[0].spec.host}' )/api/idmsvc/v1"
Expand Down
4 changes: 3 additions & 1 deletion test/scripts/local-domains-register.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@ function error {

TOKEN="$1"
[ "${TOKEN}" != "" ] || error "TOKEN is empty"
ORG_ID="$2"
[ "${ORG_ID}" != "" ] || error "ORG_ID is empty"

export X_RH_IDENTITY="$( ./tools/bin/xrhidgen -org-id 12345 system -cn "6f324116-b3d2-11ed-8a37-482ae3863d30" -cert-type system | base64 -w0 )"
export X_RH_IDENTITY="$( ./tools/bin/xrhidgen -org-id "${ORG_ID}" system -cn "6f324116-b3d2-11ed-8a37-482ae3863d30" -cert-type system | base64 -w0 )"
unset CREDS
export X_RH_IDM_REGISTRATION_TOKEN="$TOKEN"
export X_RH_IDM_VERSION='{"ipa-hcc": "0.9", "ipa": "4.10.0-8.el9_1", "os-release-id": "rhel", "os-release-version-id": "9.1"}'
Expand Down

0 comments on commit aecb0e9

Please sign in to comment.