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

Add security plugin #507

Merged
merged 21 commits into from
Apr 10, 2024
Merged

Add security plugin #507

merged 21 commits into from
Apr 10, 2024

Conversation

Jakob3xD
Copy link
Collaborator

@Jakob3xD Jakob3xD commented Apr 3, 2024

Description

  • adds security plugin
  • moves errors to opensearch package
  • add more error types and parse them by type assertion

The changes made to error are more or less braking changes as they get moved to another package.
Normal use should still work but for uses who try to parse the error with errors.As it is braking.

Issues Resolved

Closes #94

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.

Copy link

codecov bot commented Apr 3, 2024

Codecov Report

Attention: Patch coverage is 93.16038% with 58 lines in your changes are missing coverage. Please review.

Project coverage is 66.14%. Comparing base (06a6dc8) to head (289159b).
Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #507      +/-   ##
==========================================
+ Coverage   57.29%   66.14%   +8.85%     
==========================================
  Files         315      363      +48     
  Lines        9823     8563    -1260     
==========================================
+ Hits         5628     5664      +36     
+ Misses       2902     1588    -1314     
- Partials     1293     1311      +18     
Flag Coverage Δ
integration 59.44% <92.92%> (+8.60%) ⬆️
unit 81.48% <100.00%> (+68.63%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
opensearch.go 92.85% <100.00%> (+17.23%) ⬆️
plugins/security/api_account-get.go 100.00% <100.00%> (ø)
plugins/security/api_account.go 100.00% <100.00%> (ø)
plugins/security/api_actiongroups-delete.go 100.00% <100.00%> (ø)
plugins/security/api_actiongroups-get.go 100.00% <100.00%> (ø)
plugins/security/api_actiongroups.go 100.00% <100.00%> (ø)
plugins/security/api_audit-get.go 100.00% <100.00%> (ø)
plugins/security/api_audit.go 100.00% <100.00%> (ø)
plugins/security/api_flushcache.go 100.00% <100.00%> (ø)
plugins/security/api_health.go 100.00% <100.00%> (ø)
... and 39 more

... and 249 files with indirect coverage changes

@Jakob3xD Jakob3xD force-pushed the jh-security branch 10 times, most recently from d5058b3 to 44b7c7b Compare April 5, 2024 09:50
@Jakob3xD
Copy link
Collaborator Author

Jakob3xD commented Apr 5, 2024

🥳 CI is green. I am going to split all the unrelated stuff into separate PRs.

@Jakob3xD Jakob3xD force-pushed the jh-security branch 6 times, most recently from 16b7ef4 to 5274903 Compare April 9, 2024 09:37
@Jakob3xD Jakob3xD marked this pull request as ready for review April 9, 2024 09:43
dblock
dblock previously approved these changes Apr 10, 2024
Copy link
Member

@dblock dblock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice. Did you roll this code out by hand?

@Jakob3xD
Copy link
Collaborator Author

Nice. Did you roll this code out by hand?

Yes, as the API spec is IMO not in a great state because of issue like this and my focus is on adding the missing plugins I need. As I have no experience with code generation it would take way more time to add the plugins and iron out all the issues the api spec has.

I am also working on the ISM plugins but the API spec is totally missing and I am trying to get what I need from the Docs but this is also a lot of pain.

@dblock
Copy link
Member

dblock commented Apr 10, 2024

@Jakob3xD we have done a lot of work in https://github.com/opensearch-project/opensearch-api-specification, moving it to OpenAPI, adding bodies, and generally are going to push on teams such as ISM to add specs. You can get a lot of mileage "for free" there. Remember that we have 8 clients, so in order to keep up with API changes we have to automate.

@dblock
Copy link
Member

dblock commented Apr 10, 2024

@Jakob3xD rebase?

…ainer

Signed-off-by: Jakob Hahn <jakob.hahn@hetzner.com>
…ests

Signed-off-by: Jakob Hahn <jakob.hahn@hetzner.com>
Signed-off-by: Jakob Hahn <jakob.hahn@hetzner.com>
Signed-off-by: Jakob Hahn <jakob.hahn@hetzner.com>
Signed-off-by: Jakob Hahn <jakob.hahn@hetzner.com>
Signed-off-by: Jakob Hahn <jakob.hahn@hetzner.com>
Signed-off-by: Jakob Hahn <jakob.hahn@hetzner.com>
Signed-off-by: Jakob Hahn <jakob.hahn@hetzner.com>
Signed-off-by: Jakob Hahn <jakob.hahn@hetzner.com>
Signed-off-by: Jakob Hahn <jakob.hahn@hetzner.com>
Signed-off-by: Jakob Hahn <jakob.hahn@hetzner.com>
Signed-off-by: Jakob Hahn <jakob.hahn@hetzner.com>
Signed-off-by: Jakob Hahn <jakob.hahn@hetzner.com>
Signed-off-by: Jakob Hahn <jakob.hahn@hetzner.com>
Signed-off-by: Jakob Hahn <jakob.hahn@hetzner.com>
Signed-off-by: Jakob Hahn <jakob.hahn@hetzner.com>
Signed-off-by: Jakob Hahn <jakob.hahn@hetzner.com>
Signed-off-by: Jakob Hahn <jakob.hahn@hetzner.com>
Signed-off-by: Jakob Hahn <jakob.hahn@hetzner.com>
Signed-off-by: Jakob Hahn <jakob.hahn@hetzner.com>
Signed-off-by: Jakob Hahn <jakob.hahn@hetzner.com>
@dblock dblock merged commit cefc0be into opensearch-project:main Apr 10, 2024
53 checks passed
@Jakob3xD Jakob3xD deleted the jh-security branch April 10, 2024 13:43
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.

[FEATURE] Types for users and roles in opensearchapi
2 participants