@@ -242,20 +242,22 @@ describe("discord allowlist helpers", () => {
242242 [ "123" , "steipete" , "Friends of OpenClaw" ] ,
243243 [ "discord:" , "user:" , "guild:" , "channel:" ] ,
244244 ) ;
245- expect ( allowListMatches ( allow , { id : "123" } ) ) . toBe ( true ) ;
246- expect ( allowListMatches ( allow , { name : "steipete" } ) ) . toBe ( false ) ;
247- expect ( allowListMatches ( allow , { name : "friends-of-openclaw" } ) ) . toBe ( false ) ;
245+ expect ( allowListMatches ( allow , { id : "123" } , { allowNameMatching : false } ) ) . toBe ( true ) ;
246+ expect ( allowListMatches ( allow , { name : "steipete" } , { allowNameMatching : false } ) ) . toBe ( false ) ;
247+ expect (
248+ allowListMatches ( allow , { name : "friends-of-openclaw" } , { allowNameMatching : false } ) ,
249+ ) . toBe ( false ) ;
248250 expect ( allowListMatches ( allow , { name : "steipete" } , { allowNameMatching : true } ) ) . toBe ( true ) ;
249251 expect (
250252 allowListMatches ( allow , { name : "friends-of-openclaw" } , { allowNameMatching : true } ) ,
251253 ) . toBe ( true ) ;
252- expect ( allowListMatches ( allow , { name : "other" } ) ) . toBe ( false ) ;
254+ expect ( allowListMatches ( allow , { name : "other" } , { allowNameMatching : false } ) ) . toBe ( false ) ;
253255 } ) ;
254256
255257 it ( "matches pk-prefixed allowlist entries" , ( ) => {
256258 const allow = expectNormalizedAllowList ( [ "pk:member-123" ] , [ "discord:" , "user:" , "pk:" ] ) ;
257- expect ( allowListMatches ( allow , { id : "member-123" } ) ) . toBe ( true ) ;
258- expect ( allowListMatches ( allow , { id : "member-999" } ) ) . toBe ( false ) ;
259+ expect ( allowListMatches ( allow , { id : "member-123" } , { allowNameMatching : false } ) ) . toBe ( true ) ;
260+ expect ( allowListMatches ( allow , { id : "member-999" } , { allowNameMatching : false } ) ) . toBe ( false ) ;
259261 } ) ;
260262
261263 it ( "does not treat DM wildcard access as owner access" , ( ) => {
0 commit comments