Move security api from plugins to clients (#442)

* fix(security): move security api from plugins to clients

Signed-off-by: florian <[email protected]>

* chore(CHANGELOG): update CHANGELOG for the PR#442

Signed-off-by: florian <[email protected]>

---------

Signed-off-by: florian <[email protected]>
This commit is contained in:
florianvazelle
2023-07-21 13:07:20 -04:00
committed by GitHub
parent 4dba35deea
commit 5dc51d4b7f
17 changed files with 17 additions and 15 deletions
+4 -1
View File
@@ -39,6 +39,7 @@ from .ingest import IngestClient
from .nodes import NodesClient
from .plugins import PluginsClient
from .remote import RemoteClient
from .security import SecurityClient
from .snapshot import SnapshotClient
from .tasks import TasksClient
from .utils import SKIP_IN_PATH, _bulk_body, _make_path, _normalize_hosts, query_params
@@ -196,12 +197,14 @@ class AsyncOpenSearch(object):
self.ingest = IngestClient(self)
self.nodes = NodesClient(self)
self.remote = RemoteClient(self)
self.security = SecurityClient(self)
self.snapshot = SnapshotClient(self)
self.tasks = TasksClient(self)
self.plugins = PluginsClient(self)
self.features = FeaturesClient(self)
self.plugins = PluginsClient(self)
def __repr__(self):
try:
# get a list of all connections
+2
View File
@@ -39,6 +39,7 @@ from .indices import IndicesClient
from .ingest import IngestClient
from .nodes import NodesClient
from .remote import RemoteClient
from .security import SecurityClient
from .snapshot import SnapshotClient
from .tasks import TasksClient
@@ -54,6 +55,7 @@ class AsyncOpenSearch(object):
ingest: IngestClient
nodes: NodesClient
remote: RemoteClient
security: SecurityClient
snapshot: SnapshotClient
tasks: TasksClient
def __init__(
-3
View File
@@ -11,7 +11,6 @@ import warnings
from ..plugins.alerting import AlertingClient
from ..plugins.index_management import IndexManagementClient
from ..plugins.security import SecurityClient
from .utils import NamespacedClient
@@ -25,7 +24,6 @@ class PluginsClient(NamespacedClient):
# self.anomaly_detection = AnomalyDetectionClient(client)
# self.trace_analytics = TraceAnalyticsClient(client)
self.index_management = IndexManagementClient(client)
self.security = SecurityClient(client)
self._dynamic_lookup(client)
@@ -40,7 +38,6 @@ class PluginsClient(NamespacedClient):
# "anomaly_detection",
# "trace_analytics",
"index_management",
"security",
]
for plugin in plugins:
if not hasattr(client, plugin):
-1
View File
@@ -15,5 +15,4 @@ from .utils import NamespacedClient as NamespacedClient
class PluginsClient(NamespacedClient):
alerting: Any
index_management: Any
security: Any
def __init__(self, client: AsyncOpenSearch) -> None: ...
+2
View File
@@ -40,6 +40,7 @@ from .ingest import IngestClient
from .nodes import NodesClient
from .plugins import PluginsClient
from .remote import RemoteClient
from .security import SecurityClient
from .snapshot import SnapshotClient
from .tasks import TasksClient
from .utils import SKIP_IN_PATH, _bulk_body, _make_path, _normalize_hosts, query_params
@@ -197,6 +198,7 @@ class OpenSearch(object):
self.ingest = IngestClient(self)
self.nodes = NodesClient(self)
self.remote = RemoteClient(self)
self.security = SecurityClient(self)
self.snapshot = SnapshotClient(self)
self.tasks = TasksClient(self)
+2
View File
@@ -39,6 +39,7 @@ from .indices import IndicesClient
from .ingest import IngestClient
from .nodes import NodesClient
from .remote import RemoteClient
from .security import SecurityClient
from .snapshot import SnapshotClient
from .tasks import TasksClient
@@ -54,6 +55,7 @@ class OpenSearch(object):
ingest: IngestClient
nodes: NodesClient
remote: RemoteClient
security: SecurityClient
snapshot: SnapshotClient
tasks: TasksClient
def __init__(
-3
View File
@@ -12,7 +12,6 @@ import warnings
from ..plugins.alerting import AlertingClient
from ..plugins.index_management import IndexManagementClient
from ..plugins.security import SecurityClient
from .utils import NamespacedClient
@@ -26,7 +25,6 @@ class PluginsClient(NamespacedClient):
# self.anomaly_detection = AnomalyDetectionClient(client)
# self.trace_analytics = TraceAnalyticsClient(client)
self.index_management = IndexManagementClient(client)
self.security = SecurityClient(client)
self._dynamic_lookup(client)
@@ -41,7 +39,6 @@ class PluginsClient(NamespacedClient):
# "anomaly_detection",
# "trace_analytics",
"index_management",
"security",
]
for plugin in plugins:
if not hasattr(client, plugin):
-1
View File
@@ -15,5 +15,4 @@ from .utils import NamespacedClient as NamespacedClient
class PluginsClient(NamespacedClient):
alerting: Any
index_management: Any
security: Any
def __init__(self, client: OpenSearch) -> None: ...