diff --git a/server/backend/opensearch_security_configuration_plugin.ts b/server/backend/opensearch_security_configuration_plugin.ts index 09735c63a..ad91e34fd 100644 --- a/server/backend/opensearch_security_configuration_plugin.ts +++ b/server/backend/opensearch_security_configuration_plugin.ts @@ -21,6 +21,12 @@ export default function (Client: any, config: any, components: any) { Client.prototype.opensearch_security = components.clientAction.namespaceFactory(); } + Client.prototype.opensearch_security.prototype.restapiinfo = ca({ + url: { + fmt: '/_plugins/_security/api/permissionsinfo', + }, + }); + /** * list all field mappings for all indices. */ @@ -30,6 +36,29 @@ export default function (Client: any, config: any, components: any) { }, }); + /** + * Returns a Security resource configuration. + * + * Sample response: + * + * { + * "user": { + * "hash": "#123123" + * } + * } + */ + Client.prototype.opensearch_security.prototype.listResource = ca({ + url: { + fmt: '/_plugins/_security/api/<%=resourceName%>', + req: { + resourceName: { + type: 'string', + required: true, + }, + }, + }, + }); + Client.prototype.opensearch_security.prototype.listInternalAccounts = ca({ url: { fmt: '/_plugins/_security/api/internalusers?filterBy=internal', @@ -72,6 +101,30 @@ export default function (Client: any, config: any, components: any) { }, }); + /** + * Updates a resource. + * Resource identification is expected to computed from headers. Eg: auth headers. + * + * Sample response: + * { + * "status": "OK", + * "message": "Username updated." + * } + */ + Client.prototype.opensearch_security.prototype.saveResourceWithoutId = ca({ + method: 'PUT', + needBody: true, + url: { + fmt: '/_plugins/_security/api/<%=resourceName%>', + req: { + resourceName: { + type: 'string', + required: true, + }, + }, + }, + }); + /** * Returns a Security resource instance. * @@ -178,4 +231,4 @@ export default function (Client: any, config: any, components: any) { fmt: '/_plugins/_security/api/audit/config', }, }); -} +} \ No newline at end of file diff --git a/server/backend/opensearch_security_plugin.ts b/server/backend/opensearch_security_plugin.ts index ea2c4c5a4..77b5a5b1f 100644 --- a/server/backend/opensearch_security_plugin.ts +++ b/server/backend/opensearch_security_plugin.ts @@ -21,59 +21,6 @@ export default function (Client: any, config: any, components: any) { Client.prototype.opensearch_security = components.clientAction.namespaceFactory(); } - Client.prototype.opensearch_security.prototype.restapiinfo = ca({ - url: { - fmt: '/_plugins/_security/api/permissionsinfo', - }, - }); - - /** - * Updates a resource. - * Resource identification is expected to computed from headers. Eg: auth headers. - * - * Sample response: - * { - * "status": "OK", - * "message": "Username updated." - * } - */ - Client.prototype.opensearch_security.prototype.saveResourceWithoutId = ca({ - method: 'PUT', - needBody: true, - url: { - fmt: '/_plugins/_security/api/<%=resourceName%>', - req: { - resourceName: { - type: 'string', - required: true, - }, - }, - }, - }); - - /** - * Returns a Security resource configuration. - * - * Sample response: - * - * { - * "user": { - * "hash": "#123123" - * } - * } - */ - Client.prototype.opensearch_security.prototype.listResource = ca({ - url: { - fmt: '/_plugins/_security/api/<%=resourceName%>', - req: { - resourceName: { - type: 'string', - required: true, - }, - }, - }, - }); - /** * Gets auth info. */ @@ -137,4 +84,4 @@ export default function (Client: any, config: any, components: any) { fmt: '/_plugins/_security/api/tenancy/config', }, }); -} +} \ No newline at end of file