Skip to content

Commit 5510b97

Browse files
authored
feat: add field in Admin UI configuration to set interval to sync license details into configuration (#2016)
Signed-off-by: duttarnab <arnab.bdutta@gmail.com>
1 parent 6a064d6 commit 5510b97

File tree

4 files changed

+13
-8
lines changed

4 files changed

+13
-8
lines changed

admin-ui/app/utils/Util.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,5 +41,8 @@ export function formatDate(date) {
4141
if (date.length > 10) {
4242
return date.substring(0, 10)
4343
}
44+
if(date.length == 10) {
45+
return date
46+
}
4447
return '-'
4548
}

docs/admin/admin-ui/auth-server-interaction.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ When accessing the Gluu Flex Admin UI through a web browser, the following steps
1414

1515
1. The user accesses the Gluu Flex Admin UI frontend through a web browser.
1616
2. The frontend requests the Admin UI backend to retrieve Admin UI configuration from Janssen persistence. The [Admin UI configuration](./configuration.md) includes OIDC client details for accessing the Auth Server, OIDC client details for accessing the Token Server, OIDC client details for accessing the License APIs, and license metadata. It's important to note that **the Admin UI backend is implemented as a Jans Config API plugin**.
17-
3. The frontend calls the Admin UI backend API (`/isConfigValid`) to validate the license configuration in persistence, essentially verifying the validity of the OIDC client used to access the License APIs. If it is not valid, the same API tries to register a new OIDC client using the SSA uploaded during installation. In case the SSA is invalid, the Admin UI shows a page to upload a new valid SSA.
18-
4. After ensuring the validity of the OIDC client, the Admin UI calls the Admin UI backend API (/isActive) to check if a valid license is present in the license configuration. The Admin UI backend then calls the SCAN API (/scan/license/isActive) to verify the validity of the license.
17+
3. The frontend calls the Admin UI backend API (`/isConfigValid`) to validate the license configuration in persistence, essentially verifying the validity of the OIDC client used to access the License APIs. If it is not valid, the same API tries to register a new OIDC client using the SSA uploaded during installation. In case the SSA is invalid, the Admin UI shows a page to upload a new valid SSA. To minimize network calls to account.gluu.org, `/isConfigValid` verifies the OIDC client validity only at a set interval (default: 30 days). Otherwise, `/isConfigValid` checks if the required OIDC client for License APIs exists in the Admin UI configuration (persistence).
18+
4. After validating the OIDC client, the Admin UI calls the backend API (/isActive) to check if a valid license is present in the license configuration. It verifies whether the license key and its details are valid and not expired. At regular intervals (default is 30 days), the Admin UI backend calls the SCAN API (/scan/license/isActive) to verify license validity and sync its details into the license configuration (persistence).
1919
5. If a valid license is not present, the frontend calls the backend API (/retrieve) to retrieve the license for the user via the SCAN API (/scan/license/retrieve). The license can only be retrieved from SCAN if the user has subscribed to the Admin UI license in Agama Lab.
2020
6. If the user has not already subscribed to a valid license in Agama Lab, the Admin UI displays a page to generate a 30-day trial license. The user cannot generate another trial license after expiry of a generated trial license and will need to subscribe to the Admin UI license in Agama Lab to access the user interface.
2121
7. After verification of valid license the frontend initiates the Authorization Code Flow by redirecting the user to the login page.

docs/admin/admin-ui/configuration.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -136,12 +136,13 @@ License metadata includes relevant information about the Gluu Flex Admin UI's li
136136

137137
The information is stored in json format with following attributes.
138138

139-
|Attribute Name|Description|
140-
|--------------|-----------|
141-
|licenseConfig|Object with License configuration details|
142-
|ssa|SSA used to register OIDC client to access license APIs|
143-
|scanLicenseApiHostname| SCAN License server hostname|
144-
|licenseHardwareKey|Hardware key (org_id) to access license APIs|
139+
|Attribute Name| Description|
140+
|--------------|------------|
141+
|licenseConfig| Object with License configuration details |
142+
|ssa| SSA used to register OIDC client to access license APIs |
143+
|scanLicenseApiHostname| SCAN License server hostname |
144+
|licenseHardwareKey| Hardware key (org_id) to access license APIs |
145+
|intervalForSyncLicenseDetailsInDays| The Admin UI backend syncs license details into the configuration (persistence) after the set interval (default: 30 days). |
145146

146147
**Sample configuration stored in persistence**
147148

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
"ssa": "%(ssa)s",
4242
"scanLicenseApiHostname": "%(scan_license_api_hostname)s",
4343
"licenseHardwareKey": "%(license_hardware_key)s",
44+
"intervalForSyncLicenseDetailsInDays": 30,
4445
"oidcClient": {
4546
"opHost": "%(op_host)s",
4647
"clientId": "%(oidc_client_id)s",

0 commit comments

Comments
 (0)