File tree Expand file tree Collapse file tree 2 files changed +8
-4
lines changed
Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -86,7 +86,9 @@ function mergeEnvAllowlist(config: PermissionGroupConfig | null): PermissionGrou
8686 const merged =
8787 config . allowedIntegrations === null
8888 ? envAllowlist
89- : config . allowedIntegrations . filter ( ( i ) => envAllowlist . includes ( i ) )
89+ : config . allowedIntegrations
90+ . map ( ( i ) => i . toLowerCase ( ) )
91+ . filter ( ( i ) => envAllowlist . includes ( i ) )
9092
9193 return { ...config , allowedIntegrations : merged }
9294}
Original file line number Diff line number Diff line change @@ -45,7 +45,7 @@ function useAllowedIntegrationsFromEnv() {
4545function intersectAllowlists ( a : string [ ] | null , b : string [ ] | null ) : string [ ] | null {
4646 if ( a === null ) return b
4747 if ( b === null ) return a
48- return a . filter ( ( i ) => b . includes ( i ) )
48+ return a . map ( ( i ) => i . toLowerCase ( ) ) . filter ( ( i ) => b . includes ( i ) )
4949}
5050
5151export function usePermissionConfig ( ) : PermissionConfigResult {
@@ -82,7 +82,7 @@ export function usePermissionConfig(): PermissionConfigResult {
8282 return ( blockType : string ) => {
8383 if ( blockType === 'start_trigger' ) return true
8484 if ( mergedAllowedIntegrations === null ) return true
85- return mergedAllowedIntegrations . includes ( blockType )
85+ return mergedAllowedIntegrations . includes ( blockType . toLowerCase ( ) )
8686 }
8787 } , [ mergedAllowedIntegrations ] )
8888
@@ -97,7 +97,9 @@ export function usePermissionConfig(): PermissionConfigResult {
9797 return < T extends { type : string } > ( blocks : T [ ] ) : T [ ] => {
9898 if ( mergedAllowedIntegrations === null ) return blocks
9999 return blocks . filter (
100- ( block ) => block . type === 'start_trigger' || mergedAllowedIntegrations . includes ( block . type )
100+ ( block ) =>
101+ block . type === 'start_trigger' ||
102+ mergedAllowedIntegrations . includes ( block . type . toLowerCase ( ) )
101103 )
102104 }
103105 } , [ mergedAllowedIntegrations ] )
You can’t perform that action at this time.
0 commit comments