Skip to content

Commit cd216b2

Browse files
feat: add snowflake/connections.toml schema. (#4565)
* feat: add snowflake/connections.toml schema. * chore: add fileMatch pattern. * feat: add snowflake/config.toml * fix: snowflake connection schema. * fix: ci. * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 207f6fd commit cd216b2

File tree

4 files changed

+303
-0
lines changed

4 files changed

+303
-0
lines changed

src/api/json/catalog.json

+15
Original file line numberDiff line numberDiff line change
@@ -4999,6 +4999,21 @@
49994999
"fileMatch": [".snapcraft.yaml", "snapcraft.yaml"],
50005000
"url": "https://raw.githubusercontent.com/snapcore/snapcraft/master/schema/snapcraft.json"
50015001
},
5002+
{
5003+
"name": "snowflake-config",
5004+
"description": "Configuration file for Snowflake",
5005+
"fileMatch": ["**/.snowflake/config.toml", "**/snowflake/config.toml"],
5006+
"url": "https://json.schemastore.org/snowflake-config.json"
5007+
},
5008+
{
5009+
"name": "snowflake-connections",
5010+
"description": "Configuration file for Snowflake connections",
5011+
"fileMatch": [
5012+
"**/.snowflake/connections.toml",
5013+
"**/snowflake/connections.toml"
5014+
],
5015+
"url": "https://json.schemastore.org/snowflake-connections.json"
5016+
},
50025017
{
50035018
"name": "Solidarity",
50045019
"description": "CLI config for enforcing environment settings",

src/schema-validation.jsonc

+6
Original file line numberDiff line numberDiff line change
@@ -1229,6 +1229,12 @@
12291229
"pep561-stub-name"
12301230
]
12311231
},
1232+
"snowflake-config.json": {
1233+
"unknownKeywords": ["x-tombi-toml-version", "x-tombi-table-keys-order"]
1234+
},
1235+
"snowflake-connections.json": {
1236+
"unknownKeywords": ["x-tombi-toml-version", "x-tombi-table-keys-order"]
1237+
},
12321238
"staticwebapp.config.json": {
12331239
"unknownKeywords": ["examples"]
12341240
},
+172
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,172 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-07/schema#",
3+
"$id": "https://json.schemastore.org/snowflake-config.json",
4+
"x-tombi-toml-version": "1.0.0",
5+
"type": "object",
6+
"title": "Snowflake Config",
7+
"description": "Configuration for Snowflake",
8+
"properties": {
9+
"default_connection_name": {
10+
"title": "Default Connection",
11+
"description": "The default connection to use",
12+
"type": "string"
13+
},
14+
"connections": {
15+
"type": "object",
16+
"additionalProperties": {
17+
"$ref": "#/definitions/SnowflakeConnection"
18+
},
19+
"minProperties": 1
20+
},
21+
"cli": {
22+
"type": "object",
23+
"properties": {
24+
"logs": {
25+
"$ref": "#/definitions/Logs"
26+
},
27+
"features": {
28+
"$ref": "#/definitions/Features"
29+
}
30+
},
31+
"additionalProperties": false
32+
}
33+
},
34+
"additionalProperties": false,
35+
"minProperties": 1,
36+
"x-tombi-table-keys-order": "schema",
37+
"definitions": {
38+
"Features": {
39+
"type": "object",
40+
"title": "Features",
41+
"description": "Configuration for features",
42+
"properties": {
43+
"enable_separate_authentication_policy_id": {
44+
"type": "boolean",
45+
"title": "Enable Separate Authentication Policy ID",
46+
"description": "When this access is enabled, specified users can access Snowflake CLI but not the other Snowflake drivers.",
47+
"default": false
48+
}
49+
},
50+
"additionalProperties": false,
51+
"x-tombi-table-keys-order": "schema"
52+
},
53+
"Logs": {
54+
"type": "object",
55+
"title": "Logs",
56+
"description": "Configuration for logging",
57+
"properties": {
58+
"save_logs": {
59+
"type": "boolean",
60+
"title": "Save Logs",
61+
"description": "Whether to save logs to a file",
62+
"default": true
63+
},
64+
"level": {
65+
"title": "Level",
66+
"description": "The level of logs to output",
67+
"type": "string",
68+
"default": "info",
69+
"enum": ["debug", "info", "warning", "error"]
70+
},
71+
"path": {
72+
"type": "string",
73+
"title": "Path",
74+
"description": "specifies the absolute path to save the log files. The format of the path varies based on your operating system. If not specified, the command creates a logs directory in the default config.toml file location."
75+
}
76+
},
77+
"additionalProperties": false,
78+
"x-tombi-table-keys-order": "schema"
79+
},
80+
"SnowflakeConnection": {
81+
"type": "object",
82+
"title": "Snowflake Connection Configuration",
83+
"description": "Configuration settings for connecting to a Snowflake database instance",
84+
"properties": {
85+
"account": {
86+
"type": "string",
87+
"title": "Account Identifier",
88+
"description": "The Snowflake account identifier",
89+
"examples": ["myaccount"]
90+
},
91+
"user": {
92+
"type": "string",
93+
"title": "Username",
94+
"description": "The username to authenticate with Snowflake",
95+
"examples": ["jondoe"]
96+
},
97+
"password": {
98+
"type": "string",
99+
"title": "Password",
100+
"description": "The password for authentication with Snowflake",
101+
"examples": ["******"]
102+
},
103+
"warehouse": {
104+
"type": "string",
105+
"title": "Warehouse",
106+
"description": "The name of the Snowflake warehouse to use for queries",
107+
"examples": ["my-wh"]
108+
},
109+
"database": {
110+
"type": "string",
111+
"title": "Database",
112+
"description": "The name of the Snowflake database to connect to",
113+
"examples": ["my_db"]
114+
},
115+
"schema": {
116+
"type": "string",
117+
"title": "Schema",
118+
"description": "The name of the database schema to use",
119+
"examples": ["my_schema"]
120+
},
121+
"role": {
122+
"type": "string",
123+
"title": "Role",
124+
"description": "The name of the Snowflake role to use"
125+
},
126+
"authenticator": {
127+
"type": "string",
128+
"title": "Authenticator",
129+
"description": "The name of the Snowflake authenticator to use",
130+
"enum": [
131+
"externalbrowser",
132+
"id_token",
133+
"no_auth",
134+
"oauth",
135+
"programmatic_access_token",
136+
"snowflake_jwt",
137+
"snowflake",
138+
"username_password_mfa"
139+
],
140+
"default": "snowflake"
141+
},
142+
"private_key_file": {
143+
"type": "string",
144+
"title": "Private Key File for JWT Authentication",
145+
"description": "The path to the private key file for the Snowflake JWT Authentication"
146+
},
147+
"private_key_file_pwd": {
148+
"type": "string",
149+
"title": "Private Key File Password for JWT Authentication",
150+
"description": "The password for the private key file for the Snowflake JWT Authentication"
151+
},
152+
"private_key_path": {
153+
"type": "string",
154+
"title": "Private Key Path for Key Pair Authentication",
155+
"description": "The path to the private key file for the Snowflake Key Pair Authentication"
156+
},
157+
"private_key_passphrase": {
158+
"type": "string",
159+
"title": "Private Key Passphrase for Key Pair Authentication",
160+
"description": "The passphrase for the private key file for the Snowflake Key Pair Authentication"
161+
},
162+
"token_file_path": {
163+
"type": "string",
164+
"title": "Token File Path for OAuth",
165+
"description": "The path to the token file for the Snowflake OAuth Authentication"
166+
}
167+
},
168+
"additionalProperties": true,
169+
"x-tombi-table-keys-order": "schema"
170+
}
171+
}
172+
}
+110
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-07/schema#",
3+
"$id": "https://json.schemastore.org/snowflake-connections.json",
4+
"x-tombi-toml-version": "1.0.0",
5+
"type": "object",
6+
"properties": {
7+
"default": {
8+
"$ref": "#/definitions/SnowflakeConnection",
9+
"title": "Default Connection",
10+
"description": "The default connection to use"
11+
}
12+
},
13+
"additionalProperties": {
14+
"$ref": "#/definitions/SnowflakeConnection"
15+
},
16+
"minProperties": 1,
17+
"definitions": {
18+
"SnowflakeConnection": {
19+
"type": "object",
20+
"title": "Snowflake Connection Configuration",
21+
"description": "Configuration settings for connecting to a Snowflake database instance",
22+
"properties": {
23+
"account": {
24+
"type": "string",
25+
"title": "Account Identifier",
26+
"description": "The Snowflake account identifier",
27+
"examples": ["myaccount"]
28+
},
29+
"user": {
30+
"type": "string",
31+
"title": "Username",
32+
"description": "The username to authenticate with Snowflake",
33+
"examples": ["jondoe"]
34+
},
35+
"password": {
36+
"type": "string",
37+
"title": "Password",
38+
"description": "The password for authentication with Snowflake",
39+
"examples": ["******"]
40+
},
41+
"warehouse": {
42+
"type": "string",
43+
"title": "Warehouse",
44+
"description": "The name of the Snowflake warehouse to use for queries",
45+
"examples": ["my-wh"]
46+
},
47+
"database": {
48+
"type": "string",
49+
"title": "Database",
50+
"description": "The name of the Snowflake database to connect to",
51+
"examples": ["my_db"]
52+
},
53+
"schema": {
54+
"type": "string",
55+
"title": "Schema",
56+
"description": "The name of the database schema to use",
57+
"examples": ["my_schema"]
58+
},
59+
"role": {
60+
"type": "string",
61+
"title": "Role",
62+
"description": "The name of the Snowflake role to use"
63+
},
64+
"authenticator": {
65+
"type": "string",
66+
"title": "Authenticator",
67+
"description": "The name of the Snowflake authenticator to use",
68+
"enum": [
69+
"externalbrowser",
70+
"id_token",
71+
"no_auth",
72+
"oauth",
73+
"programmatic_access_token",
74+
"snowflake_jwt",
75+
"snowflake",
76+
"username_password_mfa"
77+
],
78+
"default": "snowflake"
79+
},
80+
"private_key_file": {
81+
"type": "string",
82+
"title": "Private Key File for JWT Authentication",
83+
"description": "The path to the private key file for the Snowflake JWT Authentication"
84+
},
85+
"private_key_file_pwd": {
86+
"type": "string",
87+
"title": "Private Key File Password for JWT Authentication",
88+
"description": "The password for the private key file for the Snowflake JWT Authentication"
89+
},
90+
"private_key_path": {
91+
"type": "string",
92+
"title": "Private Key Path for Key Pair Authentication",
93+
"description": "The path to the private key file for the Snowflake Key Pair Authentication"
94+
},
95+
"private_key_passphrase": {
96+
"type": "string",
97+
"title": "Private Key Passphrase for Key Pair Authentication",
98+
"description": "The passphrase for the private key file for the Snowflake Key Pair Authentication"
99+
},
100+
"token_file_path": {
101+
"type": "string",
102+
"title": "Token File Path for OAuth",
103+
"description": "The path to the token file for the Snowflake OAuth Authentication"
104+
}
105+
},
106+
"additionalProperties": true,
107+
"x-tombi-table-keys-order": "schema"
108+
}
109+
}
110+
}

0 commit comments

Comments
 (0)