Files
vault/ui/lib/core/addon/components/secrets-engine-mount-config.ts
Angel Garbarino 3abca46464 WIF sidebranch (#28148)
* manual cherry pick to deal with all the merge things

* changelog

* test fixes

* Update 28148.txt

* fix tests failures after main merge

* fix test failures after main merge

* Add Access Type and conditionally render WIF fields (#28149)

* initial work.

* remove access_type

* better no model logic well kind of

* rollback attrs

* remove defaults

* stopping point

* wip changing back to sidebranch

* hustling shuffling and serializing

* some of the component test coverage

* disable acces type if editing

* test coverage

* hide max retries that sneaky bugger

* cleanup

* cleanup

* Update root-config.js

* remove flash message check, locally passes great but on ci flaky

* clean up

* thank you chelsea

* test clean up per enterprise vs community

* address pr comments

* welp a miss add

* UI (sidebranch) WIF Issuer field (#28187)

* Add type declaration files for aws config models

* use updated task syntax for save method on configure-aws

* fix types on edit route

* fetch issuer on configure edit page if aws + enterprise

* track issuer within configure-aws component

* add placeholder support on form-field

* Add warning if issuer changed from previous value or could not be read

* cleanup

* preliminary tests

* dont use while loop so we can test the modal

* tests

* cleanup

* fix tests

* remove extra tracked value and duplicate changed attrs check

* modal footer

---------

Co-authored-by: Angel Garbarino <argarbarino@gmail.com>

* Display issuer on Configuration details (#28209)

* display issuer on configuration details

* workflow complete, now on to testing

* handle issuer things

* fix all the broken tests things

* add test coveragE:

* cleanup

* rename model/adapter

* Update configure-aws.ts

* Update aws-configuration-test.js

* 90 percent there for pr comments

* last one for tonight

* a few more because why not

* hasDirtyAttributes fixes

* revert back to previous noRead->queryIssuerError

---------

Co-authored-by: Chelsea Shaw <82459713+hashishaw@users.noreply.github.com>
2024-08-29 12:17:51 -06:00

47 lines
1.7 KiB
TypeScript

/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: BUSL-1.1
*/
import Component from '@glimmer/component';
import { tracked } from '@glimmer/tracking';
import { duration } from 'core/helpers/format-duration';
import type SecretEngineModel from 'vault/models/secret-engine';
/**
* @module SecretsEngineMountConfig
* SecretsEngineMountConfig component is used to display a "Show mount configuration" toggle section. It is generally used alongside the fetch-secret-engine-config decorator which displays the engine configuration above this component. Mount configuration is always available for display but is hidden by default behind a toggle.
*
* @example
* <SecretsEngineMountConfig @model={{model}} />
*
* @param {Model} model- The secret engines model, generated via the secret-engine model and a belongsTo relationship connecting to the mount-config model.
*/
interface Args {
model: SecretEngineModel;
}
interface Field {
label: string;
value: string | boolean;
}
export default class SecretsEngineMountConfig extends Component<Args> {
@tracked showConfig = false;
get fields(): Array<Field> {
const { model } = this.args;
return [
{ label: 'Secret Engine Type', value: model.engineType },
{ label: 'Path', value: model.path },
{ label: 'Accessor', value: model.accessor },
{ label: 'Local', value: model.local },
{ label: 'Seal Wrap', value: model.sealWrap },
{ label: 'Default Lease TTL', value: duration([model.config.defaultLeaseTtl]) },
{ label: 'Max Lease TTL', value: duration([model.config.maxLeaseTtl]) },
{ label: 'Identity Token Key', value: model.config.identityTokenKey },
];
}
}