Skip to content

Commit

Permalink
feat: connect service account
Browse files Browse the repository at this point in the history
  • Loading branch information
doctrino committed Dec 12, 2024
1 parent 6f76aa4 commit 6a9d95c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
1 change: 1 addition & 0 deletions cognite/client/_api/iam.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ def __init__(self, config: ClientConfig, api_version: str | None, cognite_client
self.user_profiles = UserProfilesAPI(config, api_version, cognite_client)
# TokenAPI only uses base_url, so we pass `api_version=None`:
self.token = TokenAPI(config, api_version=None, cognite_client=cognite_client)
self.service_accounts = ServiceAccountsAPI(config, api_version, cognite_client)

@staticmethod
def compare_capabilities(
Expand Down
12 changes: 11 additions & 1 deletion cognite/client/testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,15 @@
from cognite.client._api.hosted_extractors.jobs import JobsAPI
from cognite.client._api.hosted_extractors.mappings import MappingsAPI
from cognite.client._api.hosted_extractors.sources import SourcesAPI
from cognite.client._api.iam import IAMAPI, GroupsAPI, SecurityCategoriesAPI, SessionsAPI, TokenAPI
from cognite.client._api.iam import (
IAMAPI,
GroupsAPI,
SecurityCategoriesAPI,
ServiceAccountsAPI,
ServiceAccountSecretsAPI,
SessionsAPI,
TokenAPI,
)
from cognite.client._api.labels import LabelsAPI
from cognite.client._api.postgres_gateway import PostgresGatewaysAPI
from cognite.client._api.postgres_gateway.tables import TablesAPI as PostgresTablesAPI
Expand Down Expand Up @@ -129,6 +137,8 @@ def __init__(self, *args: Any, **kwargs: Any) -> None:
self.iam = MagicMock(spec=IAMAPI)
self.iam.groups = MagicMock(spec_set=GroupsAPI)
self.iam.security_categories = MagicMock(spec_set=SecurityCategoriesAPI)
self.iam.service_accounts = MagicMock(spec=ServiceAccountsAPI)
self.iam.service_accounts.secrets = MagicMock(spec_set=ServiceAccountSecretsAPI)
self.iam.sessions = MagicMock(spec_set=SessionsAPI)
self.iam.user_profiles = MagicMock(spec_set=UserProfilesAPI)
self.iam.token = MagicMock(spec_set=TokenAPI)
Expand Down

0 comments on commit 6a9d95c

Please sign in to comment.