Skip to content

Add security create user 201 response to OpenAPI spec#810

Merged
dblock merged 4 commits intoopensearch-project:mainfrom
zelinh:security-create-user
Jan 31, 2025
Merged

Add security create user 201 response to OpenAPI spec#810
dblock merged 4 commits intoopensearch-project:mainfrom
zelinh:security-create-user

Conversation

@zelinh
Copy link
Copy Markdown
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.

Signed-off-by: Zelin Hao <zelinhao@amazon.com>
@github-actions
Copy link
Copy Markdown
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

@github-actions
Copy link
Copy Markdown
Contributor

Spec Test Coverage Analysis

Total Tested
594 593 (99.83 %)

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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.

Signed-off-by: Zelin Hao <zelinhao@amazon.com>
@zelinh
Copy link
Copy Markdown
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 <zelinhao@amazon.com>
Copy link
Copy Markdown
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
- 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
Copy Markdown
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
Copy Markdown
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.

Signed-off-by: Zelin Hao <zelinhao@amazon.com>
@dblock dblock merged commit b9dcb25 into opensearch-project:main Jan 31, 2025
@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