Skip to content

Commit

Permalink
Renames everything to match the API path
Browse files Browse the repository at this point in the history
Signed-off-by: Darshit Chanpura <[email protected]>
  • Loading branch information
DarshitChanpura committed Aug 12, 2024
1 parent 7e6bf0c commit 705e6cf
Show file tree
Hide file tree
Showing 28 changed files with 221 additions and 145 deletions.
11 changes: 11 additions & 0 deletions tests/default/security/api/_upgrade_check.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
$schema: ../../../../json_schemas/test_story.schema.yaml

description: Test _upgrade_check endpoint.
version: '> 2.13'

chapters:
- synopsis: Check whether an upgrade can be performed.
path: /_plugins/_security/api/_upgrade_check
method: GET
response:
status: 200
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
$schema: ../../../../json_schemas/test_story.schema.yaml

description: Test upgrade eligibility endpoints.
version: '>= 2.14'
description: Test _upgrade_perform endpoint.
version: '> 2.13'

chapters:
- synopsis: Check whether an upgrade can be performed.
path: /_plugins/_security/api/_upgrade_check
method: GET
response:
status: 200
- synopsis: Perform the upgrade.
path: /_plugins/_security/api/_upgrade_perform
method: POST
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
$schema: ../../../../json_schemas/test_story.schema.yaml

description: Test action_groups endpoints.
description: Test actiongroups endpoints.

chapters:
- synopsis: Create action group.
Expand Down
2 changes: 1 addition & 1 deletion tests/default/security/api/allowlist.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
$schema: ../../../../json_schemas/test_story.schema.yaml

description: Test allowlist endpoints.
version: '>2.0'
version: '> 2.0'

# ADMIN-CERT only. These tests require explicit rest api admin privileges.
chapters:
Expand Down
34 changes: 0 additions & 34 deletions tests/default/security/api/audit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,40 +3,6 @@ $schema: ../../../../json_schemas/test_story.schema.yaml
description: Test audit endpoints.

chapters:
- synopsis: Create an audit config.
path: /_plugins/_security/api/audit/config
method: PUT
request:
payload:
enabled: true
audit:
ignore_users: []
ignore_requests: []
disabled_rest_categories:
- AUTHENTICATED
- GRANTED_PRIVILEGES
disabled_transport_categories:
- AUTHENTICATED
- GRANTED_PRIVILEGES
log_request_body: false
resolve_indices: false
resolve_bulk_requests: false
exclude_sensitive_headers: true
enable_transport: false
enable_rest: true
compliance:
enabled: true
write_log_diffs: false
read_watched_fields: {}
read_ignore_users: []
write_watched_indices: []
write_ignore_users: []
read_metadata_only: true
write_metadata_only: true
external_config: false
internal_config: true
response:
status: 200
- synopsis: Get an audit config.
path: /_plugins/_security/api/audit
method: GET
Expand Down
39 changes: 39 additions & 0 deletions tests/default/security/api/audit/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
$schema: ../../../../../json_schemas/test_story.schema.yaml

description: Test audit/config endpoint.

chapters:
- synopsis: Create an audit config.
path: /_plugins/_security/api/audit/config
method: PUT
request:
payload:
enabled: true
audit:
ignore_users: []
ignore_requests: []
disabled_rest_categories:
- AUTHENTICATED
- GRANTED_PRIVILEGES
disabled_transport_categories:
- AUTHENTICATED
- GRANTED_PRIVILEGES
log_request_body: false
resolve_indices: false
resolve_bulk_requests: false
exclude_sensitive_headers: true
enable_transport: false
enable_rest: true
compliance:
enabled: true
write_log_diffs: false
read_watched_fields: {}
read_ignore_users: []
write_watched_indices: []
write_ignore_users: []
read_metadata_only: true
write_metadata_only: true
external_config: false
internal_config: true
response:
status: 200
10 changes: 10 additions & 0 deletions tests/default/security/api/authtoken.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
$schema: ../../../../json_schemas/test_story.schema.yaml

description: Test authtoken endpoint.

chapters:
- synopsis: Create an auth token.
path: /_plugins/_security/api/authtoken
method: POST
response:
status: 200
2 changes: 1 addition & 1 deletion tests/default/security/api/certificates.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
$schema: ../../../../json_schemas/test_story.schema.yaml

description: Test certificates endpoints.
version: '>= 2.15'
version: '> 2.14'

# ADMIN-CERT only. These tests require explicit rest api admin privileges.
chapters:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,11 @@
$schema: ../../../../json_schemas/test_story.schema.yaml

description: Test authtoken endpoints.
description: Test generateonbehalfoftoken endpoint.
version: '> 2.11'

chapters:
- synopsis: Create an auth token.
path: /_plugins/_security/api/authtoken
method: POST
response:
status: 200
- synopsis: Create an On-Behalf-Of token.
# Feature is disabled by default. https://opensearch.org/docs/latest/security/access-control/authentication-tokens/#configuration
version: '>= 2.12'
path: /_plugins/_security/api/generateonbehalfoftoken
method: POST
request:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
$schema: ../../../../json_schemas/test_story.schema.yaml

description: Test internal users endpoints.
description: Test internalusers endpoints.

chapters:
- synopsis: Get internal users bulk.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
$schema: ../../../../../json_schemas/test_story.schema.yaml

$schema: ../../../../json_schemas/test_story.schema.yaml

description: Test authtoken endpoints for user.
version: '>2.16' # Fixed via https://github.com/opensearch-project/security/pull/4628
description: Test internalusers/authtoken endpoint.
version: '> 2.16' # Fixed via https://github.com/opensearch-project/security/pull/4628

