Skip to content
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

Closed
wants to merge 4 commits into from

Conversation

@noCharger noCharger changed the title Adopt saved object client factory [MD] Adopt saved object client factory Aug 1, 2022
Comment on lines +23 to +35
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);

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

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);
};

Copy link
Collaborator Author

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

@noCharger noCharger closed this Oct 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants