Skip to content

Commit 0a4e770

Browse files
Bill LeoutsakosBill Leoutsakos
authored andcommitted
fix(oauth): normalize Snowflake account locators
1 parent 9f3ad46 commit 0a4e770

2 files changed

Lines changed: 9 additions & 1 deletion

File tree

apps/sim/lib/oauth/snowflake.test.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,14 @@ describe('Snowflake OAuth helper', () => {
5656
).toThrow(/locator/)
5757
})
5858

59+
it('canonicalizes account locators while retaining documented regional segments', () => {
60+
const encoded = serializeSnowflakeOAuthMetadata({
61+
...metadata,
62+
accountLocator: 'xy12345.us-east-2',
63+
})
64+
expect(parseSnowflakeOAuthMetadata(encoded).accountLocator).toBe('XY12345.US-EAST-2')
65+
})
66+
5967
it('creates PKCE values using S256', async () => {
6068
const first = await generateSnowflakePkce()
6169
const second = await generateSnowflakePkce()

apps/sim/lib/oauth/snowflake.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ export function normalizeSnowflakeAccountLocator(value: string): string {
119119
if (!ACCOUNT_LOCATOR_PATTERN.test(accountLocator)) {
120120
throw new Error('Snowflake account locator contains unsupported characters')
121121
}
122-
return accountLocator
122+
return accountLocator.toUpperCase()
123123
}
124124

125125
export function normalizeSnowflakeClientId(value: string): string {

0 commit comments

Comments
 (0)