Ember upgrade to 3.28.6 (#14763)

* initial upgrade running ember-cli-update --to 3.28

* bumps node-sass version

* fragments bump

* fixes overriding errors prop on policy model causing issues

* bumps some addon versions related to Ember Global deprecation warning on build

* bumps back ember-test-selectors version for now

* removes ember-promise-helpers addon and creates await helper

* upgrades ember-template-lint and adds prettier plugin

* Ember 3.28 Upgrade Lint Fixes (#14890)

* fixes js lint errors

* fixes hbs lint errors

* allow multiple node versions for now to get tests runinng

* fixes tests

* Upgrade ember-test-selectors (#14937)

* updates ember-test-selectors, ember-cli-page-object and ember-cli-string-helpers

* adds attributeBindings to classic components with data-test property

* glimmerizes toolbar-link component and removes data-test args

* glimmerizes toolbar-secret-link and secret-link components and removes data-test and class args

* glimmerizes linked-block component

* glimmerizes toggle-button component

* updates toggle-button test

* fixes remaining test selector issues

* comments out test assertions related to cp-validations bug

* adds todo to comment

* Model Validations (#14991)

* adds model-validations decorator and validators util

* converts key-mixin to decorator

* updates models to use validations decorator instead of ember-cp-validations

* updates invocation of model validations

* removes ember-cp-validations

* reverts secret-v2 model updates

* adds initials to TODO comment

* flight-icons (#14993)

* flight-icons

* basic dropdown

* UI/merge main (#14997)

* Vault documentation: changing references from learn to tutorial (#14844)

* changed learn to tutorial references

* changed learn to tutorial

* Update website/content/docs/plugins/plugin-portal.mdx

Co-authored-by: Yoko Hyakuna <yoko@hashicorp.com>

* Update website/content/docs/platform/aws/run.mdx

Co-authored-by: Yoko Hyakuna <yoko@hashicorp.com>

Co-authored-by: Yoko Hyakuna <yoko@hashicorp.com>

* UI/Only show form values if have read access (#14794)

* only show value in edit form if has read capabilities

* revert messing with form

* delete secret data from secret

* add check for selected version

* remove added line

* add changelog

* modified text (#14854)

* fixed a link issue (#14850)

* docs: add known issue to 1.10 release notes (#14859)

* Vault 3999 Change permissions for directory/archive created by debug command  (#14846)

* adding debug changes from ent

* adding changelog

* Vault 3992 ToB Config and Plugins Permissions  (#14817)

* updating changes from ent PR

* adding changelog

* fixing err

* fixing semgrep error

* updated references from learn to tutorial (#14866)

* updated references from learn to tutorial (#14867)

* changed reference from learn to tutorial (#14868)

* Fix handling of default zero SignatureBits value with Any key type in PKI Secrets Engine (#14875)

* Correctly handle minimums, default SignatureBits

When using KeyType = "any" on a role (whether explicitly or implicitly
via a sign-verbatim like operation), we need to update the value of
SignatureBits from its new value 0 to a per-key-type default value. This
will allow sign operations on these paths to function correctly, having
the correctly inferred default signature bit length.

Additionally, this allows the computed default value for key type to be
used for minimum size validation in the RSA/ECDSA paths. We additionally
enforce the 2048-minimum in this case as well.

Signed-off-by: Alexander Scheel <alex.scheel@hashicorp.com>

* Fix defaults and validation of "any" KeyType

When certutil is given the placeholder any keytype, it attempts to
validate and update the default zero value. However, in lacking a
default value for SignatureBits, it cannot update the value from the
zero value, thus causing validation to fail.

Add more awareness to the placeholder "any" value to certutil.

Signed-off-by: Alexander Scheel <alex.scheel@hashicorp.com>

* Add role-based regression tests for key bits

This adds regression tests for Key Type, Key Bits, and Signature Bits
parameters on the role. We test several values, including the "any"
value to ensure it correctly restricts key sizes.

Signed-off-by: Alexander Scheel <alex.scheel@hashicorp.com>

* Add sign-verbatim test for key type

This ensures that we test sign-verbatim against a variety of key types.

Signed-off-by: Alexander Scheel <alex.scheel@hashicorp.com>

* Add changelog entry

Signed-off-by: Alexander Scheel <alex.scheel@hashicorp.com>

Co-authored-by: Steven Clark <steven.clark@hashicorp.com>

* Subtle docs change for allow_store_key (#14889)

* Subtle docs change for allow_store_key

* errant space

* Adds Vault version prerelease and metadata to logical.PluginEnvironment (#14851)

* docs: fix formatting on plugin upgrade page (#14874)

* docs: fix formatting on plugin upgrade page

* fix more formatting issues

* Update CC docs (#14714)

* Update CC docs

* Add sample response

* Address review feedback

* Update website/content/api-docs/system/internal-counters.mdx

Co-authored-by: Loann Le <84412881+taoism4504@users.noreply.github.com>

* Update website/content/api-docs/system/internal-counters.mdx

Co-authored-by: Loann Le <84412881+taoism4504@users.noreply.github.com>

* Update website/content/api-docs/system/internal-counters.mdx

Co-authored-by: Loann Le <84412881+taoism4504@users.noreply.github.com>

* Update website/content/api-docs/system/internal-counters.mdx

Co-authored-by: Loann Le <84412881+taoism4504@users.noreply.github.com>

* Update website/content/api-docs/system/internal-counters.mdx

Co-authored-by: Loann Le <84412881+taoism4504@users.noreply.github.com>

* Update website/content/api-docs/system/internal-counters.mdx

Co-authored-by: Loann Le <84412881+taoism4504@users.noreply.github.com>

* Update website/content/api-docs/system/internal-counters.mdx

Co-authored-by: Loann Le <84412881+taoism4504@users.noreply.github.com>

* Update website/content/api-docs/system/internal-counters.mdx

Co-authored-by: Loann Le <84412881+taoism4504@users.noreply.github.com>

* Update website/content/api-docs/system/internal-counters.mdx

Co-authored-by: Loann Le <84412881+taoism4504@users.noreply.github.com>

* Update website/content/api-docs/system/internal-counters.mdx

Co-authored-by: Loann Le <84412881+taoism4504@users.noreply.github.com>

* Update website/content/api-docs/system/internal-counters.mdx

Co-authored-by: Loann Le <84412881+taoism4504@users.noreply.github.com>

* Update website/content/api-docs/system/internal-counters.mdx

Co-authored-by: Loann Le <84412881+taoism4504@users.noreply.github.com>

* Update website/content/api-docs/system/internal-counters.mdx

Co-authored-by: Loann Le <84412881+taoism4504@users.noreply.github.com>

* Update website/content/api-docs/system/internal-counters.mdx

Co-authored-by: Loann Le <84412881+taoism4504@users.noreply.github.com>

* Update website/content/api-docs/system/internal-counters.mdx

Co-authored-by: Meggie <meggie@hashicorp.com>

* Update website/content/api-docs/system/internal-counters.mdx

Co-authored-by: Loann Le <84412881+taoism4504@users.noreply.github.com>

* Update website/content/api-docs/system/internal-counters.mdx

Co-authored-by: Loann Le <84412881+taoism4504@users.noreply.github.com>

* Minor edits

* Update partial month API

Co-authored-by: Loann Le <84412881+taoism4504@users.noreply.github.com>
Co-authored-by: Meggie <meggie@hashicorp.com>

* Docs improvements for Managed Keys (#14756)

* Add more color around managed keys in their concepts page, and create additional links between
the various docs pages related to them.

* Typos

* sdk/useragent: plugin version string consistent with Vault version string (#14912)

* clean up (#14911)

* website: fix usages of img tag  (#14910)

* fix usages of img tag and integrate dev-portal workflows

* Adjust Makefile

* remove mount_accessor from the docs (#14927)

* Add extra test coverage to PKI  (#14767)

* Add PKI test for delete role

 - Create a role, validate that defaults are what we expect
   and delete the role, verifying it is gone on subsequent read
   attempts.

* Add PKI test for crl/rotate command

 - Missing a unit test that validates the crl/rotate command works. The test validates the rotate command was successful
   by checking if we have a different/new update time on the CRL.

* Rework PKI TestBackend_PathFetchValidRaw test to not write directly to storage

 - Rework the existing test to not write directly to storage as we might change that in the future.
 - Add tests that validate the ca_chain behaviour of not returning the root authority cert

* PR Feedback

* Additional PR feedback

* Use WriteWithContext in auth helpers (#14775)

* Add ability to pass certificate PEM bytes to vault/api (#14753)

* Respect increment value in grace period calculations (api/LifetimeWatcher) (#14836)

* Mount flag syntax to mitigate confusion from KV-v2 path discrepancies (#14807)

* Add explanation to help text and flag usage text

* KV get with new mount flag

* Clearer naming

* KV Put, Patch, Metadata Get + corresponding tests

* KV Delete, Destroy, Rollback, Undelete, MetadataDelete, MetadataPatch, MetadataPut

* Update KV-v2 docs to use mount flag syntax

* Add changelog

* Run make fmt

* Clarify deprecation message in help string

* Address style comments

* Update vault-plugin-auth-gcp to newest pseudo-version (#14923)

* docs: added hello-vault-spring repo link to developer-qs.mdx. (#14928)

* Update developer-qs.mdx

docs: added link to Java / Spring Boot sample app repo in developer quick start.

* removed space.

* trigger ci

Co-authored-by: taoism4504 <loann@hashicorp.com>

* OIDC Login Bug (#14916)

* fixes issue logging in with oidc from listed auth path tab

* adds changelog entry

* adds more tests for oidc auth workflow

* updates oidc auth method test to use non-standard path

* Fix handling of SignatureBits for ECDSA issuers (#14943)

When adding SignatureBits control logic, we incorrectly allowed
specification of SignatureBits in the case of an ECDSA issuer. As noted
in the original request, NIST and Mozilla (and others) are fairly
prescriptive in the choice of signatures (matching the size of the
NIST P-curve), and we shouldn't usually use a smaller (or worse, larger
and truncate!) hash.

Ignore the configuration of signature bits and always use autodetection
for ECDSA like ed25519.

Signed-off-by: Alexander Scheel <alex.scheel@hashicorp.com>

* Bug Fix and Glimmerize secret-edit component (#14941)

* inital glimmerize

* wip

* wip

* wip

* fix maybeQueryRecord

* fix

* fix

* fix test

* cleanup

* add changelog

* clean up

* Agent error log level is mismatched (#14424)

* [VAULT-1618] Agent error log level is mismatched

`logLevelToStringPtr` translates `go-hclog`'s `ERROR` to `"ERROR"` for
Consul Template's runner, but that expects `ERR` and is quite strict
about it.

This will address https://github.com/hashicorp/vault-k8s/issues/223
after it is set as the default image in `vault-k8s`.

I didn't find a simple way to test this other than starting up a full
server and agent and letting them run, which is unfortunately fairly
slow.

I confirmed that this addresses the original issue by modifying the helm
chart with the values in this commit and patching the log level to `err`.

* VAULT-1618 Add changelog/14424.txt

* VAULT-1618 Update changelog/14424.txt based on @kalafut suggestion

Co-authored-by: Jim Kalafut <jkalafut@hashicorp.com>

* VAULT-1618 Move cancel and server stop into defer in tests

* VAULT-1618 Triggering CircleCI tests

* VAULT-1618 Replace ioutil with os functions for agent template tests

Co-authored-by: Jim Kalafut <jkalafut@hashicorp.com>

* UI/Add months to activity serializer (#14942)

* add mock monthly data to mirage handler

* add months to serializer for activity response

* change selectors

Co-authored-by: Chelsea Shaw <82459713+hashishaw@users.noreply.github.com>

* clean up serializer

* please stop being flakey <3

Co-authored-by: Chelsea Shaw <82459713+hashishaw@users.noreply.github.com>

* Revert the WithContext changes to vault tests (#14947)

* adding env var (#14958)

* Fix dead link for JWT supported algorithms (#14953)

* Don't clone OutputCurlString value (#14968)

* Don't clone OutputCurlString value, add flag to docs

* Add changelog

* Ensure initialMmapSize is 0 on Windows (#14977)

* ensure initialMmapSize is 0 on windows

* add changelog

* Vault 3992 documentation changes (#14918)

* doc changes

* adding config changes

* adding chnages to plugins

* using include

* making doc changes

* adding newline

* aws auth displayName (#14954)

* set displayName to include RoleSessionName

* Add Windows error (#14982)

* Warnings indicating ignored and replaced parameters (#14962)

* Warnings indicating ignored and replaced parameters

* Avoid additional var creation

* Add warnings only if the response is non-nil

* Return the response even when error is non-nil

* Fix tests

* Rearrange comments

* Print warning in the log

* Fix another test

* Add CL

* Fix edit capabilities call in auth method (#14966)

* Fix edit capabilities call in auth method

- Capabilities call was not getting triggered correctly as apiPath
  method was missing the correct context.

* Added changelog

* make linting fix

Co-authored-by: Loann Le <84412881+taoism4504@users.noreply.github.com>
Co-authored-by: Yoko Hyakuna <yoko@hashicorp.com>
Co-authored-by: claire bontempo <68122737+hellobontempo@users.noreply.github.com>
Co-authored-by: Austin Gebauer <34121980+austingebauer@users.noreply.github.com>
Co-authored-by: akshya96 <87045294+akshya96@users.noreply.github.com>
Co-authored-by: Alexander Scheel <alex.scheel@hashicorp.com>
Co-authored-by: Steven Clark <steven.clark@hashicorp.com>
Co-authored-by: Scott Miller <smiller@hashicorp.com>
Co-authored-by: John-Michael Faircloth <fairclothjm@users.noreply.github.com>
Co-authored-by: Vishal Nayak <vishalnayak@users.noreply.github.com>
Co-authored-by: Meggie <meggie@hashicorp.com>
Co-authored-by: Bryce Kalow <bkalow@hashicorp.com>
Co-authored-by: Josh Black <raskchanky@users.noreply.github.com>
Co-authored-by: Anton Averchenkov <84287187+averche@users.noreply.github.com>
Co-authored-by: VAL <val@hashicorp.com>
Co-authored-by: Robert <17119716+robmonte@users.noreply.github.com>
Co-authored-by: mryan-hashi <88851444+mryan-hashi@users.noreply.github.com>
Co-authored-by: taoism4504 <loann@hashicorp.com>
Co-authored-by: Jordan Reimer <zofskeez@gmail.com>
Co-authored-by: Christopher Swenson <swenson@swenson.io>
Co-authored-by: Jim Kalafut <jkalafut@hashicorp.com>
Co-authored-by: Chelsea Shaw <82459713+hashishaw@users.noreply.github.com>
Co-authored-by: Tom Proctor <tomhjp@users.noreply.github.com>
Co-authored-by: Jose Estrada <jose.estrada@tradeshift.com>
Co-authored-by: Arnav Palnitkar <arnav@hashicorp.com>

* skips kmip tests with concurrency issues for now

* changelog

* skips another test

* Remove ModelWrap Component (#15001)

* removes ModelWrap component which was not working in Ember 3.28

* removes kmip test skips

* updates role controller class name

* adds annotations to model-validations file

* pr feedback

* lint fixes after main merge

Co-authored-by: Jordan Reimer <zofskeez@gmail.com>
Co-authored-by: Loann Le <84412881+taoism4504@users.noreply.github.com>
Co-authored-by: Yoko Hyakuna <yoko@hashicorp.com>
Co-authored-by: claire bontempo <68122737+hellobontempo@users.noreply.github.com>
Co-authored-by: Austin Gebauer <34121980+austingebauer@users.noreply.github.com>
Co-authored-by: akshya96 <87045294+akshya96@users.noreply.github.com>
Co-authored-by: Alexander Scheel <alex.scheel@hashicorp.com>
Co-authored-by: Steven Clark <steven.clark@hashicorp.com>
Co-authored-by: Scott Miller <smiller@hashicorp.com>
Co-authored-by: John-Michael Faircloth <fairclothjm@users.noreply.github.com>
Co-authored-by: Vishal Nayak <vishalnayak@users.noreply.github.com>
Co-authored-by: Meggie <meggie@hashicorp.com>
Co-authored-by: Bryce Kalow <bkalow@hashicorp.com>
Co-authored-by: Josh Black <raskchanky@users.noreply.github.com>
Co-authored-by: Anton Averchenkov <84287187+averche@users.noreply.github.com>
Co-authored-by: VAL <val@hashicorp.com>
Co-authored-by: Robert <17119716+robmonte@users.noreply.github.com>
Co-authored-by: mryan-hashi <88851444+mryan-hashi@users.noreply.github.com>
Co-authored-by: taoism4504 <loann@hashicorp.com>
Co-authored-by: Christopher Swenson <swenson@swenson.io>
Co-authored-by: Jim Kalafut <jkalafut@hashicorp.com>
Co-authored-by: Chelsea Shaw <82459713+hashishaw@users.noreply.github.com>
Co-authored-by: Tom Proctor <tomhjp@users.noreply.github.com>
Co-authored-by: Jose Estrada <jose.estrada@tradeshift.com>
Co-authored-by: Arnav Palnitkar <arnav@hashicorp.com>
This commit is contained in:
Angel Garbarino 2022-04-12 13:59:34 -06:00 committed by GitHub
parent 8ebdf1ee5a
commit 3e2028441f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
257 changed files with 3292 additions and 2059 deletions

3
changelog/14763.txt Normal file
View File

@ -0,0 +1,3 @@
```release-note:change
ui: Upgrade Ember to version 3.28
```

View File

@ -17,6 +17,7 @@
# misc # misc
/coverage/ /coverage/
!.* !.*
.*/
.eslintcache .eslintcache
# ember-try # ember-try

View File

@ -32,16 +32,15 @@ module.exports = {
// node files // node files
{ {
files: [ files: [
'.eslintrc.js', './.eslintrc.js',
'.prettierrc.js', './.prettierrc.js',
'.template-lintrc.js', './.template-lintrc.js',
'ember-cli-build.js', './ember-cli-build.js',
'testem.js', './testem.js',
'blueprints/*/index.js', './blueprints/*/index.js',
'config/**/*.js', './config/**/*.js',
'lib/*/index.js', './lib/*/index.js',
'scripts/start-vault.js', './server/**/*.js',
'server/**/*.js',
], ],
parserOptions: { parserOptions: {
sourceType: 'script', sourceType: 'script',
@ -58,5 +57,10 @@ module.exports = {
'node/no-unpublished-require': 'off', 'node/no-unpublished-require': 'off',
}, },
}, },
{
// Test files:
files: ['tests/**/*-test.{js,ts}'],
extends: ['plugin:qunit/recommended'],
},
], ],
}; };

View File

@ -1,14 +1,40 @@
'use strict'; 'use strict';
const recommended = require('ember-template-lint/lib/config/recommended').rules; // octane extends recommended - no additions as of 3.14
const stylistic = require('ember-template-lint/lib/config/stylistic').rules;
const testOverrides = { ...recommended, ...stylistic }; const fs = require('fs');
for (const key in testOverrides) { let testOverrides = {};
testOverrides[key] = false; try {
// ember-template-lint no longer exports anything so we cannot access the rule definitions conventionally
// read file, convert to json string and parse
const toJSON = (str) => {
return JSON.parse(
str
.slice(str.indexOf(':') + 2) // get rid of export statement
.slice(0, -(str.length - str.lastIndexOf(','))) // remove trailing brackets from export
.replace(/:.*,/g, `: ${false},`) // convert values to false
.replace(/,([^,]*)$/, '$1') // remove last comma
.replace(/'/g, '"') // convert to double quotes
.replace(/(\w[^"].*[^"]):/g, '"$1":') // wrap quotes around single word keys
.trim()
);
};
const recommended = toJSON(
fs.readFileSync('node_modules/ember-template-lint/lib/config/recommended.js').toString()
);
const stylistic = toJSON(
fs.readFileSync('node_modules/ember-template-lint/lib/config/stylistic.js').toString()
);
testOverrides = {
...recommended,
...stylistic,
prettier: false,
};
} catch (error) {
console.log(error);
} }
module.exports = { module.exports = {
extends: ['octane', 'stylistic'], plugins: ['ember-template-lint-plugin-prettier'],
extends: ['recommended', 'ember-template-lint-plugin-prettier:recommended'],
rules: { rules: {
'no-bare-strings': 'off', 'no-bare-strings': 'off',
'no-action': 'off', 'no-action': 'off',
@ -22,7 +48,7 @@ module.exports = {
}, },
ignore: ['lib/story-md', 'tests/**'], ignore: ['lib/story-md', 'tests/**'],
// ember language server vscode extension does not currently respect the ignore field // ember language server vscode extension does not currently respect the ignore field
// override all rules manually as workround to align with cli // override all rules manually as workaround to align with cli
overrides: [ overrides: [
{ {
files: ['**/*-test.js'], files: ['**/*-test.js'],

View File

@ -8,7 +8,7 @@ const B64 = 'base64';
const UTF8 = 'utf-8'; const UTF8 = 'utf-8';
export default Component.extend({ export default Component.extend({
tagName: 'button', tagName: 'button',
attributeBindings: ['type'], attributeBindings: ['type', 'data-test-transit-b64-toggle'],
type: 'button', type: 'button',
classNames: ['button', 'b64-toggle'], classNames: ['button', 'b64-toggle'],
classNameBindings: ['isInput:is-input:is-textarea'], classNameBindings: ['isInput:is-input:is-textarea'],

View File

@ -2,4 +2,5 @@ import Component from '@ember/component';
export default Component.extend({ export default Component.extend({
'data-test-component': 'console/log-json', 'data-test-component': 'console/log-json',
attributeBindings: ['data-test-component'],
}); });

View File

@ -2,4 +2,5 @@ import Component from '@ember/component';
export default Component.extend({ export default Component.extend({
'data-test-component': 'console/log-text', 'data-test-component': 'console/log-text',
attributeBindings: ['data-test-component'],
}); });

View File

@ -2,5 +2,6 @@ import Component from '@ember/component';
export default Component.extend({ export default Component.extend({
'data-test-component': 'console/output-log', 'data-test-component': 'console/output-log',
attributeBindings: ['data-test-component'],
log: null, log: null,
}); });

View File

@ -20,6 +20,7 @@ export default Component.extend({
controlGroup: service(), controlGroup: service(),
store: service(), store: service(),
'data-test-component': 'console/ui-panel', 'data-test-component': 'console/ui-panel',
attributeBindings: ['data-test-component'],
classNames: 'console-ui-panel', classNames: 'console-ui-panel',
classNameBindings: ['isFullscreen:fullscreen'], classNameBindings: ['isFullscreen:fullscreen'],

View File

@ -67,16 +67,16 @@ export default Component.extend({
actions: { actions: {
onKeyUp(name, value) { onKeyUp(name, value) {
this.model.set(name, value); this.model.set(name, value);
if (this.model.validations) { if (this.model.validate) {
// Set validation error message for updated attribute // Set validation error message for updated attribute
this.model.validations.attrs[name] && this.model.validations.attrs[name].isValid const { isValid, state } = this.model.validate();
? set(this.validationMessages, name, '') if (state[name]) {
: set(this.validationMessages, name, this.model.validations.attrs[name].message); state[name].isValid
? set(this.validationMessages, name, '')
: set(this.validationMessages, name, state[name].errors.join('. '));
}
// Set form button state // Set form button state
this.model.validate().then(({ validations }) => { this.set('isFormInvalid', !isValid);
this.set('isFormInvalid', !validations.isValid);
});
} else { } else {
this.set('isFormInvalid', false); this.set('isFormInvalid', false);
} }

View File

@ -2,6 +2,7 @@ import Component from '@ember/component';
export default Component.extend({ export default Component.extend({
'data-test-hover-copy': true, 'data-test-hover-copy': true,
attributeBindings: ['data-test-hover-copy'],
classNameBindings: 'alwaysShow:hover-copy-button-static:hover-copy-button', classNameBindings: 'alwaysShow:hover-copy-button-static:hover-copy-button',
copyValue: null, copyValue: null,
alwaysShow: false, alwaysShow: false,

View File

@ -8,6 +8,7 @@ import { waitFor } from '@ember/test-waiters';
export default Component.extend({ export default Component.extend({
flashMessages: service(), flashMessages: service(),
'data-test-component': 'identity-edit-form', 'data-test-component': 'identity-edit-form',
attributeBindings: ['data-test-component'],
model: null, model: null,
// 'create', 'edit', 'merge' // 'create', 'edit', 'merge'

View File

@ -45,7 +45,7 @@ export default Component.extend({
showEnable: false, showEnable: false,
// cp-validation related properties // validation related properties
validationMessages: null, validationMessages: null,
isFormInvalid: false, isFormInvalid: false,
@ -166,27 +166,24 @@ export default Component.extend({
actions: { actions: {
onKeyUp(name, value) { onKeyUp(name, value) {
this.mountModel.set(name, value);
const {
isValid,
state: { path, maxVersions },
} = this.mountModel.validate();
// validate path // validate path
if (name === 'path') { if (name === 'path') {
this.mountModel.set('path', value); path.isValid
this.mountModel.validations.attrs.path.isValid
? set(this.validationMessages, 'path', '') ? set(this.validationMessages, 'path', '')
: set(this.validationMessages, 'path', this.mountModel.validations.attrs.path.message); : set(this.validationMessages, 'path', path.errors.join('. '));
} }
// check maxVersions is a number // check maxVersions is a number
if (name === 'maxVersions') { if (name === 'maxVersions') {
this.mountModel.set('maxVersions', value); maxVersions.isValid
this.mountModel.validations.attrs.maxVersions.isValid
? set(this.validationMessages, 'maxVersions', '') ? set(this.validationMessages, 'maxVersions', '')
: set( : set(this.validationMessages, 'maxVersions', maxVersions.errors.join('. '));
this.validationMessages,
'maxVersions',
this.mountModel.validations.attrs.maxVersions.message
);
} }
this.mountModel.validate().then(({ validations }) => { this.set('isFormInvalid', !isValid);
this.set('isFormInvalid', !validations.isValid);
});
}, },
onTypeChange(path, value) { onTypeChange(path, value) {
if (path === 'type') { if (path === 'type') {

View File

@ -5,6 +5,7 @@ import { computed } from '@ember/object';
export default Component.extend({ export default Component.extend({
router: service(), router: service(),
'data-test-navheader': true, 'data-test-navheader': true,
attributeBindings: ['data-test-navheader'],
classNameBindings: 'consoleFullscreen:panel-fullscreen', classNameBindings: 'consoleFullscreen:panel-fullscreen',
tagName: 'header', tagName: 'header',
navDrawerOpen: false, navDrawerOpen: false,

View File

@ -7,6 +7,7 @@ const BASE_64_REGEX = /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]
export default Component.extend({ export default Component.extend({
'data-test-pgp-file': true, 'data-test-pgp-file': true,
attributeBindings: ['data-test-pgp-file'],
classNames: ['box', 'is-fullwidth', 'is-marginless', 'is-shadowless'], classNames: ['box', 'is-fullwidth', 'is-marginless', 'is-shadowless'],
key: null, key: null,
index: null, index: null,

View File

@ -5,7 +5,7 @@ export default Component.extend({
'data-test-radial-progress': true, 'data-test-radial-progress': true,
tagName: 'svg', tagName: 'svg',
classNames: 'radial-progress', classNames: 'radial-progress',
attributeBindings: ['size:width', 'size:height', 'viewBox'], attributeBindings: ['size:width', 'size:height', 'viewBox', 'data-test-radial-progress'],
progressDecimal: null, progressDecimal: null,
size: 20, size: 20,
strokeWidth: 1, strokeWidth: 1,

View File

@ -62,7 +62,7 @@
spellcheck="false" spellcheck="false"
value={{this.testValue}} value={{this.testValue}}
{{on "change" this.updateTestValue}} {{on "change" this.updateTestValue}}
class="input {{if this.regexError "has-error"}}" class="input {{if this.regexError 'has-error'}}"
/> />
{{#if this.testValue}} {{#if this.testValue}}

View File

@ -54,6 +54,7 @@ export default class SecretEditMetadata extends Component {
if (value) { if (value) {
if (name === 'customMetadata') { if (name === 'customMetadata') {
// cp validations won't work on an object so performing validations here // cp validations won't work on an object so performing validations here
// JLR TODO: review this and incorporate into model-validations system
/* eslint-disable no-useless-escape */ /* eslint-disable no-useless-escape */
let regex = /^[^\\]+$/g; // looking for a backward slash let regex = /^[^\\]+$/g; // looking for a backward slash
value.match(regex) value.match(regex)
@ -62,9 +63,12 @@ export default class SecretEditMetadata extends Component {
} }
if (name === 'maxVersions') { if (name === 'maxVersions') {
this.args.model.maxVersions = value; this.args.model.maxVersions = value;
this.args.model.validations.attrs.maxVersions.isValid const {
state: { maxVersions },
} = this.args.model.validate();
maxVersions.isValid
? set(this.validationMessages, name, '') ? set(this.validationMessages, name, '')
: set(this.validationMessages, name, this.args.model.validations.attrs.maxVersions.message); : set(this.validationMessages, name, maxVersions.errors.join('. '));
} }
} }

View File

@ -1,28 +1,26 @@
import { computed } from '@ember/object'; import Component from '@glimmer/component';
import Component from '@ember/component'; import { action } from '@ember/object';
import { encodePath } from 'vault/utils/path-encoding-helpers'; import { encodePath } from 'vault/utils/path-encoding-helpers';
export default Component.extend({ export default class SecretLink extends Component {
onLinkClick() {}, get link() {
tagName: '', const { mode, secret } = this.args;
// so that ember-test-selectors doesn't log a warning const route = `vault.cluster.secrets.backend.${mode}`;
supportsDataTestProperties: true, if ((mode !== 'versions' && !secret) || secret === ' ') {
mode: 'list',
secret: null,
queryParams: null,
ariaLabel: null,
link: computed('mode', 'secret', function () {
const route = `vault.cluster.secrets.backend.${this.mode}`;
if ((this.mode !== 'versions' && !this.secret) || this.secret === ' ') {
return { route: `${route}-root`, models: [] }; return { route: `${route}-root`, models: [] };
} else { } else {
return { route, models: [encodePath(this.secret)] }; return { route, models: [encodePath(secret)] };
} }
}), }
query: computed('queryParams', function () { get query() {
const qp = this.queryParams || {}; const qp = this.args.queryParams || {};
return qp.isQueryParams ? qp.values : qp; return qp.isQueryParams ? qp.values : qp;
}), }
});
@action
onLinkClick() {
if (this.args.onLinkClick) {
this.args.onLinkClick(...arguments);
}
}
}

View File

@ -1,3 +1,4 @@
import Component from '@glimmer/component';
/** /**
* @module ToolbarSecretLink * @module ToolbarSecretLink
* `ToolbarSecretLink` styles SecretLink for the Toolbar. * `ToolbarSecretLink` styles SecretLink for the Toolbar.
@ -16,18 +17,8 @@
* *
* @param type="" {String} - Use "add" to change icon * @param type="" {String} - Use "add" to change icon
*/ */
export default class ToolbarSecretLink extends Component {
import OuterHTML from './outer-html'; get glyph() {
import { computed } from '@ember/object'; return this.args.type === 'add' ? 'plus' : 'chevron-right';
}
export default OuterHTML.extend({ }
glyph: computed('type', function () {
if (this.type == 'add') {
return 'plus';
} else {
return 'chevron-right';
}
}),
tagName: '',
supportsDataTestProperties: true,
});

View File

@ -0,0 +1,94 @@
/* eslint-disable no-console */
import validators from 'vault/utils/validators';
/**
* used to validate properties on a class
*
* decorator expects validations object with the following shape:
* { [propertyKeyName]: [{ type, options, message }] }
* each key in the validations object should refer to the property on the class to apply the validation to
* type refers to the type of validation to apply -- must be exported from validators util for lookup
* options is an optional object for given validator -- min, max, nullable etc. -- see validators in util
* message is added to the errors array and returned from the validate method if validation fails
* each property supports multiple validations provided as an array -- for example, presence and length for string
*
* validations must be invoked using the validate method which is added directly to the decorated class
* const { isValid, state } = this.model.validate();
* isValid represents the validity of the full class -- if no properties provided in the validations object are invalid this will be true
* state represents the error state of the properties defined in the validations object
* const { isValid, errors } = state[propertyKeyName];
* isValid represents the validity of the property
* errors will be populated with messages defined in the validations object when validations fail
* since a property can have multiple validations, errors is always returned as an array
*
* full example
*
* import Model from '@ember-data/model';
* import withModelValidations from 'vault/decorators/model-validations';
*
* const validations = { foo: [{ type: 'presence', message: 'foo is a required field' }] };
* @withModelValidations(validations)
* class SomeModel extends Model { foo = null; }
*
* const model = new SomeModel();
* const { isValid, state } = model.validate();
* -> isValid = false;
* -> state.foo.isValid = false;
* -> state.foo.errors = ['foo is a required field'];
*/
export function withModelValidations(validations) {
return function decorator(SuperClass) {
return class ModelValidations extends SuperClass {
static _validations;
constructor() {
super(...arguments);
if (!validations || typeof validations !== 'object') {
throw new Error('Validations object must be provided to constructor for setup');
}
this._validations = validations;
}
validate() {
let isValid = true;
const state = {};
for (const key in this._validations) {
const rules = this._validations[key];
if (!Array.isArray(rules)) {
console.error(
`Must provide validations as an array for property "${key}" on ${this.modelName} model`
);
continue;
}
state[key] = { errors: [] };
for (const rule of rules) {
const { type, options, message } = rule;
if (!validators[type]) {
console.error(
`Validator type: "${type}" not found. Available validators: ${Object.keys(validators).join(
', '
)}`
);
continue;
}
if (!validators[type](this[key], options)) {
// consider setting a prop like validationErrors directly on the model
// for now return an errors object
state[key].errors.push(message);
if (isValid) {
isValid = false;
}
}
}
state[key].isValid = !state[key].errors.length;
}
return { isValid, state };
}
};
};
}

31
ui/app/helpers/await.js Normal file
View File

@ -0,0 +1,31 @@
import Helper from '@ember/component/helper';
import { Promise } from 'rsvp';
export default class AwaitHelper extends Helper {
compute([promise]) {
if (!promise || typeof promise.then !== 'function') {
return promise;
}
if (promise !== this.lastPromise) {
this.lastPromise = promise;
this.value = null;
this.resolve(promise);
}
return this.value;
}
async resolve(promise) {
let value;
try {
value = await Promise.resolve(promise);
} catch (error) {
value = error;
} finally {
// ensure this promise is still the newest promise
// otherwise avoid firing recompute since a newer promise is in flight
if (promise === this.lastPromise) {
this.value = value;
this.recompute();
}
}
}
}

View File

@ -36,8 +36,9 @@ export default Mixin.create({
} }
return this.transitionToRoute('vault.cluster.policy.show', m.get('policyType'), m.get('name')); return this.transitionToRoute('vault.cluster.policy.show', m.get('policyType'), m.get('name'));
}) })
.catch((e) => { .catch(() => {
model.set('errors', e.errors); // swallow error -- model.errors set by Adapter
return;
}); });
}, },

View File

@ -1,22 +1,22 @@
import Model, { hasMany, attr } from '@ember-data/model'; import Model, { hasMany, attr } from '@ember-data/model';
import { alias } from '@ember/object/computed'; import { alias } from '@ember/object/computed'; // eslint-disable-line
import { computed } from '@ember/object'; import { computed } from '@ember/object'; // eslint-disable-line
import { fragment } from 'ember-data-model-fragments/attributes'; import { fragment } from 'ember-data-model-fragments/attributes';
import fieldToAttrs, { expandAttributeMeta } from 'vault/utils/field-to-attrs'; import fieldToAttrs, { expandAttributeMeta } from 'vault/utils/field-to-attrs';
import { memberAction } from 'ember-api-actions'; import { memberAction } from 'ember-api-actions';
import { validator, buildValidations } from 'ember-cp-validations';
import apiPath from 'vault/utils/api-path'; import apiPath from 'vault/utils/api-path';
import attachCapabilities from 'vault/lib/attach-capabilities'; import attachCapabilities from 'vault/lib/attach-capabilities';
import { withModelValidations } from 'vault/decorators/model-validations';
const Validations = buildValidations({ const validations = {
path: validator('presence', { path: [{ type: 'presence', message: "Path can't be blank." }],
presence: true, };
message: "Path can't be blank.",
}),
});
let ModelExport = Model.extend(Validations, { // unsure if ember-api-actions will work on native JS class model
// for now create class to use validations and then use classic extend pattern
@withModelValidations(validations)
class AuthMethodModel extends Model {}
const ModelExport = AuthMethodModel.extend({
authConfigs: hasMany('auth-config', { polymorphic: true, inverse: 'backend', async: false }), authConfigs: hasMany('auth-config', { polymorphic: true, inverse: 'backend', async: false }),
path: attr('string'), path: attr('string'),
accessor: attr('string'), accessor: attr('string'),

View File

@ -4,7 +4,6 @@ import { computed } from '@ember/object';
import lazyCapabilities, { apiPath } from 'vault/macros/lazy-capabilities'; import lazyCapabilities, { apiPath } from 'vault/macros/lazy-capabilities';
export default Model.extend({ export default Model.extend({
errors: attr('array'),
name: attr('string'), name: attr('string'),
policy: attr('string'), policy: attr('string'),
policyType: computed('constructor.modelName', function () { policyType: computed('constructor.modelName', function () {

View File

@ -1,34 +1,25 @@
import Model, { attr } from '@ember-data/model'; import Model, { attr } from '@ember-data/model';
import { computed } from '@ember/object'; import { computed } from '@ember/object'; // eslint-disable-line
import { equal } from '@ember/object/computed'; import { equal } from '@ember/object/computed'; // eslint-disable-line
import { fragment } from 'ember-data-model-fragments/attributes'; import { fragment } from 'ember-data-model-fragments/attributes';
import fieldToAttrs, { expandAttributeMeta } from 'vault/utils/field-to-attrs'; import fieldToAttrs, { expandAttributeMeta } from 'vault/utils/field-to-attrs';
import { validator, buildValidations } from 'ember-cp-validations'; import { withModelValidations } from 'vault/decorators/model-validations';
// identity will be managed separately and the inclusion // identity will be managed separately and the inclusion
// of the system backend is an implementation detail // of the system backend is an implementation detail
const LIST_EXCLUDED_BACKENDS = ['system', 'identity']; const LIST_EXCLUDED_BACKENDS = ['system', 'identity'];
const Validations = buildValidations({ const validations = {
path: validator('presence', { path: [{ type: 'presence', message: "Path can't be blank." }],
presence: true,
message: "Path can't be blank.",
}),
maxVersions: [ maxVersions: [
validator('number', { { type: 'number', options: { asString: true }, message: 'Maximum versions must be a number.' },
allowString: true, { type: 'length', options: { min: 1, max: 16 }, message: 'You cannot go over 16 characters.' },
integer: true,
message: 'Maximum versions must be a number.',
}),
validator('length', {
min: 1,
max: 16,
message: 'You cannot go over 16 characters.',
}),
], ],
}); };
export default Model.extend(Validations, { @withModelValidations(validations)
class SecretEngineModel extends Model {}
export default SecretEngineModel.extend({
path: attr('string'), path: attr('string'),
accessor: attr('string'), accessor: attr('string'),
name: attr('string'), name: attr('string'),

View File

@ -1,27 +1,21 @@
import Model, { belongsTo, hasMany, attr } from '@ember-data/model'; import Model, { belongsTo, hasMany, attr } from '@ember-data/model';
import { computed } from '@ember/object'; import { computed } from '@ember/object'; // eslint-disable-line
import { alias } from '@ember/object/computed'; import { alias } from '@ember/object/computed'; // eslint-disable-line
import { expandAttributeMeta } from 'vault/utils/field-to-attrs'; import { expandAttributeMeta } from 'vault/utils/field-to-attrs';
import KeyMixin from 'vault/mixins/key-mixin'; import KeyMixin from 'vault/mixins/key-mixin';
import lazyCapabilities, { apiPath } from 'vault/macros/lazy-capabilities'; import lazyCapabilities, { apiPath } from 'vault/macros/lazy-capabilities';
import { validator, buildValidations } from 'ember-cp-validations'; import { withModelValidations } from 'vault/decorators/model-validations';
const Validations = buildValidations({ const validations = {
maxVersions: [ maxVersions: [
validator('number', { { type: 'number', options: { asString: true }, message: 'Maximum versions must be a number.' },
allowString: true, { type: 'length', options: { min: 1, max: 16 }, message: 'You cannot go over 16 characters.' },
integer: true,
message: 'Maximum versions must be a number.',
}),
validator('length', {
min: 1,
max: 16,
message: 'You cannot go over 16 characters.',
}),
], ],
}); };
export default Model.extend(KeyMixin, Validations, { @withModelValidations(validations)
class SecretV2Model extends Model {}
export default SecretV2Model.extend(KeyMixin, {
failedServerRead: attr('boolean'), failedServerRead: attr('boolean'),
engine: belongsTo('secret-engine', { async: false }), engine: belongsTo('secret-engine', { async: false }),
engineId: attr('string'), engineId: attr('string'),

View File

@ -36,8 +36,8 @@ export default Route.extend({
case 'alphabet': case 'alphabet':
modelType = 'transform/alphabet'; modelType = 'transform/alphabet';
break; break;
default: default: // CBS TODO: transform/transformation
modelType = 'transform'; // CBS TODO: transform/transformation modelType = 'transform';
break; break;
} }
return modelType; return modelType;

View File

@ -14,7 +14,7 @@ import { resolve, reject } from 'rsvp';
import { debug } from '@ember/debug'; import { debug } from '@ember/debug';
import { dasherize, capitalize } from '@ember/string'; import { dasherize, capitalize } from '@ember/string';
import { singularize } from 'ember-inflector'; import { singularize } from 'ember-inflector';
import buildValidations from 'vault/utils/build-api-validators'; import { withModelValidations } from 'vault/decorators/model-validations';
import generatedItemAdapter from 'vault/adapters/generated-item-list'; import generatedItemAdapter from 'vault/adapters/generated-item-list';
export function sanitizePath(path) { export function sanitizePath(path) {
@ -36,6 +36,7 @@ export default Service.extend({
getNewModel(modelType, backend, apiPath, itemType) { getNewModel(modelType, backend, apiPath, itemType) {
let owner = getOwner(this); let owner = getOwner(this);
const modelName = `model:${modelType}`; const modelName = `model:${modelType}`;
const modelFactory = owner.factoryFor(modelName); const modelFactory = owner.factoryFor(modelName);
let newModel, helpUrl; let newModel, helpUrl;
// if we have a factory, we need to take the existing model into account // if we have a factory, we need to take the existing model into account
@ -298,8 +299,17 @@ export default Service.extend({
// Build and add validations on model // Build and add validations on model
// NOTE: For initial phase, initialize validations only for user pass auth // NOTE: For initial phase, initialize validations only for user pass auth
if (backend === 'userpass') { if (backend === 'userpass') {
let validations = buildValidations(fieldGroups); const validations = fieldGroups.reduce((obj, element) => {
newModel = newModel.extend(validations); if (element.default) {
element.default.forEach((v) => {
obj[v.name] = [{ type: 'presence', message: `${v.name} can't be black` }];
});
}
return obj;
}, {});
@withModelValidations(validations)
class GeneratedItemModel extends newModel {}
newModel = GeneratedItemModel;
} }
} }
} catch (err) { } catch (err) {

View File

@ -11,7 +11,7 @@
{{this.type.text}} {{this.type.text}}
</div> </div>
{{#if this.message}} {{#if this.message}}
<p class="message-body {{if @isPreformatted "pre"}}" data-test-flash-message-body="true">{{this.message}}</p> <p class="message-body {{if @isPreformatted 'pre'}}" data-test-flash-message-body="true">{{this.message}}</p>
{{/if}} {{/if}}
</div> </div>
</div> </div>

View File

@ -35,7 +35,7 @@
<ToolbarSecretLink <ToolbarSecretLink
@secret={{concat this.model.idPrefix this.model.id}} @secret={{concat this.model.idPrefix this.model.id}}
@mode="edit" @mode="edit"
@data-test-edit-link={{true}} data-test-edit-link={{true}}
@replace={{true}} @replace={{true}}
> >
Edit alphabet Edit alphabet
@ -89,7 +89,7 @@
</button> </button>
<SecretLink <SecretLink
@mode={{if (eq this.mode "create") "list" "show"}} @mode={{if (eq this.mode "create") "list" "show"}}
@class="button" class="button"
@secret={{concat this.model.idPrefix this.model.id}} @secret={{concat this.model.idPrefix this.model.id}}
> >
Cancel Cancel

View File

@ -14,7 +14,7 @@
<button <button
type="submit" type="submit"
data-test-save-config="true" data-test-save-config="true"
class="button is-primary {{if this.saveModel.isRunning "loading"}}" class="button is-primary {{if this.saveModel.isRunning 'loading'}}"
disabled={{this.saveModel.isRunning}} disabled={{this.saveModel.isRunning}}
> >
Save Save

View File

@ -10,7 +10,7 @@
<button <button
type="submit" type="submit"
data-test-save-config="true" data-test-save-config="true"
class="button is-primary {{if this.saveModel.isRunning "loading"}}" class="button is-primary {{if this.saveModel.isRunning 'loading'}}"
disabled={{this.saveModel.isRunning}} disabled={{this.saveModel.isRunning}}
> >
Update Options Update Options

View File

@ -1,6 +1,6 @@
{{#unless this.selectedAuthIsPath}} {{#unless this.selectedAuthIsPath}}
<div class="box has-slim-padding is-shadowless"> <div class="box has-slim-padding is-shadowless">
<ToggleButton @toggleTarget={{this}} @toggleAttr="isOpen" /> <ToggleButton @isOpen={{this.isOpen}} @onClick={{fn (mut this.isOpen)}} />
{{#if this.isOpen}} {{#if this.isOpen}}
<div class="field"> <div class="field">
<label for="custom-path" class="is-label"> <label for="custom-path" class="is-label">

View File

@ -156,7 +156,7 @@
data-test-auth-submit={{true}} data-test-auth-submit={{true}}
type="submit" type="submit"
disabled={{this.authenticate.isRunning}} disabled={{this.authenticate.isRunning}}
class="button is-primary {{if this.authenticate.isRunning "is-loading"}}" class="button is-primary {{if this.authenticate.isRunning 'is-loading'}}"
id="auth-submit" id="auth-submit"
> >
Sign In Sign In

View File

@ -12,7 +12,7 @@
@type="warning" @type="warning"
@message="We've stopped auto-renewing your token due to inactivity. @message="We've stopped auto-renewing your token due to inactivity.
It will expire in {{date-from-now this.auth.tokenExpirationDate interval=1000 hideSuffix=true}}. It will expire in {{date-from-now this.auth.tokenExpirationDate interval=1000 hideSuffix=true}}.
On {{date-format this.auth.tokenExpirationDate "MMMM do yyyy, h:mm:ss a"}}" On {{date-format this.auth.tokenExpirationDate 'MMMM do yyyy, h:mm:ss a'}}"
/> />
</li> </li>
{{/if}} {{/if}}
@ -34,7 +34,7 @@
{{#if (is-before (now interval=1000) this.auth.tokenExpirationDate)}} {{#if (is-before (now interval=1000) this.auth.tokenExpirationDate)}}
{{#if this.auth.authData.renewable}} {{#if this.auth.authData.renewable}}
<li class="action"> <li class="action">
<button type="button" {{on "click" this.renewToken}} class="link button {{if this.isRenewing "is-loading"}}"> <button type="button" {{on "click" this.renewToken}} class="link button {{if this.isRenewing 'is-loading'}}">
Renew token Renew token
</button> </button>
</li> </li>

View File

@ -45,7 +45,7 @@
data-test-auth-submit={{true}} data-test-auth-submit={{true}}
type="submit" type="submit"
disabled={{@disabled}} disabled={{@disabled}}
class="button is-primary {{if @disabled "is-loading"}}" class="button is-primary {{if @disabled 'is-loading'}}"
id="auth-submit" id="auth-submit"
> >
{{#if this.isOIDC}} {{#if this.isOIDC}}

View File

@ -138,7 +138,7 @@
@runningTotals={{this.totalUsageCounts}} @runningTotals={{this.totalUsageCounts}}
@timestamp={{this.responseTimestamp}} @timestamp={{this.responseTimestamp}}
/> />
{{!-- TODO CMB: remove UsageStats component from history tab (and update associated tests) --}} {{! TODO CMB: remove UsageStats component from history tab (and update associated tests) }}
<Clients::UsageStats @title="Total usage" @totalUsageCounts={{this.totalUsageCounts}} /> <Clients::UsageStats @title="Total usage" @totalUsageCounts={{this.totalUsageCounts}} />
{{#if this.hasAttributionData}} {{#if this.hasAttributionData}}
<Clients::Attribution <Clients::Attribution

View File

@ -3,7 +3,8 @@
<div class="chart-header has-bottom-margin-xl"> <div class="chart-header has-bottom-margin-xl">
<h2 class="chart-title">Vault client counts</h2> <h2 class="chart-title">Vault client counts</h2>
<p class="chart-description"> <p class="chart-description">
A client is any user or service that interacts with Vault. They are made up of entity clients and non-entity clients. The total client count number is an important consideration for Vault billing. A client is any user or service that interacts with Vault. They are made up of entity clients and non-entity clients.
The total client count number is an important consideration for Vault billing.
</p> </p>
</div> </div>

View File

@ -73,7 +73,7 @@
<button <button
data-test-submit data-test-submit
type="submit" type="submit"
class="button is-primary {{if this.loading "is-loading"}}" class="button is-primary {{if this.loading 'is-loading'}}"
disabled={{this.loading}} disabled={{this.loading}}
> >
Save Save
@ -158,7 +158,7 @@
<button <button
data-test-submit data-test-submit
type="submit" type="submit"
class="button is-primary {{if this.loading "is-loading"}}" class="button is-primary {{if this.loading 'is-loading'}}"
disabled={{this.loading}} disabled={{this.loading}}
> >
Save Save
@ -199,7 +199,7 @@
<button <button
data-test-submit data-test-submit
type="submit" type="submit"
class="button is-primary {{if this.loading "is-loading"}}" class="button is-primary {{if this.loading 'is-loading'}}"
disabled={{this.loading}} disabled={{this.loading}}
> >
Save Save

View File

@ -24,7 +24,7 @@
<button <button
data-test-submit data-test-submit
type="submit" type="submit"
class="button is-primary {{if this.loading "is-loading"}}" class="button is-primary {{if this.loading 'is-loading'}}"
disabled={{this.loading}} disabled={{this.loading}}
> >
Save Save

View File

@ -89,7 +89,7 @@
</div> </div>
</div> </div>
<ToggleButton @toggleAttr="showOptions" @toggleTarget={{this}} @openLabel="Hide options" @closedLabel="More options" /> <ToggleButton @isOpen={{this.showOptions}} @onClick={{fn (mut this.showOptions)}} />
{{#if this.showOptions}} {{#if this.showOptions}}
<div class="box is-marginless"> <div class="box is-marginless">
<div class="field"> <div class="field">

View File

@ -78,7 +78,7 @@
<div class="control"> <div class="control">
<button <button
type="submit" type="submit"
class="button is-primary {{if this.loading "is-loading"}}" class="button is-primary {{if this.loading 'is-loading'}}"
disabled={{this.loading}} disabled={{this.loading}}
data-test-ssh-input="configure-submit" data-test-ssh-input="configure-submit"
> >

View File

@ -11,7 +11,7 @@
</div> </div>
{{else}} {{else}}
{{#if this.unwrapData}} {{#if this.unwrapData}}
<div class="control-group-success {{if this.unwrapData "is-editor"}}"> <div class="control-group-success {{if this.unwrapData 'is-editor'}}">
<div class="has-copy-button"> <div class="has-copy-button">
<JsonEditor <JsonEditor
data-test-json-viewer data-test-json-viewer

View File

@ -1,6 +1,6 @@
<div class="box is-fullwidth is-bottomless is-sideless"> <div class="box is-fullwidth is-bottomless is-sideless">
<MessageError @model={{this.model}} /> <MessageError @model={{this.model}} />
<div class="control-group-header {{if this.isSuccess "is-success"}}"> <div class="control-group-header {{if this.isSuccess 'is-success'}}">
<p> <p>
<Icon @name={{if this.isSuccess "check-circle-fill" "lock-fill"}} /> <Icon @name={{if this.isSuccess "check-circle-fill" "lock-fill"}} />
<strong data-test-banner-prefix>{{this.bannerPrefix}}</strong> <strong data-test-banner-prefix>{{this.bannerPrefix}}</strong>
@ -98,7 +98,7 @@
{{else}} {{else}}
<button <button
type="button" type="button"
class="button is-primary {{if this.authorize.isRunning "is-loading"}}" class="button is-primary {{if this.authorize.isRunning 'is-loading'}}"
{{action (perform this.authorize)}} {{action (perform this.authorize)}}
data-test-authorize-button data-test-authorize-button
> >
@ -108,7 +108,7 @@
{{else}} {{else}}
<button <button
type="button" type="button"
class="button is-primary {{if this.refresh.isRunning "is-loading"}}" class="button is-primary {{if this.refresh.isRunning 'is-loading'}}"
{{action (perform this.refresh)}} {{action (perform this.refresh)}}
data-test-refresh-button data-test-refresh-button
> >

View File

@ -64,13 +64,13 @@
@mode="create" @mode="create"
@type="add" @type="add"
@queryParams={{query-params initialKey=@model.name itemType="role"}} @queryParams={{query-params initialKey=@model.name itemType="role"}}
@data-test-secret-create={{true}} data-test-secret-create={{true}}
> >
Add role Add role
</ToolbarSecretLink> </ToolbarSecretLink>
{{/if}} {{/if}}
{{#if @model.canEdit}} {{#if @model.canEdit}}
<ToolbarSecretLink @secret={{@model.id}} @mode="edit" @data-test-edit-link={{true}} @replace={{true}}> <ToolbarSecretLink @secret={{@model.id}} @mode="edit" data-test-edit-link={{true}} @replace={{true}}>
Edit configuration Edit configuration
</ToolbarSecretLink> </ToolbarSecretLink>
{{/if}} {{/if}}
@ -120,21 +120,23 @@
{{/each}} {{/each}}
</div> </div>
{{else}} {{else}}
<ToggleButton {{#let (camelize (concat "show" group)) as |prop|}}
@class="is-block" <ToggleButton
@toggleAttr={{camelize (concat "show" group)}} @isOpen={{get this prop}}
@toggleTarget={{this}} @openLabel={{concat "Hide " group}}
@openLabel={{concat "Hide " group}} @closedLabel={{group}}
@closedLabel={{group}} @onClick={{fn (mut (get this prop))}}
@data-test-toggle-group={{group}} class="is-block"
/> data-test-toggle-group={{group}}
{{#if (get this (camelize (concat "show" group)))}} />
<div class="box is-marginless"> {{#if (get this prop)}}
{{#each fields as |attr|}} <div class="box is-marginless">
<FormField data-test-field={{true}} @attr={{attr}} @model={{@model}} /> {{#each fields as |attr|}}
{{/each}} <FormField data-test-field={{true}} @attr={{attr}} @model={{@model}} />
</div> {{/each}}
{{/if}} </div>
{{/if}}
{{/let}}
{{/if}} {{/if}}
{{/each-in}} {{/each-in}}
{{/each}} {{/each}}
@ -167,7 +169,7 @@
</button> </button>
</div> </div>
<div class="control"> <div class="control">
<SecretLink @mode="list" @class="button"> <SecretLink @mode="list" class="button">
Cancel Cancel
</SecretLink> </SecretLink>
</div> </div>
@ -246,21 +248,23 @@
{{/each}} {{/each}}
</div> </div>
{{else}} {{else}}
<ToggleButton {{#let (camelize (concat "show" group)) as |prop|}}
@class="is-block" <ToggleButton
@toggleAttr={{camelize (concat "show" group)}} @isOpen={{get this prop}}
@toggleTarget={{this}} @openLabel={{concat "Hide " group}}
@openLabel={{concat "Hide " group}} @closedLabel={{group}}
@closedLabel={{group}} @onClick={{fn (mut (get this prop))}}
@data-test-toggle-group={{group}} class="is-block"
/> data-test-toggle-group={{group}}
{{#if (get this (camelize (concat "show" group)))}} />
<div class="box is-marginless"> {{#if (get this prop)}}
{{#each fields as |attr|}} <div class="box is-marginless">
<FormField data-test-field={{true}} @attr={{attr}} @model={{@model}} /> {{#each fields as |attr|}}
{{/each}} <FormField data-test-field={{true}} @attr={{attr}} @model={{@model}} />
</div> {{/each}}
{{/if}} </div>
{{/if}}
{{/let}}
{{/if}} {{/if}}
{{/each-in}} {{/each-in}}
{{/each}} {{/each}}
@ -287,7 +291,7 @@
</button> </button>
</div> </div>
<div class="control"> <div class="control">
<SecretLink @mode="list" @class="button"> <SecretLink @mode="list" class="button">
Cancel Cancel
</SecretLink> </SecretLink>
</div> </div>

View File

@ -52,7 +52,7 @@
@mode="edit" @mode="edit"
@replace={{true}} @replace={{true}}
@queryParams={{query-params itemType="role"}} @queryParams={{query-params itemType="role"}}
@data-test-edit-link={{true}} data-test-edit-link={{true}}
> >
Edit role Edit role
</ToolbarSecretLink> </ToolbarSecretLink>
@ -119,7 +119,7 @@
data-test-secret-save data-test-secret-save
type="submit" type="submit"
disabled={{this.loading}} disabled={{this.loading}}
class="button is-primary {{if this.loading "is-loading"}}" class="button is-primary {{if this.loading 'is-loading'}}"
> >
{{#if (eq @mode "create")}} {{#if (eq @mode "create")}}
Create role Create role
@ -145,7 +145,7 @@
{{/if}} {{/if}}
</div> </div>
<div class="control"> <div class="control">
<SecretLink @mode="list" @class="button"> <SecretLink @mode="list" class="button">
Cancel Cancel
</SecretLink> </SecretLink>
</div> </div>

View File

@ -25,7 +25,7 @@
{{leftSideSecretVersion.version}} {{leftSideSecretVersion.version}}
{{#if {{#if
(and (and
(eq leftSideSecretVersion.version (or this.leftSideVersionSelected @args.model.currentVersion)) (eq leftSideSecretVersion.version (or this.leftSideVersionSelected @model.currentVersion))
(not leftSideSecretVersion.destroyed) (not leftSideSecretVersion.destroyed)
(not leftSideSecretVersion.deleted) (not leftSideSecretVersion.deleted)
) )

View File

@ -8,21 +8,23 @@
{{/unless}} {{/unless}}
{{/each}} {{/each}}
{{else}} {{else}}
<ToggleButton {{#let (camelize (concat "show" group)) as |prop|}}
@class="is-block" <ToggleButton
@toggleAttr={{camelize (concat "show" group)}} @isOpen={{get @model prop}}
@toggleTarget={{@model}} @openLabel={{concat "Hide " group}}
@openLabel={{concat "Hide " group}} @closedLabel={{group}}
@closedLabel={{group}} @onClick={{fn (mut (get @model prop))}}
@data-test-toggle-group={{group}} class="is-block"
/> data-test-toggle-group={{group}}
{{#if (get @model (camelize (concat "show" group)))}} />
<div class="box is-marginless"> {{#if (get @model prop)}}
{{#each fields as |attr|}} <div class="box is-marginless">
<FormField data-test-field={{true}} @attr={{attr}} @model={{@model}} /> {{#each fields as |attr|}}
{{/each}} <FormField data-test-field={{true}} @attr={{attr}} @model={{@model}} />
</div> {{/each}}
{{/if}} </div>
{{/if}}
{{/let}}
{{/if}} {{/if}}
{{/each-in}} {{/each-in}}
{{/each}} {{/each}}

View File

@ -145,7 +145,7 @@
<button <button
type="submit" type="submit"
disabled={{this.loading}} disabled={{this.loading}}
class="button is-primary {{if this.loading "is-loading"}}" class="button is-primary {{if this.loading 'is-loading'}}"
data-test-secret-generate={{true}} data-test-secret-generate={{true}}
> >
Generate Generate

View File

@ -37,7 +37,7 @@
<Toolbar> <Toolbar>
<ToolbarActions> <ToolbarActions>
<ToolbarLink <ToolbarLink
@data-test-entity-create-link={{this.itemType}} data-test-entity-create-link={{this.itemType}}
@type="add" @type="add"
@params={{array "vault.cluster.access.method.item.create" this.itemType}} @params={{array "vault.cluster.access.method.item.create" this.itemType}}
> >

View File

@ -45,7 +45,7 @@
<div class="toolbar-separator"></div> <div class="toolbar-separator"></div>
<ToolbarLink <ToolbarLink
@params={{array "vault.cluster.access.method.item.edit" this.itemType this.model.id}} @params={{array "vault.cluster.access.method.item.edit" this.itemType this.model.id}}
@data-test-configure-link="true" data-test-configure-link="true"
> >
Edit Edit
{{singularize this.itemType}} {{singularize this.itemType}}
@ -72,7 +72,7 @@
<button <button
type="submit" type="submit"
data-test-save-config="true" data-test-save-config="true"
class="button is-primary {{if this.saveModel.isRunning "loading"}}" class="button is-primary {{if this.saveModel.isRunning 'loading'}}"
disabled={{or this.saveModel.isRunning this.isFormInvalid}} disabled={{or this.saveModel.isRunning this.isFormInvalid}}
> >
Save Save

View File

@ -34,7 +34,7 @@
<button <button
type="submit" type="submit"
data-test-identity-submit={{true}} data-test-identity-submit={{true}}
class="button is-primary {{if this.save.isRunning "loading"}}" class="button is-primary {{if this.save.isRunning 'loading'}}"
disabled={{this.save.isRunning}} disabled={{this.save.isRunning}}
> >
{{#if (eq this.mode "create")}} {{#if (eq this.mode "create")}}

View File

@ -27,7 +27,7 @@
{{#if (eq this.identityType "entity")}} {{#if (eq this.identityType "entity")}}
<ToolbarLink <ToolbarLink
@params={{array "vault.cluster.access.identity.merge" (pluralize this.identityType)}} @params={{array "vault.cluster.access.identity.merge" (pluralize this.identityType)}}
@data-test-entity-merge-link={{true}} data-test-entity-merge-link={{true}}
> >
Merge Merge
{{pluralize this.identityType}} {{pluralize this.identityType}}
@ -36,7 +36,7 @@
<ToolbarLink <ToolbarLink
@type="add" @type="add"
@params={{array "vault.cluster.access.identity.create" (pluralize this.identityType)}} @params={{array "vault.cluster.access.identity.create" (pluralize this.identityType)}}
@data-test-entity-create-link={{true}} data-test-entity-create-link={{true}}
> >
Create Create
{{this.identityType}} {{this.identityType}}

View File

@ -1,5 +1,5 @@
{{#each (if @model.alias.id (array @model.alias) @model.aliases) as |item|}} {{#each (if @model.alias.id (array @model.alias) @model.aliases) as |item|}}
{{#linked-block "vault.cluster.access.identity.aliases.show" item.id "details" class="list-item-row"}} <LinkedBlock @params={{array "vault.cluster.access.identity.aliases.show" item.id "details"}} class="list-item-row">
<div class="columns is-mobile"> <div class="columns is-mobile">
<div class="column is-10"> <div class="column is-10">
<LinkTo <LinkTo
@ -22,7 +22,7 @@
<Identity::PopupAlias @params={{array item}} /> <Identity::PopupAlias @params={{array item}} />
</div> </div>
</div> </div>
{{/linked-block}} </LinkedBlock>
{{else}} {{else}}
<EmptyState @title="No {{@model.identityType}} aliases for {{@model.name}} yet" /> <EmptyState @title="No {{@model.identityType}} aliases for {{@model.name}} yet" />
{{/each}} {{/each}}

View File

@ -5,12 +5,12 @@
</LinkTo> </LinkTo>
{{/each}} {{/each}}
{{#each @model.inheritedGroupIds as |gid|}} {{#each @model.inheritedGroupIds as |gid|}}
{{#linked-block "vault.cluster.access.identity.show" "groups" gid "details" class="list-item-row"}} <LinkedBlock @params={{array "vault.cluster.access.identity.show" "groups" gid "details"}} class="list-item-row">
<LinkTo @route="vault.cluster.access.identity.show" @models={{array "groups" gid "details"}} class="has-text-black"> <LinkTo @route="vault.cluster.access.identity.show" @models={{array "groups" gid "details"}} class="has-text-black">
<Icon @name="folder" class="has-text-grey-light" />{{gid}} <Icon @name="folder" class="has-text-grey-light" />{{gid}}
</LinkTo> </LinkTo>
<span class="tag has-text-grey is-size-8">inherited</span> <span class="tag has-text-grey is-size-8">inherited</span>
{{/linked-block}} </LinkedBlock>
{{/each}} {{/each}}
{{else}} {{else}}
<EmptyState @title="{{@model.name}} is not a member of any groups." /> <EmptyState @title="{{@model.name}} is not a member of any groups." />

View File

@ -1,6 +1,6 @@
{{#if @model.hasMembers}} {{#if @model.hasMembers}}
{{#each @model.memberGroupIds as |gid|}} {{#each @model.memberGroupIds as |gid|}}
{{#linked-block "vault.cluster.access.identity.show" "groups" gid this.details class="list-item-row"}} <LinkedBlock @params={{array "vault.cluster.access.identity.show" "groups" gid this.details}} class="list-item-row">
<div class="columns is-mobile"> <div class="columns is-mobile">
<div class="column is-10"> <div class="column is-10">
<LinkTo <LinkTo
@ -17,10 +17,10 @@
{{/if}} {{/if}}
</div> </div>
</div> </div>
{{/linked-block}} </LinkedBlock>
{{/each}} {{/each}}
{{#each @model.memberEntityIds as |gid|}} {{#each @model.memberEntityIds as |gid|}}
{{#linked-block "vault.cluster.access.identity.show" "groups" gid this.details class="list-item-row"}} <LinkedBlock @params={{array "vault.cluster.access.identity.show" "groups" gid this.details}} class="list-item-row">
<div class="columns"> <div class="columns">
<div class="column is-10"> <div class="column is-10">
<LinkTo <LinkTo
@ -37,7 +37,7 @@
{{/if}} {{/if}}
</div> </div>
</div> </div>
{{/linked-block}} </LinkedBlock>
{{/each}} {{/each}}
{{else}} {{else}}
<EmptyState @title="No members in this group yet" /> <EmptyState @title="No members in this group yet" />

View File

@ -1,6 +1,6 @@
{{#if @model.parentGroupIds.length}} {{#if @model.parentGroupIds.length}}
{{#each @model.parentGroupIds as |gid|}} {{#each @model.parentGroupIds as |gid|}}
{{#linked-block "vault.cluster.access.identity.show" "groups" gid this.details class="list-item-row"}} <LinkedBlock @params={{array "vault.cluster.access.identity.show" "groups" gid this.details}} class="list-item-row">
<div class="columns is-mobile"> <div class="columns is-mobile">
<div class="column is-10"> <div class="column is-10">
<LinkTo <LinkTo
@ -14,7 +14,7 @@
<div class="column has-text-right"> <div class="column has-text-right">
</div> </div>
</div> </div>
{{/linked-block}} </LinkedBlock>
{{/each}} {{/each}}
{{else}} {{else}}
<EmptyState @title="This group has no parent groups yet" /> <EmptyState @title="This group has no parent groups yet" />

View File

@ -1,5 +1,5 @@
{{#each @model.policies as |policyName|}} {{#each @model.policies as |policyName|}}
{{#linked-block "vault.cluster.policy.show" "acl" this.item class="list-item-row"}} <LinkedBlock @params={{array "vault.cluster.policy.show" "acl" this.item}} class="list-item-row">
<div class="columns is-mobile"> <div class="columns is-mobile">
<div class="column is-10"> <div class="column is-10">
<LinkTo <LinkTo
@ -16,7 +16,7 @@
{{/if}} {{/if}}
</div> </div>
</div> </div>
{{/linked-block}} </LinkedBlock>
{{else}} {{else}}
<EmptyState @title="No policies associated with {{@model.name}} yet" /> <EmptyState @title="No policies associated with {{@model.name}} yet" />
{{/each}} {{/each}}

View File

@ -29,7 +29,7 @@
<Textarea <Textarea
data-test-kv-value={{index}} data-test-kv-value={{index}}
name={{row.name}} name={{row.name}}
class="input {{if @validationError "has-error-border"}}" class="input {{if @validationError 'has-error-border'}}"
@value={{row.value}} @value={{row.value}}
wrap="off" wrap="off"
placeholder={{this.placeholders.value}} placeholder={{this.placeholders.value}}

View File

@ -5,7 +5,7 @@
@title="License expired" @title="License expired"
@message="Your Vault license expired on {{date-format @message="Your Vault license expired on {{date-format
@expiry @expiry
"MMM d, yyyy" 'MMM d, yyyy'
}}. Add a new license to your configuration and restart Vault." }}. Add a new license to your configuration and restart Vault."
@marginless={{true}} @marginless={{true}}
> >
@ -25,11 +25,11 @@
@title="Vault license expiring" @title="Vault license expiring"
@message="Your Vault license will expire in {{this.licenseExpiringInDays}} days at {{date-format @message="Your Vault license will expire in {{this.licenseExpiringInDays}} days at {{date-format
@expiry @expiry
"hh:mm:ss a" 'hh:mm:ss a'
}} on {{date-format @expiry "MMM d, yyyy"}}. {{if }} on {{date-format @expiry 'MMM d, yyyy'}}. {{if
@autoloaded @autoloaded
"Add a new license to your configuration." 'Add a new license to your configuration.'
"Keep in mind that your next license will need to be autoloaded" 'Keep in mind that your next license will need to be autoloaded'
}}" }}"
@marginless={{true}} @marginless={{true}}
> >

View File

@ -29,6 +29,7 @@
{{/if}} {{/if}}
{{#if constraint.selectedMethod.uses_passcode}} {{#if constraint.selectedMethod.uses_passcode}}
<div class="control"> <div class="control">
{{! template-lint-disable no-autofocus-attribute}}
<Input <Input
id="passcode" id="passcode"
name="passcode" name="passcode"
@ -41,6 +42,7 @@
@value={{constraint.passcode}} @value={{constraint.passcode}}
data-test-mfa-passcode={{index}} data-test-mfa-passcode={{index}}
/> />
{{! template-lint-enable no-autofocus-attribute}}
</div> </div>
{{else if (eq constraint.methods.length 1)}} {{else if (eq constraint.methods.length 1)}}
<p class="has-text-grey-400"> <p class="has-text-grey-400">
@ -62,7 +64,7 @@
id="validate" id="validate"
type="submit" type="submit"
disabled={{or this.validate.isRunning this.newCodeDelay.isRunning}} disabled={{or this.validate.isRunning this.newCodeDelay.isRunning}}
class="button is-primary {{if this.validate.isRunning "is-loading"}}" class="button is-primary {{if this.validate.isRunning 'is-loading'}}"
data-test-mfa-validate data-test-mfa-validate
> >
Verify Verify

View File

@ -66,7 +66,7 @@
<button <button
type="submit" type="submit"
data-test-mount-submit="true" data-test-mount-submit="true"
class="button is-primary {{if this.mountBackend.isRunning "loading"}}" class="button is-primary {{if this.mountBackend.isRunning 'loading'}}"
disabled={{or this.mountBackend.isRunning this.isFormInvalid}} disabled={{or this.mountBackend.isRunning this.isFormInvalid}}
> >
{{#if (eq this.mountType "auth")}} {{#if (eq this.mountType "auth")}}

View File

@ -48,7 +48,7 @@
</header> </header>
</div> </div>
</div> </div>
<div class="namespace-list {{if this.isAnimating "animated-list"}}"> <div class="namespace-list {{if this.isAnimating 'animated-list'}}">
<div class="is-mobile level-left"> <div class="is-mobile level-left">
{{#unless this.isUserRootNamespace}} {{#unless this.isUserRootNamespace}}
<NamespaceLink <NamespaceLink
@ -65,7 +65,7 @@
</div> </div>
{{#if (contains "" this.lastMenuLeaves)}} {{#if (contains "" this.lastMenuLeaves)}}
{{! leaf is '' which is the root namespace, and then we need to iterate the root leaves }} {{! leaf is '' which is the root namespace, and then we need to iterate the root leaves }}
<div class="leaf-panel {{if (eq "" this.currentLeaf) "leaf-panel-current" "leaf-panel-left"}} "> <div class="leaf-panel {{if (eq '' this.currentLeaf) 'leaf-panel-current' 'leaf-panel-left'}} ">
{{~#each this.rootLeaves as |rootLeaf|}} {{~#each this.rootLeaves as |rootLeaf|}}
<NamespaceLink @targetNamespace={{rootLeaf}} @class="namespace-link" @showLastSegment={{true}} /> <NamespaceLink @targetNamespace={{rootLeaf}} @class="namespace-link" @showLastSegment={{true}} />
{{/each~}} {{/each~}}
@ -74,9 +74,9 @@
{{#each this.lastMenuLeaves as |leaf|}} {{#each this.lastMenuLeaves as |leaf|}}
<div <div
class="leaf-panel class="leaf-panel
{{if (eq leaf this.currentLeaf) "leaf-panel-current" "leaf-panel-left"}} {{if (eq leaf this.currentLeaf) 'leaf-panel-current' 'leaf-panel-left'}}
{{if (and this.isAdding (eq leaf this.changedLeaf)) "leaf-panel-adding"}} {{if (and this.isAdding (eq leaf this.changedLeaf)) 'leaf-panel-adding'}}
{{if (and (not this.isAdding) (eq leaf this.changedLeaf)) "leaf-panel-exiting"}} {{if (and (not this.isAdding) (eq leaf this.changedLeaf)) 'leaf-panel-exiting'}}
" "
> >
{{~#each-in (get this.namespaceTree leaf) as |leafName|}} {{~#each-in (get this.namespaceTree leaf) as |leafName|}}

View File

@ -11,7 +11,7 @@
{{/unless}} {{/unless}}
{{#unless this.hideLinks}} {{#unless this.hideLinks}}
<div class="navbar-drawer{{if this.navDrawerOpen " is-active"}}"> <div class="navbar-drawer{{if this.navDrawerOpen ' is-active'}}">
<div class="navbar-drawer-scroll"> <div class="navbar-drawer-scroll">
<div data-test-navheader-main> <div data-test-navheader-main>
{{yield (hash main=(component "nav-header/main") closeDrawer=(action "toggleNavDrawer" false))}} {{yield (hash main=(component "nav-header/main") closeDrawer=(action "toggleNavDrawer" false))}}
@ -30,7 +30,7 @@
{{/unless}} {{/unless}}
<div <div
class="navbar-drawer-overlay{{if this.navDrawerOpen " is-active"}}" class="navbar-drawer-overlay{{if this.navDrawerOpen ' is-active'}}"
role="button" role="button"
onclick={{action "toggleNavDrawer" (not this.navDrawerOpen)}} onclick={{action "toggleNavDrawer" (not this.navDrawerOpen)}}
></div> ></div>

View File

@ -33,7 +33,7 @@
<div class="toolbar-separator"></div> <div class="toolbar-separator"></div>
{{/if}} {{/if}}
{{#if this.model.canGenerate}} {{#if this.model.canGenerate}}
<ToolbarSecretLink @secret={{this.model.id}} @mode="credentials" @data-test-backend-credentials="iam"> <ToolbarSecretLink @secret={{this.model.id}} @mode="credentials" data-test-backend-credentials="iam">
Generate credentials Generate credentials
</ToolbarSecretLink> </ToolbarSecretLink>
{{/if}} {{/if}}
@ -54,7 +54,7 @@
{{#if (gt this.model.credentialTypes.length 1)}} {{#if (gt this.model.credentialTypes.length 1)}}
<AlertBanner <AlertBanner
@type="warning" @type="warning"
@message="This role has more than one credential_type, currently: {{join ", " this.model.credentialTypes}}. @message="This role has more than one credential_type, currently: {{join ', ' this.model.credentialTypes}}.
Multiple credential types is deprecated and you must choose one in order to save this role." Multiple credential types is deprecated and you must choose one in order to save this role."
/> />
{{/if}} {{/if}}
@ -71,7 +71,7 @@
Save Save
{{/if}} {{/if}}
</button> </button>
<SecretLink @mode={{if (eq this.mode "create") "list" "show"}} @class="button" @secret={{this.model.id}}> <SecretLink @mode={{if (eq this.mode "create") "list" "show"}} class="button" @secret={{this.model.id}}>
Cancel Cancel
</SecretLink> </SecretLink>
</div> </div>
@ -82,7 +82,7 @@
{{#if (gt this.model.credentialTypes.length 1)}} {{#if (gt this.model.credentialTypes.length 1)}}
<AlertBanner <AlertBanner
@type="warning" @type="warning"
@message="This role has more than one credential_type, currently: {{join ", " this.model.credentialTypes}}. @message="This role has more than one credential_type, currently: {{join ', ' this.model.credentialTypes}}.
When you next edit this role, you will have to choose a single credential type." When you next edit this role, you will have to choose a single credential type."
/> />
{{/if}} {{/if}}

View File

@ -36,7 +36,7 @@
@secret={{this.model.id}} @secret={{this.model.id}}
@mode="credentials" @mode="credentials"
@queryParams={{query-params action="issue"}} @queryParams={{query-params action="issue"}}
@data-test-credentials-link={{true}} data-test-credentials-link={{true}}
> >
Generate Certificate Generate Certificate
</ToolbarSecretLink> </ToolbarSecretLink>
@ -46,13 +46,13 @@
@secret={{this.model.id}} @secret={{this.model.id}}
@mode="credentials" @mode="credentials"
@queryParams={{query-params action="sign"}} @queryParams={{query-params action="sign"}}
@data-test-sign-link={{true}} data-test-sign-link={{true}}
> >
Sign Certificate Sign Certificate
</ToolbarSecretLink> </ToolbarSecretLink>
{{/if}} {{/if}}
{{#if this.model.canEdit}} {{#if this.model.canEdit}}
<ToolbarSecretLink @secret={{this.model.id}} @mode="edit" @data-test-edit-link={{true}} @replace={{true}}> <ToolbarSecretLink @secret={{this.model.id}} @mode="edit" data-test-edit-link={{true}} @replace={{true}}>
Edit role Edit role
</ToolbarSecretLink> </ToolbarSecretLink>
{{/if}} {{/if}}
@ -75,7 +75,7 @@
Save Save
{{/if}} {{/if}}
</button> </button>
<SecretLink @mode={{if (eq this.mode "create") "list" "show"}} @class="button" @secret={{this.model.id}}> <SecretLink @mode={{if (eq this.mode "create") "list" "show"}} class="button" @secret={{this.model.id}}>
Cancel Cancel
</SecretLink> </SecretLink>
</div> </div>

View File

@ -35,18 +35,18 @@
<ToolbarSecretLink <ToolbarSecretLink
@secret={{this.model.id}} @secret={{this.model.id}}
@mode="credentials" @mode="credentials"
@data-test-backend-credentials={{true}} data-test-backend-credentials={{true}}
@replace={{true}} @replace={{true}}
> >
Generate Credential Generate Credential
</ToolbarSecretLink> </ToolbarSecretLink>
{{else}} {{else}}
<ToolbarSecretLink @secret={{this.model.id}} @mode="sign" @data-test-backend-credentials={{true}} @replace={{true}}> <ToolbarSecretLink @secret={{this.model.id}} @mode="sign" data-test-backend-credentials={{true}} @replace={{true}}>
Sign Keys Sign Keys
</ToolbarSecretLink> </ToolbarSecretLink>
{{/if}} {{/if}}
{{#if (or this.model.canUpdate this.model.canDelete)}} {{#if (or this.model.canUpdate this.model.canDelete)}}
<ToolbarSecretLink @secret={{this.model.id}} @mode="edit" @data-test-edit-link={{true}} @replace={{true}}> <ToolbarSecretLink @secret={{this.model.id}} @mode="edit" data-test-edit-link={{true}} @replace={{true}}>
Edit role Edit role
</ToolbarSecretLink> </ToolbarSecretLink>
{{/if}} {{/if}}
@ -70,7 +70,7 @@
Save Save
{{/if}} {{/if}}
</button> </button>
<SecretLink @mode={{if (eq this.mode "create") "list" "show"}} @class="button" @secret={{this.model.id}}> <SecretLink @mode={{if (eq this.mode "create") "list" "show"}} class="button" @secret={{this.model.id}}>
Cancel Cancel
</SecretLink> </SecretLink>
</div> </div>

View File

@ -10,7 +10,7 @@
spellcheck="false" spellcheck="false"
data-test-secret-path="true" data-test-secret-path="true"
id="kv-key" id="kv-key"
class="input {{if (get this.validationMessages "path") "has-error-border"}}" class="input {{if (get this.validationMessages 'path') 'has-error-border'}}"
@value={{get @modelForData @modelForData.pathAttr}} @value={{get @modelForData @modelForData.pathAttr}}
{{on "keyup" (perform this.waitForKeyUp "path" value="target.value")}} {{on "keyup" (perform this.waitForKeyUp "path" value="target.value")}}
/> />
@ -112,11 +112,11 @@
{{! must have UPDATE permissions to add secret metadata. Create only will not work }} {{! must have UPDATE permissions to add secret metadata. Create only will not work }}
{{#if (and @isV2 @canUpdateSecretMetadata)}} {{#if (and @isV2 @canUpdateSecretMetadata)}}
<ToggleButton <ToggleButton
@class="is-block" @isOpen={{this.showMetadata}}
@toggleAttr={{"showMetadata"}}
@toggleTarget={{this}}
@openLabel="Hide secret metadata" @openLabel="Hide secret metadata"
@closedLabel="Show secret metadata" @closedLabel="Show secret metadata"
@onClick={{fn (mut this.showMetadata)}}
class="is-block"
data-test-show-metadata-toggle data-test-show-metadata-toggle
/> />
{{#if this.showMetadata}} {{#if this.showMetadata}}
@ -139,7 +139,7 @@
</button> </button>
</div> </div>
<div class="control"> <div class="control">
<SecretLink @mode="list" @secret={{@model.parentKey}} @class="button"> <SecretLink @mode="list" @secret={{@model.parentKey}} class="button">
Cancel Cancel
</SecretLink> </SecretLink>
</div> </div>

View File

@ -42,7 +42,7 @@
</button> </button>
</div> </div>
<div class="control"> <div class="control">
<SecretLink @secret={{@model.id}} @class="button" @mode="show"> <SecretLink @secret={{@model.id}} class="button" @mode="show">
Cancel Cancel
</SecretLink> </SecretLink>
</div> </div>

View File

@ -57,7 +57,7 @@
<li class="action"> <li class="action">
{{#if this.showWrapButton}} {{#if this.showWrapButton}}
<button <button
class="link link-plain has-text-weight-semibold is-ghost {{if this.isWrapping "is-loading"}}" class="link link-plain has-text-weight-semibold is-ghost {{if this.isWrapping 'is-loading'}}"
type="button" type="button"
{{on "click" this.handleWrapClick}} {{on "click" this.handleWrapClick}}
data-test-wrap-button data-test-wrap-button
@ -97,14 +97,14 @@
@model.id @model.id
(query-params version=(if @model.canReadMetadata @modelForData.version "")) (query-params version=(if @model.canReadMetadata @modelForData.version ""))
}} }}
@data-test-secret-edit="true" data-test-secret-edit="true"
@replace={{true}} @replace={{true}}
@type="add" @type="add"
> >
Create new version Create new version
</ToolbarLink> </ToolbarLink>
{{else}} {{else}}
<ToolbarLink @params={{array targetRoute @model.id}} @data-test-secret-edit="true" @replace={{true}}> <ToolbarLink @params={{array targetRoute @model.id}} data-test-secret-edit="true" @replace={{true}}>
Edit secret Edit secret
</ToolbarLink> </ToolbarLink>
{{/if}} {{/if}}

View File

@ -2,18 +2,8 @@
@route={{this.link.route}} @route={{this.link.route}}
@models={{this.link.models}} @models={{this.link.models}}
@query={{this.query}} @query={{this.query}}
class={{this.class}}
data-test-secret-create={{this.data-test-secret-create}}
data-test-credentials-link={{this.data-test-credentials-link}}
data-test-backend-credentials={{this.data-test-backend-credentials}}
data-test-edit-link={{this.data-test-edit-link}}
data-test-sign-link={{this.data-test-sign-link}}
data-test-transit-link={{this.data-test-transit-link}}
data-test-transit-key-actions-link={{this.data-test-transit-key-actions-link}}
data-test-transit-action-link={{this.data-test-transit-action-link}}
data-test-version-history={{this.data-test-version-history}}
data-test-version={{this.data-test-version}}
{{on "click" this.onLinkClick}} {{on "click" this.onLinkClick}}
...attributes
> >
{{yield}} {{yield}}
</LinkTo> </LinkTo>

View File

@ -1,10 +1,9 @@
{{#linked-block <LinkedBlock
(concat "vault.cluster.secrets.backend." "credentials" (unless @item.id "-root")) @params={{array (concat "vault.cluster.secrets.backend." "credentials" (unless @item.id "-root")) @item.id}}
@item.id
class="list-item-row" class="list-item-row"
data-test-secret-link=@item.id data-test-secret-link={{@item.id}}
encode=true @encode={{true}}
}} >
<div class="columns is-mobile"> <div class="columns is-mobile">
<div class="column is-10"> <div class="column is-10">
<LinkTo <LinkTo
@ -78,4 +77,4 @@
</PopupMenu> </PopupMenu>
</div> </div>
</div> </div>
{{/linked-block}} </LinkedBlock>

View File

@ -2,8 +2,8 @@
@params={{array "vault.cluster.secrets.backend.show" (if this.keyTypeValue (concat "role/" @item.id) @item.id)}} @params={{array "vault.cluster.secrets.backend.show" (if this.keyTypeValue (concat "role/" @item.id) @item.id)}}
class="list-item-row" class="list-item-row"
data-test-secret-link={{@item.id}} data-test-secret-link={{@item.id}}
encode={{true}} @encode={{true}}
queryParams={{secret-query-params @backendType @item.type}} @queryParams={{secret-query-params @backendType @item.type}}
> >
<div class="columns is-mobile"> <div class="columns is-mobile">
<div class="column is-10"> <div class="column is-10">
@ -26,18 +26,14 @@
<ul class="menu-list"> <ul class="menu-list">
{{#if @item.canEdit}} {{#if @item.canEdit}}
<li class="action"> <li class="action">
<SecretLink @mode="show" @secret={{@item.id}} @class="has-text-black has-text-weight-semibold"> <SecretLink @mode="show" @secret={{@item.id}} class="has-text-black has-text-weight-semibold">
Edit connection Edit connection
</SecretLink> </SecretLink>
</li> </li>
{{/if}} {{/if}}
{{#if @item.canEditRole}} {{#if @item.canEditRole}}
<li class="action"> <li class="action">
<SecretLink <SecretLink @mode="edit" @secret={{concat "role/" @item.id}} class="has-text-black has-text-weight-semibold">
@mode="edit"
@secret={{concat "role/" @item.id}}
@class="has-text-black has-text-weight-semibold"
>
Edit Role Edit Role
</SecretLink> </SecretLink>
</li> </li>

View File

@ -1,18 +1,20 @@
{{#linked-block <LinkedBlock
(concat "vault.cluster.secrets.backend." (if @item.isFolder "list" "show") (unless @item.id "-root")) @params={{array
@item.id (concat "vault.cluster.secrets.backend." (if @item.isFolder "list" "show") (unless @item.id "-root"))
@item.id
}}
class="list-item-row" class="list-item-row"
data-test-secret-link=@item.id data-test-secret-link={{@item.id}}
encode=true @encode={{true}}
queryParams=(secret-query-params @backendModel.type) @queryParams={{secret-query-params @backendModel.type}}
}} >
<div class="columns is-mobile"> <div class="columns is-mobile">
<div class="column is-10"> <div class="column is-10">
<SecretLink <SecretLink
@mode={{if @item.isFolder "list" "show"}} @mode={{if @item.isFolder "list" "show"}}
@secret={{@item.id}} @secret={{@item.id}}
@queryParams={{if (eq @backendModel.type "transit") (query-params tab="actions") ""}} @queryParams={{if (eq @backendModel.type "transit") (query-params tab="actions") ""}}
@class="has-text-black has-text-weight-semibold" class="has-text-black has-text-weight-semibold"
> >
{{#if (eq @backendModel.type "transit")}} {{#if (eq @backendModel.type "transit")}}
<Icon @name="key" class="has-text-grey-light" /> <Icon @name="key" class="has-text-grey-light" />
@ -28,7 +30,7 @@
<nav class="menu"> <nav class="menu">
<ul class="menu-list"> <ul class="menu-list">
{{#if @item.isFolder}} {{#if @item.isFolder}}
<SecretLink @mode="list" @secret={{@item.id}} @class="has-text-black has-text-weight-semibold"> <SecretLink @mode="list" @secret={{@item.id}} class="has-text-black has-text-weight-semibold">
Contents Contents
</SecretLink> </SecretLink>
{{else}} {{else}}
@ -41,13 +43,13 @@
{{else}} {{else}}
{{#if (or @item.canReadSecretData @item.canRead)}} {{#if (or @item.canReadSecretData @item.canRead)}}
<li class="action"> <li class="action">
<SecretLink @mode="show" @secret={{@item.id}} @class="has-text-black has-text-weight-semibold"> <SecretLink @mode="show" @secret={{@item.id}} class="has-text-black has-text-weight-semibold">
Details Details
</SecretLink> </SecretLink>
</li> </li>
{{#if @backendModel.isV2KV}} {{#if @backendModel.isV2KV}}
<li class="action"> <li class="action">
<SecretLink @mode="versions" @secret={{@item.id}} @class="has-text-black has-text-weight-semibold"> <SecretLink @mode="versions" @secret={{@item.id}} class="has-text-black has-text-weight-semibold">
View version history View version history
</SecretLink> </SecretLink>
</li> </li>
@ -55,7 +57,7 @@
{{/if}} {{/if}}
{{#if (or @item.canEditSecretData @item.canEdit)}} {{#if (or @item.canEditSecretData @item.canEdit)}}
<li class="action"> <li class="action">
<SecretLink @mode="edit" @secret={{@item.id}} @class="has-text-black has-text-weight-semibold"> <SecretLink @mode="edit" @secret={{@item.id}} class="has-text-black has-text-weight-semibold">
{{if @backendModel.isV2KV "Create new version" "Edit"}} {{if @backendModel.isV2KV "Create new version" "Edit"}}
</SecretLink> </SecretLink>
</li> </li>
@ -78,4 +80,4 @@
</PopupMenu> </PopupMenu>
</div> </div>
</div> </div>
{{/linked-block}} </LinkedBlock>

View File

@ -1,11 +1,9 @@
{{#linked-block <LinkedBlock
(concat "vault.cluster.secrets.backend." "show" (unless @item.id "-root")) @params={{array (concat "vault.cluster.secrets.backend." "show" (unless @item.id "-root")) @item.idForNav}}
@item.idForNav
class="list-item-row" class="list-item-row"
data-test-secret-link=@item.id data-test-secret-link={{@item.id}}
tagName="div" @encode={{true}}
encode=true >
}}
<div class="columns is-mobile"> <div class="columns is-mobile">
<div class="column is-10"> <div class="column is-10">
<LinkTo <LinkTo
@ -23,4 +21,4 @@
<PkiCertPopup @item={{@item}} /> <PkiCertPopup @item={{@item}} />
</div> </div>
</div> </div>
{{/linked-block}} </LinkedBlock>

View File

@ -1,13 +1,10 @@
{{#linked-block <LinkedBlock
(concat "vault.cluster.secrets.backend." "credentials" (unless @item.id "-root")) @params={{array (concat "vault.cluster.secrets.backend." "credentials" (unless @item.id "-root")) @item.backend @item.id}}
@item.backend @queryParams={{hash action="issue"}}
@item.id
queryParams=(hash action="issue")
class="list-item-row" class="list-item-row"
data-test-secret-link=@item.id data-test-secret-link={{@item.id}}
tagName="div" @encode={{true}}
encode=true >
}}
<div class="columns is-mobile"> <div class="columns is-mobile">
<div class="column is-10"> <div class="column is-10">
<LinkTo <LinkTo
@ -101,4 +98,4 @@
</PopupMenu> </PopupMenu>
</div> </div>
</div> </div>
{{/linked-block}} </LinkedBlock>

View File

@ -1,10 +1,12 @@
{{#linked-block <LinkedBlock
(concat "vault.cluster.secrets.backend." (if (eq @item.keyType "ca") "sign" "credentials") (unless @item.id "-root")) @params={{array
@item.id (concat "vault.cluster.secrets.backend." (if (eq @item.keyType "ca") "sign" "credentials") (unless @item.id "-root"))
@item.id
}}
class="list-item-row" class="list-item-row"
data-test-secret-link=@item.id data-test-secret-link={{@item.id}}
encode=true @encode={{true}}
}} >
<div class="columns is-mobile"> <div class="columns is-mobile">
<div class="column is-10"> <div class="column is-10">
<LinkTo <LinkTo
@ -76,7 +78,7 @@
<button <button
type="button" type="button"
disabled={{get this (concat "loading-" @item.id)}} disabled={{get this (concat "loading-" @item.id)}}
class="link button is-transparent {{if (get this (concat "loading-" @item.id)) "is-loading"}} " class="link button is-transparent {{if (get this (concat 'loading-' @item.id)) 'is-loading'}} "
{{on "click" @toggleZeroAddress}} {{on "click" @toggleZeroAddress}}
> >
Disable Zero Address Disable Zero Address
@ -87,7 +89,7 @@
<button <button
type="button" type="button"
disabled={{get this (concat "loading-" @item.id)}} disabled={{get this (concat "loading-" @item.id)}}
class="link button is-transparent {{if (get this (concat "loading-" @item.id)) "is-loading"}}" class="link button is-transparent {{if (get this (concat 'loading-' @item.id)) 'is-loading'}}"
{{on "click" @toggleZeroAddress}} {{on "click" @toggleZeroAddress}}
> >
Enable Zero Address Enable Zero Address
@ -134,4 +136,4 @@
{{/if}} {{/if}}
</div> </div>
</div> </div>
{{/linked-block}} </LinkedBlock>

View File

@ -1,19 +1,18 @@
{{#if (and @item.updatePath.canRead (not this.isBuiltin))}} {{#if (and @item.updatePath.canRead (not this.isBuiltin))}}
{{#linked-block <LinkedBlock
"vault.cluster.secrets.backend.show" @params={{array "vault.cluster.secrets.backend.show" @itemPath}}
@itemPath
class="list-item-row" class="list-item-row"
data-test-secret-link=@itemPath data-test-secret-link={{@itemPath}}
encode=true @encode={{true}}
queryParams=(secret-query-params @backendType) @queryParams={{secret-query-params @backendType}}
}} >
<div class="columns is-mobile"> <div class="columns is-mobile">
<div class="column is-10"> <div class="column is-10">
<SecretLink <SecretLink
@mode="show" @mode="show"
@secret={{@itemPath}} @secret={{@itemPath}}
@queryParams={{query-params type=@modelType}} @queryParams={{query-params type=@modelType}}
@class="has-text-black has-text-weight-semibold" class="has-text-black has-text-weight-semibold"
> >
<Icon @name="file" class="has-text-grey-light" /> <Icon @name="file" class="has-text-grey-light" />
{{if (eq @item.id " ") "(self)" (or @item.keyWithoutParent @item.id)}} {{if (eq @item.id " ") "(self)" (or @item.keyWithoutParent @item.id)}}
@ -26,14 +25,14 @@
<ul class="menu-list"> <ul class="menu-list">
{{#if @item.updatePath.canRead}} {{#if @item.updatePath.canRead}}
<li class="action"> <li class="action">
<SecretLink @mode="show" @secret={{@itemPath}} @class="has-text-black has-text-weight-semibold"> <SecretLink @mode="show" @secret={{@itemPath}} class="has-text-black has-text-weight-semibold">
Details Details
</SecretLink> </SecretLink>
</li> </li>
{{/if}} {{/if}}
{{#if @item.updatePath.canUpdate}} {{#if @item.updatePath.canUpdate}}
<li class="action"> <li class="action">
<SecretLink @mode="edit" @secret={{@itemPath}} @class="has-text-black has-text-weight-semibold"> <SecretLink @mode="edit" @secret={{@itemPath}} class="has-text-black has-text-weight-semibold">
Edit Edit
</SecretLink> </SecretLink>
</li> </li>
@ -44,7 +43,7 @@
{{/if}} {{/if}}
</div> </div>
</div> </div>
{{/linked-block}} </LinkedBlock>
{{else}} {{else}}
<div class="list-item-row" data-test-view-only-list-item> <div class="list-item-row" data-test-view-only-list-item>
<div class="columns is-mobile"> <div class="columns is-mobile">

View File

@ -1,20 +1,19 @@
{{! CBS TODO do not let click if !canRead }} {{! CBS TODO do not let click if !canRead }}
{{#if (eq @options.item "transformation")}} {{#if (eq @options.item "transformation")}}
{{#linked-block <LinkedBlock
"vault.cluster.secrets.backend.show" @params={{array "vault.cluster.secrets.backend.show" @item.id}}
@item.id
class="list-item-row" class="list-item-row"
data-test-secret-link=@item.id data-test-secret-link={{@item.id}}
encode=true @encode={{true}}
queryParams=(secret-query-params @backendModel.type) @queryParams={{secret-query-params @backendModel.type}}
}} >
<div class="columns is-mobile"> <div class="columns is-mobile">
<div class="column is-10"> <div class="column is-10">
<SecretLink <SecretLink
@mode="show" @mode="show"
@secret={{@item.id}} @secret={{@item.id}}
@queryParams={{if (eq @backendModel.type "transform") (query-params tab="actions") ""}} @queryParams={{if (eq @backendModel.type "transform") (query-params tab="actions") ""}}
@class="has-text-black has-text-weight-semibold" class="has-text-black has-text-weight-semibold"
> >
<Icon @name="file" class="has-text-grey-light" /> <Icon @name="file" class="has-text-grey-light" />
{{if (eq @item.id " ") "(self)" (or @item.keyWithoutParent @item.id)}} {{if (eq @item.id " ") "(self)" (or @item.keyWithoutParent @item.id)}}
@ -34,14 +33,14 @@
{{else}} {{else}}
{{#if @item.updatePath.canRead}} {{#if @item.updatePath.canRead}}
<li class="action"> <li class="action">
<SecretLink @mode="show" @secret={{@item.id}} @class="has-text-black has-text-weight-semibold"> <SecretLink @mode="show" @secret={{@item.id}} class="has-text-black has-text-weight-semibold">
Details Details
</SecretLink> </SecretLink>
</li> </li>
{{/if}} {{/if}}
{{#if @item.updatePath.canUpdate}} {{#if @item.updatePath.canUpdate}}
<li class="action"> <li class="action">
<SecretLink @mode="edit" @secret={{@item.id}} @class="has-text-black has-text-weight-semibold"> <SecretLink @mode="edit" @secret={{@item.id}} class="has-text-black has-text-weight-semibold">
Edit Edit
</SecretLink> </SecretLink>
</li> </li>
@ -53,7 +52,7 @@
{{/if}} {{/if}}
</div> </div>
</div> </div>
{{/linked-block}} </LinkedBlock>
{{else}} {{else}}
<div class="list-item-row"> <div class="list-item-row">
<div class="columns is-mobile"> <div class="columns is-mobile">

View File

@ -36,10 +36,10 @@
{{/each}} {{/each}}
<li class="action"> <li class="action">
<SecretLink <SecretLink
@data-test-version-history data-test-version-history={{true}}
@mode="versions" @mode="versions"
@secret={{@model.id}} @secret={{@model.id}}
@class="has-text-black has-text-weight-semibold has-bottom-shadow" class="has-text-black has-text-weight-semibold has-bottom-shadow"
@onLinkClick={{D.actions.close}} @onLinkClick={{D.actions.close}}
> >
View version history View version history

View File

@ -9,7 +9,7 @@
{{yield}} {{yield}}
</div> </div>
{{else}} {{else}}
<div class="selectable-card is-rounded {{if this.actionCard "no-flex"}}"> <div class="selectable-card is-rounded {{if this.actionCard 'no-flex'}}">
{{#if this.actionCard}} {{#if this.actionCard}}
<div class="is-flex-between is-fullwidth card-details" data-test-selectable-card={{this.formattedCardTitle}}> <div class="is-flex-between is-fullwidth card-details" data-test-selectable-card={{this.formattedCardTitle}}>
<h3 class="title is-5">{{this.formattedCardTitle}}</h3> <h3 class="title is-5">{{this.formattedCardTitle}}</h3>

View File

@ -35,20 +35,20 @@
</div> </div>
{{/unless}} {{/unless}}
<div <div
class="field text-file box is-fullwidth is-marginless is-shadowless {{if this.inputOnly "is-paddingless"}}" class="field text-file box is-fullwidth is-marginless is-shadowless {{if this.inputOnly 'is-paddingless'}}"
data-test-component="text-file" data-test-component="text-file"
> >
{{#if @file.enterAsText}} {{#if @file.enterAsText}}
<div class="control has-icon-right"> <div class="control has-icon-right">
<textarea <textarea
class="textarea {{unless this.showValue "masked-font"}}" class="textarea {{unless this.showValue 'masked-font'}}"
{{on "input" this.updateData}} {{on "input" this.updateData}}
data-test-text-file-textarea={{true}} data-test-text-file-textarea={{true}}
>{{@file.value}}</textarea> >{{@file.value}}</textarea>
<button <button
{{on "click" this.toggleMask}} {{on "click" this.toggleMask}}
type="button" type="button"
class="{{if (eq this.value "") "has-text-grey"}} masked-input-toggle button {{if this.displayOnly "is-compact"}}" class="{{if (eq this.value '') 'has-text-grey'}} masked-input-toggle button {{if this.displayOnly 'is-compact'}}"
data-test-button data-test-button
> >
<Icon @name={{if this.showValue "eye" "eye-off"}} /> <Icon @name={{if this.showValue "eye" "eye-off"}} />

View File

@ -3,7 +3,7 @@
<AlertBanner <AlertBanner
@type="danger" @type="danger"
@message="Your auth token expired on @message="Your auth token expired on
{{date-format @expirationDate "MMMM do yyyy, h:mm:ss a"}} {{date-format @expirationDate 'MMMM do yyyy, h:mm:ss a'}}
. You will need to re-authenticate." . You will need to re-authenticate."
> >
<LinkTo @route="vault.cluster.logout" class="button link"> <LinkTo @route="vault.cluster.logout" class="button link">

View File

@ -41,7 +41,7 @@
</label> </label>
<div class="control"> <div class="control">
<Textarea id="input-hash" name="input" @value={{@input}} class="textarea" data-test-tools-input="hash-input" /> <Textarea id="input-hash" name="input" @value={{@input}} class="textarea" data-test-tools-input="hash-input" />
<B64Toggle @value={{@input}} @isInput={{false}} @data-test-tools-b64-toggle="input" /> <B64Toggle @value={{@input}} @isInput={{false}} @data-test-transit-b64-toggle="input" />
</div> </div>
</div> </div>
<div class="field is-horizontal"> <div class="field is-horizontal">

View File

@ -12,7 +12,6 @@
<ul> <ul>
{{! template-lint-configure no-nested-interactive "warn" }} {{! template-lint-configure no-nested-interactive "warn" }}
<li <li
role="tab"
aria-selected={{if (eq @unwrapActiveTab "data") "true" "false"}} aria-selected={{if (eq @unwrapActiveTab "data") "true" "false"}}
class={{if (eq @unwrapActiveTab "data") "is-active"}} class={{if (eq @unwrapActiveTab "data") "is-active"}}
> >
@ -26,7 +25,6 @@
</button> </button>
</li> </li>
<li <li
role="tab"
aria-selected={{if (eq @unwrapActiveTab "data") "true" "false"}} aria-selected={{if (eq @unwrapActiveTab "data") "true" "false"}}
class={{if (eq @unwrapActiveTab "details") "is-active"}} class={{if (eq @unwrapActiveTab "details") "is-active"}}
> >

View File

@ -1,17 +1,10 @@
<SecretLink <SecretLink
@class="toolbar-link" @mode={{@mode}}
@mode={{this.mode}} @secret={{@secret}}
@secret={{this.secret}} @replace={{@replace}}
@replace={{this.replace}} @queryParams={{@queryParams}}
@queryParams={{this.queryParams}} class="toolbar-link"
@data-test-edit-link={{this.data-test-edit-link}} ...attributes
@data-test-sign-link={{this.data-test-sign-link}}
@data-test-transit-link={{this.data-test-transit-link}}
@data-test-secret-create={{this.data-test-secret-create}}
@data-test-credentials-link={{this.data-test-credentials-link}}
@data-test-backend-credentials={{this.data-test-backend-credentials}}
@data-test-transit-action-link={{this.data-test-transit-action-link}}
@data-test-transit-key-actions-link={{this.data-test-transit-key-actions-link}}
> >
{{yield}} {{yield}}
<Icon @name={{this.glyph}} /> <Icon @name={{this.glyph}} />

View File

@ -1,8 +1,8 @@
<ToggleButton <ToggleButton
@toggleAttr={{"showForm"}} @isOpen={{this.showForm}}
@toggleTarget={{this}}
@openLabel="Advanced templating" @openLabel="Advanced templating"
@closedLabel="Advanced templating" @closedLabel="Advanced templating"
@onClick={{fn (mut this.showForm)}}
data-test-toggle-advanced={{true}} data-test-toggle-advanced={{true}}
/> />

View File

@ -15,7 +15,7 @@
Save Save
{{/if}} {{/if}}
</button> </button>
<SecretLink @mode={{if (eq this.mode "create") "list" "show"}} @class="button" @secret={{this.model.id}}> <SecretLink @mode={{if (eq this.mode "create") "list" "show"}} class="button" @secret={{this.model.id}}>
Cancel Cancel
</SecretLink> </SecretLink>
</div> </div>

View File

@ -51,7 +51,7 @@
Save Save
{{/if}} {{/if}}
</button> </button>
<SecretLink @mode={{if (eq this.mode "create") "list" "show"}} @class="button" @secret={{this.model.id}}> <SecretLink @mode={{if (eq this.mode "create") "list" "show"}} class="button" @secret={{this.model.id}}>
Cancel Cancel
</SecretLink> </SecretLink>
</div> </div>

View File

@ -42,7 +42,7 @@
<ToolbarSecretLink <ToolbarSecretLink
@secret={{concat this.model.idPrefix this.model.id}} @secret={{concat this.model.idPrefix this.model.id}}
@mode="edit" @mode="edit"
@data-test-edit-link={{true}} data-test-edit-link={{true}}
@replace={{true}} @replace={{true}}
> >
Edit role Edit role
@ -77,7 +77,7 @@
</button> </button>
<SecretLink <SecretLink
@mode={{if (eq this.mode "create") "list" "show"}} @mode={{if (eq this.mode "create") "list" "show"}}
@class="button" class="button"
@secret={{concat "role/" this.model.id}} @secret={{concat "role/" this.model.id}}
> >
Cancel Cancel

View File

@ -35,7 +35,7 @@
<ToolbarSecretLink <ToolbarSecretLink
@secret={{concat this.model.idPrefix this.model.id}} @secret={{concat this.model.idPrefix this.model.id}}
@mode="edit" @mode="edit"
@data-test-edit-link={{true}} data-test-edit-link={{true}}
@replace={{true}} @replace={{true}}
> >
Edit template Edit template
@ -92,7 +92,7 @@
</button> </button>
<SecretLink <SecretLink
@mode={{if (eq this.mode "create") "list" "show"}} @mode={{if (eq this.mode "create") "list" "show"}}
@class="button" class="button"
@secret={{concat this.model.idPrefix this.model.id}} @secret={{concat this.model.idPrefix this.model.id}}
> >
Cancel Cancel

View File

@ -57,7 +57,7 @@
Edit transformation Edit transformation
</button> </button>
{{else}} {{else}}
<ToolbarSecretLink @secret={{this.model.id}} @mode="edit" @data-test-edit-link={{true}} @replace={{true}}> <ToolbarSecretLink @secret={{this.model.id}} @mode="edit" data-test-edit-link={{true}} @replace={{true}}>
Edit transformation Edit transformation
</ToolbarSecretLink> </ToolbarSecretLink>
{{/if}} {{/if}}

View File

@ -124,13 +124,13 @@
data-test-transit-key-create data-test-transit-key-create
type="submit" type="submit"
disabled={{@requestInFlight}} disabled={{@requestInFlight}}
class="button is-primary {{if @requestInFlight "is-loading"}}" class="button is-primary {{if @requestInFlight 'is-loading'}}"
> >
Create encryption key Create encryption key
</button> </button>
</div> </div>
<div class="control"> <div class="control">
<SecretLink @mode="list" @class="button"> <SecretLink @mode="list" class="button">
Cancel Cancel
</SecretLink> </SecretLink>
</div> </div>

View File

@ -86,13 +86,13 @@
<div class="field is-grouped"> <div class="field is-grouped">
{{#if @capabilities.canUpdate}} {{#if @capabilities.canUpdate}}
<div class="control"> <div class="control">
<button type="submit" disabled={{@requestInFlight}} class="button is-primary {{if @requestInFlight "is-loading"}}"> <button type="submit" disabled={{@requestInFlight}} class="button is-primary {{if @requestInFlight 'is-loading'}}">
Update transit key Update transit key
</button> </button>
</div> </div>
{{/if}} {{/if}}
<div class="control"> <div class="control">
<SecretLink @mode="show" @secret={{@key.id}} @class="button"> <SecretLink @mode="show" @secret={{@key.id}} class="button">
Cancel Cancel
</SecretLink> </SecretLink>
</div> </div>

View File

@ -7,7 +7,7 @@
@mode="show" @mode="show"
@replace={{true}} @replace={{true}}
@queryParams={{query-params tab="actions"}} @queryParams={{query-params tab="actions"}}
@data-test-transit-key-actions-link={{true}} data-test-transit-key-actions-link={{true}}
> >
Key Actions Key Actions
</SecretLink> </SecretLink>
@ -19,7 +19,7 @@
@mode="show" @mode="show"
@replace={{true}} @replace={{true}}
@queryParams={{query-params tab="details"}} @queryParams={{query-params tab="details"}}
@data-test-transit-link="details" data-test-transit-link="details"
> >
Details Details
</SecretLink> </SecretLink>
@ -31,7 +31,7 @@
@mode="show" @mode="show"
@replace={{true}} @replace={{true}}
@queryParams={{query-params tab="versions"}} @queryParams={{query-params tab="versions"}}
@data-test-transit-link="versions" data-test-transit-link="versions"
> >
Versions Versions
</SecretLink> </SecretLink>
@ -59,13 +59,12 @@
{{#if (eq @tab "actions")}} {{#if (eq @tab "actions")}}
<div class="transit-card-container"> <div class="transit-card-container">
{{#each @model.supportedActions as |supportedAction|}} {{#each @model.supportedActions as |supportedAction|}}
{{#linked-block <LinkedBlock
"vault.cluster.secrets.backend.actions" @params={{array "vault.cluster.secrets.backend.actions" @model.id}}
@model.id @queryParams={{hash action=supportedAction.name}}
queryParams=(hash action=supportedAction.name)
class="transit-card" class="transit-card"
data-test-transit-card=supportedAction.name data-test-transit-card={{supportedAction.name}}
}} >
<div class="transit-icon"> <div class="transit-icon">
<Icon <Icon
@name={{supportedAction.glyph}} @name={{supportedAction.glyph}}
@ -85,7 +84,7 @@
</h2> </h2>
<p class="transit-action-description">{{supportedAction.description}}</p> <p class="transit-action-description">{{supportedAction.description}}</p>
</div> </div>
{{/linked-block}} </LinkedBlock>
{{/each}} {{/each}}
</div> </div>
{{else if (eq @tab "versions")}} {{else if (eq @tab "versions")}}

View File

@ -109,7 +109,7 @@
</div> </div>
<div class="field is-grouped box is-fullwidth is-bottomless"> <div class="field is-grouped box is-fullwidth is-bottomless">
<div class="control"> <div class="control">
<button type="submit" disabled={{@loading}} class="button is-primary {{if @loading "is-loading"}}"> <button type="submit" disabled={{@loading}} class="button is-primary {{if @loading 'is-loading'}}">
Sign Sign
</button> </button>
</div> </div>

View File

@ -181,7 +181,7 @@
</div> </div>
<div class="field is-grouped box is-fullwidth is-bottomless"> <div class="field is-grouped box is-fullwidth is-bottomless">
<div class="control"> <div class="control">
<button type="submit" disabled={{@loading}} class="button is-primary {{if @loading "is-loading"}}"> <button type="submit" disabled={{@loading}} class="button is-primary {{if @loading 'is-loading'}}">
Verify Verify
</button> </button>
</div> </div>
@ -192,7 +192,7 @@
<AlertBanner <AlertBanner
@type={{if @valid "success" "danger"}} @type={{if @valid "success" "danger"}}
@title={{if @valid "Valid" "Not Valid"}} @title={{if @valid "Valid" "Not Valid"}}
@message="The input is {{if @valid "valid" "not valid"}} for the given {{if @signature "signature" "HMAC"}}" @message="The input is {{if @valid 'valid' 'not valid'}} for the given {{if @signature 'signature' 'HMAC'}}"
data-test-transit-verify="true" data-test-transit-verify="true"
/> />
</section> </section>

View File

@ -1,4 +1,4 @@
<div class="app-content {{if (and this.shouldRender this.featureComponent) "wizard-open"}}"> <div class="app-content {{if (and this.shouldRender this.featureComponent) 'wizard-open'}}">
{{yield}} {{yield}}
</div> </div>
{{#if this.featureComponent}} {{#if this.featureComponent}}

View File

@ -5,7 +5,7 @@
<span class="feature-progress" style={{bar.style}} {{! template-lint-disable }}></span> <span class="feature-progress" style={{bar.style}} {{! template-lint-disable }}></span>
</span> </span>
{{#if bar.showIcon}} {{#if bar.showIcon}}
<Icon @name="check-circle-fill" class="feature-check {{if bar.completed "completed-check" "incomplete-check"}}" /> <Icon @name="check-circle-fill" class="feature-check {{if bar.completed 'completed-check' 'incomplete-check'}}" />
{{/if}} {{/if}}
</div> </div>
{{/each}} {{/each}}

Some files were not shown because too many files have changed in this diff Show More