tinybird-cli 3.7.1.dev1__tar.gz → 3.7.1.dev2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. {tinybird-cli-3.7.1.dev1 → tinybird-cli-3.7.1.dev2}/PKG-INFO +12 -1
  2. {tinybird-cli-3.7.1.dev1 → tinybird-cli-3.7.1.dev2}/tinybird/__cli__.py +2 -2
  3. {tinybird-cli-3.7.1.dev1 → tinybird-cli-3.7.1.dev2}/tinybird/datafile.py +3 -2
  4. {tinybird-cli-3.7.1.dev1 → tinybird-cli-3.7.1.dev2}/tinybird/tb_cli_modules/connection.py +82 -13
  5. {tinybird-cli-3.7.1.dev1 → tinybird-cli-3.7.1.dev2}/tinybird_cli.egg-info/PKG-INFO +12 -1
  6. {tinybird-cli-3.7.1.dev1 → tinybird-cli-3.7.1.dev2}/tinybird_cli.egg-info/SOURCES.txt +0 -2
  7. {tinybird-cli-3.7.1.dev1 → tinybird-cli-3.7.1.dev2}/tinybird_cli.egg-info/requires.txt +1 -1
  8. tinybird-cli-3.7.1.dev1/tinybird/connector_settings.py +0 -239
  9. tinybird-cli-3.7.1.dev1/tinybird/data_connectors/credentials.py +0 -31
  10. {tinybird-cli-3.7.1.dev1 → tinybird-cli-3.7.1.dev2}/setup.cfg +0 -0
  11. {tinybird-cli-3.7.1.dev1 → tinybird-cli-3.7.1.dev2}/tinybird/ch_utils/constants.py +0 -0
  12. {tinybird-cli-3.7.1.dev1 → tinybird-cli-3.7.1.dev2}/tinybird/ch_utils/engine.py +0 -0
  13. {tinybird-cli-3.7.1.dev1 → tinybird-cli-3.7.1.dev2}/tinybird/check_pypi.py +0 -0
  14. {tinybird-cli-3.7.1.dev1 → tinybird-cli-3.7.1.dev2}/tinybird/client.py +0 -0
  15. {tinybird-cli-3.7.1.dev1 → tinybird-cli-3.7.1.dev2}/tinybird/config.py +0 -0
  16. {tinybird-cli-3.7.1.dev1 → tinybird-cli-3.7.1.dev2}/tinybird/connectors.py +0 -0
  17. {tinybird-cli-3.7.1.dev1 → tinybird-cli-3.7.1.dev2}/tinybird/context.py +0 -0
  18. {tinybird-cli-3.7.1.dev1 → tinybird-cli-3.7.1.dev2}/tinybird/datatypes.py +0 -0
  19. {tinybird-cli-3.7.1.dev1 → tinybird-cli-3.7.1.dev2}/tinybird/feedback_manager.py +0 -0
  20. {tinybird-cli-3.7.1.dev1 → tinybird-cli-3.7.1.dev2}/tinybird/git_settings.py +0 -0
  21. {tinybird-cli-3.7.1.dev1 → tinybird-cli-3.7.1.dev2}/tinybird/sql.py +0 -0
  22. {tinybird-cli-3.7.1.dev1 → tinybird-cli-3.7.1.dev2}/tinybird/sql_template.py +0 -0
  23. {tinybird-cli-3.7.1.dev1 → tinybird-cli-3.7.1.dev2}/tinybird/sql_template_fmt.py +0 -0
  24. {tinybird-cli-3.7.1.dev1 → tinybird-cli-3.7.1.dev2}/tinybird/sql_toolset.py +0 -0
  25. {tinybird-cli-3.7.1.dev1 → tinybird-cli-3.7.1.dev2}/tinybird/syncasync.py +0 -0
  26. {tinybird-cli-3.7.1.dev1 → tinybird-cli-3.7.1.dev2}/tinybird/tb_cli.py +0 -0
  27. {tinybird-cli-3.7.1.dev1 → tinybird-cli-3.7.1.dev2}/tinybird/tb_cli_modules/auth.py +0 -0
  28. {tinybird-cli-3.7.1.dev1 → tinybird-cli-3.7.1.dev2}/tinybird/tb_cli_modules/branch.py +0 -0
  29. {tinybird-cli-3.7.1.dev1 → tinybird-cli-3.7.1.dev2}/tinybird/tb_cli_modules/cicd.py +0 -0
  30. {tinybird-cli-3.7.1.dev1 → tinybird-cli-3.7.1.dev2}/tinybird/tb_cli_modules/cli.py +0 -0
  31. {tinybird-cli-3.7.1.dev1 → tinybird-cli-3.7.1.dev2}/tinybird/tb_cli_modules/common.py +0 -0
  32. {tinybird-cli-3.7.1.dev1 → tinybird-cli-3.7.1.dev2}/tinybird/tb_cli_modules/config.py +0 -0
  33. {tinybird-cli-3.7.1.dev1 → tinybird-cli-3.7.1.dev2}/tinybird/tb_cli_modules/datasource.py +0 -0
  34. {tinybird-cli-3.7.1.dev1 → tinybird-cli-3.7.1.dev2}/tinybird/tb_cli_modules/exceptions.py +0 -0
  35. {tinybird-cli-3.7.1.dev1 → tinybird-cli-3.7.1.dev2}/tinybird/tb_cli_modules/job.py +0 -0
  36. {tinybird-cli-3.7.1.dev1 → tinybird-cli-3.7.1.dev2}/tinybird/tb_cli_modules/pipe.py +0 -0
  37. {tinybird-cli-3.7.1.dev1 → tinybird-cli-3.7.1.dev2}/tinybird/tb_cli_modules/regions.py +0 -0
  38. {tinybird-cli-3.7.1.dev1 → tinybird-cli-3.7.1.dev2}/tinybird/tb_cli_modules/telemetry.py +0 -0
  39. {tinybird-cli-3.7.1.dev1 → tinybird-cli-3.7.1.dev2}/tinybird/tb_cli_modules/test.py +0 -0
  40. {tinybird-cli-3.7.1.dev1 → tinybird-cli-3.7.1.dev2}/tinybird/tb_cli_modules/tinyunit/tinyunit.py +0 -0
  41. {tinybird-cli-3.7.1.dev1 → tinybird-cli-3.7.1.dev2}/tinybird/tb_cli_modules/tinyunit/tinyunit_lib.py +0 -0
  42. {tinybird-cli-3.7.1.dev1 → tinybird-cli-3.7.1.dev2}/tinybird/tb_cli_modules/token.py +0 -0
  43. {tinybird-cli-3.7.1.dev1 → tinybird-cli-3.7.1.dev2}/tinybird/tb_cli_modules/workspace.py +0 -0
  44. {tinybird-cli-3.7.1.dev1 → tinybird-cli-3.7.1.dev2}/tinybird/tb_cli_modules/workspace_members.py +0 -0
  45. {tinybird-cli-3.7.1.dev1 → tinybird-cli-3.7.1.dev2}/tinybird/tornado_template.py +0 -0
  46. {tinybird-cli-3.7.1.dev1 → tinybird-cli-3.7.1.dev2}/tinybird_cli.egg-info/dependency_links.txt +0 -0
  47. {tinybird-cli-3.7.1.dev1 → tinybird-cli-3.7.1.dev2}/tinybird_cli.egg-info/entry_points.txt +0 -0
  48. {tinybird-cli-3.7.1.dev1 → tinybird-cli-3.7.1.dev2}/tinybird_cli.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: tinybird-cli
