open-vault/ui/app/serializers/pki/role.js
claire bontempo 4af59fd6cd
UI/vault 13506/pki attr cleanup (#19121)
* add show page for generated CSR

* fix typo, make key-id copyable

* add tests

* move pki tests to designated folder

* list keys when in between state after CSR generation

* uses customTTL for generateing role cert and adds privateKeyFormat

* Revert "move pki tests to designated folder"

This reverts commit 82b60e4beab0717bbace8dee64cc0863a5488079.

* Revert "add tests"

This reverts commit 3c90fc9abacf8309d2cf9f1b90299a5153b743da.

* Revert "fix typo, make key-id copyable"

This reverts commit 8e6f5a1f4580229e6de8f6e919945f03ee29ac3d.

* revert accidental parent commits

* Revert "list keys when in between state after CSR generation"

This reverts commit c01d7852a46d41a72e5eace28aafed5daa93f70f.

* fix empty arrays removed when serialized

* fix comment;
g

* update test
2023-02-10 18:12:40 +00:00

17 lines
557 B
JavaScript

import ApplicationSerializer from '../application';
export default class PkiRoleSerializer extends ApplicationSerializer {
attrs = {
name: { serialize: false },
};
serialize() {
const json = super.serialize(...arguments);
// attributes with empty arrays are stripped from serialized json
// but an empty list is acceptable for key_usage to specify no default constraints
// intercepting here to ensure an empty array persists (the backend assumes default values)
json.key_usage = json.key_usage || [];
return json;
}
}