prologues:
- path: /_plugins/_security/api/internalusers/{username}
Expand All @@ -17,6 +16,7 @@ prologues:
service: true
enabled: true
status: [201]

chapters:
# Auth-tokens can only be vended for service accounts.
- synopsis: Create internal user token.
Expand All @@ -26,13 +26,7 @@ chapters:
username: test
response:
status: 200
- synopsis: Create user token.
path: /_plugins/_security/api/user/{username}/authtoken
method: POST
parameters:
username: test
response:
status: 501

epilogues:
- path: /_plugins/_security/api/internalusers/{username}
method: DELETE
Expand Down
3 changes: 1 addition & 2 deletions tests/default/security/api/nodesdn.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
$schema: ../../../../json_schemas/test_story.schema.yaml

description: Test nodesdn endpoints.

# ADMIN-CERT only. These tests require explicit rest api admin privileges.
# The setting `plugins. security. nodes_dn_dynamic_config_enabled` must be enabled.
description: Test nodesdn endpoints.

chapters:
- synopsis: Get distinguished names.
path: /_plugins/_security/api/nodesdn
Expand Down
41 changes: 2 additions & 39 deletions tests/default/security/api/securityconfig.yaml
Original file line number Diff line number Diff line change
@@ -1,47 +1,10 @@
$schema: ../../../../json_schemas/test_story.schema.yaml

# ADMIN-CERT only (except GET). These tests require explicit rest api admin privileges.

description: Test securityconfig endpoints.
version: '>=2.10'
version: '> 2.9'

# ADMIN-CERT only (except GET). These tests require explicit rest api admin privileges.
chapters:
- synopsis: Update a security config.
path: /_plugins/_security/api/securityconfig/config
method: PUT
request:
payload:
dynamic:
filtered_alias_mode: warn
disable_rest_auth: false
disable_intertransport_auth: false
respect_request_indices_options: false
opensearch-dashboards:
multitenancy_enabled: true
server_username: kibanaserver
index: .opensearch-dashboards
http:
anonymous_auth_enabled: false
authc:
basic_internal_auth_domain:
http_enabled: true
transport_enabled: true
order: 0
http_authenticator:
challenge: true
type: basic
config: {}
authentication_backend:
type: intern
config: {}
description: Authenticate via HTTP Basic against internal users database
auth_failure_listeners: {}
do_not_fail_on_forbidden: false
multi_rolespan_enabled: true
hosts_resolver_mode: ip-only
do_not_fail_on_forbidden_empty: false
response:
status: 403
- synopsis: Get a security config.
path: /_plugins/_security/api/securityconfig
method: GET
Expand Down
43 changes: 43 additions & 0 deletions tests/default/security/api/securityconfig/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
$schema: ../../../../../json_schemas/test_story.schema.yaml

description: Test securityconfig/config endpoint.
version: '>2.9'

# ADMIN-CERT only (except GET). These tests require explicit rest api admin privileges.
chapters:
- synopsis: Update a security config.
path: /_plugins/_security/api/securityconfig/config
method: PUT
request:
payload:
dynamic:
filtered_alias_mode: warn
disable_rest_auth: false
disable_intertransport_auth: false
respect_request_indices_options: false
opensearch-dashboards:
multitenancy_enabled: true
server_username: kibanaserver
index: .opensearch-dashboards
http:
anonymous_auth_enabled: false
authc:
basic_internal_auth_domain:
http_enabled: true
transport_enabled: true
order: 0
http_authenticator:
challenge: true
type: basic
config: {}
authentication_backend:
type: intern
config: {}
description: Authenticate via HTTP Basic against internal users database
auth_failure_listeners: {}
do_not_fail_on_forbidden: false
multi_rolespan_enabled: true
hosts_resolver_mode: ip-only
do_not_fail_on_forbidden_empty: false
response:
status: 403
12 changes: 12 additions & 0 deletions tests/default/security/api/ssl/certs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
$schema: ../../../../../json_schemas/test_story.schema.yaml

description: Test ssl/certs endpoint.
version: '>= 2.0'

# ADMIN-CERT only. These tests require explicit rest api admin privileges.
chapters:
- synopsis: Get ssl certificates.
path: /_plugins/_security/api/ssl/certs
method: GET
response:
status: 403
12 changes: 12 additions & 0 deletions tests/default/security/api/ssl/http/reloadcerts.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
$schema: ../../../../../../json_schemas/test_story.schema.yaml

description: Test ssl/http/reloadcerts endpoint.
version: '> 2.7'

# ADMIN-CERT only. These tests require explicit rest api admin privileges.
chapters:
- synopsis: Reload http certs.
path: /_plugins/_security/api/ssl/http/reloadcerts
method: PUT
response:
status: 403
12 changes: 12 additions & 0 deletions tests/default/security/api/ssl/transport/reloadcerts.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
$schema: ../../../../../../json_schemas/test_story.schema.yaml

description: Test ssl/transport/reloadcerts endpoint.
version: '> 2.7'

# ADMIN-CERT only. These tests require explicit rest api admin privileges.
chapters:
- synopsis: Reload transport certs.
path: /_plugins/_security/api/ssl/transport/reloadcerts
method: PUT
response:
status: 403
23 changes: 0 additions & 23 deletions tests/default/security/api/ssl_certs.yaml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
$schema: ../../../../json_schemas/test_story.schema.yaml
$schema: ../../../../../json_schemas/test_story.schema.yaml

description: Test tenancy config endpoint.
version: '>= 2.7'
description: Test tenancy/config endpoints.
version: '> 2.6'

chapters:
- synopsis: Get tenancy config.
Expand Down
Loading

0 comments on commit 705e6cf

Please sign in to comment.