import ApplicationSerializer from './application'; import { copy } from 'ember-copy'; export default class CredentialSerializer extends ApplicationSerializer { /** * @override * @method serialize * @param {Snapshot} snapshot */ /** * @type {boolean} */ serializeScopeID = false; normalize(typeClass, hash, ...rest) { const normalizedHash = copy(hash, true); const normalized = super.normalize(typeClass, normalizedHash, ...rest); // Remove secret fields as we don't track them after being created/updated normalized.data.attributes.password = ''; normalized.data.attributes.private_key = ''; normalized.data.attributes.private_key_passphrase = ''; return normalized; } }