MCPcopy Create free account
hub / github.com/heygen-com/hyperframes / actionMatches

Function actionMatches

packages/cli/src/commands/lambda/policies.ts:390–403  ·  view source on GitHub ↗
(pattern: string, action: string)

Source from the content-addressed store, hash-verified

388}
389
390function actionMatches(pattern: string, action: string): boolean {
391 if (pattern === "*") return true;
392 if (pattern === action) return true;
393 // `s3:*` matches `s3:GetObject` etc.
394 if (pattern.endsWith(":*")) {
395 const service = pattern.slice(0, -2);
396 return action.startsWith(`${service}:`);
397 }
398 // Single trailing `*` wildcard ("s3:Get*").
399 if (pattern.endsWith("*")) {
400 return action.startsWith(pattern.slice(0, -1));
401 }
402 return false;
403}

Callers 1

validatePolicyFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected