fix(authz): strengthen permissionMatches warning, complete export coverage
Move the "don't gate on permissionsFor() with permissionMatches" warning onto permissionMatches itself so it's visible via autocomplete, not just on AuthzResolver.permissionsFor. Round out exports.test.ts to cover scopeKey, safeRecord, and AUTHZ_LOCALS_KEY, closing the gap where dropping either export from index.ts would not fail the test.
This commit is contained in:
1 parent
e05ddc7aa5
commit
703baa1ead
2 files changed
+13
-1
No files matched your search
@@ -43,8 +43,14 @@ describe("@wrnexus/authz exports", () => {
|
||||
"decideFor",
|
||||
"guardPermission",
|
||||
"filterCan",
|
||||
"scopeKey",
|
||||
"safeRecord",
|
||||
]) {
|
||||
expect(typeof (authz as Record<string, unknown>)[name]).toBe("function");
|
||||
}
|
||||
});
|
||||
|
||||
test("exports the locals key used to reach the per-request resolver", () => {
|
||||
expect(typeof (authz as Record<string, unknown>).AUTHZ_LOCALS_KEY).toBe("string");
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user