@@ -103,28 +103,6 @@ test("fromConfig - mixed string and object values", () => {
103103 ] )
104104} )
105105
106- test ( "fromConfig - custom key remains separate from bash" , ( ) => {
107- const result = Permission . fromConfig ( {
108- custom : "deny" ,
109- bash : "allow" ,
110- } )
111- expect ( result ) . toEqual ( [
112- { permission : "custom" , pattern : "*" , action : "deny" } ,
113- { permission : "bash" , pattern : "*" , action : "allow" } ,
114- ] )
115- expect ( Permission . evaluate ( "bash" , "ls" , result ) . action ) . toBe ( "allow" )
116- expect ( Permission . evaluate ( "custom" , "ls" , result ) . action ) . toBe ( "deny" )
117- } )
118-
119- test ( "fromConfig - custom rules do not affect bash rules" , ( ) => {
120- const result = Permission . fromConfig ( {
121- custom : { "rm *" : "deny" } ,
122- bash : { "*" : "allow" , "rm *" : "ask" } ,
123- } )
124- expect ( Permission . evaluate ( "custom" , "rm foo" , result ) . action ) . toBe ( "deny" )
125- expect ( Permission . evaluate ( "bash" , "rm foo" , result ) . action ) . toBe ( "ask" )
126- } )
127-
128106test ( "fromConfig - empty object" , ( ) => {
129107 const result = Permission . fromConfig ( { } )
130108 expect ( result ) . toEqual ( [ ] )
@@ -304,11 +282,6 @@ test("evaluate - exact pattern match", () => {
304282 expect ( result . action ) . toBe ( "deny" )
305283} )
306284
307- test ( "evaluate - custom tool does not match bash rules" , ( ) => {
308- const result = Permission . evaluate ( "custom" , "rm" , [ { permission : "bash" , pattern : "rm" , action : "deny" } ] )
309- expect ( result . action ) . toBe ( "ask" )
310- } )
311-
312285test ( "evaluate - wildcard pattern match" , ( ) => {
313286 const result = Permission . evaluate ( "bash" , "rm" , [ { permission : "bash" , pattern : "*" , action : "allow" } ] )
314287 expect ( result . action ) . toBe ( "allow" )
0 commit comments