mirror of
https://github.com/hashicorp/vault.git
synced 2025-08-22 15:11:07 +02:00
* rename validators util into model-helpers folder * move kmip-role-fields to model-helpers * fill out docs * Move database-helpers into model-helpers * broom
28 lines
811 B
JavaScript
28 lines
811 B
JavaScript
/**
|
|
* Copyright (c) HashiCorp, Inc.
|
|
* SPDX-License-Identifier: BUSL-1.1
|
|
*/
|
|
|
|
import { removeManyFromArray } from 'vault/helpers/remove-from-array';
|
|
|
|
export const operationFields = (fieldNames) => {
|
|
if (!Array.isArray(fieldNames)) {
|
|
throw new Error('fieldNames must be an array');
|
|
}
|
|
return fieldNames.filter((key) => key.startsWith('operation'));
|
|
};
|
|
|
|
export const operationFieldsWithoutSpecial = (fieldNames) => {
|
|
const opFields = operationFields(fieldNames);
|
|
return removeManyFromArray(opFields, ['operationAll', 'operationNone']);
|
|
};
|
|
|
|
export const nonOperationFields = (fieldNames) => {
|
|
const opFields = operationFields(fieldNames);
|
|
return removeManyFromArray(fieldNames, opFields);
|
|
};
|
|
|
|
export const tlsFields = () => {
|
|
return ['tlsClientKeyBits', 'tlsClientKeyType', 'tlsClientTtl'];
|
|
};
|