3
- Version: 3.7.1.dev1
3
+ Version: 3.7.1.dev2
4
4
  Summary: Tinybird Command Line Tool
5
5
  Home-page: https://www.tinybird.co/docs/cli/introduction.html
6
6
  Author: Tinybird
@@ -19,6 +19,17 @@ Changelog
19
19
 
20
20
  ---------
21
21
 
22
+ 3.7.1.dev2
23
+ ************
24
+
25
+ - `Changed` Upgrade clickhouse-toolset to 0.30dev0
26
+ - `Added` Support for S3IAM role for ingest
27
+
28
+ 3.7.1.dev1
29
+ ************
30
+
31
+ - `Changed` Decouple cli from connector_settings module
32
+
22
33
  3.7.0
23
34
  ************
24
35
 
@@ -4,5 +4,5 @@ __description__ = 'Tinybird Command Line Tool'
4
4
  __url__ = 'https://www.tinybird.co/docs/cli/introduction.html'
5
5
  __author__ = 'Tinybird'
6
6
  __author_email__ = 'support@tinybird.co'
7
- __version__ = '3.7.1.dev1'
8
- __revision__ = 'f5f887d'
7
+ __version__ = '3.7.1.dev2'
8
+ __revision__ = '7afe9ab'
@@ -120,7 +120,7 @@ class CopyParameters:
120
120
  COPY_SCHEDULE = "copy_schedule"
