Skip to content

Commit

Permalink
Added configuration API (#140)
Browse files Browse the repository at this point in the history
Signed-off-by: alen_abeshov <[email protected]>
  • Loading branch information
aabeshov committed Aug 14, 2023
1 parent df7f025 commit fb20015
Show file tree
Hide file tree
Showing 8 changed files with 170 additions and 0 deletions.
3 changes: 3 additions & 0 deletions model/opensearch.smithy
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@ service OpenSearch {
GetActionGroups,
GetAuditConfig,
GetCertificates,
GetConfiguration,
GetDistinguishedNames,
GetDistinguishedNamesWithClusterName,
GetScript,
Expand Down Expand Up @@ -361,6 +362,7 @@ service OpenSearch {
PatchActionGroup,
PatchActionGroups,
PatchAuditConfig,
PatchConfiguration,
PatchRole,
PatchRoles,
PatchTenant,
Expand Down Expand Up @@ -434,6 +436,7 @@ service OpenSearch {
UpdateAuditConfig,
UpdateByQuery,
UpdateByQueryRethrottle,
UpdateConfiguration,
UpdateDistinguishedNames,
]
}
28 changes: 28 additions & 0 deletions model/security/configuration.smithy
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// SPDX-License-Identifier: Apache-2.0
//
// The OpenSearch Contributors require contributions made to
// this file be licensed under the Apache-2.0 license or a
// compatible open source license.

$version: "2"
namespace OpenSearch

structure DynamicConfig {
dynamic: DynamicOptions
}

structure DynamicOptions {
filteredAliasMode: String,
disableRestAuth: Boolean,
disableIntertransportAuth: Boolean,
respectRequestIndicesOptions: Boolean,
kibana: Document,
http: Document,
authc: Document,
authz: Document,
authFailureListeners: Document,
doNotFailOnForbidden: Boolean,
multiRolespanEnabled: Boolean,
hostsResolverMode: String,
doNotFailOnForbiddenEmpty: Boolean
}
26 changes: 26 additions & 0 deletions model/security/get_configuration/operations.smithy
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// SPDX-License-Identifier: Apache-2.0
//
// The OpenSearch Contributors require contributions made to
// this file be licensed under the Apache-2.0 license or a
// compatible open source license.

$version: "2"
namespace OpenSearch
use opensearch.openapi#vendorExtensions

@externalDocumentation(
"API Reference": "https://opensearch.org/docs/2.7/security/access-control/api/#get-configuration"
)

@vendorExtensions(
"x-operation-group": "security.get_configuration",
"x-version-added": "1.0",
)
@readonly
@suppress(["HttpUriConflict", "HttpMethodSemantics.UnexpectedPayload"])
@http(method: "GET", uri: "/_plugins/_security/api/securityconfig")
@documentation("Returns the current Security plugin configuration in JSON format.")
operation GetConfiguration {
input: GetConfiguration_Input,
output: GetConfiguration_Output
}
18 changes: 18 additions & 0 deletions model/security/get_configuration/structures.smithy
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// SPDX-License-Identifier: Apache-2.0
//
// The OpenSearch Contributors require contributions made to
// this file be licensed under the Apache-2.0 license or a
// compatible open source license.

$version: "2"
namespace OpenSearch

@input
structure GetConfiguration_Input{
}

@output
structure GetConfiguration_Output {
@httpPayload
content: DynamicConfig
}
26 changes: 26 additions & 0 deletions model/security/patch_configuration/operations.smithy
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// SPDX-License-Identifier: Apache-2.0
//
// The OpenSearch Contributors require contributions made to
// this file be licensed under the Apache-2.0 license or a
// compatible open source license.

$version: "2"
namespace OpenSearch
use opensearch.openapi#vendorExtensions

@externalDocumentation(
"API Reference": "https://opensearch.org/docs/2.7/security/access-control/api/#patch-configuration"
)

@vendorExtensions(
"x-operation-group": "security.patch_configuration",
"x-version-added": "1.0",
)
@idempotent
@suppress(["HttpUriConflict"])
@http(method: "PATCH", uri: "/_plugins/_security/api/securityconfig")
@documentation("A PATCH call is used to update the existing configuration using the REST API.")
operation PatchConfiguration {
input: PatchConfiguration_Input,
output: PatchConfiguration_Output
}
21 changes: 21 additions & 0 deletions model/security/patch_configuration/structures.smithy
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// SPDX-License-Identifier: Apache-2.0
//
// The OpenSearch Contributors require contributions made to
// this file be licensed under the Apache-2.0 license or a
// compatible open source license.

$version: "2"
namespace OpenSearch

@input
structure PatchConfiguration_Input {
@required
@httpPayload
content: PatchOperationList
}

@output
structure PatchConfiguration_Output {
status: MessageStatus,
message: Message
}
27 changes: 27 additions & 0 deletions model/security/update_configuration/operations.smithy
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@

// SPDX-License-Identifier: Apache-2.0
//
// The OpenSearch Contributors require contributions made to
// this file be licensed under the Apache-2.0 license or a
// compatible open source license.

$version: "2"
namespace OpenSearch
use opensearch.openapi#vendorExtensions

@externalDocumentation(
"API Reference": "https://opensearch.org/docs/2.7/security/access-control/api/#update-configuration"
)

@vendorExtensions(
"x-operation-group": "security.update_configuration",
"x-version-added": "1.0",
)
@idempotent
@suppress(["HttpUriConflict"])
@http(method: "PUT", uri: "/_plugins/_security/api/securityconfig/config")
@documentation("Adds or updates the existing configuration using the REST API.")
operation UpdateConfiguration {
input: UpdateConfiguration_Input,
output: UpdateConfiguration_Output
}
21 changes: 21 additions & 0 deletions model/security/update_configuration/structures.smithy
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// SPDX-License-Identifier: Apache-2.0
//
// The OpenSearch Contributors require contributions made to
// this file be licensed under the Apache-2.0 license or a
// compatible open source license.

$version: "2"
namespace OpenSearch

@input
structure UpdateConfiguration_Input{
@required
@httpPayload
content: DynamicConfig
}

@output
structure UpdateConfiguration_Output {
status: MessageStatus,
message: Message
}

0 comments on commit fb20015

Please sign in to comment.