From 688b6652d1c7c9c60bf1d2b339dca8fca76e8803 Mon Sep 17 00:00:00 2001 From: Carlos Alcaide Date: Mon, 21 Jun 2021 15:39:36 -0700 Subject: [PATCH 1/6] =?UTF-8?q?chore:=20=F0=9F=A4=96=20Update=20resolution?= =?UTF-8?q?s=20for=20glob-parent?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Update resolutions field in package json to avoid security vulnerability with glob-parent older versions. --- package.json | 3 ++- yarn.lock | 24 ++---------------------- 2 files changed, 4 insertions(+), 23 deletions(-) diff --git a/package.json b/package.json index 0f6ba027f..a845a7c56 100755 --- a/package.json +++ b/package.json @@ -71,7 +71,8 @@ "ws": "^7.4.6", "css-what": "^5.0.1", "trim-newlines": "^3.0.1", - "clean-css": "^4.1.11" + "clean-css": "^4.1.11", + "glob-parent": "^5.1.2" }, "config": { "commitizen": { diff --git a/yarn.lock b/yarn.lock index 2c78436b9..0b06ea235 100644 --- a/yarn.lock +++ b/yarn.lock @@ -11290,22 +11290,7 @@ glob-base@^0.3.0: glob-parent "^2.0.0" is-glob "^2.0.0" -glob-parent@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-2.0.0.tgz#81383d72db054fcccf5336daa902f182f6edbb28" - integrity sha1-gTg9ctsFT8zPUzbaqQLxgvbtuyg= - dependencies: - is-glob "^2.0.0" - -glob-parent@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-3.1.0.tgz#9e6af6299d8d3bd2bd40430832bd113df906c5ae" - integrity sha1-nmr2KZ2NO9K9QEMIMr0RPfkGxa4= - dependencies: - is-glob "^3.1.0" - path-dirname "^1.0.0" - -glob-parent@^5.1.0, glob-parent@^5.1.2, glob-parent@~5.1.0: +glob-parent@^2.0.0, glob-parent@^3.1.0, glob-parent@^5.1.0, glob-parent@^5.1.2, glob-parent@~5.1.0: version "5.1.2" resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4" integrity sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow== @@ -12772,7 +12757,7 @@ is-glob@^2.0.0: dependencies: is-extglob "^1.0.0" -is-glob@^3.0.0, is-glob@^3.1.0: +is-glob@^3.0.0: version "3.1.0" resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-3.1.0.tgz#7ba5ae24217804ac70707b96922567486cc3e84a" integrity sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo= @@ -16616,11 +16601,6 @@ path-browserify@0.0.1: resolved "https://registry.yarnpkg.com/path-browserify/-/path-browserify-0.0.1.tgz#e6c4ddd7ed3aa27c68a20cc4e50e1a4ee83bbc4a" integrity sha512-BapA40NHICOS+USX9SN4tyhq+A2RrN/Ws5F0Z5aMHDp98Fl86lX8Oti8B7uN93L4Ifv4fHOEA+pQw87gmMO/lQ== -path-dirname@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/path-dirname/-/path-dirname-1.0.2.tgz#cc33d24d525e099a5388c0336c6e32b9160609e0" - integrity sha1-zDPSTVJeCZpTiMAzbG4yuRYGCeA= - path-exists@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-2.1.0.tgz#0feb6c64f0fc518d9a754dd5efb62c7022761f4b" From ed513ebd14660d5928aa7e2fda3dd1bda4d455a3 Mon Sep 17 00:00:00 2001 From: Randall Morey Date: Tue, 29 Jun 2021 08:25:36 -0400 Subject: [PATCH 2/6] =?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 3/6] 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 4/6] 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 5/6] 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 6/6] 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;