tinybird 0.0.1.dev89__tar.gz → 0.0.1.dev90__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.
Potentially problematic release.
This version of tinybird might be problematic. Click here for more details.
- {tinybird-0.0.1.dev89 → tinybird-0.0.1.dev90}/PKG-INFO +1 -1
- {tinybird-0.0.1.dev89 → tinybird-0.0.1.dev90}/tinybird/client.py +19 -0
- {tinybird-0.0.1.dev89 → tinybird-0.0.1.dev90}/tinybird/tb/__cli__.py +2 -2
- {tinybird-0.0.1.dev89 → tinybird-0.0.1.dev90}/tinybird/tb/cli.py +1 -0
- tinybird-0.0.1.dev90/tinybird/tb/modules/secret.py +85 -0
- {tinybird-0.0.1.dev89 → tinybird-0.0.1.dev90}/tinybird.egg-info/PKG-INFO +1 -1
- {tinybird-0.0.1.dev89 → tinybird-0.0.1.dev90}/tinybird.egg-info/SOURCES.txt +1 -0
- {tinybird-0.0.1.dev89 → tinybird-0.0.1.dev90}/setup.cfg +0 -0
- {tinybird-0.0.1.dev89 → tinybird-0.0.1.dev90}/tinybird/__cli__.py +0 -0
- {tinybird-0.0.1.dev89 → tinybird-0.0.1.dev90}/tinybird/ch_utils/constants.py +0 -0
- {tinybird-0.0.1.dev89 → tinybird-0.0.1.dev90}/tinybird/ch_utils/engine.py +0 -0
- {tinybird-0.0.1.dev89 → tinybird-0.0.1.dev90}/tinybird/check_pypi.py +0 -0
- {tinybird-0.0.1.dev89 → tinybird-0.0.1.dev90}/tinybird/config.py +0 -0
- {tinybird-0.0.1.dev89 → tinybird-0.0.1.dev90}/tinybird/connectors.py +0 -0
- {tinybird-0.0.1.dev89 → tinybird-0.0.1.dev90}/tinybird/context.py +0 -0
- {tinybird-0.0.1.dev89 → tinybird-0.0.1.dev90}/tinybird/datafile.py +0 -0
- {tinybird-0.0.1.dev89 → tinybird-0.0.1.dev90}/tinybird/datatypes.py +0 -0
- {tinybird-0.0.1.dev89 → tinybird-0.0.1.dev90}/tinybird/feedback_manager.py +0 -0
- {tinybird-0.0.1.dev89 → tinybird-0.0.1.dev90}/tinybird/git_settings.py +0 -0
- {tinybird-0.0.1.dev89 → tinybird-0.0.1.dev90}/tinybird/prompts.py +0 -0
- {tinybird-0.0.1.dev89 → tinybird-0.0.1.dev90}/tinybird/sql.py +0 -0
- {tinybird-0.0.1.dev89 → tinybird-0.0.1.dev90}/tinybird/sql_template.py +0 -0
- {tinybird-0.0.1.dev89 → tinybird-0.0.1.dev90}/tinybird/sql_template_fmt.py +0 -0
- {tinybird-0.0.1.dev89 → tinybird-0.0.1.dev90}/tinybird/sql_toolset.py +0 -0
- {tinybird-0.0.1.dev89 → tinybird-0.0.1.dev90}/tinybird/syncasync.py +0 -0
- {tinybird-0.0.1.dev89 → tinybird-0.0.1.dev90}/tinybird/tb/modules/auth.py +0 -0
- {tinybird-0.0.1.dev89 → tinybird-0.0.1.dev90}/tinybird/tb/modules/build.py +0 -0
- {tinybird-0.0.1.dev89 → tinybird-0.0.1.dev90}/tinybird/tb/modules/cicd.py +0 -0
- {tinybird-0.0.1.dev89 → tinybird-0.0.1.dev90}/tinybird/tb/modules/cli.py +0 -0
- {tinybird-0.0.1.dev89 → tinybird-0.0.1.dev90}/tinybird/tb/modules/common.py +0 -0
- {tinybird-0.0.1.dev89 → tinybird-0.0.1.dev90}/tinybird/tb/modules/config.py +0 -0
- {tinybird-0.0.1.dev89 → tinybird-0.0.1.dev90}/tinybird/tb/modules/copy.py +0 -0
- {tinybird-0.0.1.dev89 → tinybird-0.0.1.dev90}/tinybird/tb/modules/create.py +0 -0
- {tinybird-0.0.1.dev89 → tinybird-0.0.1.dev90}/tinybird/tb/modules/datafile/build.py +0 -0
- {tinybird-0.0.1.dev89 → tinybird-0.0.1.dev90}/tinybird/tb/modules/datafile/build_common.py +0 -0
- {tinybird-0.0.1.dev89 → tinybird-0.0.1.dev90}/tinybird/tb/modules/datafile/build_datasource.py +0 -0
- {tinybird-0.0.1.dev89 → tinybird-0.0.1.dev90}/tinybird/tb/modules/datafile/build_pipe.py +0 -0
- {tinybird-0.0.1.dev89 → tinybird-0.0.1.dev90}/tinybird/tb/modules/datafile/common.py +0 -0
- {tinybird-0.0.1.dev89 → tinybird-0.0.1.dev90}/tinybird/tb/modules/datafile/diff.py +0 -0
- {tinybird-0.0.1.dev89 → tinybird-0.0.1.dev90}/tinybird/tb/modules/datafile/exceptions.py +0 -0
- {tinybird-0.0.1.dev89 → tinybird-0.0.1.dev90}/tinybird/tb/modules/datafile/fixture.py +0 -0
- {tinybird-0.0.1.dev89 → tinybird-0.0.1.dev90}/tinybird/tb/modules/datafile/format_common.py +0 -0
- {tinybird-0.0.1.dev89 → tinybird-0.0.1.dev90}/tinybird/tb/modules/datafile/format_datasource.py +0 -0
- {tinybird-0.0.1.dev89 → tinybird-0.0.1.dev90}/tinybird/tb/modules/datafile/format_pipe.py +0 -0
- {tinybird-0.0.1.dev89 → tinybird-0.0.1.dev90}/tinybird/tb/modules/datafile/parse_datasource.py +0 -0
- {tinybird-0.0.1.dev89 → tinybird-0.0.1.dev90}/tinybird/tb/modules/datafile/parse_pipe.py +0 -0
- {tinybird-0.0.1.dev89 → tinybird-0.0.1.dev90}/tinybird/tb/modules/datafile/pipe_checker.py +0 -0
- {tinybird-0.0.1.dev89 → tinybird-0.0.1.dev90}/tinybird/tb/modules/datafile/playground.py +0 -0
- {tinybird-0.0.1.dev89 → tinybird-0.0.1.dev90}/tinybird/tb/modules/datafile/pull.py +0 -0
- {tinybird-0.0.1.dev89 → tinybird-0.0.1.dev90}/tinybird/tb/modules/datasource.py +0 -0
- {tinybird-0.0.1.dev89 → tinybird-0.0.1.dev90}/tinybird/tb/modules/deployment.py +0 -0
- {tinybird-0.0.1.dev89 → tinybird-0.0.1.dev90}/tinybird/tb/modules/endpoint.py +0 -0
- {tinybird-0.0.1.dev89 → tinybird-0.0.1.dev90}/tinybird/tb/modules/exceptions.py +0 -0
- {tinybird-0.0.1.dev89 → tinybird-0.0.1.dev90}/tinybird/tb/modules/feedback_manager.py +0 -0
- {tinybird-0.0.1.dev89 → tinybird-0.0.1.dev90}/tinybird/tb/modules/fmt.py +0 -0
- {tinybird-0.0.1.dev89 → tinybird-0.0.1.dev90}/tinybird/tb/modules/job.py +0 -0
- {tinybird-0.0.1.dev89 → tinybird-0.0.1.dev90}/tinybird/tb/modules/llm.py +0 -0
- {tinybird-0.0.1.dev89 → tinybird-0.0.1.dev90}/tinybird/tb/modules/llm_utils.py +0 -0
- {tinybird-0.0.1.dev89 → tinybird-0.0.1.dev90}/tinybird/tb/modules/local.py +0 -0
- {tinybird-0.0.1.dev89 → tinybird-0.0.1.dev90}/tinybird/tb/modules/local_common.py +0 -0
- {tinybird-0.0.1.dev89 → tinybird-0.0.1.dev90}/tinybird/tb/modules/login.py +0 -0
- {tinybird-0.0.1.dev89 → tinybird-0.0.1.dev90}/tinybird/tb/modules/logout.py +0 -0
- {tinybird-0.0.1.dev89 → tinybird-0.0.1.dev90}/tinybird/tb/modules/materialization.py +0 -0
- {tinybird-0.0.1.dev89 → tinybird-0.0.1.dev90}/tinybird/tb/modules/mock.py +0 -0
- {tinybird-0.0.1.dev89 → tinybird-0.0.1.dev90}/tinybird/tb/modules/pipe.py +0 -0
- {tinybird-0.0.1.dev89 → tinybird-0.0.1.dev90}/tinybird/tb/modules/playground.py +0 -0
- {tinybird-0.0.1.dev89 → tinybird-0.0.1.dev90}/tinybird/tb/modules/project.py +0 -0
- {tinybird-0.0.1.dev89 → tinybird-0.0.1.dev90}/tinybird/tb/modules/regions.py +0 -0
- {tinybird-0.0.1.dev89 → tinybird-0.0.1.dev90}/tinybird/tb/modules/shell.py +0 -0
- {tinybird-0.0.1.dev89 → tinybird-0.0.1.dev90}/tinybird/tb/modules/table.py +0 -0
- {tinybird-0.0.1.dev89 → tinybird-0.0.1.dev90}/tinybird/tb/modules/tag.py +0 -0
- {tinybird-0.0.1.dev89 → tinybird-0.0.1.dev90}/tinybird/tb/modules/telemetry.py +0 -0
- {tinybird-0.0.1.dev89 → tinybird-0.0.1.dev90}/tinybird/tb/modules/test.py +0 -0
- {tinybird-0.0.1.dev89 → tinybird-0.0.1.dev90}/tinybird/tb/modules/tinyunit/tinyunit.py +0 -0
- {tinybird-0.0.1.dev89 → tinybird-0.0.1.dev90}/tinybird/tb/modules/tinyunit/tinyunit_lib.py +0 -0
- {tinybird-0.0.1.dev89 → tinybird-0.0.1.dev90}/tinybird/tb/modules/token.py +0 -0
- {tinybird-0.0.1.dev89 → tinybird-0.0.1.dev90}/tinybird/tb/modules/watch.py +0 -0
- {tinybird-0.0.1.dev89 → tinybird-0.0.1.dev90}/tinybird/tb/modules/workspace.py +0 -0
- {tinybird-0.0.1.dev89 → tinybird-0.0.1.dev90}/tinybird/tb/modules/workspace_members.py +0 -0
- {tinybird-0.0.1.dev89 → tinybird-0.0.1.dev90}/tinybird/tb_cli.py +0 -0
- {tinybird-0.0.1.dev89 → tinybird-0.0.1.dev90}/tinybird/tb_cli_modules/auth.py +0 -0
- {tinybird-0.0.1.dev89 → tinybird-0.0.1.dev90}/tinybird/tb_cli_modules/branch.py +0 -0
- {tinybird-0.0.1.dev89 → tinybird-0.0.1.dev90}/tinybird/tb_cli_modules/cicd.py +0 -0
- {tinybird-0.0.1.dev89 → tinybird-0.0.1.dev90}/tinybird/tb_cli_modules/cli.py +0 -0
- {tinybird-0.0.1.dev89 → tinybird-0.0.1.dev90}/tinybird/tb_cli_modules/common.py +0 -0
- {tinybird-0.0.1.dev89 → tinybird-0.0.1.dev90}/tinybird/tb_cli_modules/config.py +0 -0
- {tinybird-0.0.1.dev89 → tinybird-0.0.1.dev90}/tinybird/tb_cli_modules/connection.py +0 -0
- {tinybird-0.0.1.dev89 → tinybird-0.0.1.dev90}/tinybird/tb_cli_modules/datasource.py +0 -0
- {tinybird-0.0.1.dev89 → tinybird-0.0.1.dev90}/tinybird/tb_cli_modules/exceptions.py +0 -0
- {tinybird-0.0.1.dev89 → tinybird-0.0.1.dev90}/tinybird/tb_cli_modules/fmt.py +0 -0
- {tinybird-0.0.1.dev89 → tinybird-0.0.1.dev90}/tinybird/tb_cli_modules/job.py +0 -0
- {tinybird-0.0.1.dev89 → tinybird-0.0.1.dev90}/tinybird/tb_cli_modules/pipe.py +0 -0
- {tinybird-0.0.1.dev89 → tinybird-0.0.1.dev90}/tinybird/tb_cli_modules/regions.py +0 -0
- {tinybird-0.0.1.dev89 → tinybird-0.0.1.dev90}/tinybird/tb_cli_modules/tag.py +0 -0
- {tinybird-0.0.1.dev89 → tinybird-0.0.1.dev90}/tinybird/tb_cli_modules/telemetry.py +0 -0
- {tinybird-0.0.1.dev89 → tinybird-0.0.1.dev90}/tinybird/tb_cli_modules/test.py +0 -0
- {tinybird-0.0.1.dev89 → tinybird-0.0.1.dev90}/tinybird/tb_cli_modules/tinyunit/tinyunit.py +0 -0
- {tinybird-0.0.1.dev89 → tinybird-0.0.1.dev90}/tinybird/tb_cli_modules/tinyunit/tinyunit_lib.py +0 -0
- {tinybird-0.0.1.dev89 → tinybird-0.0.1.dev90}/tinybird/tb_cli_modules/workspace.py +0 -0
- {tinybird-0.0.1.dev89 → tinybird-0.0.1.dev90}/tinybird/tb_cli_modules/workspace_members.py +0 -0
- {tinybird-0.0.1.dev89 → tinybird-0.0.1.dev90}/tinybird/tornado_template.py +0 -0
- {tinybird-0.0.1.dev89 → tinybird-0.0.1.dev90}/tinybird.egg-info/dependency_links.txt +0 -0
- {tinybird-0.0.1.dev89 → tinybird-0.0.1.dev90}/tinybird.egg-info/entry_points.txt +0 -0
- {tinybird-0.0.1.dev89 → tinybird-0.0.1.dev90}/tinybird.egg-info/requires.txt +0 -0
- {tinybird-0.0.1.dev89 → tinybird-0.0.1.dev90}/tinybird.egg-info/top_level.txt +0 -0
|
@@ -288,6 +288,25 @@ class TinyB:
|
|
|
288
288
|
ds = [x for x in ds if x["name"].startswith(branch)]
|
|
289
289
|
return ds
|
|
290
290
|
|
|
291
|
+
async def secrets(self) -> List[Dict[str, Any]]:
|
|
292
|
+
response = await self._req("/v0/variables")
|
|
293
|
+
return response["variables"]
|
|
294
|
+
|
|
295
|
+
async def get_secret(self, name: str) -> Optional[Dict[str, Any]]:
|
|
296
|
+
return await self._req(f"/v0/variables/{name}")
|
|
297
|
+
|
|
298
|
+
async def create_secret(self, name: str, value: str):
|
|
299
|
+
response = await self._req("/v0/variables", method="POST", data={"name": name, "value": value})
|
|
300
|
+
return response
|
|
301
|
+
|
|
302
|
+
async def update_secret(self, name: str, value: str):
|
|
303
|
+
response = await self._req(f"/v0/variables/{name}", method="PUT", data={"value": value})
|
|
304
|
+
return response
|
|
305
|
+
|
|
306
|
+
async def delete_secret(self, name: str):
|
|
307
|
+
response = await self._req(f"/v0/variables/{name}", method="DELETE")
|
|
308
|
+
return response
|
|
309
|
+
|
|
291
310
|
async def get_connections(self, service: Optional[str] = None):
|
|
292
311
|
params = {}
|
|
293
312
|
|
|
@@ -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__ = '0.0.1.
|
|
8
|
-
__revision__ = '
|
|
7
|
+
__version__ = '0.0.1.dev90'
|
|
8
|
+
__revision__ = 'd11bb13'
|
|
@@ -22,6 +22,7 @@ import tinybird.tb.modules.materialization
|
|
|
22
22
|
import tinybird.tb.modules.mock
|
|
23
23
|
import tinybird.tb.modules.pipe
|
|
24
24
|
import tinybird.tb.modules.playground
|
|
25
|
+
import tinybird.tb.modules.secret
|
|
25
26
|
import tinybird.tb.modules.tag
|
|
26
27
|
import tinybird.tb.modules.test
|
|
27
28
|
import tinybird.tb.modules.token
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import re
|
|
2
|
+
from typing import Optional
|
|
3
|
+
|
|
4
|
+
import click
|
|
5
|
+
|
|
6
|
+
from tinybird.client import TinyB
|
|
7
|
+
from tinybird.tb.modules.cli import cli
|
|
8
|
+
from tinybird.tb.modules.common import coro, echo_safe_humanfriendly_tables_format_smart_table
|
|
9
|
+
from tinybird.tb.modules.feedback_manager import FeedbackManager
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
@cli.group()
|
|
13
|
+
@click.pass_context
|
|
14
|
+
def secret(ctx):
|
|
15
|
+
"""Secret commands."""
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
@secret.command(name="ls")
|
|
19
|
+
@click.option("--match", default=None, help="Retrieve any secrets matching the pattern. For example, --match _test")
|
|
20
|
+
@click.pass_context
|
|
21
|
+
@coro
|
|
22
|
+
async def secret_ls(ctx: click.Context, match: Optional[str]):
|
|
23
|
+
"""List secrets"""
|
|
24
|
+
|
|
25
|
+
client: TinyB = ctx.ensure_object(dict)["client"]
|
|
26
|
+
secrets = await client.secrets()
|
|
27
|
+
columns = ["name", "created_at", "updated_at"]
|
|
28
|
+
table_human_readable = []
|
|
29
|
+
table_machine_readable = []
|
|
30
|
+
pattern = re.compile(match) if match else None
|
|
31
|
+
|
|
32
|
+
for secret in secrets:
|
|
33
|
+
name = secret["name"]
|
|
34
|
+
|
|
35
|
+
if pattern and not pattern.search(name):
|
|
36
|
+
continue
|
|
37
|
+
|
|
38
|
+
created_at = secret["created_at"]
|
|
39
|
+
updated_at = secret["updated_at"]
|
|
40
|
+
|
|
41
|
+
table_human_readable.append((name, created_at, updated_at))
|
|
42
|
+
table_machine_readable.append({"name": name, "created at": created_at, "updated at": updated_at})
|
|
43
|
+
|
|
44
|
+
click.echo(FeedbackManager.info(message="** Secrets:"))
|
|
45
|
+
echo_safe_humanfriendly_tables_format_smart_table(table_human_readable, column_names=columns)
|
|
46
|
+
click.echo("\n")
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
@secret.command(name="set")
|
|
50
|
+
@click.argument("name")
|
|
51
|
+
@click.argument("value")
|
|
52
|
+
@click.pass_context
|
|
53
|
+
@coro
|
|
54
|
+
async def secret_set(ctx: click.Context, name: str, value: str):
|
|
55
|
+
"""Create or update secrets"""
|
|
56
|
+
try:
|
|
57
|
+
click.echo(FeedbackManager.highlight(message=f"\n» Setting secret '{name}'..."))
|
|
58
|
+
client: TinyB = ctx.ensure_object(dict)["client"]
|
|
59
|
+
existing_secret = None
|
|
60
|
+
try:
|
|
61
|
+
existing_secret = await client.get_secret(name)
|
|
62
|
+
except Exception:
|
|
63
|
+
pass
|
|
64
|
+
if existing_secret:
|
|
65
|
+
await client.update_secret(name, value)
|
|
66
|
+
else:
|
|
67
|
+
await client.create_secret(name, value)
|
|
68
|
+
click.echo(FeedbackManager.success(message=f"\n✓ Secret '{name}' set"))
|
|
69
|
+
except Exception as e:
|
|
70
|
+
click.echo(FeedbackManager.error(message=f"✗ Error: {e}"))
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
@secret.command(name="rm")
|
|
74
|
+
@click.argument("name")
|
|
75
|
+
@click.pass_context
|
|
76
|
+
@coro
|
|
77
|
+
async def secret_rm(ctx: click.Context, name: str):
|
|
78
|
+
"""Delete a secret"""
|
|
79
|
+
try:
|
|
80
|
+
click.echo(FeedbackManager.highlight(message=f"\n» Deleting secret '{name}'..."))
|
|
81
|
+
client: TinyB = ctx.ensure_object(dict)["client"]
|
|
82
|
+
await client.delete_secret(name)
|
|
83
|
+
click.echo(FeedbackManager.success(message=f"\n✓ Secret '{name}' deleted"))
|
|
84
|
+
except Exception as e:
|
|
85
|
+
click.echo(FeedbackManager.error(message=f"✗ Error: {e}"))
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{tinybird-0.0.1.dev89 → tinybird-0.0.1.dev90}/tinybird/tb/modules/datafile/build_datasource.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{tinybird-0.0.1.dev89 → tinybird-0.0.1.dev90}/tinybird/tb/modules/datafile/format_datasource.py
RENAMED
|
File without changes
|
|
File without changes
|
{tinybird-0.0.1.dev89 → tinybird-0.0.1.dev90}/tinybird/tb/modules/datafile/parse_datasource.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{tinybird-0.0.1.dev89 → tinybird-0.0.1.dev90}/tinybird/tb_cli_modules/tinyunit/tinyunit_lib.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|