mirror of
https://github.com/hashicorp/vault.git
synced 2025-08-29 02:21:08 +02:00
* remove named path adapter extension, add subdirectory query logic to adapter * add subdirectory route and logic to page::roles component * fix overview page search select * breadcrumbs * update tests and mirage * revert ss changes * oops * cleanup adapter, add _ for private methods * add acceptance test * remove type * add changelog * add ldap breadcrumb test * VAULT-31905 link jira * update breadcrumbs in Edit route * rename type interfaces
21 lines
541 B
JavaScript
21 lines
541 B
JavaScript
/**
|
|
* Copyright (c) HashiCorp, Inc.
|
|
* SPDX-License-Identifier: BUSL-1.1
|
|
*/
|
|
|
|
import ApplicationSerializer from '../application';
|
|
|
|
export default class LdapRoleSerializer extends ApplicationSerializer {
|
|
serialize(snapshot) {
|
|
// remove all fields that are not relevant to specified role type
|
|
const { fieldsForType } = snapshot.record;
|
|
const json = super.serialize(...arguments);
|
|
Object.keys(json).forEach((key) => {
|
|
if (!fieldsForType.includes(key)) {
|
|
delete json[key];
|
|
}
|
|
});
|
|
return json;
|
|
}
|
|
}
|