diff --git a/charts/traction/README.md b/charts/traction/README.md index ea7c73ec0..7a80bdf86 100644 --- a/charts/traction/README.md +++ b/charts/traction/README.md @@ -301,7 +301,6 @@ kubectl delete secret,pvc --selector "app.kubernetes.io/instance"=my-release | `ui.ux.copyright` | | `""` | | `ui.ux.owner` | | `""` | | `ui.ux.coverImageCopyright` | | `Photo by Kristoffer Fredriksson on StockSnap` | -| `ui.ariesDetails.ledgerDescription` | Ledger description | `bcovrin-test` | | `ui.oidc.showInnkeeperAdminLogin` | Show Innkeeper Admin Login | `true` | | `ui.oidc.showWritableComponents` | Show ledger-write UI components | `true` | | `ui.oidc.active` | Enable OIDC authentication | `true` | diff --git a/charts/traction/templates/ui/configmap.yaml b/charts/traction/templates/ui/configmap.yaml index 44b73289d..b4a006f38 100644 --- a/charts/traction/templates/ui/configmap.yaml +++ b/charts/traction/templates/ui/configmap.yaml @@ -6,7 +6,6 @@ metadata: labels: {{- include "tenant-ui.labels" . | nindent 4 }} data: - FRONTEND_ARIES_LEDGER_DESCRIPTION: {{ .Values.ui.ariesDetails.ledgerDescription | quote }} FRONTEND_INNKEEPER_OIDC_ACTIVE: {{ .Values.ui.oidc.active | quote }} FRONTEND_INNKEEPER_OIDC_AUTHORITY: {{ .Values.ui.oidc.authority | quote }} FRONTEND_INNKEEPER_OIDC_CLIENT: {{ .Values.ui.oidc.client | quote }} diff --git a/charts/traction/values.yaml b/charts/traction/values.yaml index 088f4d099..002016486 100644 --- a/charts/traction/values.yaml +++ b/charts/traction/values.yaml @@ -622,10 +622,6 @@ ui: ## @param ui.ux.infoBanner.showMessage Show the info banner showMessage: false - ariesDetails: - ## @param ui.ariesDetails.ledgerDescription Ledger description - ledgerDescription: "bcovrin-test" - ## Backend Configuration ## oidc: diff --git a/deploy/traction/values-development.yaml b/deploy/traction/values-development.yaml index c69e37079..4f2ee6fb8 100644 --- a/deploy/traction/values-development.yaml +++ b/deploy/traction/values-development.yaml @@ -137,8 +137,6 @@ ui: ] } } - ariesDetails: - ledgerDescription: "bcovrin-test" smtp: server: apps.smtp.gov.bc.ca port: 25 diff --git a/deploy/traction/values-pr.yaml b/deploy/traction/values-pr.yaml index 41cb9ad7a..654662cdf 100644 --- a/deploy/traction/values-pr.yaml +++ b/deploy/traction/values-pr.yaml @@ -128,8 +128,6 @@ ui: ] } } - ariesDetails: - ledgerDescription: "bcovrin-test" smtp: server: apps.smtp.gov.bc.ca port: 25 diff --git a/plugins/traction_innkeeper/traction_innkeeper/v1_0/innkeeper/routes.py b/plugins/traction_innkeeper/traction_innkeeper/v1_0/innkeeper/routes.py index 16bca1080..c5608fb84 100644 --- a/plugins/traction_innkeeper/traction_innkeeper/v1_0/innkeeper/routes.py +++ b/plugins/traction_innkeeper/traction_innkeeper/v1_0/innkeeper/routes.py @@ -11,6 +11,7 @@ use_kwargs, ) from aries_cloudagent.admin.request_context import AdminRequestContext +from aries_cloudagent.admin.server import AdminConfigSchema from aries_cloudagent.messaging.models.base import BaseModelError from aries_cloudagent.messaging.models.openapi import OpenAPISchema from aries_cloudagent.messaging.valid import JSONWebToken, UUIDFour @@ -21,6 +22,7 @@ from aries_cloudagent.multitenant.base import BaseMultitenantManager from aries_cloudagent.multitenant.error import WalletKeyMissingError from aries_cloudagent.storage.error import StorageError, StorageNotFoundError +from aries_cloudagent.version import __version__ from aries_cloudagent.wallet.error import WalletSettingsError from aries_cloudagent.wallet.models.wallet_record import WalletRecord from marshmallow import fields, validate @@ -917,6 +919,41 @@ async def innkeeper_authentications_api_delete(request: web.BaseRequest): return web.json_response({"success": result}) +@docs(tags=[SWAGGER_CATEGORY], summary="Fetch the server configuration") +@response_schema(AdminConfigSchema(), 200, description="") +@innkeeper_only +@error_handler +async def innkeeper_config_handler(request: web.BaseRequest): + context: AdminRequestContext = request["context"] + # use base/root profile for server config, use Tenant Manager profile + # this is to not get the Innkeeper tenant's config, but the server cfg + mgr = context.inject(TenantManager) + profile = mgr.profile + + config = { + key: ( + profile.context.settings[key] + ) + for key in profile.context.settings + if key + not in [ + "admin.admin_api_key", + "multitenant.jwt_secret", + "wallet.key", + "wallet.rekey", + "wallet.seed", + "wallet.storage_creds", + ] + } + try: + del config["plugin_config"]["traction_innkeeper"]["innkeeper_wallet"]["wallet_key"] + except KeyError as e: + LOGGER.warn(f"The key to be removed: '{e.args[0]}' is missing from the dictionary.") + config["version"] = __version__ + + return web.json_response({"config": config}) + + async def register(app: web.Application): """Register routes.""" LOGGER.info("> registering routes") @@ -987,6 +1024,11 @@ async def register(app: web.Application): "/innkeeper/authentications/api/{tenant_authentication_api_id}", innkeeper_authentications_api_delete, ), + web.get( + "/innkeeper/server/status/config", + innkeeper_config_handler, + allow_head=False, + ), ] ) LOGGER.info("< registering routes") diff --git a/plugins/traction_innkeeper/traction_innkeeper/v1_0/tenant/routes.py b/plugins/traction_innkeeper/traction_innkeeper/v1_0/tenant/routes.py index 5e823cba0..285e26b7c 100644 --- a/plugins/traction_innkeeper/traction_innkeeper/v1_0/tenant/routes.py +++ b/plugins/traction_innkeeper/traction_innkeeper/v1_0/tenant/routes.py @@ -8,6 +8,7 @@ request_schema, ) from aries_cloudagent.admin.request_context import AdminRequestContext +from aries_cloudagent.admin.server import AdminConfigSchema from aries_cloudagent.messaging.models.openapi import OpenAPISchema from aries_cloudagent.multitenant.admin.routes import ( format_wallet_record, @@ -16,6 +17,7 @@ ) from aries_cloudagent.multitenant.base import BaseMultitenantManager from aries_cloudagent.storage.error import StorageNotFoundError +from aries_cloudagent.version import __version__ from aries_cloudagent.wallet.models.wallet_record import ( WalletRecordSchema, WalletRecord, @@ -352,6 +354,55 @@ async def tenant_api_key_delete(request: web.BaseRequest): return web.json_response({"success": result}) +@docs(tags=[SWAGGER_CATEGORY], summary="Fetch the server configuration") +@response_schema(AdminConfigSchema(), 200, description="") +@error_handler +async def tenant_server_config_handler(request: web.BaseRequest): + context: AdminRequestContext = request["context"] + # use base/root profile for server config, use Tenant Manager profile + # this is to not get the Innkeeper tenant's config, but the server cfg + mgr = context.inject(TenantManager) + profile = mgr.profile + + config = { + k: ( + profile.context.settings[k] + ) + for k in profile.context.settings + if k + not in [ + "default_label", + "admin.admin_api_key", + "admin.admin_insecure_mode", + "admin.enabled", + "admin.host", + "admin.port", + "admin.webhook_urls", + "admin.admin_client_max_request_size", + "multitenant.jwt_secret", + "wallet.key", + "wallet.name", + "multitenant.wallet_name", + "wallet.storage_type", + "wallet.storage_config", + "wallet.rekey", + "wallet.seed", + "wallet.storage_creds", + ] + } + try: + del config["plugin_config"]["traction_innkeeper"]["innkeeper_wallet"] + config["config"]["ledger.ledger_config_list"] = [ + {k: v for k, v in d.items() if k != "genesis_transactions"} + for d in config["config"]["ledger.ledger_config_list"] + ] + except KeyError as e: + LOGGER.warn(f"The key to be removed: '{e.args[0]}' is missing from the dictionary.") + config["version"] = __version__ + + return web.json_response({"config": config}) + + async def register(app: web.Application): """Register routes.""" LOGGER.info("> registering routes") @@ -376,6 +427,11 @@ async def register(app: web.Application): "/tenant/authentications/api/{tenant_authentication_api_id}", tenant_api_key_delete, ), + web.get( + "/tenant/server/status/config", + tenant_server_config_handler, + allow_head=False + ), ] ) LOGGER.info("< registering routes") diff --git a/services/tenant-ui/config/custom-environment-variables.json b/services/tenant-ui/config/custom-environment-variables.json index ead467c14..70303ef5c 100644 --- a/services/tenant-ui/config/custom-environment-variables.json +++ b/services/tenant-ui/config/custom-environment-variables.json @@ -35,12 +35,6 @@ "messageLevel": "UX_INFO_BANNER_MESSAGE_LEVEL", "showMessage": "UX_INFO_BANNER_SHOW_MESSAGE" } - }, - "ariesDetails": { - "acapyVersion": "FRONTEND_ACAPY_VERSION_DISPLAY", - "ledgerName": "FRONTEND_ARIES_LEDGER_DESCRIPTION", - "ledgerBrowser": "ACAPY_LEDGER_BROWSER_URL", - "tailsServer": "ACAPY_TAILS_BASE_URL" } }, "image": { diff --git a/services/tenant-ui/config/default.json b/services/tenant-ui/config/default.json index 8963d620e..034f72a7a 100644 --- a/services/tenant-ui/config/default.json +++ b/services/tenant-ui/config/default.json @@ -37,12 +37,6 @@ "messageLevel": "info", "showMessage": false } - }, - "ariesDetails": { - "acapyVersion": "0.10.3", - "ledgerName": "bcovrin-test", - "ledgerBrowser": "http://test.bcovrin.vonx.io", - "tailsServer": "https://tails-test.vonx.io" } }, "image": { diff --git a/services/tenant-ui/frontend/src/components/about/Acapy.vue b/services/tenant-ui/frontend/src/components/about/Acapy.vue index f5354ad87..d48ad0e1b 100644 --- a/services/tenant-ui/frontend/src/components/about/Acapy.vue +++ b/services/tenant-ui/frontend/src/components/about/Acapy.vue @@ -5,7 +5,7 @@

