Skip to content

Commit

Permalink
Revert changes
Browse files Browse the repository at this point in the history
Signed-off-by: Craig Perkins <[email protected]>
  • Loading branch information
cwperks committed May 22, 2024
1 parent 70367e8 commit 72b6990
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 55 deletions.
55 changes: 54 additions & 1 deletion server/backend/opensearch_security_configuration_plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand All @@ -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',
Expand Down Expand Up @@ -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.
*
Expand Down Expand Up @@ -178,4 +231,4 @@ export default function (Client: any, config: any, components: any) {
fmt: '/_plugins/_security/api/audit/config',
},
});
}
}
55 changes: 1 addition & 54 deletions server/backend/opensearch_security_plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand Down Expand Up @@ -137,4 +84,4 @@ export default function (Client: any, config: any, components: any) {
fmt: '/_plugins/_security/api/tenancy/config',
},
});
}
}

0 comments on commit 72b6990

Please sign in to comment.