opensearch-project / opensearch-py

Python Client for OpenSearch
https://opensearch.org/docs/latest/clients/python/
Apache License 2.0
350 stars 175 forks source link

Added SecurityClient APIs #439

Closed saimedhi closed 1 year ago

saimedhi commented 1 year ago

Description

Added SecurityClient APIs

Issues Resolved

Related to #435 By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license. For more information on following Developer Certificate of Origin and signing off your commits, please check here.

codecov[bot] commented 1 year ago

Codecov Report

Merging #439 (a2e7b71) into main (49d75c2) will decrease coverage by 2.77%. The diff coverage is 0.00%.

@@            Coverage Diff             @@
##             main     #439      +/-   ##
==========================================
- Coverage   71.48%   68.72%   -2.77%     
==========================================
  Files          81       83       +2     
  Lines        7667     7975     +308     
==========================================
  Hits         5481     5481              
- Misses       2186     2494     +308     
Impacted Files Coverage Δ
opensearchpy/_async/client/security.py 0.00% <0.00%> (ø)
opensearchpy/client/security.py 0.00% <0.00%> (ø)
saimedhi commented 1 year ago

@nhtruong, I notice "body" and "path params" descriptions are missing for these APIs in OPenAPI spec. Can you please confirm? Thanks :)

nhtruong commented 1 year ago

@saimedhi Looks like they dont. You can also check it our yourself. All files related to security are in this folder: https://github.com/opensearch-project/opensearch-api-specification/tree/main/model/security on API repo. For example, to check if the create_user endpoint has any description for the body, inspect the @output in structures.smithy file in the create_user subfolder: https://github.com/opensearch-project/opensearch-api-specification/blob/main/model/security/create_user/structures.smithy#L22

florianvazelle commented 1 year ago

Hi :slightly_smiling_face: The security client is already implemented in this MR https://github.com/opensearch-project/opensearch-py/pull/399. Is anything missing ?

nhtruong commented 1 year ago

@florianvazelle The code in this PR was generated from OpenSearch API. Moving forward, all new API endpoints will be first added to the API repo then the API code is generated for each client like this. This is to assure consistency across clients, and speed up the deployment of new features. This draft is also a chance for us to fine tune the generator and plug holes in the API specs.

saimedhi commented 1 year ago

Closing this pull request as SecurityClient is already present in plugins. @dblock Should the Security Client be left in plugins or added to opensearchpy/client as like cat client?

nhtruong commented 1 year ago

@saimedhi that PR that added security endpoints are for this repo.

dblock commented 1 year ago

@saimedhi @nhtruong I think I'm missing context, you guys decide what to do with this :)

for license headers, the rule of thumb is that all existing code needs to keep existing headers, and all new code needs only the SPDX header