Skip to content

Commit 85249a3

Browse files
committed
fix(flex-linux-setup): adminui template
1 parent 248cc60 commit 85249a3

File tree

2 files changed

+34
-11
lines changed

2 files changed

+34
-11
lines changed

flex-linux-setup/flex_linux_setup/flex_setup.py

+20
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
import shutil
1313
import tempfile
1414
import json
15+
import uuid
1516

1617
from pathlib import Path
1718
from urllib import request
@@ -195,6 +196,7 @@ def download_jans_install_py(setup_branch):
195196
sys.path.insert(0, os.path.join(base.pylib_dir, 'gcs'))
196197

197198
from setup_app.pylib.jproperties import Properties
199+
from setup_app.pylib import jwt
198200
from setup_app.pylib.ldif4.ldif import LDIFWriter
199201
from setup_app.utils.package_utils import packageUtils
200202
from setup_app.config import Config
@@ -460,9 +462,25 @@ def install_gluu_admin_ui(self):
460462
print("Copying files to", Config.templateRenderingDict['admin_ui_apache_root'])
461463
config_api_installer.copy_tree(os.path.join(self.source_dir, 'dist'), Config.templateRenderingDict['admin_ui_apache_root'])
462464

465+
466+
ssa = installed_components.get('ssa')
467+
ssa_json = {}
468+
if ssa:
469+
ssa_json = jwt.decode(
470+
ssa,
471+
options={
472+
'verify_signature': False,
473+
'verify_exp': True,
474+
'verify_aud': False
475+
}
476+
)
477+
463478
oidc_client = installed_components.get('oidc_client', {})
464479
Config.templateRenderingDict['oidc_client_id'] = oidc_client.get('client_id', '')
465480
Config.templateRenderingDict['oidc_client_secret'] = oidc_client.get('client_secret', '')
481+
Config.templateRenderingDict['license_hardware_key'] = str(uuid.uuid4())
482+
Config.templateRenderingDict['scan_license_auth_server_hostname'] = ssa_json.get('iss', '')
483+
Config.templateRenderingDict['scan_license_api_hostname'] = Config.templateRenderingDict['scan_license_auth_server_hostname'].replace('account', 'cloud')
466484

467485
print("Creating credentials encryption private and public key")
468486

@@ -837,6 +855,8 @@ def get_components_from_setup_properties():
837855
def obtain_oidc_client_credidentials():
838856
with open(argsp.admin_ui_ssa) as f:
839857
ssa = f.read()
858+
installed_components['ssa'] = ssa
859+
840860
data = {
841861
"software_statement": ssa,
842862
"response_types": ["token"],

flex-linux-setup/flex_linux_setup/templates/auiConfiguration.json

+14-11
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,6 @@
1717
"postLogoutUri": "https://%(hostname)s/admin",
1818
"frontchannelLogoutUri": "https://%(hostname)s/admin/logout"
1919
},
20-
"oidcClient": {
21-
"clientId": "%(oidc_client_id)s",
22-
"clientSecret": "%(oidc_client_secret)s",
23-
"tokenEndpoint": null,
24-
"redirectUri": null,
25-
"postLogoutUri": null,
26-
"frontchannelLogoutUri": null,
27-
"scopes": null,
28-
"acrValues": null
29-
},
3020
"tokenServerClient": {
3121
"opHost": "https://%(hostname)s/admin",
3222
"clientId": "%(admin_ui_client_id)s",
@@ -39,11 +29,24 @@
3929
"email"
4030
]
4131
},
42-
"license": {
32+
"licenseConfig": {
33+
"scanLicenseApiHostname": "%(scan_license_api_hostname)s",
34+
"scanLicenseAuthServerHostname": "%(scan_license_auth_server_hostname)s",
35+
"licenseHardwareKey": "%(license_hardware_key)s",
4336
"credentialsEncryptionKey": {
4437
"alg": "RS256",
4538
"publicKey": "%(cred_enc_public_key)s",
4639
"privateKey": "%(cred_enc_private_key)s"
40+
},
41+
"oidcClient": {
42+
"clientId": "%(oidc_client_id)s",
43+
"clientSecret": "%(oidc_client_secret)s",
44+
"tokenEndpoint": null,
45+
"redirectUri": null,
46+
"postLogoutUri": null,
47+
"frontchannelLogoutUri": null,
48+
"scopes": null,
49+
"acrValues": null
4750
}
4851
}
4952
}

0 commit comments

Comments
 (0)