mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 10:02:05 +00:00
fix: Allow saved credenitals types of up to 64 characters instead of 32 (#13985)
This commit is contained in:
@@ -34,6 +34,17 @@ describe('CreateCredentialDto', () => {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: 'longer type',
|
||||||
|
request: {
|
||||||
|
name: 'LinkedIn Community Management OAuth2 API',
|
||||||
|
type: 'linkedInCommunityManagementOAuth2Api',
|
||||||
|
data: {
|
||||||
|
clientId: '123',
|
||||||
|
clientSecret: 'secret',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
])('should validate $name', ({ request }) => {
|
])('should validate $name', ({ request }) => {
|
||||||
const result = CreateCredentialDto.safeParse(request);
|
const result = CreateCredentialDto.safeParse(request);
|
||||||
expect(result.success).toBe(true);
|
expect(result.success).toBe(true);
|
||||||
@@ -110,7 +121,7 @@ describe('CreateCredentialDto', () => {
|
|||||||
name: 'type too long',
|
name: 'type too long',
|
||||||
request: {
|
request: {
|
||||||
name: 'My API Credentials',
|
name: 'My API Credentials',
|
||||||
type: 'a'.repeat(33),
|
type: 'a'.repeat(129),
|
||||||
data: {},
|
data: {},
|
||||||
},
|
},
|
||||||
expectedErrorPath: ['type'],
|
expectedErrorPath: ['type'],
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import { Z } from 'zod-class';
|
|||||||
|
|
||||||
export class CreateCredentialDto extends Z.class({
|
export class CreateCredentialDto extends Z.class({
|
||||||
name: z.string().min(1).max(128),
|
name: z.string().min(1).max(128),
|
||||||
type: z.string().min(1).max(32),
|
type: z.string().min(1).max(128),
|
||||||
data: z.record(z.string(), z.unknown()),
|
data: z.record(z.string(), z.unknown()),
|
||||||
projectId: z.string().optional(),
|
projectId: z.string().optional(),
|
||||||
}) {}
|
}) {}
|
||||||
|
|||||||
Reference in New Issue
Block a user