-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[MD] Adopt saved object client factory #23
Conversation
src/plugins/credential_management/server/saved_objects/credential_saved_object_type.ts
Show resolved
Hide resolved
src/plugins/credential_management/server/saved_objects/credential_saved_object_type.ts
Show resolved
Hide resolved
src/plugins/credential_management/server/saved_objects/credential_saved_object_type.ts
Show resolved
Hide resolved
const createWithCredentialMaterialsContentEncryption = async <T = unknown>( | ||
type: string, | ||
attributes: T, | ||
options?: SavedObjectsCreateOptions | ||
) => { | ||
// TODO: Add validation | ||
const encryptedAttributes = { | ||
title: attributes.title, | ||
description: attributes.description, | ||
credentialType: attributes.credentialType, | ||
credentialMaterials: await handleEncryption(attributes.credentialMaterials), | ||
}; | ||
return await wrapperOptions.client.create(type, encryptedAttributes, options); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you need to check if the type
parameter is credential
or not
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And same for other functions in this wrapper
}; | ||
return await wrapperOptions.client.create(type, encryptedAttributes, options); | ||
}; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Discussed here opensearch-project#1926
Description
Adopt saved object client factory
Issues Resolved
Next Step