From 62c0c82d66e4214ce04eb04ada286692292c6036 Mon Sep 17 00:00:00 2001 From: Leonardo Luz Almeida Date: Tue, 19 Nov 2024 09:39:57 -0500 Subject: [PATCH 1/2] docs: Add JS vars documentation Signed-off-by: Leonardo Luz Almeida --- README.md | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/README.md b/README.md index 7a2ec2f..4c71a51 100644 --- a/README.md +++ b/README.md @@ -85,6 +85,15 @@ spec: value: https://github.com/argoproj-labs/argocd-ephemeral-access/releases/download/v0.1.0/extension.tar.gz - name: EXTENSION_CHECKSUM_URL value: https://github.com/argoproj-labs/argocd-ephemeral-access/releases/download/v0.1.0/extension_checksums.txt + - name: EXTENSION_JS_VARS + value: | + { + "EPHEMERAL_ACCESS_LABEL_KEY": "some-label/is-production", + "EPHEMERAL_ACCESS_LABEL_VALUE": "true", + "EPHEMERAL_ACCESS_MAIN_BANNER": "All production changes require an associated change request. Click the REQUEST ACCESS button above to automatically create a change request associated with your user", + "EPHEMERAL_ACCESS_MAIN_BANNER_ADDITIONAL_INFO_LINK": "https://link-to-some-documentation.com", + "EPHEMERAL_ACCESS_DEFAULT_ROLE": "devops" + } volumeMounts: - name: extensions mountPath: /tmp/extensions/ @@ -101,6 +110,22 @@ spec: emptyDir: {} ``` +> [!NOTE] +> The `EXTENSION_JS_VARS` is an special variable. It contains the UI +> extension configurations. If provided, the +> `argocd-extension-installer` will automatically create the js file +> to expose the provided values to the UI extension. The following +> table describes the js variables accepted by the EphemeralAccess UI +> extension: + +| Name | Description | Required | Default | +|---|---|---|---| +|`EPHEMERAL_ACCESS_DEFAULT_ROLE` | Defines the RoleName to be associated with users once the AccessRequest is created | Yes | - | +|`EPHEMERAL_ACCESS_LABEL_KEY` | If provided, it will only enable the UI extension if the Argo CD Application has this label key | No | - | +|`EPHEMERAL_ACCESS_LABEL_VALUE` | If provided, it will only enable the UI extension if the Argo CD Application has this label value | No | - | +|`EPHEMERAL_ACCESS_MAIN_BANNER` | A text with the brief description to instruct users about how the extension works | No | - | +|`EPHEMERAL_ACCESS_MAIN_BANNER_ADDITIONAL_INFO_LINK` | An additional link to provide users with more detailed documentation | No | - | + ### Enabling the EphemeralAccess extension in Argo CD Argo CD needs to have the proxy extension feature enabled for the From 893c7174637b07f5fb32d00e54ea8954ae736eaa Mon Sep 17 00:00:00 2001 From: Leonardo Luz Almeida Date: Tue, 19 Nov 2024 10:51:26 -0500 Subject: [PATCH 2/2] format table Signed-off-by: Leonardo Luz Almeida --- README.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 4c71a51..48ba697 100644 --- a/README.md +++ b/README.md @@ -118,13 +118,13 @@ spec: > table describes the js variables accepted by the EphemeralAccess UI > extension: -| Name | Description | Required | Default | -|---|---|---|---| -|`EPHEMERAL_ACCESS_DEFAULT_ROLE` | Defines the RoleName to be associated with users once the AccessRequest is created | Yes | - | -|`EPHEMERAL_ACCESS_LABEL_KEY` | If provided, it will only enable the UI extension if the Argo CD Application has this label key | No | - | -|`EPHEMERAL_ACCESS_LABEL_VALUE` | If provided, it will only enable the UI extension if the Argo CD Application has this label value | No | - | -|`EPHEMERAL_ACCESS_MAIN_BANNER` | A text with the brief description to instruct users about how the extension works | No | - | -|`EPHEMERAL_ACCESS_MAIN_BANNER_ADDITIONAL_INFO_LINK` | An additional link to provide users with more detailed documentation | No | - | +| Name | Description | Required | Default | +| --------------------------------------------------- | ------------------------------------------------------------------------------------------------- | -------- | ------- | +| `EPHEMERAL_ACCESS_DEFAULT_ROLE` | Defines the RoleName to be associated with users once the AccessRequest is created | Yes | - | +| `EPHEMERAL_ACCESS_LABEL_KEY` | If provided, it will only enable the UI extension if the Argo CD Application has this label key | No | - | +| `EPHEMERAL_ACCESS_LABEL_VALUE` | If provided, it will only enable the UI extension if the Argo CD Application has this label value | No | - | +| `EPHEMERAL_ACCESS_MAIN_BANNER` | A text with the brief description to instruct users about how the extension works | No | - | +| `EPHEMERAL_ACCESS_MAIN_BANNER_ADDITIONAL_INFO_LINK` | An additional link to provide users with more detailed documentation | No | - | ### Enabling the EphemeralAccess extension in Argo CD