strata-cli 0.1.7 → 0.1.8
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -0
- data/README.md +24 -1
- data/lib/strata/cli/credentials.rb +5 -9
- data/lib/strata/cli/generators/templates/adapters/databricks.yml +4 -3
- data/lib/strata/cli/generators/templates/adapters/snowflake.yml +1 -21
- data/lib/strata/cli/sub_commands/datasource.rb +11 -4
- data/lib/strata/cli/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e87ebe6383ea4dea3c2b0a57d47bc8a70cdbad507bcb9233614fb33161f5e71a
|
|
4
|
+
data.tar.gz: c343df7299ff6959a73e31e68ca3cc959c5e9596dceb671be4d25868c9c04a5e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 1629834279f085c6ef45b74f057f732e722fea8567a98d3ac48e2ae46ce51e0aff46219f41e392940198b5507a8c22d17b20851724c61136ba29d3837f8647b1
|
|
7
|
+
data.tar.gz: 7b37420ff55bdb3910e702e1cb349741d4aa629a67e14b8bb3651189d2d840916a92ac0dbf7e54473ebcc82c71191d3af702a4eb958252a03f97c3919510fd70
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
## [Unreleased]
|
|
2
2
|
|
|
3
|
+
## [0.1.8] - 2026-04-28
|
|
4
|
+
|
|
5
|
+
### Changed
|
|
6
|
+
|
|
7
|
+
- **Snowflake authentication**: Removed OAuth flow from CLI prompts and templates; Snowflake now supports `pat` and `kp` only.
|
|
8
|
+
- **Databricks authentication**: Standardized on OAuth M2M (service principal) only; removed U2M flow and auth-mode selection prompt.
|
|
9
|
+
- **CLI credential UX**: Added explicit guidance during Databricks credential collection that service principal `oauth_client_id` and `oauth_client_secret` are expected.
|
|
10
|
+
|
|
3
11
|
## [0.1.7] - 2026-04-23
|
|
4
12
|
|
|
5
13
|
### Added
|
data/README.md
CHANGED
|
@@ -342,14 +342,37 @@ my_snowflake:
|
|
|
342
342
|
schema: PUBLIC
|
|
343
343
|
role: ACCOUNTADMIN
|
|
344
344
|
auth_mode: pat
|
|
345
|
+
|
|
346
|
+
my_databricks:
|
|
347
|
+
adapter: databricks
|
|
348
|
+
name: Databricks Warehouse
|
|
349
|
+
host: workspace.cloud.databricks.com
|
|
350
|
+
warehouse: warehouse_id
|
|
351
|
+
catalog: main
|
|
352
|
+
schema: default
|
|
353
|
+
auth_mode: oauth_m2m
|
|
354
|
+
```
|
|
355
|
+
|
|
356
|
+
### Databricks authentication
|
|
357
|
+
|
|
358
|
+
Databricks now requires explicit `auth_mode`.
|
|
359
|
+
|
|
360
|
+
If you already have Databricks datasources, update `datasources.yml`:
|
|
361
|
+
|
|
362
|
+
```yaml
|
|
363
|
+
my_databricks:
|
|
364
|
+
adapter: databricks
|
|
365
|
+
auth_mode: oauth_m2m
|
|
345
366
|
```
|
|
346
367
|
|
|
368
|
+
Use service principal credentials and run `strata ds auth my_databricks` to save `oauth_client_id` and `oauth_client_secret` in `.strata`.
|
|
369
|
+
|
|
347
370
|
## Supported Data Warehouse Adapters
|
|
348
371
|
|
|
349
372
|
- **PostgreSQL** - Full support
|
|
350
373
|
- **MySQL** - Full support
|
|
351
374
|
- **SQL Server** - Full support (including Azure)
|
|
352
|
-
- **Snowflake** - Full support (PAT, Key Pair
|
|
375
|
+
- **Snowflake** - Full support (PAT, Key Pair)
|
|
353
376
|
- **Athena** - AWS Athena support
|
|
354
377
|
- **Trino** - Trino/Presto support
|
|
355
378
|
- **DuckDB** - Embedded analytics database
|
|
@@ -16,8 +16,9 @@ module Strata
|
|
|
16
16
|
|
|
17
17
|
attr_reader :adapter, :credentials
|
|
18
18
|
|
|
19
|
-
def initialize(adapter)
|
|
19
|
+
def initialize(adapter, datasource_config: nil)
|
|
20
20
|
@adapter = adapter.downcase.strip
|
|
21
|
+
@datasource_config = datasource_config || {}
|
|
21
22
|
@prompt = TTY::Prompt.new
|
|
22
23
|
end
|
|
23
24
|
|
|
@@ -30,7 +31,7 @@ module Strata
|
|
|
30
31
|
|
|
31
32
|
case adapter
|
|
32
33
|
when "snowflake"
|
|
33
|
-
auth_mode = @prompt.select("Authentication mode:", %w[pat kp
|
|
34
|
+
auth_mode = @prompt.select("Authentication mode:", %w[pat kp], default: "pat")
|
|
34
35
|
credentials["auth_mode"] = auth_mode
|
|
35
36
|
|
|
36
37
|
case auth_mode
|
|
@@ -39,18 +40,13 @@ module Strata
|
|
|
39
40
|
when "kp"
|
|
40
41
|
credentials["username"] = @prompt.ask("Enter Username:")
|
|
41
42
|
credentials["private_key"] = @prompt.ask("Enter Private Key Absolute Path:")
|
|
42
|
-
when "oauth"
|
|
43
|
-
credentials["oauth_client_id"] = @prompt.ask("OAuth Client ID:")
|
|
44
|
-
credentials["oauth_client_secret"] = @prompt.ask("OAuth Client Secret:")
|
|
45
|
-
credentials["oauth_redirect_uri"] = @prompt.ask("OAuth Redirect URI:", default: "https://localhost:3420/callback")
|
|
46
|
-
oauth_scope = @prompt.ask("OAuth Scope (optional):")
|
|
47
|
-
credentials["oauth_scope"] = oauth_scope unless oauth_scope.empty?
|
|
48
43
|
end
|
|
49
44
|
when "athena"
|
|
50
45
|
credentials["access_key_id"] = @prompt.ask("AWS Access Key ID:")
|
|
51
46
|
credentials["secret_access_key"] = @prompt.ask("AWS Secret Access Key:")
|
|
52
47
|
when "databricks"
|
|
53
|
-
credentials["
|
|
48
|
+
credentials["auth_mode"] = "oauth_m2m"
|
|
49
|
+
credentials["oauth_client_id"] = @prompt.ask("OAuth Client ID:")
|
|
54
50
|
credentials["oauth_client_secret"] = @prompt.ask("OAuth Client Secret:")
|
|
55
51
|
else
|
|
56
52
|
if required?
|
|
@@ -33,10 +33,11 @@
|
|
|
33
33
|
# Optional: default schema within that catalog (often "default")
|
|
34
34
|
schema: default
|
|
35
35
|
|
|
36
|
-
#
|
|
37
|
-
#
|
|
36
|
+
# Required: Authentication mode
|
|
37
|
+
# oauth_m2m: service principal (client_credentials)
|
|
38
|
+
auth_mode: oauth_m2m
|
|
38
39
|
#
|
|
39
|
-
# Set credentials securely
|
|
40
|
+
# Set credentials securely via:
|
|
40
41
|
# `strata ds auth <%= @ds_key %>`
|
|
41
42
|
# or they are collected when you run `strata datasource add databricks`.
|
|
42
43
|
#
|
|
@@ -33,15 +33,9 @@
|
|
|
33
33
|
# Optional: Role name
|
|
34
34
|
role: ACCOUNTADMIN
|
|
35
35
|
|
|
36
|
-
# Required: Authentication mode - one of: pat, kp
|
|
36
|
+
# Required: Authentication mode - one of: pat, kp
|
|
37
37
|
# pat: personal_access_token
|
|
38
38
|
# kp: key pair (requires username)
|
|
39
|
-
# oauth: OAuth (requires setup on snowflake to enable)
|
|
40
|
-
# Additional required params
|
|
41
|
-
# oauth_client_id: <MYCLIENTID>
|
|
42
|
-
# oauth_cleint_secret: <MYCLIENTSECRET>
|
|
43
|
-
# oauth_redirect_uri: https://localhost:3420/callback
|
|
44
|
-
# oauth_scope: <SCOPE> # optional
|
|
45
39
|
auth_mode: pat
|
|
46
40
|
|
|
47
41
|
# For Personal Access Token (PAT) authentication:
|
|
@@ -53,17 +47,3 @@
|
|
|
53
47
|
# For Key Pair (KP) authentication, uncomment and set:
|
|
54
48
|
# username: john_doe
|
|
55
49
|
# private_key: /path/to/private_key.pem
|
|
56
|
-
|
|
57
|
-
# For OAuth authentication, additional setup required.
|
|
58
|
-
# https://docs.snowflake.com/en/user-guide/oauth-custom
|
|
59
|
-
#
|
|
60
|
-
# Securely save tokens in .strata by running:
|
|
61
|
-
# `strata ds auth <%= @ds_key %>`
|
|
62
|
-
#
|
|
63
|
-
# This would only work if your snowflake setup allows modification
|
|
64
|
-
# of the redirect url. Otherwise, you can get access_token and
|
|
65
|
-
# refresh_token by other means. Then add it to .strata like so:
|
|
66
|
-
#
|
|
67
|
-
# access_token: wrwerjwrljwer
|
|
68
|
-
# refresh_token: erwerewrwer
|
|
69
|
-
# expires_at: <%= Time.now %>
|
|
@@ -86,7 +86,7 @@ module Strata
|
|
|
86
86
|
# Collect adapter-specific fields
|
|
87
87
|
adapter_fields(adapter).each do |field, default_value|
|
|
88
88
|
config[field] = if field == "auth_mode"
|
|
89
|
-
|
|
89
|
+
default_value
|
|
90
90
|
elsif %w[ssl azure].include?(field)
|
|
91
91
|
prompt.yes?(" #{field.tr("_", " ").capitalize}?", default: default_value)
|
|
92
92
|
elsif field == "port"
|
|
@@ -103,11 +103,14 @@ module Strata
|
|
|
103
103
|
say "\n✔ Added #{adapter} config to datasources.yml", :green
|
|
104
104
|
|
|
105
105
|
# Automatically collect credentials if required
|
|
106
|
-
creds = Credentials.new(adapter)
|
|
106
|
+
creds = Credentials.new(adapter, datasource_config: config)
|
|
107
107
|
if creds.required?
|
|
108
108
|
say "\n Now let's set up credentials:\n", :yellow
|
|
109
109
|
say " Note: Credentials are stored securely in the local .strata file", :cyan
|
|
110
110
|
say " and are NOT committed to the repository (ensured by .gitignore).", :cyan
|
|
111
|
+
if adapter == "databricks"
|
|
112
|
+
say " Databricks uses OAuth M2M with service principal credentials (client ID + client secret).", :cyan
|
|
113
|
+
end
|
|
111
114
|
say ""
|
|
112
115
|
creds.collect
|
|
113
116
|
creds.write_local(ds_key, self)
|
|
@@ -137,7 +140,7 @@ module Strata
|
|
|
137
140
|
end
|
|
138
141
|
|
|
139
142
|
adapter = datasources[ds_key]["adapter"]
|
|
140
|
-
creds = Credentials.new(adapter)
|
|
143
|
+
creds = Credentials.new(adapter, datasource_config: datasources[ds_key])
|
|
141
144
|
|
|
142
145
|
unless creds.required?
|
|
143
146
|
say "Credentials not required for #{adapter} adapter.", :yellow
|
|
@@ -147,6 +150,9 @@ module Strata
|
|
|
147
150
|
say "\nEnter credentials for #{ds_key}", :red
|
|
148
151
|
say " Note: Credentials are stored securely in the local .strata file", :cyan
|
|
149
152
|
say " and are NOT committed to the repository (ensured by .gitignore).", :cyan
|
|
153
|
+
if adapter == "databricks"
|
|
154
|
+
say " Databricks uses OAuth M2M with service principal credentials (client ID + client secret).", :cyan
|
|
155
|
+
end
|
|
150
156
|
say ""
|
|
151
157
|
creds.collect
|
|
152
158
|
creds.write_local(ds_key, self)
|
|
@@ -343,7 +349,8 @@ module Strata
|
|
|
343
349
|
"host" => "workspace-id.cloud.databricks.com",
|
|
344
350
|
"warehouse" => "warehouse_id",
|
|
345
351
|
"catalog" => "main",
|
|
346
|
-
"schema" => "default"
|
|
352
|
+
"schema" => "default",
|
|
353
|
+
"auth_mode" => "oauth_m2m"
|
|
347
354
|
}
|
|
348
355
|
else
|
|
349
356
|
{}
|
data/lib/strata/cli/version.rb
CHANGED