* feat: 🎸 Create Credential Model in API ✅ Closes: ICU-5229 * feat: 🎸 update credential model Add attributes to credential model ✅ Closes: ICU-5229 * feat: 🎸 no verify ✅ Closes: ICU-5230 * feat: 🎸 Add credential serializer and tests ✅ Closes: ICU-5230 * feat: 🎸 Add credential serializer Credential serializer along with unit tests were added. ✅ Closes: ICU-5230 * feat: 🎸 Credential serializer & unit tests ✅ Closes: ICU-5230 * fix: 🐛 Resolved commit conflicts ✅ Closes: ICU-5230 * fix: 🐛 deleted password_hmac from inside the serializer ✅ Closes: ICU-5230 Co-authored-by: Cameron Perera <cameron.perera@hashicorp.com>
18 lines
556 B
JavaScript
18 lines
556 B
JavaScript
import ApplicationSerializer from './application';
|
|
import { copy } from 'ember-copy';
|
|
|
|
export default class CredentialSerializer extends ApplicationSerializer {
|
|
serialize() {
|
|
let serialized = super.serialize(...arguments);
|
|
delete serialized['attributes']['password_hmac'];
|
|
return serialized;
|
|
}
|
|
|
|
normalize(typeClass, hash, ...rest) {
|
|
const normalizedHash = copy(hash, true);
|
|
const normalized = super.normalize(typeClass, normalizedHash, ...rest);
|
|
normalized['data']['attributes']['password'] = '';
|
|
return normalized;
|
|
}
|
|
}
|