{{ $t('about.acaPy.acapyVersion', { - version: config.frontend.ariesDetails.acapyVersion, + version: acapyVersion, }) }}

@@ -16,55 +16,43 @@
-
- {{ $t('about.acaPy.ledger') }} -
-
- {{ config.frontend.ariesDetails.ledgerName }} -
- -
- {{ $t('about.acaPy.ledgerBrowser') }} -
-
- {{ config.frontend.ariesDetails.ledgerBrowser }} -
- -
- {{ $t('about.acaPy.tailsServer') }} -
-
- {{ config.frontend.ariesDetails.tailsServer }} -
-
- -
- - -
- -
- -
-
+
diff --git a/services/tenant-ui/frontend/src/components/common/ConfigItem.vue b/services/tenant-ui/frontend/src/components/common/ConfigItem.vue new file mode 100644 index 000000000..6aedfe6e8 --- /dev/null +++ b/services/tenant-ui/frontend/src/components/common/ConfigItem.vue @@ -0,0 +1,32 @@ + + + diff --git a/services/tenant-ui/frontend/src/components/innkeeper/config/ServerConfig.vue b/services/tenant-ui/frontend/src/components/innkeeper/config/ServerConfig.vue new file mode 100644 index 000000000..938edd60c --- /dev/null +++ b/services/tenant-ui/frontend/src/components/innkeeper/config/ServerConfig.vue @@ -0,0 +1,234 @@ + + + + + diff --git a/services/tenant-ui/frontend/src/components/innkeeper/tenants/Tenants.vue b/services/tenant-ui/frontend/src/components/innkeeper/tenants/Tenants.vue index 701d1545f..17455dbea 100644 --- a/services/tenant-ui/frontend/src/components/innkeeper/tenants/Tenants.vue +++ b/services/tenant-ui/frontend/src/components/innkeeper/tenants/Tenants.vue @@ -69,6 +69,23 @@ /> + + +