You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit f9cebf4
Browse filesBrowse the repository at this point in the historyBrowse files
fix(snowflake): close unload-query breakouts, drop parked secrets, correct docs
- assertBalancedQuery now skips // line comments, $$ dollar quoting and rejects
ambiguous nested block comments; each hid a paren that let an injected
OVERWRITE = TRUE escape the derived table
- always emit OVERWRITE so an injected duplicate is rejected by Snowflake
rather than silently replacing staged files
- _removed_ migration targets now drop the stored value instead of parking it
under a dead key, where export scrubbing (which walks the block config) would
never clear it
- 403 falls back to the shared invalid-credentials message, which names the
network policy and SQL API causes Snowflake does not distinguish in the body
- correct the network-policy-by-user-type claim: only SERVICE_AGENT is exempt
- correct MAX_FILE_SIZE and errorOnly tool descriptions to match the fixed code
Copy file name to clipboardExpand all lines: apps/docs/content/docs/en/integrations/snowflake-service-account.mdx
+10-4Lines changed: 10 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,7 +18,13 @@ Sim stores the token alongside your account host as one credential. Once it is a
18
18
- A network policy covering the user, or an authentication policy that waives the requirement (see below).
19
19
20
20
<Callouttype="warn">
21
-
By default Snowflake requires a **human** user to be subject to a **network policy** before a programmatic access token can be generated or used. If your account has no network policy, either create one (allowing Sim's egress) or set `NETWORK_POLICY_EVALUATION = ENFORCED_NOT_REQUIRED` on an authentication policy applied to the user. Without one of these, token generation fails and a generated token is rejected at run time. Service users (`TYPE = SERVICE`) are exempt from the requirement.
21
+
Snowflake's **network policy** requirement varies by user type, and getting it wrong is the most common reason a token is rejected:
22
+
23
+
-`TYPE = PERSON` — you can generate a token without a network policy, but the user **must** be covered by one to authenticate with it.
24
+
-`TYPE = SERVICE` and `TYPE = LEGACY_SERVICE` — a network policy is required to generate **and** to use a token.
25
+
-`TYPE = SERVICE_AGENT` — exempt; generate and use freely.
26
+
27
+
If your account has no network policy, either create one (allowing Sim's egress) or set `NETWORK_POLICY_EVALUATION = ENFORCED_NOT_REQUIRED` on an authentication policy applied to the user.
22
28
</Callout>
23
29
24
30
## Creating the Token
@@ -48,9 +54,9 @@ ALTER USER my_service_user ADD PROGRAMMATIC ACCESS TOKEN sim_workflows
48
54
DAYS_TO_EXPIRY =90;
49
55
```
50
56
51
-
`DAYS_TO_EXPIRY` defaults to 15 days and cannot exceed 365. **A token can never be non-expiring**, and the value cannot be changed after creation — to extend it, generate a new token and swap the credential in Sim. Plan the rotation when you create it.
57
+
`DAYS_TO_EXPIRY` defaults to 15 days and cannot exceed 365 — an authentication policy can lower that ceiling further via `PROGRAMMATIC_ACCESS_TOKEN_MAX_EXPIRY_IN_DAYS`. **A token can never be non-expiring**, and the value cannot be changed after creation — to extend it, generate a new token and swap the credential in Sim. Plan the rotation when you create it.
52
58
53
-
Service users (`TYPE = SERVICE`or `SERVICE_AGENT`) **must** set `ROLE_RESTRICTION`. For person users it is optional but recommended: a restricted token can only ever act as that one role.
59
+
Service users (`TYPE = SERVICE`, `LEGACY_SERVICE`, or `SERVICE_AGENT`) **must** set `ROLE_RESTRICTION`, unless an authentication policy exempts them. For person users it is optional but recommended: a restricted token can only ever act as that one role.
54
60
55
61
<Callouttype="info">
56
62
If an authentication policy applies to the user, `'PROGRAMMATIC_ACCESS_TOKEN'` must appear in its `AUTHENTICATION_METHODS` list, otherwise the token is refused.
@@ -98,7 +104,7 @@ A token's expiry is fixed at creation. To rotate, generate a new token on the sa
98
104
{ question: "Why a programmatic access token instead of a password?", answer: "The token is scoped to one user, can be restricted to a single role, expires on a schedule you choose, and can be revoked on its own without changing anyone's password or breaking other integrations." },
99
105
{ question: "Does the token expire?", answer: "Yes. DAYS_TO_EXPIRY defaults to 15 days and can be set up to 365 at creation. It cannot be changed afterwards, so pick the value you want up front and plan a rotation." },
100
106
{ question: "I lost the token — can I see it again?", answer: "No. Snowflake shows the secret only at creation. Generate a new token and update the credential in Sim." },
101
-
{ question: "Why does adding the credential fail with an authentication error?", answer: "The three common causes are a token that has expired or been revoked, a human user with no network policy (Snowflake requires one for token use unless an authentication policy waives it), and an authentication policy that omits PROGRAMMATIC_ACCESS_TOKEN from its AUTHENTICATION_METHODS. A wrong account host is reported separately — Snowflake resolves any *.snowflakecomputing.com name, so Sim identifies a mistyped host by the 404 it answers with." },
107
+
{ question: "Why does adding the credential fail with an authentication error?", answer: "The three common causes are a token that has expired or been revoked, a user with no network policy (required to authenticate for every type except SERVICE_AGENT, unless an authentication policy waives it), and an authentication policy that omits PROGRAMMATIC_ACCESS_TOKEN from its AUTHENTICATION_METHODS. A wrong account host is reported separately — Snowflake resolves any *.snowflakecomputing.com name, so Sim identifies a mistyped host by the 404 it answers with." },
102
108
{ question: "Why is a picker empty?", answer: "The pickers run SHOW statements as the token's user under its default role — the block's execution role is not applied to them. If the objects you expect are visible only to another role, grant the default role usage on them, restrict the token to the role that has access, or type the name in advanced mode." },
103
109
{ question: "Does listing objects cost credits?", answer: "No. Every picker and the credential check run metadata-only statements, which Snowflake serves without a running warehouse." },
104
110
{ question: "Can one credential reach two Snowflake accounts?", answer: "No. A token is bound to the user in one account, and the credential stores that account's host. Add one credential per account." },
Copy file name to clipboardExpand all lines: apps/docs/content/docs/en/integrations/snowflake.mdx
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -389,10 +389,10 @@ Export a table or query result to files in a Snowflake stage with COPY INTO.
389
389
|`table`| string | No | Source table to unload; provide either this or a statement, not both |
390
390
|`statement`| string | No | Source SELECT statement to unload; provide either this or a table, not both |
391
391
|`fileFormat`| string | No | Named file format applied to the unloaded files |
392
-
|`header`| boolean | No | Whether to write column headings into the unloaded files |
392
+
|`header`| boolean | No | Whether to write column headings into the unloaded files; supported for CSV and Parquet only|
393
393
|`overwrite`| boolean | No | Whether to replace existing files with matching names in the stage |
394
394
|`singleFile`| boolean | No | Whether to write one file instead of splitting the output across files |
395
-
|`maxFileSizeBytes`| number | No | Upper size limit per unloaded file in bytes; Snowflake defaults to 16000000 and allows up to 5000000000|
395
+
|`maxFileSizeBytes`| number | No | Upper size limit per unloaded file in bytes; Snowflake defaults to 16777216 \(16 MB\)and allows up to 5368709120 \(5 GB\)|
396
396
397
397
#### Output
398
398
@@ -721,7 +721,7 @@ Resize a Snowflake warehouse or change its auto-suspend and auto-resume settings
721
721
|`statementTimeoutSeconds`| number | No | Statement timeout in seconds; 0 uses Snowflake maximum of 604800 seconds |
722
722
|`warehouseName`| string | Yes | Warehouse name |
723
723
|`warehouseSize`| string | No | New warehouse size, one of $\{SNOWFLAKE_WAREHOUSE_SIZES.join\(', '\)\}|
724
-
|`autoSuspendSeconds`| number | No | Seconds of inactivity before the warehouse suspends; 0 disables automatic suspension|
724
+
|`autoSuspendSeconds`| number | No | Seconds of inactivity before the warehouse suspends. Snowflake polls every 30 seconds, so values under 30 or not a multiple of 30 may not behave as expected. 0 means the warehouse never suspends and keeps consuming credits|
725
725
|`autoResume`| boolean | No | Whether the warehouse resumes automatically when a statement is submitted |
726
726
727
727
#### Output
@@ -1151,7 +1151,7 @@ List queries that completed in the last seven days, optionally filtered.
1151
1151
|`warehouseName`| string | No | Only queries run on this warehouse; cannot be combined with userName |
1152
1152
|`startTime`| string | No | ISO-8601 start of the query completion window, within the last seven days |
1153
1153
|`endTime`| string | No | ISO-8601 end of the query completion window, within the last seven days |
1154
-
|`errorOnly`| boolean | No | Whether to return only queries whose execution status is FAIL|
1154
+
|`errorOnly`| boolean | No | Whether to return only queries that failed \(execution status FAILED_WITH_ERROR or FAILED_WITH_INCIDENT\). Snowflake applies the limit before this filter, so it selects the failures among the most recent queries rather than the most recent failures|
1155
1155
|`limit`| number | No | Maximum query rows, from 1 to 10000 |
'A programmatic access token acts as the Snowflake user that owns it, or as the single role it was restricted to. It always expires — 15 days by default, 365 at most — and human users must be covered by a network policy unless an authentication policy waives it.',
416
+
'A programmatic access token acts as the Snowflake user that owns it, or as the single role it was restricted to. It always expires — 15 days by default, 365 at most — and every user type except SERVICE_AGENT must be covered by a network policy to authenticate with it, unless an authentication policy waives that.',
417
417
invalidCredentialsHelp:
418
-
'Snowflake rejected this token. Check that it belongs to a user on this exact account host, has not expired, and that a network policy allows Sim to reach the account.',
418
+
'Snowflake rejected this token. Check that it belongs to a user on this exact account host, that it has not expired or been revoked, that a network policy allows Sim to reach the account, and that the SQL API is enabled for the account.',
0 commit comments