From d1355cb98f9496764e8976f3047c976743943048 Mon Sep 17 00:00:00 2001 From: Josh Black Date: Fri, 4 Oct 2024 11:14:21 -0700 Subject: [PATCH 01/13] explain how -output-curl-string works in comments to avoid confusion (#28576) --- api/client.go | 6 ++++++ api/output_string.go | 6 +++++- command/main.go | 5 +++++ 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/api/client.go b/api/client.go index 0090321caa7f..d7e61c116cee 100644 --- a/api/client.go +++ b/api/client.go @@ -1467,6 +1467,12 @@ START: } if outputCurlString { + // Note that although we're building this up here and returning it as an error object, the Error() + // interface method on it only gets called in a context where the actual string returned from that + // method is irrelevant, because it gets swallowed by an error buffer that's never output to the user. + // That's on purpose, not a bug, because in this case, OutputStringError is not really an _error_, per se. + // It's just a way of aborting the control flow so that requests don't actually execute, and instead, + // we can detect what's happened back in the CLI machinery and show the actual curl string to the user. LastOutputStringError = &OutputStringError{ Request: req, TLSSkipVerify: c.config.HttpClient.Transport.(*http.Transport).TLSClientConfig.InsecureSkipVerify, diff --git a/api/output_string.go b/api/output_string.go index d7777712d209..dbf37e8b3874 100644 --- a/api/output_string.go +++ b/api/output_string.go @@ -8,7 +8,7 @@ import ( "net/http" "strings" - retryablehttp "github.com/hashicorp/go-retryablehttp" + "github.com/hashicorp/go-retryablehttp" ) const ( @@ -25,6 +25,10 @@ type OutputStringError struct { finalCurlString string } +// Error is here so that we can return this struct as an error from client.rawRequestWithContext(). Note that +// the ErrOutputStringRequest constant is never actually used and is completely irrelevant to how this all functions. +// We could've just as easily returned an empty string. What matters is the machinery that happens before then where +// the curl string is built. So yes, this is confusing, but yes, this is also on purpose, and it is not incorrect. func (d *OutputStringError) Error() string { if d.finalCurlString == "" { cs, err := d.buildCurlString() diff --git a/command/main.go b/command/main.go index 465ec5e6e864..45762d559ac6 100644 --- a/command/main.go +++ b/command/main.go @@ -186,6 +186,8 @@ func RunCustom(args []string, runOpts *RunOptions) int { runOpts.Stderr = colorable.NewNonColorable(runOpts.Stderr) } + // This bytes.Buffer override of the uiErrWriter is why we don't see errors printed to the screen + // when running commands with e.g. -output-curl-string uiErrWriter := runOpts.Stderr if outputCurlString || outputPolicy { uiErrWriter = &bytes.Buffer{} @@ -318,6 +320,9 @@ func generateCurlString(exitCode int, runOpts *RunOptions, preParsingErrBuf *byt return 1 } + // When we actually return from client.rawRequestWithContext(), this value should be set to the OutputStringError + // that contains the data/context required to output the actual string, so it's doubtful this chunk of code will + // ever run, but I'm guessing it's a defense in depth thing. if api.LastOutputStringError == nil { if exitCode == 127 { // Usage, just pass it through From 7307c56f59dd453f0031e65fec50b3470aa34f35 Mon Sep 17 00:00:00 2001 From: Josh Black Date: Fri, 4 Oct 2024 11:29:03 -0700 Subject: [PATCH 02/13] -agent-address flag should have higher precedence than the env var (#28574) * -agent-address flag should have higher precedence than the env var * add changelog --- changelog/28574.txt | 3 +++ command/base.go | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 changelog/28574.txt diff --git a/changelog/28574.txt b/changelog/28574.txt new file mode 100644 index 000000000000..b3e6c34c8b92 --- /dev/null +++ b/changelog/28574.txt @@ -0,0 +1,3 @@ +```release-note:bug +cli: Fixed a CLI precedence issue where -agent-address didn't override VAULT_AGENT_ADDR as it should +``` diff --git a/command/base.go b/command/base.go index 47f7be04a8bc..ceba362e34ba 100644 --- a/command/base.go +++ b/command/base.go @@ -106,7 +106,7 @@ func (c *BaseCommand) Client() (*api.Client, error) { config.Address = c.flagAddress } if c.flagAgentProxyAddress != "" { - config.Address = c.flagAgentProxyAddress + config.AgentAddress = c.flagAgentProxyAddress } if c.flagOutputCurlString { From aeca0cdee64cb79d9ed71e8b28e658f35fbef5e3 Mon Sep 17 00:00:00 2001 From: Guillermo Barroso Date: Fri, 4 Oct 2024 20:33:09 +0200 Subject: [PATCH 03/13] secrets/aws: add sts_region parameter to root config (#22726) * Set region parameter to be used for STS only on AWS secrets engine * Add changelog * Fix formatting * region fix when not setting iam_endpoint or sts_endpoint * Add 'sts_region' parameter for AWS secrets engine. * Update TestBackend_PathConfigRoot for aws secrets * Update changelog entry --------- Co-authored-by: Robert <17119716+robmonte@users.noreply.github.com> --- builtin/logical/aws/client.go | 3 +++ builtin/logical/aws/path_config_root.go | 8 ++++++++ builtin/logical/aws/path_config_root_test.go | 1 + changelog/22726.txt | 3 +++ 4 files changed, 15 insertions(+) create mode 100644 changelog/22726.txt diff --git a/builtin/logical/aws/client.go b/builtin/logical/aws/client.go index dd6a58196631..802abb3d1db7 100644 --- a/builtin/logical/aws/client.go +++ b/builtin/logical/aws/client.go @@ -48,6 +48,9 @@ func (b *backend) getRootConfig(ctx context.Context, s logical.Storage, clientTy endpoint = *aws.String(config.IAMEndpoint) case clientType == "sts" && config.STSEndpoint != "": endpoint = *aws.String(config.STSEndpoint) + if config.STSRegion != "" { + credsConfig.Region = config.STSRegion + } } if config.IdentityTokenAudience != "" { diff --git a/builtin/logical/aws/path_config_root.go b/builtin/logical/aws/path_config_root.go index 93fccc370e71..741c8502d08c 100644 --- a/builtin/logical/aws/path_config_root.go +++ b/builtin/logical/aws/path_config_root.go @@ -48,6 +48,10 @@ func pathConfigRoot(b *backend) *framework.Path { Type: framework.TypeString, Description: "Endpoint to custom STS server URL", }, + "sts_region": { + Type: framework.TypeString, + Description: "Specific region for STS API calls.", + }, "max_retries": { Type: framework.TypeInt, Default: aws.UseServiceDefaultRetries, @@ -110,6 +114,7 @@ func (b *backend) pathConfigRootRead(ctx context.Context, req *logical.Request, "region": config.Region, "iam_endpoint": config.IAMEndpoint, "sts_endpoint": config.STSEndpoint, + "sts_region": config.STSRegion, "max_retries": config.MaxRetries, "username_template": config.UsernameTemplate, "role_arn": config.RoleARN, @@ -125,6 +130,7 @@ func (b *backend) pathConfigRootWrite(ctx context.Context, req *logical.Request, region := data.Get("region").(string) iamendpoint := data.Get("iam_endpoint").(string) stsendpoint := data.Get("sts_endpoint").(string) + stsregion := data.Get("sts_region").(string) maxretries := data.Get("max_retries").(int) roleARN := data.Get("role_arn").(string) usernameTemplate := data.Get("username_template").(string) @@ -140,6 +146,7 @@ func (b *backend) pathConfigRootWrite(ctx context.Context, req *logical.Request, SecretKey: data.Get("secret_key").(string), IAMEndpoint: iamendpoint, STSEndpoint: stsendpoint, + STSRegion: stsregion, Region: region, MaxRetries: maxretries, UsernameTemplate: usernameTemplate, @@ -193,6 +200,7 @@ type rootConfig struct { SecretKey string `json:"secret_key"` IAMEndpoint string `json:"iam_endpoint"` STSEndpoint string `json:"sts_endpoint"` + STSRegion string `json:"sts_region"` Region string `json:"region"` MaxRetries int `json:"max_retries"` UsernameTemplate string `json:"username_template"` diff --git a/builtin/logical/aws/path_config_root_test.go b/builtin/logical/aws/path_config_root_test.go index 783745ac0ed8..9c1ed0476f3a 100644 --- a/builtin/logical/aws/path_config_root_test.go +++ b/builtin/logical/aws/path_config_root_test.go @@ -30,6 +30,7 @@ func TestBackend_PathConfigRoot(t *testing.T) { "region": "us-west-2", "iam_endpoint": "https://iam.amazonaws.com", "sts_endpoint": "https://sts.us-west-2.amazonaws.com", + "sts_region": "", "max_retries": 10, "username_template": defaultUserNameTemplate, "role_arn": "", diff --git a/changelog/22726.txt b/changelog/22726.txt new file mode 100644 index 000000000000..7da05f79482b --- /dev/null +++ b/changelog/22726.txt @@ -0,0 +1,3 @@ +```release-note:bug +secrets/aws: Add sts_region parameter to root config for STS API calls. +``` \ No newline at end of file From bae00721d2a07299f50cdbaf3dc5348d26cc92a3 Mon Sep 17 00:00:00 2001 From: Scott Miller Date: Fri, 4 Oct 2024 13:59:40 -0500 Subject: [PATCH 04/13] Dont add the error from validating via issuer signature if the subsequent verification from extraCas succeeds (#28597) * Dont add the error from validating via issuer signature if the subsequent verification from extraCas succeeds * changelog --- changelog/28597.txt | 3 +++ sdk/helper/ocsp/client.go | 20 ++++++++++++-------- 2 files changed, 15 insertions(+), 8 deletions(-) create mode 100644 changelog/28597.txt diff --git a/changelog/28597.txt b/changelog/28597.txt new file mode 100644 index 000000000000..774c200f1adc --- /dev/null +++ b/changelog/28597.txt @@ -0,0 +1,3 @@ +```release-note:bug +auth/cert: When using ocsp_ca_certificates, an error was produced though extra certs validation succeeded. +``` diff --git a/sdk/helper/ocsp/client.go b/sdk/helper/ocsp/client.go index 888d2025176b..71f75f168a4a 100644 --- a/sdk/helper/ocsp/client.go +++ b/sdk/helper/ocsp/client.go @@ -495,15 +495,19 @@ func validateOCSPParsedResponse(ocspRes *ocsp.Response, subject, issuer *x509.Ce var matchedCA *x509.Certificate // Assumption 1 failed, try 2 - if err := ocspRes.Certificate.CheckSignatureFrom(issuer); err != nil { - // Assumption 2 failed, try 3 - overallErr = multierror.Append(overallErr, err) - - m, err := verifySignature(ocspRes, extraCas) - if err != nil { - overallErr = multierror.Append(overallErr, err) + if sigFromIssuerErr := ocspRes.Certificate.CheckSignatureFrom(issuer); sigFromIssuerErr != nil { + if len(extraCas) > 0 { + // Assumption 2 failed, try 3 + m, err := verifySignature(ocspRes, extraCas) + if err != nil { + overallErr = multierror.Append(overallErr, sigFromIssuerErr) + overallErr = multierror.Append(overallErr, err) + } else { + overallErr = nil + matchedCA = m + } } else { - matchedCA = m + overallErr = multierror.Append(overallErr, sigFromIssuerErr) } } else { matchedCA = ocspRes.Certificate From 05f32b69ee55b934b06ac1e32d5c96d4fd71526d Mon Sep 17 00:00:00 2001 From: claire bontempo <68122737+hellobontempo@users.noreply.github.com> Date: Fri, 4 Oct 2024 13:07:48 -0700 Subject: [PATCH 05/13] UI: upgrade HDS to `4.12.0` (#28525) * update hds to latest version * yield dropdown Interactive text instead of use @text arg, results after running codemod * remaining dropdown changes * address sidebar nav IconButton deprecation, fix secret tests * revert * explicitly select popupmenu * more test changes * fix pki toggle button * remove tracked prop in oidc client controller * aaand more test updates * change to tilde * tilde yarn lock changes * small cleanup items --- ui/app/components/sidebar/frame.hbs | 6 +- ui/app/components/sidebar/user-menu.hbs | 2 +- .../cluster/access/oidc/clients/client.js | 15 --- .../vault/cluster/access/oidc/keys/key.js | 14 --- .../cluster/access/oidc/providers/provider.js | 14 --- ui/app/styles/components/popup-menu.scss | 3 +- ui/app/styles/core/element-styling.scss | 5 - .../components/generated-item-list.hbs | 15 ++- .../components/identity/popup-alias.hbs | 9 +- .../components/identity/popup-members.hbs | 2 +- .../components/identity/popup-metadata.hbs | 2 +- .../components/identity/popup-policy.hbs | 13 ++- .../mfa/login-enforcement-list-item.hbs | 6 +- .../components/mfa/method-list-item.hbs | 6 +- .../templates/components/oidc/client-list.hbs | 6 +- .../components/oidc/provider-list.hbs | 6 +- .../components/raft-storage-overview.hbs | 7 +- .../components/secret-list/aws-role-item.hbs | 12 +-- .../secret-list/database-list-item.hbs | 19 ++-- .../templates/components/secret-list/item.hbs | 12 +-- .../components/secret-list/ssh-role-item.hbs | 22 ++--- .../secret-list/transform-list-item.hbs | 4 +- .../transform-transformation-item.hbs | 4 +- ui/app/templates/docs.hbs | 2 +- .../vault/cluster/access/identity/index.hbs | 18 ++-- .../vault/cluster/access/methods.hbs | 21 ++--- .../mfa/enforcements/enforcement/index.hbs | 3 +- .../vault/cluster/access/namespaces/index.hbs | 2 +- .../cluster/access/oidc/assignments/index.hbs | 6 +- .../cluster/access/oidc/clients/client.hbs | 2 +- .../vault/cluster/access/oidc/keys/index.hbs | 8 +- .../vault/cluster/access/oidc/keys/key.hbs | 2 +- .../access/oidc/providers/provider.hbs | 2 +- .../cluster/access/oidc/scopes/index.hbs | 6 +- .../vault/cluster/policies/index.hbs | 9 +- .../vault/cluster/secrets/backends.hbs | 12 +-- .../addon/components/messages/page/list.hbs | 7 +- .../core/addon/components/confirm-action.hbs | 5 +- .../addon/templates/credentials/index.hbs | 9 +- ui/lib/kmip/addon/templates/scope/roles.hbs | 9 +- ui/lib/kmip/addon/templates/scopes/index.hbs | 5 +- .../addon/components/page/roles.hbs | 7 +- ui/lib/kv/addon/components/page/list.hbs | 24 ++--- .../page/secret/metadata/version-history.hbs | 6 +- .../ldap/addon/components/page/libraries.hbs | 11 ++- ui/lib/ldap/addon/components/page/roles.hbs | 24 +++-- .../addon/components/page/pki-issuer-list.hbs | 5 +- .../addon/components/page/pki-key-list.hbs | 6 +- .../addon/templates/certificates/index.hbs | 5 +- ui/lib/pki/addon/templates/roles/index.hbs | 6 +- .../templates/mode/secondaries/index.hbs | 6 +- .../components/secrets/page/destinations.hbs | 9 +- .../page/destinations/destination/secrets.hbs | 13 +-- .../components/secrets/page/overview.hbs | 6 +- ui/package.json | 2 +- .../access/identity/_shared-tests.js | 8 +- ui/tests/acceptance/auth-list-test.js | 2 +- ui/tests/acceptance/mfa-method-test.js | 8 +- .../acceptance/oidc-config/clients-test.js | 4 +- ui/tests/acceptance/raft-storage-test.js | 5 +- .../secrets/backend/engines-test.js | 77 +++++++--------- .../backend/kv/kv-v2-workflow-create-test.js | 18 ++-- .../secrets/backend/kv/secret-test.js | 16 ++-- .../secret-engine/secret-engine-selectors.ts | 5 + .../components/kv/page/kv-page-list-test.js | 1 + .../components/ldap/page/roles-test.js | 4 +- ui/yarn.lock | 91 ++++++++----------- 67 files changed, 282 insertions(+), 419 deletions(-) diff --git a/ui/app/components/sidebar/frame.hbs b/ui/app/components/sidebar/frame.hbs index 7cd0c84b2f88..2b19db5c9b72 100644 --- a/ui/app/components/sidebar/frame.hbs +++ b/ui/app/components/sidebar/frame.hbs @@ -18,9 +18,11 @@ /> <:actions> - diff --git a/ui/app/components/sidebar/user-menu.hbs b/ui/app/components/sidebar/user-menu.hbs index dde7f1cec8a7..c46cf1d4b588 100644 --- a/ui/app/components/sidebar/user-menu.hbs +++ b/ui/app/components/sidebar/user-menu.hbs @@ -12,7 +12,7 @@ as |Dropdown| > - + diff --git a/ui/app/templates/components/identity/popup-metadata.hbs b/ui/app/templates/components/identity/popup-metadata.hbs index 9954f1c78534..80c516f90bbf 100644 --- a/ui/app/templates/components/identity/popup-metadata.hbs +++ b/ui/app/templates/components/identity/popup-metadata.hbs @@ -6,7 +6,7 @@
- + Remove
diff --git a/ui/app/templates/components/identity/popup-policy.hbs b/ui/app/templates/components/identity/popup-policy.hbs index eef6d33d5829..6f049afdaac6 100644 --- a/ui/app/templates/components/identity/popup-policy.hbs +++ b/ui/app/templates/components/identity/popup-policy.hbs @@ -11,13 +11,12 @@ @hasChevron={{false}} data-test-popup-menu-trigger /> - - - + View policy + Edit policy + + Remove from + {{@model.identityType}} + diff --git a/ui/app/templates/components/mfa/login-enforcement-list-item.hbs b/ui/app/templates/components/mfa/login-enforcement-list-item.hbs index 1827e60c27b5..804ca654e626 100644 --- a/ui/app/templates/components/mfa/login-enforcement-list-item.hbs +++ b/ui/app/templates/components/mfa/login-enforcement-list-item.hbs @@ -27,17 +27,15 @@ data-test-popup-menu-trigger /> + >Details + >Edit diff --git a/ui/app/templates/components/mfa/method-list-item.hbs b/ui/app/templates/components/mfa/method-list-item.hbs index 75a719a5a3e6..ef3e9bdf3845 100644 --- a/ui/app/templates/components/mfa/method-list-item.hbs +++ b/ui/app/templates/components/mfa/method-list-item.hbs @@ -38,17 +38,15 @@ data-test-popup-menu-trigger /> + >Details + >Edit diff --git a/ui/app/templates/components/oidc/client-list.hbs b/ui/app/templates/components/oidc/client-list.hbs index 27f00eeea09c..7e89d8665774 100644 --- a/ui/app/templates/components/oidc/client-list.hbs +++ b/ui/app/templates/components/oidc/client-list.hbs @@ -34,19 +34,17 @@ /> {{#if client.canRead}} + >Details {{/if}} {{#if client.canEdit}} + >Edit {{/if}} {{/if}} diff --git a/ui/app/templates/components/oidc/provider-list.hbs b/ui/app/templates/components/oidc/provider-list.hbs index d684399fb062..5850cbf07d8d 100644 --- a/ui/app/templates/components/oidc/provider-list.hbs +++ b/ui/app/templates/components/oidc/provider-list.hbs @@ -34,19 +34,17 @@ /> {{#if provider.canRead}} + >Details {{/if}} {{#if provider.canEdit}} + >Edit {{/if}} {{/if}} diff --git a/ui/app/templates/components/raft-storage-overview.hbs b/ui/app/templates/components/raft-storage-overview.hbs index 7c4e00100fc3..b9cd94daa903 100644 --- a/ui/app/templates/components/raft-storage-overview.hbs +++ b/ui/app/templates/components/raft-storage-overview.hbs @@ -12,13 +12,12 @@ + >Download {{else}} - + Download {{/if}} - + Restore diff --git a/ui/app/templates/components/secret-list/aws-role-item.hbs b/ui/app/templates/components/secret-list/aws-role-item.hbs index a995f16e4f15..76b8f3ce2acc 100644 --- a/ui/app/templates/components/secret-list/aws-role-item.hbs +++ b/ui/app/templates/components/secret-list/aws-role-item.hbs @@ -36,11 +36,10 @@ {{else if @item.canGenerate}} + >Generate credentials {{/if}} {{#if @item.updatePath.isPending}} @@ -49,27 +48,24 @@ {{else}} {{#if @item.canRead}} + >Details {{/if}} {{#if @item.canEdit}} + >Edit {{/if}} {{#if @item.canDelete}} + >Delete {{/if}} {{/if}} diff --git a/ui/app/templates/components/secret-list/database-list-item.hbs b/ui/app/templates/components/secret-list/database-list-item.hbs index 409429dfd3aa..04ea0f438021 100644 --- a/ui/app/templates/components/secret-list/database-list-item.hbs +++ b/ui/app/templates/components/secret-list/database-list-item.hbs @@ -34,46 +34,41 @@ data-test-popup-menu-trigger /> {{#if @item.canEdit}} - + Edit connection {{/if}} {{#if @item.canEditRole}} - + Edit Role {{/if}} {{#if @item.canReset}} + >Reset connection {{/if}} {{#if (and (eq @item.type "dynamic") @item.canGenerateCredentials)}} + >Generate credentials {{else if (and (eq @item.type "static") @item.canGetCredentials)}} + >Get credentials {{/if}} {{#if (and @item.canRotateRoleCredentials (eq this.keyTypeValue "static"))}} + >Rotate credentials {{/if}} {{#if @item.canRotateRoot}} + >Rotate root credentials {{/if}} diff --git a/ui/app/templates/components/secret-list/item.hbs b/ui/app/templates/components/secret-list/item.hbs index 4aa54a69807f..12af42a3e8d4 100644 --- a/ui/app/templates/components/secret-list/item.hbs +++ b/ui/app/templates/components/secret-list/item.hbs @@ -21,6 +21,7 @@ @backend={{@backendModel.id}} @queryParams={{secret-query-params @backendModel.type @item.type asQueryParams=true}} class="has-text-black has-text-weight-semibold" + data-test-secret-item-link={{@item.id}} > {{#if (eq @backendModel.type "transit")}} @@ -39,7 +40,7 @@ data-test-popup-menu-trigger /> {{#if @item.isFolder}} - + Contents {{else}} {{#if (or @item.versionPath.isLoading @item.secretPath.isLoading)}} @@ -48,27 +49,24 @@ {{else}} {{#if @item.canRead}} + >Details {{/if}} {{#if @item.canEdit}} + >Edit {{/if}} {{#if @item.canDelete}} + >Delete {{/if}} {{/if}} {{/if}} diff --git a/ui/app/templates/components/secret-list/ssh-role-item.hbs b/ui/app/templates/components/secret-list/ssh-role-item.hbs index aa6c295704e8..b137c41798e6 100644 --- a/ui/app/templates/components/secret-list/ssh-role-item.hbs +++ b/ui/app/templates/components/secret-list/ssh-role-item.hbs @@ -50,11 +50,10 @@ {{else if @item.canGenerate}} + >Generate credentials {{/if}} {{else if (eq @item.keyType "ca")}} {{#if @item.signPath.isPending}} @@ -63,11 +62,10 @@ {{else if @item.canGenerate}} + >Sign Keys {{/if}} {{/if}} {{#if @loadingToggleZeroAddress}} @@ -75,10 +73,9 @@ {{else if @item.canEditZeroAddress}} - + + {{if @item.zeroAddress "Disable Zero Address" "Enable Zero Address"}} + {{/if}} {{#if @item.updatePath.isPending}} @@ -87,27 +84,24 @@ {{else}} {{#if @item.canRead}} + >Details {{/if}} {{#if @item.canEdit}} + >Edit {{/if}} {{#if @item.canDelete}} + >Delete {{/if}} {{/if}} diff --git a/ui/app/templates/components/secret-list/transform-list-item.hbs b/ui/app/templates/components/secret-list/transform-list-item.hbs index 18c176ac0db7..94e8c28a39bd 100644 --- a/ui/app/templates/components/secret-list/transform-list-item.hbs +++ b/ui/app/templates/components/secret-list/transform-list-item.hbs @@ -33,10 +33,10 @@ data-test-popup-menu-trigger /> {{#if @item.updatePath.canRead}} - + Details {{/if}} {{#if @item.updatePath.canUpdate}} - + Edit {{/if}} {{/if}} diff --git a/ui/app/templates/components/secret-list/transform-transformation-item.hbs b/ui/app/templates/components/secret-list/transform-transformation-item.hbs index 37fd28ccac52..a1d8cc7548ee 100644 --- a/ui/app/templates/components/secret-list/transform-transformation-item.hbs +++ b/ui/app/templates/components/secret-list/transform-transformation-item.hbs @@ -33,10 +33,10 @@ data-test-popup-menu-trigger /> {{#if @item.updatePath.canRead}} - + Details {{/if}} {{#if @item.updatePath.canUpdate}} - + Edit {{/if}} {{/if}} diff --git a/ui/app/templates/docs.hbs b/ui/app/templates/docs.hbs index 27b4f56a80f4..500bd5fc4349 100644 --- a/ui/app/templates/docs.hbs +++ b/ui/app/templates/docs.hbs @@ -15,7 +15,7 @@ <:actions> - + diff --git a/ui/app/templates/vault/cluster/access/identity/index.hbs b/ui/app/templates/vault/cluster/access/identity/index.hbs index de21aa26f668..03cccc36df9d 100644 --- a/ui/app/templates/vault/cluster/access/identity/index.hbs +++ b/ui/app/templates/vault/cluster/access/identity/index.hbs @@ -41,10 +41,9 @@ data-test-popup-menu-trigger /> + >Details {{#if (or item.isReloading item.updatePath.isPending item.aliasPath.isPending)}} @@ -55,27 +54,28 @@ {{#if (or (eq this.identityType "entity") (and (eq item.type "external") (not item.alias)))}} + >Create alias {{/if}} {{/if}} {{#if item.canEdit}} - + Edit {{#if item.disabled}} - + Enable {{else if (eq this.identityType "entity")}} - + Disable {{/if}} {{/if}} {{#if item.canDelete}} + >Delete {{/if}} {{/if}} diff --git a/ui/app/templates/vault/cluster/access/methods.hbs b/ui/app/templates/vault/cluster/access/methods.hbs index 3efa7fb88fd4..01d92eba451b 100644 --- a/ui/app/templates/vault/cluster/access/methods.hbs +++ b/ui/app/templates/vault/cluster/access/methods.hbs @@ -76,20 +76,19 @@ @hasChevron={{false}} data-test-popup-menu-trigger /> - + + View configuration + {{#if (or method.canEdit (and (eq method.methodType "aws") method.canEditAws))}} - + + Edit configuration + {{/if}} {{#if (and (not-eq method.methodType "token") method.canDisable)}} - + Disable {{/if}} diff --git a/ui/app/templates/vault/cluster/access/mfa/enforcements/enforcement/index.hbs b/ui/app/templates/vault/cluster/access/mfa/enforcements/enforcement/index.hbs index 46900af36feb..7932f9f5f880 100644 --- a/ui/app/templates/vault/cluster/access/mfa/enforcements/enforcement/index.hbs +++ b/ui/app/templates/vault/cluster/access/mfa/enforcements/enforcement/index.hbs @@ -93,11 +93,10 @@ data-test-popup-menu-trigger /> + >Details diff --git a/ui/app/templates/vault/cluster/access/namespaces/index.hbs b/ui/app/templates/vault/cluster/access/namespaces/index.hbs index 169753405e22..6c2b8f6b3595 100644 --- a/ui/app/templates/vault/cluster/access/namespaces/index.hbs +++ b/ui/app/templates/vault/cluster/access/namespaces/index.hbs @@ -46,7 +46,7 @@ {{/if}} {{/let}} - + Delete {{#if (eq this.nsToDelete list.item)}} + >Details + >Edit diff --git a/ui/app/templates/vault/cluster/access/oidc/clients/client.hbs b/ui/app/templates/vault/cluster/access/oidc/clients/client.hbs index 546493397863..ffee2802fbe8 100644 --- a/ui/app/templates/vault/cluster/access/oidc/clients/client.hbs +++ b/ui/app/templates/vault/cluster/access/oidc/clients/client.hbs @@ -3,7 +3,7 @@ SPDX-License-Identifier: BUSL-1.1 ~}} -{{#if this.showHeader}} +{{#if (not-eq this.router.currentRoute.localName "edit")}} diff --git a/ui/app/templates/vault/cluster/access/oidc/keys/index.hbs b/ui/app/templates/vault/cluster/access/oidc/keys/index.hbs index 2995b2cb5347..377e3238fe34 100644 --- a/ui/app/templates/vault/cluster/access/oidc/keys/index.hbs +++ b/ui/app/templates/vault/cluster/access/oidc/keys/index.hbs @@ -21,7 +21,7 @@
- + {{model.name}}
@@ -36,19 +36,17 @@ data-test-popup-menu-trigger /> + >Details + >Edit
diff --git a/ui/app/templates/vault/cluster/access/oidc/keys/key.hbs b/ui/app/templates/vault/cluster/access/oidc/keys/key.hbs index 8ed90248a7e9..57b92fa36d74 100644 --- a/ui/app/templates/vault/cluster/access/oidc/keys/key.hbs +++ b/ui/app/templates/vault/cluster/access/oidc/keys/key.hbs @@ -3,7 +3,7 @@ SPDX-License-Identifier: BUSL-1.1 ~}} -{{#if this.showHeader}} +{{#if (not-eq this.router.currentRoute.localName "edit")}} diff --git a/ui/app/templates/vault/cluster/access/oidc/providers/provider.hbs b/ui/app/templates/vault/cluster/access/oidc/providers/provider.hbs index abdcb1235cc7..08407ac09ac8 100644 --- a/ui/app/templates/vault/cluster/access/oidc/providers/provider.hbs +++ b/ui/app/templates/vault/cluster/access/oidc/providers/provider.hbs @@ -3,7 +3,7 @@ SPDX-License-Identifier: BUSL-1.1 ~}} -{{#if this.showHeader}} +{{#if (not-eq this.router.currentRoute.localName "edit")}} diff --git a/ui/app/templates/vault/cluster/access/oidc/scopes/index.hbs b/ui/app/templates/vault/cluster/access/oidc/scopes/index.hbs index 0747bde83971..21237bcd31ec 100644 --- a/ui/app/templates/vault/cluster/access/oidc/scopes/index.hbs +++ b/ui/app/templates/vault/cluster/access/oidc/scopes/index.hbs @@ -37,19 +37,17 @@ data-test-popup-menu-trigger /> + >Details + >Edit diff --git a/ui/app/templates/vault/cluster/policies/index.hbs b/ui/app/templates/vault/cluster/policies/index.hbs index df42c3bd8735..fc010973279e 100644 --- a/ui/app/templates/vault/cluster/policies/index.hbs +++ b/ui/app/templates/vault/cluster/policies/index.hbs @@ -105,27 +105,24 @@ {{else}} {{#if item.canRead}} + >Details {{/if}} {{#if item.canEdit}} + >Edit {{/if}} {{#if (and item.canDelete (not-eq item.name "default"))}} + >Delete {{/if}} {{/if}} diff --git a/ui/app/templates/vault/cluster/secrets/backends.hbs b/ui/app/templates/vault/cluster/secrets/backends.hbs index 5457cb4328e7..dc7f510cc45e 100644 --- a/ui/app/templates/vault/cluster/secrets/backends.hbs +++ b/ui/app/templates/vault/cluster/secrets/backends.hbs @@ -94,19 +94,15 @@ @hasChevron={{false}} data-test-popup-menu-trigger /> - + + View configuration + {{#if (not-eq backend.type "cubbyhole")}} + >Disable {{/if}} diff --git a/ui/lib/config-ui/addon/components/messages/page/list.hbs b/ui/lib/config-ui/addon/components/messages/page/list.hbs index 9b7a7c99447e..9ec8b4b285df 100644 --- a/ui/lib/config-ui/addon/components/messages/page/list.hbs +++ b/ui/lib/config-ui/addon/components/messages/page/list.hbs @@ -113,10 +113,13 @@ data-test-popup-menu-trigger /> {{#if message.canEditCustomMessages}} - + Edit {{/if}} {{#if message.canDeleteCustomMessages}} - + Delete {{/if}} {{/if}} diff --git a/ui/lib/core/addon/components/confirm-action.hbs b/ui/lib/core/addon/components/confirm-action.hbs index 019d1246fce7..e66ee1eecb90 100644 --- a/ui/lib/core/addon/components/confirm-action.hbs +++ b/ui/lib/core/addon/components/confirm-action.hbs @@ -7,13 +7,14 @@ {{! Hds component renders
  • and `); + + assert.true(this.router.transitionTo.notCalled, 'transitionTo not called on render'); + assert.true(this.router.transitionToExternal.notCalled, 'transitionToExternal not called on render'); + }); + + test('it calls transitionTo correctly', async function (assert) { + await render( + hbs`` + ); + await click('[data-test-btn]'); + + assert.true(this.router.transitionTo.calledOnce, 'transitionTo called once on click'); + assert.deepEqual( + this.router.transitionTo.args[0], + ['vault.cluster', 'foobar', 'baz'], + 'transitionTo called with positional params' + ); + assert.true(this.router.transitionToExternal.notCalled, 'transitionToExternal not called'); + }); + + test('it calls transitionToExternal correctly', async function (assert) { + await render( + hbs`` + ); + await click('[data-test-btn]'); + + assert.true(this.router.transitionToExternal.calledOnce, 'transitionToExternal called'); + assert.deepEqual( + this.router.transitionToExternal.args[0], + ['vault.cluster', 'foobar', 'baz'], + 'transitionToExternal called with positional params' + ); + assert.true(this.router.transitionTo.notCalled, 'transitionTo not called'); + }); + + // This test is confusing (and admittedly not ideal) because stubbing routers gets strange, + // but if you go into the TransitionTo class and console.log owner.lookup('service:router') in get router() + // you'll see the getter returns 'service:app-router' (because of the context setup) + // so although we're asserting this.router, the TransitionTo helper is using "service:app-router" under the hood. + // This test passing, indirectly means the helper works as expected. Failures might be something like "global failure: TypeError: this.router is undefined" + test('it uses service:app-router when base router undefined', async function (assert) { + await render( + hbs``, + { owner: this.engine } + ); + await click('[data-test-btn]'); + assert.true(this.router.transitionToExternal.calledOnce, 'transitionToExternal called'); + }); +}); diff --git a/ui/yarn.lock b/ui/yarn.lock index 7b207dfa3213..d58e7d495f48 100644 --- a/ui/yarn.lock +++ b/ui/yarn.lock @@ -7613,7 +7613,7 @@ __metadata: languageName: node linkType: hard -"ember-cli-babel@npm:^7.1.2, ember-cli-babel@npm:^7.1.3, ember-cli-babel@npm:^7.10.0, ember-cli-babel@npm:^7.13.0, ember-cli-babel@npm:^7.18.0, ember-cli-babel@npm:^7.20.0, ember-cli-babel@npm:^7.22.1, ember-cli-babel@npm:^7.23.0, ember-cli-babel@npm:^7.26.11, ember-cli-babel@npm:^7.26.3, ember-cli-babel@npm:^7.26.4, ember-cli-babel@npm:^7.26.5, ember-cli-babel@npm:^7.26.6, ember-cli-babel@npm:^7.26.8, ember-cli-babel@npm:^7.5.0, ember-cli-babel@npm:^7.7.3": +"ember-cli-babel@npm:^7.1.2, ember-cli-babel@npm:^7.1.3, ember-cli-babel@npm:^7.10.0, ember-cli-babel@npm:^7.13.0, ember-cli-babel@npm:^7.18.0, ember-cli-babel@npm:^7.22.1, ember-cli-babel@npm:^7.23.0, ember-cli-babel@npm:^7.26.11, ember-cli-babel@npm:^7.26.3, ember-cli-babel@npm:^7.26.4, ember-cli-babel@npm:^7.26.5, ember-cli-babel@npm:^7.26.6, ember-cli-babel@npm:^7.26.8, ember-cli-babel@npm:^7.5.0, ember-cli-babel@npm:^7.7.3": version: 7.26.11 resolution: "ember-cli-babel@npm:7.26.11" dependencies: @@ -8652,15 +8652,6 @@ __metadata: languageName: node linkType: hard -"ember-router-helpers@npm:^0.4.0": - version: 0.4.0 - resolution: "ember-router-helpers@npm:0.4.0" - dependencies: - ember-cli-babel: ^7.20.0 - checksum: e847ceb1061f87416d6bb5d72ef539fda738a24086051bc94d740117c6353b3406c65247ac8190b8572df008a70d9f801e224d38489170129c5ca6c4ec7f206e - languageName: node - linkType: hard - "ember-service-worker@meirish/ember-service-worker#configurable-scope": version: 9.0.1 resolution: "ember-service-worker@https://github.com/meirish/ember-service-worker.git#commit=dda14187aace0d73ecdb6a55beac2194a3aec01b" @@ -18829,7 +18820,6 @@ __metadata: ember-qunit: ^8.0.1 ember-resolver: ^11.0.1 ember-responsive: 5.0.0 - ember-router-helpers: ^0.4.0 ember-service-worker: "meirish/ember-service-worker#configurable-scope" ember-sinon-qunit: ^7.4.0 ember-source: ~5.4.0 From 163cfd225f7bff327b5d714d21bdd611d95a9a38 Mon Sep 17 00:00:00 2001 From: claire bontempo <68122737+hellobontempo@users.noreply.github.com> Date: Tue, 8 Oct 2024 09:26:28 -0700 Subject: [PATCH 13/13] remove dep (#28628) --- ui/config/deprecation-workflow.js | 1 - 1 file changed, 1 deletion(-) diff --git a/ui/config/deprecation-workflow.js b/ui/config/deprecation-workflow.js index 54a067fb381b..d5c2f638e6b9 100644 --- a/ui/config/deprecation-workflow.js +++ b/ui/config/deprecation-workflow.js @@ -12,7 +12,6 @@ self.deprecationWorkflow.config = { self.deprecationWorkflow.config = { // current output from deprecationWorkflow.flushDeprecations(); workflow: [ - { handler: 'silence', matchId: 'ember-engines.deprecation-router-service-from-host' }, // ember-data { handler: 'silence', matchId: 'ember-data:no-a-with-array-like' }, // MFA { handler: 'silence', matchId: 'ember-data:deprecate-promise-many-array-behaviors' }, // MFA