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 create user 201 response to OpenAPI spec #810

Merged
merged 4 commits into from
Jan 31, 2025

Conversation

zelinh
Copy link
Member

@zelinh zelinh commented Jan 27, 2025

Description

Add security create user 201 response to OpenAPI spec

Issues Resolved

Closes #809

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
Contributor

github-actions bot commented Jan 27, 2025

Changes Analysis

Commit SHA: da8c29f
Comparing To SHA: 9df46f8

API Changes

Summary

├─┬Paths
│ ├─┬/_plugins/_security/api/internalusers/{username}
│ │ └─┬PUT
│ │   └─┬Responses
│ │     └──[➕] codes (33203:7)
│ └─┬/_opendistro/_security/api/internalusers/{username}
│   └─┬PUT
│     └─┬Responses
│       └──[➕] codes (33203:7)
└─┬Components
  └──[➕] responses (33203:7)

Document Element Total Changes Breaking Changes
paths 2 0
components 1 0
  • Total Changes: 3
  • Additions: 3

Report

The full API changes report is available at: https://github.com/opensearch-project/opensearch-api-specification/actions/runs/13059401053/artifacts/2512712828

API Coverage

Before After Δ
Covered (%) 662 (64.84 %) 662 (64.84 %) 0 (0 %)
Uncovered (%) 359 (35.16 %) 359 (35.16 %) 0 (0 %)
Unknown 45 45 0

Copy link
Contributor

Spec Test Coverage Analysis

Total Tested
594 593 (99.83 %)

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.

@zelinh
Copy link
Member Author

zelinh commented Jan 28, 2025

This needs a test, please? Something into https://github.com/opensearch-project/opensearch-api-specification/tree/main/tests/default/security.

Was thinking about tests. Yeah let me take a look. Thanks.

@zelinh zelinh force-pushed the security-create-user branch 2 times, most recently from 1e02a11 to 90e8a74 Compare January 28, 2025 21:23
@zelinh
Copy link
Member Author

zelinh commented Jan 28, 2025

@dblock After investigation, I think we already have such test to cover the 201 response here.

- path: /_plugins/_security/api/internalusers/{username}
method: PUT
parameters:
username: test
request:
payload:
opendistro_security_roles: []
backend_roles: []
attributes:
service: true
enabled: true
status: [201]

Such response might be missed in the spec file.

@zelinh
Copy link
Member Author

zelinh commented Jan 28, 2025

Updated the test cases for creating user repetitively to receive different response status.

@zelinh zelinh requested a review from dblock January 29, 2025 21:37
Signed-off-by: Zelin Hao <[email protected]>
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.

Looks good, one nit.

CHANGELOG.md Outdated
@@ -56,6 +56,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
- Added a warning for test file names that don't match the API being tested ([#793](https://github.com/opensearch-project/opensearch-api-specification/pull/793))
- Added `time` field to the `GetStats` schema in `_common.yml` ([#803](https://github.com/opensearch-project/opensearch-api-specification/pull/803))
- Added version for `POST /_plugins/_ml/_train/{algorithm_name}`, `_predict/{algorithm_name}/{model_id}`, and `_train_predict/{algorithm_name}` ([#763](https://github.com/opensearch-project/opensearch-api-specification/pull/763))
- Added `POST _plugins/_security/api/internalusers/{username}` response `201` [#810](https://github.com/opensearch-project/opensearch-api-specification/pull/810)
Copy link
Member

Choose a reason for hiding this comment

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

Match the format of other lines.

Suggested change
- Added `POST _plugins/_security/api/internalusers/{username}` response `201` [#810](https://github.com/opensearch-project/opensearch-api-specification/pull/810)
- Added `POST _plugins/_security/api/internalusers/{username}` response `201` ([#810](https://github.com/opensearch-project/opensearch-api-specification/pull/810))

Copy link
Member Author

Choose a reason for hiding this comment

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

Sure thanks! Just updated.

@dblock dblock merged commit b9dcb25 into opensearch-project:main Jan 31, 2025
30 checks passed
@zelinh zelinh deleted the security-create-user branch January 31, 2025 19:49
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.

[BUG] Security plugin create user response not found
2 participants