-
Notifications
You must be signed in to change notification settings - Fork 3k
feat(snowflake): snowflake integration #1993
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: staging
Are you sure you want to change the base?
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Greptile OverviewGreptile SummaryThis PR adds comprehensive Snowflake integration with 12 operations including query execution, data manipulation (insert/update/delete), and metadata listing (databases, schemas, tables, views, warehouses, file formats, stages). The implementation uses Personal Access Token (PAT) authentication via Snowflake's SQL API v2. Key Changes
Critical Issues FoundAuthentication Configuration Mismatch: The
Positive Aspects
Confidence Score: 3/5
Important Files ChangedFile Analysis
Sequence DiagramsequenceDiagram
participant User
participant SnowflakeBlock as Snowflake Block
participant ToolRegistry as Tool Registry
participant SnowflakeTool as Snowflake Tool
participant Utils as Utils (sanitization)
participant SnowflakeAPI as Snowflake API
User->>SnowflakeBlock: Configure operation (e.g., insert_rows)
User->>SnowflakeBlock: Provide accountUrl & accessToken (PAT)
User->>SnowflakeBlock: Provide operation params (database, schema, table, etc.)
SnowflakeBlock->>SnowflakeBlock: Select tool based on operation
SnowflakeBlock->>SnowflakeBlock: Build tool params from block config
SnowflakeBlock->>ToolRegistry: Call selected tool (e.g., snowflake_insert_rows)
ToolRegistry->>SnowflakeTool: Execute tool with params
SnowflakeTool->>Utils: Sanitize identifiers (database, schema, table, columns)
Utils-->>SnowflakeTool: Return quoted identifiers
alt Operation has WHERE clause
SnowflakeTool->>Utils: Validate WHERE clause
Utils-->>SnowflakeTool: Return validation result
end
SnowflakeTool->>SnowflakeTool: Build SQL statement
SnowflakeTool->>SnowflakeTool: Create request body with statement
SnowflakeTool->>SnowflakeAPI: POST /api/v2/statements
Note right of SnowflakeAPI: Headers: Bearer token + PAT type
SnowflakeAPI-->>SnowflakeTool: Response (statementHandle, data, etc.)
SnowflakeTool->>SnowflakeTool: Transform response
SnowflakeTool-->>ToolRegistry: Return formatted result
ToolRegistry-->>SnowflakeBlock: Return result
SnowflakeBlock-->>User: Display operation result
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
27 files reviewed, 3 comments
| function buildDeleteSQL( | ||
| database: string, | ||
| schema: string, | ||
| table: string, | ||
| whereClause?: string | ||
| ): string { | ||
| const fullTableName = `${database}.${schema}.${table}` | ||
|
|
||
| let sql = `DELETE FROM ${fullTableName}` | ||
|
|
||
| // Add WHERE clause if provided | ||
| if (whereClause && whereClause.trim()) { | ||
| sql += ` WHERE ${whereClause}` | ||
| } | ||
|
|
||
| return sql |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logic: SQL injection vulnerability: database, schema, table, and whereClause are concatenated directly into SQL without any validation or identifier quoting. Malicious input like table = "users; DROP TABLE users--" could execute arbitrary SQL.
| function buildDeleteSQL( | |
| database: string, | |
| schema: string, | |
| table: string, | |
| whereClause?: string | |
| ): string { | |
| const fullTableName = `${database}.${schema}.${table}` | |
| let sql = `DELETE FROM ${fullTableName}` | |
| // Add WHERE clause if provided | |
| if (whereClause && whereClause.trim()) { | |
| sql += ` WHERE ${whereClause}` | |
| } | |
| return sql | |
| function buildDeleteSQL( | |
| database: string, | |
| schema: string, | |
| table: string, | |
| whereClause?: string | |
| ): string { | |
| // Snowflake identifier quoting requires double quotes for SQL identifiers | |
| const quotedDatabase = `"${database.replace(/"/g, '""')}"` | |
| const quotedSchema = `"${schema.replace(/"/g, '""')}"` | |
| const quotedTable = `"${table.replace(/"/g, '""')}"` | |
| const fullTableName = `${quotedDatabase}.${quotedSchema}.${quotedTable}` | |
| let sql = `DELETE FROM ${fullTableName}` | |
| // Add WHERE clause if provided | |
| // Note: whereClause still needs proper parameterization - consider using Snowflake bind variables | |
| if (whereClause && whereClause.trim()) { | |
| sql += ` WHERE ${whereClause}` | |
| } | |
| return sql | |
| } |
Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/sim/tools/snowflake/delete_rows.ts
Line: 14:29
Comment:
**logic:** SQL injection vulnerability: `database`, `schema`, `table`, and `whereClause` are concatenated directly into SQL without any validation or identifier quoting. Malicious input like `table = "users; DROP TABLE users--"` could execute arbitrary SQL.
```suggestion
function buildDeleteSQL(
database: string,
schema: string,
table: string,
whereClause?: string
): string {
// Snowflake identifier quoting requires double quotes for SQL identifiers
const quotedDatabase = `"${database.replace(/"/g, '""')}"`
const quotedSchema = `"${schema.replace(/"/g, '""')}"`
const quotedTable = `"${table.replace(/"/g, '""')}"`
const fullTableName = `${quotedDatabase}.${quotedSchema}.${quotedTable}`
let sql = `DELETE FROM ${fullTableName}`
// Add WHERE clause if provided
// Note: whereClause still needs proper parameterization - consider using Snowflake bind variables
if (whereClause && whereClause.trim()) {
sql += ` WHERE ${whereClause}`
}
return sql
}
```
How can I resolve this? If you propose a fix, please make it concise.| function buildInsertSQL( | ||
| database: string, | ||
| schema: string, | ||
| table: string, | ||
| columns: string[], | ||
| values: any[][] | ||
| ): string { | ||
| const fullTableName = `${database}.${schema}.${table}` | ||
| const columnList = columns.join(', ') | ||
|
|
||
| // Build values clause for multiple rows | ||
| const valuesClause = values | ||
| .map((rowValues) => { | ||
| const formattedValues = rowValues.map((val) => { | ||
| if (val === null || val === undefined) { | ||
| return 'NULL' | ||
| } | ||
| if (typeof val === 'string') { | ||
| // Escape single quotes by doubling them | ||
| return `'${val.replace(/'/g, "''")}'` | ||
| } | ||
| if (typeof val === 'boolean') { | ||
| return val ? 'TRUE' : 'FALSE' | ||
| } | ||
| return String(val) | ||
| }) | ||
| return `(${formattedValues.join(', ')})` | ||
| }) | ||
| .join(', ') | ||
|
|
||
| return `INSERT INTO ${fullTableName} (${columnList}) VALUES ${valuesClause}` | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logic: SQL injection vulnerability: database, schema, table, and columns array are concatenated directly into SQL without identifier quoting. Malicious input in column names like "col1, (SELECT password FROM users)--" could expose data.
| function buildInsertSQL( | |
| database: string, | |
| schema: string, | |
| table: string, | |
| columns: string[], | |
| values: any[][] | |
| ): string { | |
| const fullTableName = `${database}.${schema}.${table}` | |
| const columnList = columns.join(', ') | |
| // Build values clause for multiple rows | |
| const valuesClause = values | |
| .map((rowValues) => { | |
| const formattedValues = rowValues.map((val) => { | |
| if (val === null || val === undefined) { | |
| return 'NULL' | |
| } | |
| if (typeof val === 'string') { | |
| // Escape single quotes by doubling them | |
| return `'${val.replace(/'/g, "''")}'` | |
| } | |
| if (typeof val === 'boolean') { | |
| return val ? 'TRUE' : 'FALSE' | |
| } | |
| return String(val) | |
| }) | |
| return `(${formattedValues.join(', ')})` | |
| }) | |
| .join(', ') | |
| return `INSERT INTO ${fullTableName} (${columnList}) VALUES ${valuesClause}` | |
| } | |
| function buildInsertSQL( | |
| database: string, | |
| schema: string, | |
| table: string, | |
| columns: string[], | |
| values: any[][] | |
| ): string { | |
| // Quote SQL identifiers to prevent injection | |
| const quotedDatabase = `"${database.replace(/"/g, '""')}"` | |
| const quotedSchema = `"${schema.replace(/"/g, '""')}"` | |
| const quotedTable = `"${table.replace(/"/g, '""')}"` | |
| const fullTableName = `${quotedDatabase}.${quotedSchema}.${quotedTable}` | |
| // Quote column names as SQL identifiers | |
| const columnList = columns.map(col => `"${col.replace(/"/g, '""')}"`).join(', ') | |
| // Build values clause for multiple rows | |
| const valuesClause = values | |
| .map((rowValues) => { | |
| const formattedValues = rowValues.map((val) => { | |
| if (val === null || val === undefined) { | |
| return 'NULL' | |
| } | |
| if (typeof val === 'string') { | |
| // Escape single quotes by doubling them | |
| return `'${val.replace(/'/g, "''")}'` | |
| } | |
| if (typeof val === 'boolean') { | |
| return val ? 'TRUE' : 'FALSE' | |
| } | |
| return String(val) | |
| }) | |
| return `(${formattedValues.join(', ')})` | |
| }) | |
| .join(', ') | |
| return `INSERT INTO ${fullTableName} (${columnList}) VALUES ${valuesClause}` | |
| } |
Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/sim/tools/snowflake/insert_rows.ts
Line: 14:45
Comment:
**logic:** SQL injection vulnerability: `database`, `schema`, `table`, and `columns` array are concatenated directly into SQL without identifier quoting. Malicious input in column names like `"col1, (SELECT password FROM users)--"` could expose data.
```suggestion
function buildInsertSQL(
database: string,
schema: string,
table: string,
columns: string[],
values: any[][]
): string {
// Quote SQL identifiers to prevent injection
const quotedDatabase = `"${database.replace(/"/g, '""')}"`
const quotedSchema = `"${schema.replace(/"/g, '""')}"`
const quotedTable = `"${table.replace(/"/g, '""')}"`
const fullTableName = `${quotedDatabase}.${quotedSchema}.${quotedTable}`
// Quote column names as SQL identifiers
const columnList = columns.map(col => `"${col.replace(/"/g, '""')}"`).join(', ')
// Build values clause for multiple rows
const valuesClause = values
.map((rowValues) => {
const formattedValues = rowValues.map((val) => {
if (val === null || val === undefined) {
return 'NULL'
}
if (typeof val === 'string') {
// Escape single quotes by doubling them
return `'${val.replace(/'/g, "''")}'`
}
if (typeof val === 'boolean') {
return val ? 'TRUE' : 'FALSE'
}
return String(val)
})
return `(${formattedValues.join(', ')})`
})
.join(', ')
return `INSERT INTO ${fullTableName} (${columnList}) VALUES ${valuesClause}`
}
```
How can I resolve this? If you propose a fix, please make it concise.| function buildUpdateSQL( | ||
| database: string, | ||
| schema: string, | ||
| table: string, | ||
| updates: Record<string, any>, | ||
| whereClause?: string | ||
| ): string { | ||
| const fullTableName = `${database}.${schema}.${table}` | ||
|
|
||
| // Build SET clause | ||
| const setClause = Object.entries(updates) | ||
| .map(([column, value]) => { | ||
| let formattedValue: string | ||
|
|
||
| if (value === null || value === undefined) { | ||
| formattedValue = 'NULL' | ||
| } else if (typeof value === 'string') { | ||
| // Escape single quotes by doubling them | ||
| formattedValue = `'${value.replace(/'/g, "''")}'` | ||
| } else if (typeof value === 'boolean') { | ||
| formattedValue = value ? 'TRUE' : 'FALSE' | ||
| } else { | ||
| formattedValue = String(value) | ||
| } | ||
|
|
||
| return `${column} = ${formattedValue}` | ||
| }) | ||
| .join(', ') | ||
|
|
||
| let sql = `UPDATE ${fullTableName} SET ${setClause}` | ||
|
|
||
| // Add WHERE clause if provided | ||
| if (whereClause && whereClause.trim()) { | ||
| sql += ` WHERE ${whereClause}` | ||
| } | ||
|
|
||
| return sql | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logic: SQL injection vulnerability: database, schema, table, and column names in updates object are concatenated directly into SQL without identifier quoting. Malicious column names could inject arbitrary SQL.
| function buildUpdateSQL( | |
| database: string, | |
| schema: string, | |
| table: string, | |
| updates: Record<string, any>, | |
| whereClause?: string | |
| ): string { | |
| const fullTableName = `${database}.${schema}.${table}` | |
| // Build SET clause | |
| const setClause = Object.entries(updates) | |
| .map(([column, value]) => { | |
| let formattedValue: string | |
| if (value === null || value === undefined) { | |
| formattedValue = 'NULL' | |
| } else if (typeof value === 'string') { | |
| // Escape single quotes by doubling them | |
| formattedValue = `'${value.replace(/'/g, "''")}'` | |
| } else if (typeof value === 'boolean') { | |
| formattedValue = value ? 'TRUE' : 'FALSE' | |
| } else { | |
| formattedValue = String(value) | |
| } | |
| return `${column} = ${formattedValue}` | |
| }) | |
| .join(', ') | |
| let sql = `UPDATE ${fullTableName} SET ${setClause}` | |
| // Add WHERE clause if provided | |
| if (whereClause && whereClause.trim()) { | |
| sql += ` WHERE ${whereClause}` | |
| } | |
| return sql | |
| } | |
| function buildUpdateSQL( | |
| database: string, | |
| schema: string, | |
| table: string, | |
| updates: Record<string, any>, | |
| whereClause?: string | |
| ): string { | |
| // Quote SQL identifiers to prevent injection | |
| const quotedDatabase = `"${database.replace(/"/g, '""')}"` | |
| const quotedSchema = `"${schema.replace(/"/g, '""')}"` | |
| const quotedTable = `"${table.replace(/"/g, '""')}"` | |
| const fullTableName = `${quotedDatabase}.${quotedSchema}.${quotedTable}` | |
| // Build SET clause with quoted column identifiers | |
| const setClause = Object.entries(updates) | |
| .map(([column, value]) => { | |
| // Quote column name as SQL identifier | |
| const quotedColumn = `"${column.replace(/"/g, '""')}"` | |
| let formattedValue: string | |
| if (value === null || value === undefined) { | |
| formattedValue = 'NULL' | |
| } else if (typeof value === 'string') { | |
| // Escape single quotes by doubling them | |
| formattedValue = `'${value.replace(/'/g, "''")}'` | |
| } else if (typeof value === 'boolean') { | |
| formattedValue = value ? 'TRUE' : 'FALSE' | |
| } else { | |
| formattedValue = String(value) | |
| } | |
| return `${quotedColumn} = ${formattedValue}` | |
| }) | |
| .join(', ') | |
| let sql = `UPDATE ${fullTableName} SET ${setClause}` | |
| // Add WHERE clause if provided | |
| // Note: whereClause still needs proper parameterization | |
| if (whereClause && whereClause.trim()) { | |
| sql += ` WHERE ${whereClause}` | |
| } | |
| return sql | |
| } |
Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/sim/tools/snowflake/update_rows.ts
Line: 14:51
Comment:
**logic:** SQL injection vulnerability: `database`, `schema`, `table`, and column names in `updates` object are concatenated directly into SQL without identifier quoting. Malicious column names could inject arbitrary SQL.
```suggestion
function buildUpdateSQL(
database: string,
schema: string,
table: string,
updates: Record<string, any>,
whereClause?: string
): string {
// Quote SQL identifiers to prevent injection
const quotedDatabase = `"${database.replace(/"/g, '""')}"`
const quotedSchema = `"${schema.replace(/"/g, '""')}"`
const quotedTable = `"${table.replace(/"/g, '""')}"`
const fullTableName = `${quotedDatabase}.${quotedSchema}.${quotedTable}`
// Build SET clause with quoted column identifiers
const setClause = Object.entries(updates)
.map(([column, value]) => {
// Quote column name as SQL identifier
const quotedColumn = `"${column.replace(/"/g, '""')}"`
let formattedValue: string
if (value === null || value === undefined) {
formattedValue = 'NULL'
} else if (typeof value === 'string') {
// Escape single quotes by doubling them
formattedValue = `'${value.replace(/'/g, "''")}'`
} else if (typeof value === 'boolean') {
formattedValue = value ? 'TRUE' : 'FALSE'
} else {
formattedValue = String(value)
}
return `${quotedColumn} = ${formattedValue}`
})
.join(', ')
let sql = `UPDATE ${fullTableName} SET ${setClause}`
// Add WHERE clause if provided
// Note: whereClause still needs proper parameterization
if (whereClause && whereClause.trim()) {
sql += ` WHERE ${whereClause}`
}
return sql
}
```
How can I resolve this? If you propose a fix, please make it concise.a128838 to
c0d357d
Compare
| ) | ||
| } | ||
|
|
||
| const clientId = env.SNOWFLAKE_CLIENT_ID |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isn't snowflake require clientId and client secret of the user account ?
1f8c88f to
ee04fdc
Compare
e0b326a to
77dc563
Compare
2737bb8 to
addd05b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
21 files reviewed, 7 comments
| function sanitizeSingleIdentifier(identifier: string): string { | ||
| const cleaned = identifier.replace(/"/g, '') | ||
|
|
||
| if (!/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(cleaned)) { | ||
| throw new Error( | ||
| `Invalid identifier: ${identifier}. Identifiers must start with a letter or underscore and contain only letters, numbers, and underscores.` | ||
| ) | ||
| } | ||
|
|
||
| return `"${cleaned}"` | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
style: Identifier validation rejects valid Snowflake identifiers containing dots
sanitizeSingleIdentifier rejects identifiers that don't match /^[a-zA-Z_][a-zA-Z0-9_]*$/, but this is called after splitting on dots in line 147. However, valid fully-qualified Snowflake identifiers like "my.table" (a single quoted identifier containing a dot) will be rejected. While uncommon, Snowflake supports such identifiers when quoted.
Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/sim/tools/snowflake/utils.ts
Line: 174:184
Comment:
**style:** Identifier validation rejects valid Snowflake identifiers containing dots
`sanitizeSingleIdentifier` rejects identifiers that don't match `/^[a-zA-Z_][a-zA-Z0-9_]*$/`, but this is called after splitting on dots in line 147. However, valid fully-qualified Snowflake identifiers like `"my.table"` (a single quoted identifier containing a dot) will be rejected. While uncommon, Snowflake supports such identifiers when quoted.
How can I resolve this? If you propose a fix, please make it concise.| const formattedValues = rowValues.map((val) => { | ||
| if (val === null || val === undefined) { | ||
| return 'NULL' | ||
| } | ||
| if (typeof val === 'string') { | ||
| return `'${val.replace(/'/g, "''")}'` | ||
| } | ||
| if (typeof val === 'boolean') { | ||
| return val ? 'TRUE' : 'FALSE' | ||
| } | ||
| return String(val) | ||
| }) | ||
| return `(${formattedValues.join(', ')})` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
style: String escaping only handles single quotes, missing backslash escaping
Line 35 escapes single quotes by doubling them (' → ''), which is correct for SQL. However, if string values contain backslashes followed by single quotes (\'), this could still lead to issues depending on Snowflake's string literal handling. Consider documenting that parameterized queries would be more robust.
Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/sim/tools/snowflake/insert_rows.ts
Line: 30:42
Comment:
**style:** String escaping only handles single quotes, missing backslash escaping
Line 35 escapes single quotes by doubling them (`'` → `''`), which is correct for SQL. However, if string values contain backslashes followed by single quotes (`\'`), this could still lead to issues depending on Snowflake's string literal handling. Consider documenting that parameterized queries would be more robust.
How can I resolve this? If you propose a fix, please make it concise.| title: 'Personal Access Token', | ||
| type: 'short-input', | ||
| placeholder: 'Enter your Snowflake PAT', | ||
| description: 'Generate a PAT in Snowflake Snowsight', | ||
| password: true, | ||
| required: true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logic: accessToken configured with password: true but missing user-only visibility
User-provided credentials like Personal Access Tokens should use user-only visibility, not rely on just password: true. The password: true property only controls UI display (masking input), while visibility controls parameter visibility in tool configs. This will cause a mismatch when the PAT is passed to tools that expect visibility: 'hidden'.
Context Used: Rule from dashboard - API keys and other user-provided credentials should use 'user-only' visibility, not 'hidden'. Only f... (source)
Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/sim/blocks/blocks/snowflake.ts
Line: 48:53
Comment:
**logic:** `accessToken` configured with `password: true` but missing `user-only` visibility
User-provided credentials like Personal Access Tokens should use `user-only` visibility, not rely on just `password: true`. The `password: true` property only controls UI display (masking input), while `visibility` controls parameter visibility in tool configs. This will cause a mismatch when the PAT is passed to tools that expect `visibility: 'hidden'`.
**Context Used:** Rule from `dashboard` - API keys and other user-provided credentials should use 'user-only' visibility, not 'hidden'. Only f... ([source](https://app.greptile.com/review/custom-context?memory=2851870a-bd1b-44d3-bc5b-1c7e716acec8))
How can I resolve this? If you propose a fix, please make it concise.| accessToken: { | ||
| type: 'string', | ||
| required: true, | ||
| visibility: 'hidden', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logic: accessToken visibility should be user-only, not hidden
User-provided credentials like Personal Access Tokens should use user-only visibility. Only framework-injected OAuth tokens should use hidden visibility.
Context Used: Rule from dashboard - API keys and other user-provided credentials should use 'user-only' visibility, not 'hidden'. Only f... (source)
Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/sim/tools/snowflake/delete_rows.ts
Line: 48:48
Comment:
**logic:** `accessToken` visibility should be `user-only`, not `hidden`
User-provided credentials like Personal Access Tokens should use `user-only` visibility. Only framework-injected OAuth tokens should use `hidden` visibility.
**Context Used:** Rule from `dashboard` - API keys and other user-provided credentials should use 'user-only' visibility, not 'hidden'. Only f... ([source](https://app.greptile.com/review/custom-context?memory=2851870a-bd1b-44d3-bc5b-1c7e716acec8))
How can I resolve this? If you propose a fix, please make it concise.| accessToken: { | ||
| type: 'string', | ||
| required: true, | ||
| visibility: 'hidden', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logic: accessToken visibility should be user-only, not hidden
User-provided credentials like Personal Access Tokens should use user-only visibility. Only framework-injected OAuth tokens should use hidden visibility.
Context Used: Rule from dashboard - API keys and other user-provided credentials should use 'user-only' visibility, not 'hidden'. Only f... (source)
Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/sim/tools/snowflake/insert_rows.ts
Line: 62:62
Comment:
**logic:** `accessToken` visibility should be `user-only`, not `hidden`
User-provided credentials like Personal Access Tokens should use `user-only` visibility. Only framework-injected OAuth tokens should use `hidden` visibility.
**Context Used:** Rule from `dashboard` - API keys and other user-provided credentials should use 'user-only' visibility, not 'hidden'. Only f... ([source](https://app.greptile.com/review/custom-context?memory=2851870a-bd1b-44d3-bc5b-1c7e716acec8))
How can I resolve this? If you propose a fix, please make it concise.| accessToken: { | ||
| type: 'string', | ||
| required: true, | ||
| visibility: 'hidden', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logic: accessToken visibility should be user-only, not hidden
User-provided credentials like Personal Access Tokens should use user-only visibility. Only framework-injected OAuth tokens should use hidden visibility.
Context Used: Rule from dashboard - API keys and other user-provided credentials should use 'user-only' visibility, not 'hidden'. Only f... (source)
Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/sim/tools/snowflake/update_rows.ts
Line: 70:70
Comment:
**logic:** `accessToken` visibility should be `user-only`, not `hidden`
User-provided credentials like Personal Access Tokens should use `user-only` visibility. Only framework-injected OAuth tokens should use `hidden` visibility.
**Context Used:** Rule from `dashboard` - API keys and other user-provided credentials should use 'user-only' visibility, not 'hidden'. Only f... ([source](https://app.greptile.com/review/custom-context?memory=2851870a-bd1b-44d3-bc5b-1c7e716acec8))
How can I resolve this? If you propose a fix, please make it concise.| accessToken: { | ||
| type: 'string', | ||
| required: true, | ||
| visibility: 'hidden', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logic: accessToken visibility should be user-only, not hidden
User-provided credentials like Personal Access Tokens should use user-only visibility. Only framework-injected OAuth tokens should use hidden visibility.
Context Used: Rule from dashboard - API keys and other user-provided credentials should use 'user-only' visibility, not 'hidden'. Only f... (source)
Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/sim/tools/snowflake/execute_query.ts
Line: 28:28
Comment:
**logic:** `accessToken` visibility should be `user-only`, not `hidden`
User-provided credentials like Personal Access Tokens should use `user-only` visibility. Only framework-injected OAuth tokens should use `hidden` visibility.
**Context Used:** Rule from `dashboard` - API keys and other user-provided credentials should use 'user-only' visibility, not 'hidden'. Only f... ([source](https://app.greptile.com/review/custom-context?memory=2851870a-bd1b-44d3-bc5b-1c7e716acec8))
How can I resolve this? If you propose a fix, please make it concise.| snowflake_update_rows: snowflakeUpdateRowsTool, | ||
| snowflake_delete_rows: snowflakeDeleteRowsTool, | ||
| snowflake_list_databases: snowflakeListDatabasesTool, | ||
| snowflake_list_schemas: snowflakeListSchemasTool, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dòng này thêm (đăng ký) một entry vào object registry của các tool — nó ánh xạ tên string "snowflake_execute_query" tới hàm/đối tượng triển khai snowflakeExecuteQueryTool.
Kết quả: nơi khác trong ứng dụng có thể tra tên "snowflake_execute_query" trong registry này để gọi chức năng thực thi truy vấn Snowflake.
Trong phần đầu của diff cũng có import của snowflakeExecuteQueryTool cùng một loạt tool Snowflake khác — tức là toàn bộ nhóm tool Snowflake được thêm vào registry để sử dụng.
Summary
Snowflake integration. Still testing some auth stuff for creating and deleting tables.
Fixes #(issue)
Type of Change
Testing
Tested manually
Checklist