From ed513ebd14660d5928aa7e2fda3dd1bda4d455a3 Mon Sep 17 00:00:00 2001 From: Randall Morey Date: Tue, 29 Jun 2021 08:25:36 -0400 Subject: [PATCH 1/5] =?UTF-8?q?chore:=20=F0=9F=A4=96=20bump=20CLI=20versio?= =?UTF-8?q?n=20and=20specify=20release=20in=20readme?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ui/desktop/CHANGELOG.md | 4 ++-- ui/desktop/electron-app/config/cli.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ui/desktop/CHANGELOG.md b/ui/desktop/CHANGELOG.md index 0f1f7544e..e9c021464 100644 --- a/ui/desktop/CHANGELOG.md +++ b/ui/desktop/CHANGELOG.md @@ -2,11 +2,11 @@ Canonical reference for changes, improvements, and bugfixes for Boundary Desktop. -## Next +## v1.2.0 [CLI 0.4.0] (2021.06.29) ### New -- Add vault credential support. ([PR](https://github.com/hashicorp/boundary-ui/pull/619)) +- Add Vault credential support. ([PR](https://github.com/hashicorp/boundary-ui/pull/619)) ## v1.1.0 [CLI 0.3.0] (2021.06.09) diff --git a/ui/desktop/electron-app/config/cli.js b/ui/desktop/electron-app/config/cli.js index 9af356e9e..e9b5a6a12 100644 --- a/ui/desktop/electron-app/config/cli.js +++ b/ui/desktop/electron-app/config/cli.js @@ -5,7 +5,7 @@ const https = require('https'); const decompress = require('decompress'); const { isMac, isWindows } = require('../src/helpers/platform.js'); -const artifactVersion = '0.3.0'; +const artifactVersion = '0.4.0'; const artifactDestination = path.resolve(__dirname, '..', 'cli'); const downloadArtifact = (version) => { From 233cc2073b0cc80fa204853ebfbf2c7a81134e65 Mon Sep 17 00:00:00 2001 From: Randall Morey Date: Tue, 29 Jun 2021 15:50:57 -0400 Subject: [PATCH 2/5] fix: OIDC form add buttons should be enabled for new auth methods --- .../form/auth-method/oidc/index.hbs | 60 +++++++++++++++---- 1 file changed, 50 insertions(+), 10 deletions(-) diff --git a/ui/admin/app/components/form/auth-method/oidc/index.hbs b/ui/admin/app/components/form/auth-method/oidc/index.hbs index abc18784f..7d43d2e67 100644 --- a/ui/admin/app/components/form/auth-method/oidc/index.hbs +++ b/ui/admin/app/components/form/auth-method/oidc/index.hbs @@ -180,7 +180,11 @@ @style='warning' @iconOnly='trash' title={{t 'actions.remove'}} - @disabled={{if form.isEditable false true}} + @disabled={{if + @model.isNew + false + (if form.isEditable false true) + }} {{on 'click' (fn @removeItemByIndex 'attributes.signing_algorithms' i) @@ -215,7 +219,11 @@ Date: Wed, 30 Jun 2021 17:20:51 -0400 Subject: [PATCH 3/5] chore: update to reflect secret { raw, decoded } schema, where decoded is optional --- addons/api/addon/models/session.js | 23 +++++++++++----- addons/api/mirage/scenarios/ipc.js | 42 ++++++++++++++++++------------ 2 files changed, 41 insertions(+), 24 deletions(-) diff --git a/addons/api/addon/models/session.js b/addons/api/addon/models/session.js index 406c10c6c..63b9025be 100644 --- a/addons/api/addon/models/session.js +++ b/addons/api/addon/models/session.js @@ -44,20 +44,29 @@ class SessionCredential { // =attributes rawCredential; library; - #rawSecretValue; + #payloadSecret; /** + * The incoming payload may contain a JSON object under the `decoded` key only + * if it can be JSON-decoded. Some credential stores may not provide JSON, + * however, in which case we may have only the raw base64-encoded secret + * string. In the former case, we convert the key/value pairs of the JSON to + * an array of `SecretItem` instances. In the latter case, we return an + * array containing a single `SecretItem` instance with key `secret` and a + * string value equal to the base64-decoded raw secret. * The credential secret as an array of key/value objects. * @type {SessionCredential.SecretItem[]} */ get secrets() { - if (typeOf(this.#rawSecretValue) === 'object') { - return Object.keys(this.#rawSecretValue).map( - (key) => - new SessionCredential.SecretItem(key, this.#rawSecretValue[key]) + if (this.#payloadSecret?.decoded) { + const secretJSON = this.#payloadSecret.decoded; + return Object.keys(secretJSON).map( + (key) => new SessionCredential.SecretItem(key, secretJSON[key]) ); } else { - return [new SessionCredential.SecretItem('secret', this.#rawSecretValue)]; + // decode from base64 + const decodedString = atob(this.#payloadSecret.raw); + return [new SessionCredential.SecretItem('secret', decodedString)]; } } @@ -66,7 +75,7 @@ class SessionCredential { constructor(cred) { const { id, name, description, type } = cred.credential_library; this.library = new SessionCredential.Library(id, name, description, type); - this.#rawSecretValue = cred.secret; + this.#payloadSecret = cred.secret; this.rawCredential = cred; } } diff --git a/addons/api/mirage/scenarios/ipc.js b/addons/api/mirage/scenarios/ipc.js index a255cff3d..04ff375d4 100644 --- a/addons/api/mirage/scenarios/ipc.js +++ b/addons/api/mirage/scenarios/ipc.js @@ -53,6 +53,12 @@ export default function initializeMockIPC(server) { type, created_time: new Date().toISOString(), }); + const decoded = { + key1: 'value 1', + key2: true, + key3: 'test', + }; + const raw = btoa(JSON.stringify(decoded)); return { address: window.location.hostname, port: datatype.number(), @@ -67,7 +73,9 @@ export default function initializeMockIPC(server) { credential_store_id: 'csvlt_Q1HFGt7Jpm', type: 'vault', }, - secret: 'just-a-random-string', + secret: { + raw: btoa('just-a-random-string'), + }, }, { credential_library: { @@ -78,21 +86,10 @@ export default function initializeMockIPC(server) { type: 'vault', }, secret: { - key1: 'value 1', - key2: true, - key3: 'test', + raw, + decoded, }, }, - { - credential_library: { - id: 'clvlt_9KWscxpcY7', - name: 'Library Name', - description: 'Library Description', - credential_store_id: 'csvlt_Q1HFGt7Jpm', - type: 'vault', - }, - secret: 'just-a-random-string', - }, { credential_library: { id: 'clvlt_9KWscxpcY7', @@ -102,9 +99,20 @@ export default function initializeMockIPC(server) { type: 'vault', }, secret: { - key1: 'value 1', - key2: true, - key3: 'test', + raw: btoa('just-a-random-string'), + }, + }, + { + credential_library: { + id: 'clvlt_9KWscxpcY7', + name: 'Library Name', + description: 'Library Description', + credential_store_id: 'csvlt_Q1HFGt7Jpm', + type: 'vault', + }, + secret: { + raw, + decoded, }, }, ], From 4f044db204de4dd045c4bcb1459ce5e449ebe540 Mon Sep 17 00:00:00 2001 From: Randall Morey Date: Wed, 30 Jun 2021 17:27:47 -0400 Subject: [PATCH 4/5] fix: lint error --- addons/api/addon/models/session.js | 1 - 1 file changed, 1 deletion(-) diff --git a/addons/api/addon/models/session.js b/addons/api/addon/models/session.js index 63b9025be..b71a7bb13 100644 --- a/addons/api/addon/models/session.js +++ b/addons/api/addon/models/session.js @@ -3,7 +3,6 @@ import { computed } from '@ember/object'; import { equal } from '@ember/object/computed'; import { tracked } from '@glimmer/tracking'; import { A } from '@ember/array'; -import { typeOf } from '@ember/utils'; /** * From e4ccf21ed8812f3c93eba285beeb17d70d285e02 Mon Sep 17 00:00:00 2001 From: Susmitha Girumala Date: Wed, 30 Jun 2021 19:01:46 -0400 Subject: [PATCH 5/5] style: Fix z-index for rose-dialog in desktop --- ui/desktop/app/styles/app.scss | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ui/desktop/app/styles/app.scss b/ui/desktop/app/styles/app.scss index 405a2572e..6bf7c387e 100644 --- a/ui/desktop/app/styles/app.scss +++ b/ui/desktop/app/styles/app.scss @@ -328,9 +328,12 @@ // Dialog Detail // These styles are a Work In Progress. Expect changes (lots of them) +.rose-dialog, .dialog-detail { z-index: 6000; +} +.dialog-detail { .rose-notification { border-left: 0; border-right: 0;