fix(Databricks Node): Change default tokenExpiredStatusCode from 401 to 403 (#34325)

Co-authored-by: Prathamesh Hukkeri <prathamesh04@users.noreply.github.com>
This commit is contained in:
PRATHAMESH HUKKERI
2026-07-24 12:42:44 +05:30
committed by GitHub
parent fe649efcbf
commit 6f3d2b9faa
2 changed files with 6 additions and 6 deletions
@@ -55,14 +55,14 @@ export class DatabricksOAuth2Api implements ICredentialType {
{
// Re-declared because the base `oAuth2Api` field is `doNotInherit`, so it
// never reaches the decrypted credential. Without it the value is always
// undefined and token refresh is hardcoded to 401 — workspaces fronted by
// a proxy that rewrites 401 to 403 can set 403 here to keep refreshing.
// undefined and token refresh is hardcoded to 401 — Databricks returns 403
// when tokens expire, so the default must be 403.
displayName: 'Token Expired Status Code',
name: 'tokenExpiredStatusCode',
type: 'number',
default: 401,
default: 403,
description:
'HTTP status code that indicates the token has expired. Some APIs return 403 instead of 401.',
'HTTP status code that indicates the token has expired. Databricks returns 403 when tokens expire.',
},
];
@@ -24,8 +24,8 @@ describe('DatabricksOAuth2Api Credential', () => {
expect(field).toBeDefined();
});
it('should default to 401 to preserve existing behavior', () => {
expect(field?.default).toBe(401);
it('should default to 403 since Databricks returns 403 for expired tokens', () => {
expect(field?.default).toBe(403);
});
it('should be a configurable number field (not hidden)', () => {