2023-03-01 09:39:41 -06:00
|
|
|
/**
|
|
|
|
|
* Copyright (c) HashiCorp, Inc.
|
|
|
|
|
* SPDX-License-Identifier: MPL-2.0
|
|
|
|
|
*/
|
|
|
|
|
|
2022-07-21 13:48:16 -07:00
|
|
|
import ApplicationSerializer from './application';
|
|
|
|
|
|
|
|
|
|
export default ApplicationSerializer.extend({
|
|
|
|
|
modelName: 'credential',
|
|
|
|
|
|
|
|
|
|
_hashForModel(model) {
|
|
|
|
|
const json = ApplicationSerializer.prototype._hashForModel.apply(
|
|
|
|
|
this,
|
|
|
|
|
arguments
|
|
|
|
|
);
|
|
|
|
|
json.credential_store_id = model.credentialStoreId;
|
|
|
|
|
|
2022-08-30 20:40:31 -05:00
|
|
|
// in a real API, the password, private_key, and private_key_passphrase
|
|
|
|
|
// fields are not returned so we delete them from the response
|
2022-07-22 12:29:53 -05:00
|
|
|
delete json.attributes?.password;
|
2022-08-17 13:20:21 -05:00
|
|
|
delete json.attributes?.private_key;
|
2022-08-30 20:40:31 -05:00
|
|
|
delete json.attributes?.private_key_passphrase;
|
2022-11-21 16:28:10 -05:00
|
|
|
delete json.attributes?.json_object;
|
2022-07-21 13:48:16 -07:00
|
|
|
return json;
|
|
|
|
|
},
|
|
|
|
|
});
|