mirror of
https://github.com/Nezumi-2711/9router.git
synced 2026-09-22 20:00:47 +00:00
fix: update the tracking usage filter for the usage page
This commit is contained in:
@@ -30,6 +30,21 @@ describe("usage access scope SQL predicates", () => {
|
||||
expect(params).toEqual(["connection-a", "connection-b", "key-a"]);
|
||||
});
|
||||
|
||||
it("uses persisted actor attribution when a user id is available", () => {
|
||||
const conditions = [];
|
||||
const params = [];
|
||||
|
||||
appendUsageAccessClause(conditions, params, {
|
||||
isAdmin: false,
|
||||
userId: "user-a",
|
||||
connectionIds: ["connection-a"],
|
||||
apiKeys: ["key-a"],
|
||||
});
|
||||
|
||||
expect(conditions).toEqual(["userId = ?"]);
|
||||
expect(params).toEqual(["user-a"]);
|
||||
});
|
||||
|
||||
it("denies users with no attributable resources", () => {
|
||||
const conditions = [];
|
||||
const params = [];
|
||||
|
||||
Reference in New Issue
Block a user