121
121
 
122
122
 
123
- PREVIEW_CONNECTOR_SERVICES = ["s3", "gcs"]
123
+ PREVIEW_CONNECTOR_SERVICES = ["s3", "s3_iamrole", "gcs"]
124
124
 
125
125
  ON_DEMAND = "@on-demand"
126
126
 
@@ -1401,7 +1401,7 @@ async def process_file(
1401
1401
  params.update(get_engine_params(node))
1402
1402
 
1403
1403
  if "import_service" in node or "import_connection_name" in node:
1404
- VALID_SERVICES: Tuple[str, ...] = ("bigquery", "snowflake", "s3", "gcs")
1404
+ VALID_SERVICES: Tuple[str, ...] = ("bigquery", "snowflake", "s3", "s3_iamrole", "gcs")
1405
1405
 
1406
1406
  import_params = await get_import_params(params, node)
1407
1407
 
@@ -3106,6 +3106,7 @@ async def new_ds(
3106
3106
  "bigquery": ["service", "cron", "external_data_source"],
3107
3107
  "snowflake": ["connector", "service", "cron", "external_data_source"],
3108
3108
  "s3": ["connector", "service", "cron", "bucket_uri"],
3109
+ "s3_iamrole": ["connector", "service", "cron", "bucket_uri"],
3109
3110
  "gcs": ["connector", "service", "cron", "bucket_uri"],
3110
3111
  }.get(service, [])
3111
3112
 
@@ -6,21 +6,16 @@
6
6
  import json
7
7
  import os
8
8
  import sys
9
+ from enum import Enum
9
10
  from os import getcwd
10
11
  from pathlib import Path
11
- from typing import Any, Dict, Optional
12
+ from typing import Any, Dict, List, Optional
12
13
 
13
14
  import click
14
15
  import pyperclip
15
16
  from click import Context
16
17
 
17
18
  from tinybird.client import DoesNotExistException, TinyB
18
- from tinybird.connector_settings import (
19
- CLI_EXCLUDED_SETTINGS,
20
- DATA_CONNECTOR_SETTINGS,
21
- DataConnectors,
22
- DataSensitiveSettings,
23
- )
24
19
  from tinybird.feedback_manager import FeedbackManager
25
20
  from tinybird.tb_cli_modules.cli import cli
26
21
  from tinybird.tb_cli_modules.common import (
@@ -40,6 +35,82 @@ from tinybird.tb_cli_modules.exceptions import CLIConnectionException
40
35
  from tinybird.tb_cli_modules.telemetry import is_ci_environment
41
36
 
42
37
 
38
+ class DataConnectorType(str, Enum):
39
+ KAFKA = "kafka"
40
+ GCLOUD_SCHEDULER = "gcscheduler"
41
+ SNOWFLAKE = "snowflake"
42
+ BIGQUERY = "bigquery"
43
+ GCLOUD_STORAGE = "gcs"
44
+ GCLOUD_STORAGE_HMAC = "gcs_hmac"
45
+ GCLOUD_STORAGE_SA = "gcs_service_account"
46
+ AMAZON_S3 = "s3"
47
+ AMAZON_S3_IAMROLE = "s3_iamrole"
48
+
49
+ def __str__(self) -> str:
50
+ return self.value
51
+
52
+
53
+ DATA_CONNECTOR_SETTINGS: Dict[DataConnectorType, List[str]] = {
54
+ DataConnectorType.KAFKA: [
55
+ "kafka_bootstrap_servers",
56
+ "kafka_sasl_plain_username",
57
+ "kafka_sasl_plain_password",
58
+ "cli_version",
59
+ "endpoint",
60
+ "kafka_security_protocol",
61
+ "kafka_sasl_mechanism",
62
+ "kafka_schema_registry_url",
63
+ ],
64
+ DataConnectorType.GCLOUD_SCHEDULER: ["gcscheduler_region"],
65
+ DataConnectorType.SNOWFLAKE: [
66
+ "account",
67
+ "username",
68
+ "password",
69
+ "role",
70
+ "warehouse",
71
+ "warehouse_size",
72
+ "stage",
73
+ "integration",
74
+ ],
75
+ DataConnectorType.BIGQUERY: ["account"],
76
+ DataConnectorType.GCLOUD_STORAGE: [
77
+ "gcs_private_key_id",
78
+ "gcs_client_x509_cert_url",
79
+ "gcs_project_id",
80
+ "gcs_client_id",
81
+ "gcs_client_email",
82
+ "gcs_private_key",
83
+ ],
84
+ DataConnectorType.GCLOUD_STORAGE_HMAC: [
85
+ "gcs_hmac_access_id",
86
+ "gcs_hmac_secret",
87
+ ],
88
+ DataConnectorType.GCLOUD_STORAGE_SA: ["account_email"],
89
+ DataConnectorType.AMAZON_S3: [
90
+ "s3_access_key_id",
91
+ "s3_secret_access_key",
92
+ "s3_region",
93
+ ],
94
+ DataConnectorType.AMAZON_S3_IAMROLE: [
95
+ "s3_iamrole_arn",
96
+ "s3_iamrole_region",
97
+ "s3_iamrole_external_id",
98
+ ],
99
+ }
100
+
101
+ SENSITIVE_CONNECTOR_SETTINGS = {
102
+ DataConnectorType.KAFKA: ["kafka_sasl_plain_password"],
103
+ DataConnectorType.GCLOUD_SCHEDULER: [
104
+ "gcscheduler_target_url",
105
+ "gcscheduler_job_name",
106
+ "gcscheduler_region",
107
+ ],
108
+ DataConnectorType.GCLOUD_STORAGE_HMAC: ["gcs_hmac_secret"],
109
+ DataConnectorType.AMAZON_S3: ["s3_secret_access_key"],
110
+ DataConnectorType.AMAZON_S3_IAMROLE: ["s3_iamrole_arn"],
111
+ }
112
+
113
+
43
114
  @cli.group()
44
115
  @click.pass_context
45
116
  def connection(ctx: Context) -> None:
@@ -348,7 +419,7 @@ async def connection_rm(ctx: Context, connection_id: str, force: bool) -> None:
348
419
  @click.option("--connector", help="Filter by connector")
349
420
  @click.pass_context
350
421
  @coro
351
- async def connection_ls(ctx: Context, connector: Optional[DataConnectors] = None) -> None:
422
+ async def connection_ls(ctx: Context, connector: Optional[DataConnectorType] = None) -> None:
352
423
  """List connections."""
353
424
  obj: Dict[str, Any] = ctx.ensure_object(dict)
354
425
  client: TinyB = obj["client"]
@@ -363,12 +434,10 @@ async def connection_ls(ctx: Context, connector: Optional[DataConnectors] = None
363
434
  sensitive_settings = []
364
435
  columns = ["service", "name", "id", "connected_datasources"]
365
436
  else:
366
- sensitive_settings = getattr(DataSensitiveSettings, connector)
437
+ sensitive_settings = SENSITIVE_CONNECTOR_SETTINGS.get(connector, [])
367
438
  columns = ["service", "name", "id", "connected_datasources"]
368
439
  if connector_settings := DATA_CONNECTOR_SETTINGS.get(connector):
369
- settings = connector_settings.model_fields.keys()
370
- excluded_settings = CLI_EXCLUDED_SETTINGS.get(connector, [])
371
- columns += [key.replace("tb_", "") for key in settings if key not in excluded_settings]
440
+ columns += connector_settings
372
441
 
373
442
  for connection in connections:
374
443
  row = [_get_setting_value(connection, setting, sensitive_settings) for setting in columns]
@@ -727,7 +796,7 @@ async def connection_create_s3_iamrole(
727
796
  async def create_connection(connection_name, role_arn, region) -> None:
728
797
  conn_file_name = f"{connection_name}.connection"
729
798
  conn_file_path = Path(getcwd(), conn_file_name)
730
- service = DataConnectors.AMAZON_S3_IAMROLE
799
+ service = DataConnectorType.AMAZON_S3_IAMROLE
731
800
 
732
801
  if os.path.isfile(conn_file_path):
733
802
  raise CLIConnectionException(FeedbackManager.error_connection_file_already_exists(name=conn_file_name))
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: tinybird-cli
3
- Version: 3.7.1.dev1
3
+ Version: 3.7.1.dev2
4
4
  Summary: Tinybird Command Line Tool
5
5
  Home-page: https://www.tinybird.co/docs/cli/introduction.html
6
6
  Author: Tinybird
@@ -19,6 +19,17 @@ Changelog
19
19
 
20
20
  ---------
21
21
 
22
+ 3.7.1.dev2
23
+ ************
24
+
25
+ - `Changed` Upgrade clickhouse-toolset to 0.30dev0
26
+ - `Added` Support for S3IAM role for ingest
27
+
28
+ 3.7.1.dev1
29
+ ************
30
+
31
+ - `Changed` Decouple cli from connector_settings module
32
+
22
33
  3.7.0
23
34
  ************
24
35
 
@@ -2,7 +2,6 @@ tinybird/__cli__.py
2
2
  tinybird/check_pypi.py
3
3
  tinybird/client.py
4
4
  tinybird/config.py
5
- tinybird/connector_settings.py
6
5
  tinybird/connectors.py
7
6
  tinybird/context.py
8
7
  tinybird/datafile.py
@@ -18,7 +17,6 @@ tinybird/tb_cli.py
18
17
  tinybird/tornado_template.py
19
18
  tinybird/ch_utils/constants.py
20
19
  tinybird/ch_utils/engine.py
21
- tinybird/data_connectors/credentials.py
22
20
  tinybird/tb_cli_modules/auth.py
23
21
  tinybird/tb_cli_modules/branch.py
24
22
  tinybird/tb_cli_modules/cicd.py
@@ -1,5 +1,5 @@
1
1
  click<8.2,>=8.1.6
2
- clickhouse-toolset==0.29.dev0
2
+ clickhouse-toolset==0.30.dev0
3
3
  colorama==0.4.6
4
4
  cryptography>=3.4.8
5
5
  croniter==1.3.8
@@ -1,239 +0,0 @@
1
- from __future__ import annotations
2
-
3
- from enum import Enum
4
- from typing import List, Optional, Union
5
-
6
- from pydantic import BaseModel
7
-
8
- from tinybird.data_connectors.credentials import (
9
- GCSConnectorCredentials,
10
- GCSServiceAccountCredentials,
11
- IAMRoleAWSCredentials,
12
- S3ConnectorCredentials,
13
- )
14
-
15
- GCS_BASE_URL = "https://storage.googleapis.com"
16
-
17
-
18
- class DataConnectorType(str, Enum):
19
- KAFKA = "kafka"
20
- GCLOUD_SCHEDULER = "gcscheduler"
21
- SNOWFLAKE = "snowflake"
22
- BIGQUERY = "bigquery"
23
- GCLOUD_STORAGE = "gcs"
24
- GCLOUD_STORAGE_HMAC = "gcs_hmac"
25
- GCLOUD_STORAGE_SA = "gcs_service_account"
26
- AMAZON_S3 = "s3"
27
- AMAZON_S3_IAMROLE = "s3_iamrole"
28
-
29
- def __str__(self) -> str:
30
- return self.value
31
-
32
-
33
- DataConnectors = DataConnectorType # this is just to make picking happy
34
-
35
-
36
- class DataConnectorSetting(BaseModel):
37
- def get_region(self) -> str:
38
- return "unknown"
39
-
40
- def get_provider_name(self) -> str:
41
- return "unknown"
42
-
43
-
44
- class KafkaConnectorSetting(DataConnectorSetting):
45
- kafka_bootstrap_servers: str
46
- kafka_sasl_plain_username: str
47
- kafka_sasl_plain_password: str
48
- cli_version: Optional[str] = None
49
- tb_endpoint: Optional[str] = None
50
- kafka_security_protocol: Optional[str] = None
51
- kafka_sasl_mechanism: Optional[str] = None
52
- kafka_schema_registry_url: Optional[str] = None
53
-
54
-
55
- class S3ConnectorSetting(DataConnectorSetting):
56
- s3_access_key_id: str
57
- s3_secret_access_key: str
58
- s3_region: str
59
- endpoint_url: Optional[str] = None
60
-
61
- @property
62
- def credentials(self) -> S3ConnectorCredentials:
63
- return S3ConnectorCredentials(
64
- access_key_id=self.s3_access_key_id,
65
- secret_access_key=self.s3_secret_access_key,
66
- region=self.s3_region,
67
- )
68
-
69
- def get_provider_name(self) -> str:
70
- return DataConnectorType.AMAZON_S3
71
-
72
- def get_region(self) -> str:
73
- return self.s3_region
74
-
75
-
76
- class S3IAMConnectorSetting(DataConnectorSetting):
77
- s3_iamrole_arn: str
78
- s3_iamrole_region: str
79
- s3_iamrole_external_id: str
80
- endpoint_url: Optional[str] = None
81
-
82
- @property
83
- def credentials(self) -> IAMRoleAWSCredentials:
84
- return IAMRoleAWSCredentials(
85
- role_arn=self.s3_iamrole_arn,
86
- external_id=self.s3_iamrole_external_id,
87
- region=self.s3_iamrole_region,
88
- )
89
-
90
- def get_provider_name(self) -> str:
91
- return DataConnectorType.AMAZON_S3
92
-
93
- def get_region(self) -> str:
94
- return self.s3_iamrole_region
95
-
96
-
97
- class SnowflakeConnectorSetting(DataConnectorSetting):
98
- account: str
99
- username: str
100
- password: str
101
- role: str
102
- warehouse: str
103
- warehouse_size: Optional[str] = None
104
- stage: Optional[str] = None
105
- integration: Optional[str] = None
106
-
107
-
108
- class GCSchedulerConnectorSetting(DataConnectorSetting):
109
- gcscheduler_region: Optional[str] = None
110
-
111
-
112
- class BigQueryConnectorSetting(DataConnectorSetting):
113
- account: Optional[str] = None
114
-
115
-
116
- class GCSServiceAccountConnectorSetting(DataConnectorSetting):
117
- account_email: str
118
- endpoint_url: str = GCS_BASE_URL
119
-
120
- @property
121
- def credentials(self) -> GCSServiceAccountCredentials:
122
- return GCSServiceAccountCredentials(account_email=self.account_email)
123
-
124
- def get_provider_name(self) -> str:
125
- return DataConnectorType.GCLOUD_STORAGE
126
-
127
-
128
- class GCSHmacConnectorSetting(DataConnectorSetting):
129
- gcs_hmac_access_id: str
130
- gcs_hmac_secret: str
131
- endpoint_url: str = GCS_BASE_URL
132
-
133
- @property
134
- def credentials(self) -> GCSConnectorCredentials:
135
- return GCSConnectorCredentials(
136
- access_key_id=self.gcs_hmac_access_id,
137
- secret_access_key=self.gcs_hmac_secret,
138
- )
139
-
140
- def get_provider_name(self) -> str:
141
- return DataConnectorType.GCLOUD_STORAGE
142
-
143
-
144
- class GCSConnectorSetting(DataConnectorSetting):
145
- gcs_private_key_id: str
146
- gcs_client_x509_cert_url: str
147
- gcs_project_id: str
148
- gcs_client_id: str
149
- gcs_client_email: str
150
- gcs_private_key: str
151
-
152
-
153
- DATA_CONNECTOR_SETTINGS: dict[DataConnectors, type[DataConnectorSetting]] = {
154
- DataConnectors.KAFKA: KafkaConnectorSetting,
155
- DataConnectors.GCLOUD_SCHEDULER: GCSchedulerConnectorSetting,
156
- DataConnectors.SNOWFLAKE: SnowflakeConnectorSetting,
157
- DataConnectors.BIGQUERY: BigQueryConnectorSetting,
158
- DataConnectors.GCLOUD_STORAGE: GCSConnectorSetting,
159
- DataConnectors.GCLOUD_STORAGE_HMAC: GCSHmacConnectorSetting,
160
- DataConnectors.GCLOUD_STORAGE_SA: GCSServiceAccountConnectorSetting,
161
- DataConnectors.AMAZON_S3: S3ConnectorSetting,
162
- DataConnectors.AMAZON_S3_IAMROLE: S3IAMConnectorSetting,
163
- }
164
-
165
- SinkConnectorSettings = Union[
166
- S3ConnectorSetting, S3IAMConnectorSetting, GCSHmacConnectorSetting, GCSServiceAccountConnectorSetting
167
- ]
168
-
169
-
170
- class DataLinkerSettings:
171
- kafka = [
172
- "tb_datasource",
173
- "tb_token",
174
- "kafka_topic",
175
- "kafka_group_id",
176
- "kafka_auto_offset_reset",
177
- "kafka_store_raw_value",
178
- "kafka_store_headers",
179
- ]
180
-
181
-
182
- class DataSinkSettings:
183
- gcscheduler = [
184
- "cron",
185
- "timezone",
186
- "status",
187
- "gcscheduler_target_url",
188
- "gcscheduler_job_name",
189
- "gcscheduler_region",
190
- ]
191
- gcs_hmac = [
192
- "bucket_path",
193
- "file_template",
194
- "partition_node",
195
- "format",
196
- "compression",
197
- ]
198
- s3 = [
199
- "bucket_path",
200
- "file_template",
201
- "partition_node",
202
- "format",
203
- "compression",
204
- ]
205
- s3_iamrole = [
206
- "bucket_path",
207
- "file_template",
208
- "partition_node",
209
- "format",
210
- "compression",
211
- ]
212
- gcs_service_account = [
213
- "bucket_path",
214
- "file_template",
215
- "partition_node",
216
- "format",
217
- "compression",
218
- ]
219
-
220
-
221
- class DataSensitiveSettings:
222
- kafka = ["kafka_sasl_plain_password"]
223
- gcscheduler = [
224
- "gcscheduler_target_url",
225
- "gcscheduler_job_name",
226
- "gcscheduler_region",
227
- ]
228
- bigquery: List[str] = []
229
- snowflake: List[str] = []
230
- gcs_hmac: List[str] = ["gcs_hmac_secret"]
231
- s3: List[str] = ["s3_secret_access_key"]
232
- s3_iamrole: List[str] = ["s3_iamrole_arn"]
233
-
234
-
235
- CLI_EXCLUDED_SETTINGS = {
236
- "gcs_hmac": ["endpoint_url"],
237
- "s3": ["endpoint_url"],
238
- "s3_iamrole": ["endpoint_url"],
239
- }
@@ -1,31 +0,0 @@
1
- import abc
2
- import dataclasses
3
-
4
-
5
- class ConnectorCredentials(abc.ABC):
6
- pass
7
-
8
-
9
- @dataclasses.dataclass(frozen=True)
10
- class S3ConnectorCredentials(ConnectorCredentials):
11
- access_key_id: str
12
- secret_access_key: str
13
- region: str
14
-
15
-
16
- @dataclasses.dataclass(frozen=True)
17
- class IAMRoleAWSCredentials(ConnectorCredentials):
18
- role_arn: str
19
- external_id: str
20
- region: str
21
-
22
-
23
- @dataclasses.dataclass(frozen=True)
24
- class GCSConnectorCredentials(ConnectorCredentials):
25
- access_key_id: str
26
- secret_access_key: str
27
-
28
-
29
- @dataclasses.dataclass(frozen=True)
30
- class GCSServiceAccountCredentials(ConnectorCredentials):
31
- account_email: str