mirror of
https://github.com/hashicorp/vault.git
synced 2025-08-15 19:17:02 +02:00
* Adding explicit MPL license for sub-package. This directory and its subdirectories (packages) contain files licensed with the MPLv2 `LICENSE` file in this directory and are intentionally licensed separately from the BSL `LICENSE` file at the root of this repository. * Adding explicit MPL license for sub-package. This directory and its subdirectories (packages) contain files licensed with the MPLv2 `LICENSE` file in this directory and are intentionally licensed separately from the BSL `LICENSE` file at the root of this repository. * Updating the license from MPL to Business Source License. Going forward, this project will be licensed under the Business Source License v1.1. Please see our blog post for more details at https://hashi.co/bsl-blog, FAQ at www.hashicorp.com/licensing-faq, and details of the license at www.hashicorp.com/bsl. * add missing license headers * Update copyright file headers to BUS-1.1 * Fix test that expected exact offset on hcl file --------- Co-authored-by: hashicorp-copywrite[bot] <110428419+hashicorp-copywrite[bot]@users.noreply.github.com> Co-authored-by: Sarah Thompson <sthompson@hashicorp.com> Co-authored-by: Brian Kassouf <bkassouf@hashicorp.com>
60 lines
2.0 KiB
TypeScript
60 lines
2.0 KiB
TypeScript
/**
|
|
* Copyright (c) HashiCorp, Inc.
|
|
* SPDX-License-Identifier: BUSL-1.1
|
|
*/
|
|
|
|
import Component from '@glimmer/component';
|
|
import { parsedParameterKeys } from 'vault/utils/parse-pki-cert-oids';
|
|
import { ParsedCertificateData } from 'vault/vault/utils/parse-pki-cert';
|
|
|
|
/**
|
|
* @module ParsedCertificateInfoRowsComponent
|
|
* Renders attributes parsed from a PKI certificate (provided from parse-pki-cert util). It will only render rows for
|
|
* defined values that match `parsedParameterKeys` imported from the helper. It never renders common_name, even though
|
|
* the value is returned from the parse cert util, because `common_name` is important to PKI and we render it at the top.
|
|
*
|
|
* @example ```js
|
|
* <ParsedCertificateInfoRows @model={{@model.parsedCertificate}} />
|
|
* ```
|
|
*
|
|
* @param {object} model - object of parsed attributes from parse-pki-cert util
|
|
*/
|
|
|
|
interface AttrOptions {
|
|
[key: string]: {
|
|
label?: string;
|
|
formatDate?: string;
|
|
};
|
|
}
|
|
|
|
interface Args {
|
|
model: ParsedCertificateData;
|
|
}
|
|
|
|
export default class ParsedCertificateInfoRowsComponent extends Component<Args> {
|
|
get possibleFields() {
|
|
// We show common name elsewhere on the details view, so no need to render it here
|
|
const fieldKeys = parsedParameterKeys.filter((k) => k !== 'common_name');
|
|
const attrsByKey: AttrOptions = {
|
|
other_sans: { label: 'Other SANs' },
|
|
alt_names: { label: 'Subject Alternative Names (SANs)' },
|
|
uri_sans: { label: 'URI SANs' },
|
|
ip_sans: { label: 'IP SANs' },
|
|
permitted_dns_domains: { label: 'Permitted DNS domains' },
|
|
exclude_cn_from_sans: { label: 'Exclude CN from SANs' },
|
|
use_pss: { label: 'Use PSS' },
|
|
ttl: { label: 'TTL' },
|
|
ou: { label: 'Organizational units (OU)' },
|
|
not_valid_after: { formatDate: 'MMM d yyyy HH:mm:ss a zzzz' },
|
|
not_valid_before: { formatDate: 'MMM d yyyy HH:mm:ss a zzzz' },
|
|
};
|
|
|
|
return fieldKeys.map((key) => {
|
|
return {
|
|
key,
|
|
...attrsByKey[key],
|
|
};
|
|
});
|
|
}
|
|
}
|