@pikku/addon-admin 0.12.6 → 0.12.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/.pikku/addon/agent/index.d.ts +1 -1
- package/dist/.pikku/addon/agent/index.js +1 -1
- package/dist/.pikku/addon/agent/pikku-agent-map.gen.d.ts +1 -1
- package/dist/.pikku/addon/agent/pikku-agent-types.gen.d.ts +1 -1
- package/dist/.pikku/addon/agent/pikku-model-aliases.gen.js +1 -1
- package/dist/.pikku/addon/agent/pikku-scorer-names.gen.d.ts +1 -1
- package/dist/.pikku/addon/analytics/index.d.ts +1 -1
- package/dist/.pikku/addon/analytics/index.js +1 -1
- package/dist/.pikku/addon/analytics/pikku-analytics-types.gen.d.ts +1 -1
- package/dist/.pikku/addon/analytics/pikku-analytics-types.gen.js +1 -1
- package/dist/.pikku/addon/auth/index.d.ts +1 -1
- package/dist/.pikku/addon/auth/index.js +1 -1
- package/dist/.pikku/addon/auth/pikku-auth-types.gen.d.ts +1 -1
- package/dist/.pikku/addon/auth/pikku-auth-types.gen.js +1 -1
- package/dist/.pikku/addon/channel/index.d.ts +1 -1
- package/dist/.pikku/addon/channel/index.js +1 -1
- package/dist/.pikku/addon/channel/pikku-channel-types.gen.d.ts +1 -1
- package/dist/.pikku/addon/channel/pikku-channel-types.gen.js +1 -1
- package/dist/.pikku/addon/error/index.d.ts +1 -1
- package/dist/.pikku/addon/error/index.js +1 -1
- package/dist/.pikku/addon/error/pikku-error-types.gen.d.ts +1 -1
- package/dist/.pikku/addon/error/pikku-error-types.gen.js +1 -1
- package/dist/.pikku/addon/function/index.d.ts +1 -1
- package/dist/.pikku/addon/function/index.js +1 -1
- package/dist/.pikku/addon/function/pikku-function-types.gen.d.ts +1 -1
- package/dist/.pikku/addon/function/pikku-function-types.gen.js +1 -1
- package/dist/.pikku/addon/function/pikku-functions-meta-verbose.gen.json +15 -8
- package/dist/.pikku/addon/function/pikku-functions-meta.gen.js +1 -1
- package/dist/.pikku/addon/function/pikku-functions-meta.gen.json +6 -5
- package/dist/.pikku/addon/function/pikku-functions.gen.js +1 -1
- package/dist/.pikku/addon/http/index.d.ts +1 -1
- package/dist/.pikku/addon/http/index.js +1 -1
- package/dist/.pikku/addon/http/pikku-http-types.gen.d.ts +1 -1
- package/dist/.pikku/addon/http/pikku-http-types.gen.js +1 -1
- package/dist/.pikku/addon/mcp/index.d.ts +1 -1
- package/dist/.pikku/addon/mcp/index.js +1 -1
- package/dist/.pikku/addon/mcp/pikku-mcp-types.gen.d.ts +1 -1
- package/dist/.pikku/addon/mcp/pikku-mcp-types.gen.js +1 -1
- package/dist/.pikku/addon/middleware/index.d.ts +1 -1
- package/dist/.pikku/addon/middleware/index.js +1 -1
- package/dist/.pikku/addon/middleware/pikku-middleware-types.gen.d.ts +1 -1
- package/dist/.pikku/addon/middleware/pikku-middleware-types.gen.js +1 -1
- package/dist/.pikku/addon/pikku-bootstrap-scenarios.gen.d.ts +1 -1
- package/dist/.pikku/addon/pikku-bootstrap-scenarios.gen.js +1 -1
- package/dist/.pikku/addon/pikku-bootstrap.gen.d.ts +1 -1
- package/dist/.pikku/addon/pikku-bootstrap.gen.js +1 -1
- package/dist/.pikku/addon/pikku-package.gen.js +1 -1
- package/dist/.pikku/addon/pikku-services.gen.d.ts +1 -1
- package/dist/.pikku/addon/rpc/pikku-rpc-wirings-map.gen.d.ts +8 -1
- package/dist/.pikku/addon/rpc/pikku-rpc-wirings-map.internal.gen.d.ts +8 -1
- package/dist/.pikku/addon/rpc/pikku-rpc-wirings-map.remote.gen.d.ts +8 -1
- package/dist/.pikku/addon/rpc/pikku-rpc-wirings-meta.internal.gen.js +1 -1
- package/dist/.pikku/addon/scenarios/index.d.ts +1 -1
- package/dist/.pikku/addon/scenarios/index.js +1 -1
- package/dist/.pikku/addon/scenarios/pikku-personas.gen.js +1 -1
- package/dist/.pikku/addon/scenarios/pikku-scenario-functions-meta.gen.js +1 -1
- package/dist/.pikku/addon/scenarios/pikku-scenario-functions.gen.d.ts +1 -1
- package/dist/.pikku/addon/scenarios/pikku-scenario-types.gen.d.ts +7 -1
- package/dist/.pikku/addon/scenarios/pikku-scenario-types.gen.d.ts.map +1 -1
- package/dist/.pikku/addon/scenarios/pikku-scenario-types.gen.js.map +1 -1
- package/dist/.pikku/addon/scenarios/pikku-scenario-wirings-meta.gen.js +1 -1
- package/dist/.pikku/addon/scenarios/pikku-scenario-wirings.gen.d.ts +1 -1
- package/dist/.pikku/addon/scenarios/schemas/register.gen.d.ts +1 -1
- package/dist/.pikku/addon/scenarios/schemas/register.gen.js +1 -1
- package/dist/.pikku/addon/schemas/register.gen.js +1 -1
- package/dist/.pikku/addon/schemas/schemas/ListUsersInput.schema.json +1 -1
- package/dist/.pikku/addon/schemas/schemas/ListUsersOutput.schema.json +1 -1
- package/dist/.pikku/addon/scopes/index.d.ts +1 -1
- package/dist/.pikku/addon/scopes/index.js +1 -1
- package/dist/.pikku/addon/scopes/pikku-flags.gen.d.ts +1 -1
- package/dist/.pikku/addon/scopes/pikku-personas.gen.js +1 -1
- package/dist/.pikku/addon/scopes/pikku-roles.gen.d.ts +1 -1
- package/dist/.pikku/addon/scopes/pikku-scope-types.gen.d.ts +1 -1
- package/dist/.pikku/addon/scopes/pikku-scope-types.gen.js +1 -1
- package/dist/.pikku/addon/scopes/pikku-scopes.gen.d.ts +1 -1
- package/dist/.pikku/addon/secrets/index.d.ts +1 -1
- package/dist/.pikku/addon/secrets/index.js +1 -1
- package/dist/.pikku/addon/secrets/pikku-secret-types.gen.d.ts +1 -1
- package/dist/.pikku/addon/secrets/pikku-secret-types.gen.js +1 -1
- package/dist/.pikku/addon/secrets/pikku-secrets.gen.d.ts +1 -1
- package/dist/.pikku/addon/secrets/pikku-secrets.gen.js +1 -1
- package/dist/.pikku/addon/services/pikku-meta-service.gen.d.ts +1 -1
- package/dist/.pikku/addon/services/pikku-meta-service.gen.js +1 -1
- package/dist/.pikku/addon/setup/index.d.ts +1 -1
- package/dist/.pikku/addon/setup/index.js +1 -1
- package/dist/.pikku/addon/setup/pikku-addon-setup-types.gen.d.ts +1 -1
- package/dist/.pikku/addon/setup/pikku-addon-setup-types.gen.js +1 -1
- package/dist/.pikku/addon/setup/pikku-setup-types.gen.d.ts +1 -1
- package/dist/.pikku/addon/setup/pikku-setup-types.gen.js +1 -1
- package/dist/.pikku/addon/trigger/index.d.ts +1 -1
- package/dist/.pikku/addon/trigger/index.js +1 -1
- package/dist/.pikku/addon/trigger/pikku-trigger-types.gen.d.ts +1 -1
- package/dist/.pikku/addon/trigger/pikku-trigger-types.gen.js +1 -1
- package/dist/.pikku/addon/variables/index.d.ts +1 -1
- package/dist/.pikku/addon/variables/index.js +1 -1
- package/dist/.pikku/addon/variables/pikku-variable-types.gen.d.ts +1 -1
- package/dist/.pikku/addon/variables/pikku-variable-types.gen.js +1 -1
- package/dist/.pikku/addon/variables/pikku-variables.gen.d.ts +1 -1
- package/dist/.pikku/addon/variables/pikku-variables.gen.js +1 -1
- package/dist/.pikku/addon/workflow/index.d.ts +1 -1
- package/dist/.pikku/addon/workflow/index.js +1 -1
- package/dist/.pikku/addon/workflow/pikku-scenario-step-map.gen.d.ts +1 -1
- package/dist/.pikku/addon/workflow/pikku-workflow-map.gen.d.ts +1 -1
- package/dist/.pikku/addon/workflow/pikku-workflow-types.gen.d.ts +1 -1
- package/dist/.pikku/addon/workflow/pikku-workflow-types.gen.js +1 -1
- package/dist/.pikku/addon/workflow/pikku-workflow-wirings-meta.gen.js +1 -1
- package/dist/.pikku/addon/workflow/pikku-workflow-wirings.gen.d.ts +1 -1
- package/dist/.pikku/addon/workflow/pikku-workflow-wirings.gen.js +1 -1
- package/dist/src/functions/list-users.function.d.ts +15 -0
- package/dist/src/functions/list-users.function.d.ts.map +1 -1
- package/dist/src/functions/list-users.function.js +102 -25
- package/dist/src/functions/list-users.function.js.map +1 -1
- package/dist/src/functions/list-users.function.test.d.ts +2 -0
- package/dist/src/functions/list-users.function.test.d.ts.map +1 -0
- package/dist/src/functions/list-users.function.test.js +175 -0
- package/dist/src/functions/list-users.function.test.js.map +1 -0
- package/dist/src/lib/is-person.d.ts +16 -0
- package/dist/src/lib/is-person.d.ts.map +1 -1
- package/dist/src/lib/is-person.js +17 -1
- package/dist/src/lib/is-person.js.map +1 -1
- package/dist/src/lib/user.schemas.d.ts +7 -0
- package/dist/src/lib/user.schemas.d.ts.map +1 -1
- package/dist/src/lib/user.schemas.js +26 -0
- package/dist/src/lib/user.schemas.js.map +1 -1
- package/package.json +3 -3
|
@@ -1,40 +1,117 @@
|
|
|
1
1
|
import { pikkuFunc } from '#pikku/addon/function';
|
|
2
|
-
import {
|
|
2
|
+
import { verifyScopes } from '@pikku/core/scope';
|
|
3
|
+
import { isPerson, PLATFORM_USER_ID, SYNTHETIC_MARKERS, } from '../lib/is-person.js';
|
|
3
4
|
import { ListUsersInput, ListUsersOutput } from '../lib/user.schemas.js';
|
|
5
|
+
/** Rows read per marker when gathering synthetic ids. */
|
|
6
|
+
const SYNTHETIC_CEILING = 1000;
|
|
7
|
+
/**
|
|
8
|
+
* The ids that are not people, so the query itself can exclude them.
|
|
9
|
+
*
|
|
10
|
+
* They are gathered by id rather than excluded with `actor != true`, because
|
|
11
|
+
* both marker columns are declared `required: false`: a host whose migration
|
|
12
|
+
* left them nullable stores NULL for every ordinary user, and `column != true`
|
|
13
|
+
* is NULL for a NULL column — not true, so SQL drops the row and the directory
|
|
14
|
+
* comes back empty. A primary key is never NULL, so `id NOT IN (...)` is safe
|
|
15
|
+
* on any schema.
|
|
16
|
+
*/
|
|
17
|
+
const syntheticIds = async (ctx) => {
|
|
18
|
+
// The platform principal exists as soon as a singleton credential is linked
|
|
19
|
+
// and never goes away afterwards, so it is cheaper to always exclude it than
|
|
20
|
+
// to ask whether it is there.
|
|
21
|
+
const ids = new Set([PLATFORM_USER_ID]);
|
|
22
|
+
const declared = ctx.tables?.user?.fields ?? {};
|
|
23
|
+
for (const marker of SYNTHETIC_MARKERS) {
|
|
24
|
+
if (!(marker in declared)) {
|
|
25
|
+
continue;
|
|
26
|
+
}
|
|
27
|
+
const rows = (await ctx.adapter.findMany({
|
|
28
|
+
model: 'user',
|
|
29
|
+
where: [{ field: marker, operator: 'eq', value: true }],
|
|
30
|
+
select: ['id'],
|
|
31
|
+
limit: SYNTHETIC_CEILING,
|
|
32
|
+
}));
|
|
33
|
+
for (const row of rows) {
|
|
34
|
+
ids.add(row.id);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
return [...ids];
|
|
38
|
+
};
|
|
4
39
|
export const listUsers = pikkuFunc({
|
|
5
40
|
title: 'List Users',
|
|
6
|
-
description: 'Lists and searches the user directory, read through the auth adapter so it works on any database better-auth supports.',
|
|
41
|
+
description: 'Lists and searches the user directory, read through the auth adapter so it works on any database better-auth supports. Newest first, paged with `limit` and `offset`.',
|
|
7
42
|
expose: true,
|
|
8
43
|
scopes: ['admin:users:list'],
|
|
9
44
|
input: ListUsersInput,
|
|
10
45
|
output: ListUsersOutput,
|
|
11
|
-
func: async ({ auth }, { search, limit }) => {
|
|
46
|
+
func: async ({ auth, scopeService }, { search, limit, offset, includeRoles }, { session }) => {
|
|
12
47
|
if (!auth) {
|
|
13
|
-
return { users: [] };
|
|
48
|
+
return { users: [], total: 0 };
|
|
49
|
+
}
|
|
50
|
+
// Checked here rather than declared on the function, so that asking for the
|
|
51
|
+
// directory alone does not require a scope only the roles need.
|
|
52
|
+
if (includeRoles) {
|
|
53
|
+
verifyScopes(['admin:scopes:read'], session);
|
|
14
54
|
}
|
|
15
55
|
const ctx = await (await auth()).$context;
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
56
|
+
const where = search
|
|
57
|
+
? [{ field: 'email', operator: 'contains', value: search }]
|
|
58
|
+
: [];
|
|
59
|
+
where.push({
|
|
60
|
+
field: 'id',
|
|
61
|
+
operator: 'not_in',
|
|
62
|
+
value: await syntheticIds(ctx),
|
|
63
|
+
});
|
|
64
|
+
const [rows, total] = await Promise.all([
|
|
65
|
+
ctx.adapter.findMany({
|
|
66
|
+
model: 'user',
|
|
67
|
+
where,
|
|
68
|
+
limit: limit ?? 200,
|
|
69
|
+
offset: offset ?? 0,
|
|
70
|
+
// Paging over an unordered result means nothing: without a stable sort
|
|
71
|
+
// the second page is drawn from a different arrangement than the first.
|
|
72
|
+
sortBy: { field: 'createdAt', direction: 'desc' },
|
|
73
|
+
}),
|
|
74
|
+
ctx.adapter.count({ model: 'user', where }),
|
|
75
|
+
]);
|
|
76
|
+
// A floor under the query: a host with more than SYNTHETIC_CEILING marked
|
|
77
|
+
// rows loses a page slot to one the gather missed, rather than showing a
|
|
78
|
+
// service principal in a people-picker.
|
|
79
|
+
const users = rows.filter(isPerson);
|
|
80
|
+
const roles = includeRoles && scopeService
|
|
81
|
+
? await scopeService.listRolesForUsers(users.map((row) => row.id))
|
|
82
|
+
: undefined;
|
|
83
|
+
// `returned: false` marks a column that must not leave the server, and
|
|
84
|
+
// reading the adapter directly bypasses where better-auth normally applies
|
|
85
|
+
// it.
|
|
86
|
+
const additionalFields = Object.entries((ctx.options?.user?.additionalFields ?? {}))
|
|
87
|
+
.filter(([, attribute]) => attribute?.returned !== false)
|
|
88
|
+
.map(([name]) => name);
|
|
23
89
|
return {
|
|
24
|
-
users:
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
:
|
|
37
|
-
|
|
90
|
+
users: users.map((row) => {
|
|
91
|
+
const fields = {};
|
|
92
|
+
for (const name of additionalFields) {
|
|
93
|
+
if (row[name] !== undefined && row[name] !== null) {
|
|
94
|
+
fields[name] = row[name];
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
return {
|
|
98
|
+
id: row.id,
|
|
99
|
+
email: row.email,
|
|
100
|
+
name: row.name ?? undefined,
|
|
101
|
+
image: row.image ?? undefined,
|
|
102
|
+
createdAt: row.createdAt
|
|
103
|
+
? new Date(row.createdAt).toISOString()
|
|
104
|
+
: undefined,
|
|
105
|
+
banned: typeof row.banned === 'boolean' ? row.banned : undefined,
|
|
106
|
+
banReason: row.banReason ?? undefined,
|
|
107
|
+
banExpires: row.banExpires
|
|
108
|
+
? new Date(row.banExpires).toISOString()
|
|
109
|
+
: undefined,
|
|
110
|
+
roles: roles ? (roles[row.id] ?? []) : undefined,
|
|
111
|
+
fields: Object.keys(fields).length > 0 ? fields : undefined,
|
|
112
|
+
};
|
|
113
|
+
}),
|
|
114
|
+
total,
|
|
38
115
|
};
|
|
39
116
|
},
|
|
40
117
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list-users.function.js","sourceRoot":"","sources":["../../../src/functions/list-users.function.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAA;AACjD,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"list-users.function.js","sourceRoot":"","sources":["../../../src/functions/list-users.function.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAA;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAChD,OAAO,EACL,QAAQ,EACR,gBAAgB,EAChB,iBAAiB,GAClB,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AAExE,yDAAyD;AACzD,MAAM,iBAAiB,GAAG,IAAI,CAAA;AAE9B;;;;;;;;;GASG;AACH,MAAM,YAAY,GAAG,KAAK,EAAE,GAAQ,EAAqB,EAAE;IACzD,4EAA4E;IAC5E,6EAA6E;IAC7E,8BAA8B;IAC9B,MAAM,GAAG,GAAG,IAAI,GAAG,CAAS,CAAC,gBAAgB,CAAC,CAAC,CAAA;IAC/C,MAAM,QAAQ,G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,GAAG,CAAC,UAAU;wBACxB,CAAC,CAAC,IAAI,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,WAAW,EAAE;wBACxC,CAAC,CAAC,SAAS;oBACb,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS;oBAChD,MAAM,EAAE,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS;iBAC5D,CAAA;YACH,CAAC,CAAC;YACF,KAAK;SACN,CAAA;IACH,CAAC;CACF,CAAC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-users.function.test.d.ts","sourceRoot":"","sources":["../../../src/functions/list-users.function.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
import { strict as assert } from 'assert';
|
|
2
|
+
import { describe, test } from 'node:test';
|
|
3
|
+
import { listUsers } from './list-users.function.js';
|
|
4
|
+
/**
|
|
5
|
+
* Only the operators the function is allowed to use. Anything else throws
|
|
6
|
+
* rather than guessing, which is what pins the query away from `ne` on a
|
|
7
|
+
* nullable marker column — the shape that empties the directory on a host
|
|
8
|
+
* whose migration left `actor` or `fabric` NULL.
|
|
9
|
+
*/
|
|
10
|
+
const matches = (row, where) => where.every((clause) => {
|
|
11
|
+
const value = row[clause.field];
|
|
12
|
+
switch (clause.operator ?? 'eq') {
|
|
13
|
+
case 'eq':
|
|
14
|
+
return value === clause.value;
|
|
15
|
+
case 'contains':
|
|
16
|
+
return typeof value === 'string' && value.includes(clause.value);
|
|
17
|
+
case 'not_in':
|
|
18
|
+
return !clause.value.includes(value);
|
|
19
|
+
default:
|
|
20
|
+
throw new Error(`unsupported operator: ${clause.operator}`);
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
const fakeAuth = (rows, { declared = ['actor', 'fabric'], additionalFields = {} } = {}) => (async () => ({
|
|
24
|
+
$context: Promise.resolve({
|
|
25
|
+
options: { user: { additionalFields } },
|
|
26
|
+
tables: {
|
|
27
|
+
user: {
|
|
28
|
+
fields: Object.fromEntries([...declared, 'email', 'name'].map((name) => [name, {}])),
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
adapter: {
|
|
32
|
+
findMany: async ({ where = [], limit, offset, sortBy }) => {
|
|
33
|
+
let found = rows.filter((row) => matches(row, where));
|
|
34
|
+
if (sortBy) {
|
|
35
|
+
found = [...found].sort((a, b) => sortBy.direction === 'desc'
|
|
36
|
+
? Number(b[sortBy.field]) - Number(a[sortBy.field])
|
|
37
|
+
: Number(a[sortBy.field]) - Number(b[sortBy.field]));
|
|
38
|
+
}
|
|
39
|
+
return found.slice(offset ?? 0, (offset ?? 0) + (limit ?? found.length));
|
|
40
|
+
},
|
|
41
|
+
count: async ({ where = [] }) => rows.filter((row) => matches(row, where)).length,
|
|
42
|
+
},
|
|
43
|
+
}),
|
|
44
|
+
}));
|
|
45
|
+
/** `createdAt` doubles as the sort key, so newest is simply highest. */
|
|
46
|
+
const person = (id, createdAt, extra = {}) => ({
|
|
47
|
+
id,
|
|
48
|
+
email: `${id}@example.com`,
|
|
49
|
+
createdAt,
|
|
50
|
+
...extra,
|
|
51
|
+
});
|
|
52
|
+
const call = (services, data = {}, session = { scopes: ['*'] }) => listUsers.func(services, data, { session });
|
|
53
|
+
describe('admin listUsers — who is in the directory', () => {
|
|
54
|
+
test('leaves out actors, fabric users and the platform principal', async () => {
|
|
55
|
+
const auth = fakeAuth([
|
|
56
|
+
person('alice', 3),
|
|
57
|
+
person('bot', 2, { actor: true }),
|
|
58
|
+
person('operator', 1, { fabric: true }),
|
|
59
|
+
person('pikku-platform', 0),
|
|
60
|
+
]);
|
|
61
|
+
const { users, total } = await call({ auth });
|
|
62
|
+
assert.deepEqual(users.map((user) => user.id), ['alice']);
|
|
63
|
+
assert.equal(total, 1, 'total counts people, not rows');
|
|
64
|
+
});
|
|
65
|
+
test('does not query a marker column the host never declared', async () => {
|
|
66
|
+
const auth = fakeAuth([person('alice', 1)], { declared: [] });
|
|
67
|
+
const { users } = await call({ auth });
|
|
68
|
+
assert.deepEqual(users.map((user) => user.id), ['alice']);
|
|
69
|
+
});
|
|
70
|
+
test('answers nothing at all without better-auth', async () => {
|
|
71
|
+
assert.deepEqual(await call({ auth: undefined }), { users: [], total: 0 });
|
|
72
|
+
});
|
|
73
|
+
});
|
|
74
|
+
describe('admin listUsers — paging', () => {
|
|
75
|
+
const directory = [
|
|
76
|
+
person('a', 5),
|
|
77
|
+
person('bot', 4, { actor: true }),
|
|
78
|
+
person('b', 3),
|
|
79
|
+
person('c', 2),
|
|
80
|
+
person('d', 1),
|
|
81
|
+
];
|
|
82
|
+
test('fills a page with people, not with rows it then drops', async () => {
|
|
83
|
+
const { users } = await call({ auth: fakeAuth(directory) }, { limit: 2 });
|
|
84
|
+
assert.deepEqual(users.map((user) => user.id), ['a', 'b']);
|
|
85
|
+
});
|
|
86
|
+
test('offset skips people, so no one lands on two pages', async () => {
|
|
87
|
+
const auth = fakeAuth(directory);
|
|
88
|
+
const first = await call({ auth }, { limit: 2, offset: 0 });
|
|
89
|
+
const second = await call({ auth }, { limit: 2, offset: 2 });
|
|
90
|
+
assert.deepEqual([...first.users, ...second.users].map((user) => user.id), ['a', 'b', 'c', 'd']);
|
|
91
|
+
});
|
|
92
|
+
test('total is the whole match, not the page', async () => {
|
|
93
|
+
const { users, total } = await call({ auth: fakeAuth(directory) }, { limit: 2 });
|
|
94
|
+
assert.equal(users.length, 2);
|
|
95
|
+
assert.equal(total, 4);
|
|
96
|
+
});
|
|
97
|
+
test('newest first', async () => {
|
|
98
|
+
const { users } = await call({
|
|
99
|
+
auth: fakeAuth([person('old', 1), person('new', 9), person('mid', 5)]),
|
|
100
|
+
});
|
|
101
|
+
assert.deepEqual(users.map((user) => user.id), ['new', 'mid', 'old']);
|
|
102
|
+
});
|
|
103
|
+
test('search narrows the page and the total together', async () => {
|
|
104
|
+
const auth = fakeAuth([
|
|
105
|
+
person('alice', 3),
|
|
106
|
+
{ id: 'bob', email: 'bob@other.org', createdAt: 2 },
|
|
107
|
+
]);
|
|
108
|
+
const { users, total } = await call({ auth }, { search: 'example.com' });
|
|
109
|
+
assert.deepEqual(users.map((user) => user.id), ['alice']);
|
|
110
|
+
assert.equal(total, 1);
|
|
111
|
+
});
|
|
112
|
+
});
|
|
113
|
+
describe('admin listUsers — roles', () => {
|
|
114
|
+
const auth = () => fakeAuth([person('alice', 2), person('bob', 1)]);
|
|
115
|
+
const fakeScopeService = (byUser, calls = []) => ({
|
|
116
|
+
listRolesForUsers: async (userIds) => {
|
|
117
|
+
calls.push(userIds);
|
|
118
|
+
return Object.fromEntries(userIds.map((id) => [id, byUser[id] ?? []]));
|
|
119
|
+
},
|
|
120
|
+
});
|
|
121
|
+
test('are left out unless asked for', async () => {
|
|
122
|
+
const calls = [];
|
|
123
|
+
const { users } = await call({
|
|
124
|
+
auth: auth(),
|
|
125
|
+
scopeService: fakeScopeService({}, calls),
|
|
126
|
+
});
|
|
127
|
+
assert.equal(users[0].roles, undefined);
|
|
128
|
+
assert.deepEqual(calls, [], 'a directory nobody asked roles for costs no query');
|
|
129
|
+
});
|
|
130
|
+
test('come back in one query for the whole page', async () => {
|
|
131
|
+
const calls = [];
|
|
132
|
+
const { users } = await call({
|
|
133
|
+
auth: auth(),
|
|
134
|
+
scopeService: fakeScopeService({ alice: ['admin'] }, calls),
|
|
135
|
+
}, { includeRoles: true });
|
|
136
|
+
assert.deepEqual(calls, [['alice', 'bob']], 'one call, not one per user');
|
|
137
|
+
assert.deepEqual(users[0].roles, ['admin']);
|
|
138
|
+
assert.deepEqual(users[1].roles, [], 'no roles is empty, not missing');
|
|
139
|
+
});
|
|
140
|
+
test('are refused without admin:scopes:read', async () => {
|
|
141
|
+
await assert.rejects(() => call({ auth: auth(), scopeService: fakeScopeService({}) }, { includeRoles: true }, { scopes: ['admin:users:list'] }), /admin:scopes:read/);
|
|
142
|
+
});
|
|
143
|
+
test('the directory itself needs no scope beyond its own', async () => {
|
|
144
|
+
const { users } = await call({ auth: auth() }, {}, { scopes: ['admin:users:list'] });
|
|
145
|
+
assert.equal(users.length, 2);
|
|
146
|
+
});
|
|
147
|
+
test('a host with no scope service simply reports none', async () => {
|
|
148
|
+
const { users } = await call({ auth: auth() }, { includeRoles: true });
|
|
149
|
+
assert.equal(users[0].roles, undefined);
|
|
150
|
+
});
|
|
151
|
+
});
|
|
152
|
+
describe('admin listUsers — the host own columns', () => {
|
|
153
|
+
test('reports the additional fields it declared', async () => {
|
|
154
|
+
const auth = fakeAuth([person('alice', 1, { displayName: 'Alice', avatarUrl: null })], {
|
|
155
|
+
additionalFields: {
|
|
156
|
+
displayName: { type: 'string' },
|
|
157
|
+
avatarUrl: { type: 'string' },
|
|
158
|
+
},
|
|
159
|
+
});
|
|
160
|
+
const { users } = await call({ auth });
|
|
161
|
+
assert.deepEqual(users[0].fields, { displayName: 'Alice' });
|
|
162
|
+
});
|
|
163
|
+
test('withholds one marked returned: false', async () => {
|
|
164
|
+
const auth = fakeAuth([person('alice', 1, { inviteToken: 'secret' })], {
|
|
165
|
+
additionalFields: { inviteToken: { type: 'string', returned: false } },
|
|
166
|
+
});
|
|
167
|
+
const { users } = await call({ auth });
|
|
168
|
+
assert.equal(users[0].fields, undefined);
|
|
169
|
+
});
|
|
170
|
+
test('says nothing at all when the host declared none', async () => {
|
|
171
|
+
const { users } = await call({ auth: fakeAuth([person('alice', 1)]) });
|
|
172
|
+
assert.equal(users[0].fields, undefined);
|
|
173
|
+
});
|
|
174
|
+
});
|
|
175
|
+
//# sourceMappingURL=list-users.function.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-users.function.test.js","sourceRoot":"","sources":["../../../src/functions/list-users.function.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM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C,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,SAAS,CAAC,CAAA;IAC1C,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
|
|
@@ -1,3 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The platform's own principal, created by `credentialOAuth()` to own
|
|
3
|
+
* singleton credentials. It is never signed into and it is not a person.
|
|
4
|
+
*/
|
|
5
|
+
export declare const PLATFORM_USER_ID = "pikku-platform";
|
|
6
|
+
/**
|
|
7
|
+
* Columns a synthetic principal is stamped with on the way in: `actor` by the
|
|
8
|
+
* scenario actor plugin, `fabric` by the Fabric operator plugin. A host that
|
|
9
|
+
* wires neither has neither column, which is why they are looked up in the
|
|
10
|
+
* schema before they are queried rather than assumed.
|
|
11
|
+
*
|
|
12
|
+
* The two are disjoint by construction — each plugin stamps only its own row
|
|
13
|
+
* at creation — which is what lets a count subtract them without double
|
|
14
|
+
* counting, and what lets them be gathered one marker at a time.
|
|
15
|
+
*/
|
|
16
|
+
export declare const SYNTHETIC_MARKERS: readonly ['actor', 'fabric'];
|
|
1
17
|
/**
|
|
2
18
|
* Synthetic principals — the platform credential owner, fabric service users
|
|
3
19
|
* and agent actors — are not people, so they never belong in a directory a
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"is-person.d.ts","sourceRoot":"","sources":["../../../src/lib/is-person.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,eAAO,MAAM,QAAQ,QAAS,GAAG,YACyC,CAAA"}
|
|
1
|
+
{"version":3,"file":"is-person.d.ts","sourceRoot":"","sources":["../../../src/lib/is-person.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,eAAO,MAAM,gBAAgB,mBAAmB,CAAA;AAEhD;;;;;;;;;GASG;AACH,eAAO,MAAM,iBAAiB,YAAI,OAAO,EAAE,QAAQ,CAAU,CAAA;AAE7D;;;;GAIG;AACH,eAAO,MAAM,QAAQ,QAAS,GAAG,YACyC,CAAA"}
|
|
@@ -1,7 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The platform's own principal, created by `credentialOAuth()` to own
|
|
3
|
+
* singleton credentials. It is never signed into and it is not a person.
|
|
4
|
+
*/
|
|
5
|
+
export const PLATFORM_USER_ID = 'pikku-platform';
|
|
6
|
+
/**
|
|
7
|
+
* Columns a synthetic principal is stamped with on the way in: `actor` by the
|
|
8
|
+
* scenario actor plugin, `fabric` by the Fabric operator plugin. A host that
|
|
9
|
+
* wires neither has neither column, which is why they are looked up in the
|
|
10
|
+
* schema before they are queried rather than assumed.
|
|
11
|
+
*
|
|
12
|
+
* The two are disjoint by construction — each plugin stamps only its own row
|
|
13
|
+
* at creation — which is what lets a count subtract them without double
|
|
14
|
+
* counting, and what lets them be gathered one marker at a time.
|
|
15
|
+
*/
|
|
16
|
+
export const SYNTHETIC_MARKERS = ['actor', 'fabric'];
|
|
1
17
|
/**
|
|
2
18
|
* Synthetic principals — the platform credential owner, fabric service users
|
|
3
19
|
* and agent actors — are not people, so they never belong in a directory a
|
|
4
20
|
* human picks from.
|
|
5
21
|
*/
|
|
6
|
-
export const isPerson = (row) => row.fabric !== true && row.actor !== true && row.id !==
|
|
22
|
+
export const isPerson = (row) => row.fabric !== true && row.actor !== true && row.id !== PLATFORM_USER_ID;
|
|
7
23
|
//# sourceMappingURL=is-person.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"is-person.js","sourceRoot":"","sources":["../../../src/lib/is-person.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,GAAQ,EAAE,EAAE,CACnC,GAAG,CAAC,MAAM,KAAK,IAAI,IAAI,GAAG,CAAC,KAAK,KAAK,IAAI,IAAI,GAAG,CAAC,EAAE,KAAK,gBAAgB,CAAA"}
|
|
1
|
+
{"version":3,"file":"is-person.js","sourceRoot":"","sources":["../../../src/lib/is-person.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,gBAAgB,CAAA;AAEhD;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,OAAO,EAAE,QAAQ,CAAU,CAAA;AAE7D;;;;GAIG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,GAAQ,EAAE,EAAE,CACnC,GAAG,CAAC,MAAM,KAAK,IAAI,IAAI,GAAG,CAAC,KAAK,KAAK,IAAI,IAAI,GAAG,CAAC,EAAE,KAAK,gBAAgB,CAAA"}
|
|
@@ -14,10 +14,14 @@ export declare const User: z.ZodObject<{
|
|
|
14
14
|
banned: z.ZodOptional<z.ZodBoolean>;
|
|
15
15
|
banReason: z.ZodOptional<z.ZodString>;
|
|
16
16
|
banExpires: z.ZodOptional<z.ZodString>;
|
|
17
|
+
roles: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
18
|
+
fields: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
17
19
|
}, z.core.$strip>;
|
|
18
20
|
export declare const ListUsersInput: z.ZodObject<{
|
|
19
21
|
search: z.ZodOptional<z.ZodString>;
|
|
20
22
|
limit: z.ZodOptional<z.ZodNumber>;
|
|
23
|
+
offset: z.ZodOptional<z.ZodNumber>;
|
|
24
|
+
includeRoles: z.ZodOptional<z.ZodBoolean>;
|
|
21
25
|
}, z.core.$strip>;
|
|
22
26
|
export declare const ListUsersOutput: z.ZodObject<{
|
|
23
27
|
users: z.ZodArray<z.ZodObject<{
|
|
@@ -29,7 +33,10 @@ export declare const ListUsersOutput: z.ZodObject<{
|
|
|
29
33
|
banned: z.ZodOptional<z.ZodBoolean>;
|
|
30
34
|
banReason: z.ZodOptional<z.ZodString>;
|
|
31
35
|
banExpires: z.ZodOptional<z.ZodString>;
|
|
36
|
+
roles: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
37
|
+
fields: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
32
38
|
}, z.core.$strip>>;
|
|
39
|
+
total: z.ZodNumber;
|
|
33
40
|
}, z.core.$strip>;
|
|
34
41
|
/**
|
|
35
42
|
* A password is optional: an account created without one has no credential
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"user.schemas.d.ts","sourceRoot":"","sources":["../../../src/lib/user.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB;;;;;GAKG;AACH,eAAO,MAAM,IAAI
|
|
1
|
+
{"version":3,"file":"user.schemas.d.ts","sourceRoot":"","sources":["../../../src/lib/user.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB;;;;;GAKG;AACH,eAAO,MAAM,IAAI;;;;;;;;;;;iBAsBf,CAAA;AAEF,eAAO,MAAM,cAAc;;;;;iBAWzB,CAAA;AAEF,eAAO,MAAM,eAAe;;;;;;;;;;;;;;iBAO1B,CAAA;AAEF;;;;;GAKG;AACH,eAAO,MAAM,eAAe;;;;iBAI1B,CAAA;AAEF,eAAO,MAAM,gBAAgB;;iBAE3B,CAAA;AAEF,0CAA0C;AAC1C,eAAO,MAAM,OAAO;;iBAElB,CAAA;AAEF,eAAO,MAAM,kBAAkB;;;;;iBAK7B,CAAA;AAEF,eAAO,MAAM,oBAAoB;;;iBAG/B,CAAA;AAEF;;;;GAIG;AACH,eAAO,MAAM,mBAAmB;;;iBAG9B,CAAA;AAEF,eAAO,MAAM,OAAO;;iBAElB,CAAA"}
|
|
@@ -14,13 +14,39 @@ export const User = z.object({
|
|
|
14
14
|
banned: z.boolean().optional(),
|
|
15
15
|
banReason: z.string().optional(),
|
|
16
16
|
banExpires: z.string().optional(),
|
|
17
|
+
/**
|
|
18
|
+
* Present only when `includeRoles` was asked for, and only on a host with a
|
|
19
|
+
* scope service — an empty array then means the user holds no roles.
|
|
20
|
+
*/
|
|
21
|
+
roles: z.array(z.string()).optional(),
|
|
22
|
+
/**
|
|
23
|
+
* The host's own `user.additionalFields`, by the names it declared them
|
|
24
|
+
* under. An addon cannot know an application's columns, so it reports
|
|
25
|
+
* whatever better-auth was configured with rather than a fixed shape — which
|
|
26
|
+
* is what lets a directory screen render a display name or an avatar without
|
|
27
|
+
* a second call into the application's own code.
|
|
28
|
+
*/
|
|
29
|
+
fields: z.record(z.string(), z.unknown()).optional(),
|
|
17
30
|
});
|
|
18
31
|
export const ListUsersInput = z.object({
|
|
19
32
|
search: z.string().optional(),
|
|
20
33
|
limit: z.number().int().positive().optional(),
|
|
34
|
+
offset: z.number().int().nonnegative().optional(),
|
|
35
|
+
/**
|
|
36
|
+
* Roles cost a second query and are gated on `admin:scopes:read`, which
|
|
37
|
+
* `admin:users:list` does not imply — so they are asked for rather than
|
|
38
|
+
* always sent, and a caller without that scope is refused instead of
|
|
39
|
+
* quietly handed a directory with no roles in it.
|
|
40
|
+
*/
|
|
41
|
+
includeRoles: z.boolean().optional(),
|
|
21
42
|
});
|
|
22
43
|
export const ListUsersOutput = z.object({
|
|
23
44
|
users: z.array(User),
|
|
45
|
+
/**
|
|
46
|
+
* How many users match `search`, which is not `users.length` once `limit`
|
|
47
|
+
* and `offset` have done their work — it is what a pager counts against.
|
|
48
|
+
*/
|
|
49
|
+
total: z.number(),
|
|
24
50
|
});
|
|
25
51
|
/**
|
|
26
52
|
* A password is optional: an account created without one has no credential
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"user.schemas.js","sourceRoot":"","sources":["../../../src/lib/user.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB;;;;;GAKG;AACH,MAAM,CAAC,MAAM,IAAI,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3B,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE;IACd,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;IACjB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CA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C,CAAC,MAAM,EAAE;IAClB,MAAM,EAAE,CAAC,CAAC,OAAO,EAAE;IACnB,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC7B,gBAAgB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;CACzD,CAAC,CAAA;AAEF,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3C,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE;IAClB,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE;CACxB,CAAC,CAAA;AAEF;;;;GAIG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC1C,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;IACjB,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CACnC,CAAC,CAAA;AAEF,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,CAAC,MAAM,CAAC;IAC9B,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE;CACrB,CAAC,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pikku/addon-admin",
|
|
3
|
-
"version": "0.12.
|
|
3
|
+
"version": "0.12.7",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/pikkujs/pikku.git",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
},
|
|
34
34
|
"peerDependencies": {
|
|
35
35
|
"@pikku/better-auth": "^0.12.42",
|
|
36
|
-
"@pikku/core": "^0.12.
|
|
36
|
+
"@pikku/core": "^0.12.120",
|
|
37
37
|
"zod": "^4"
|
|
38
38
|
},
|
|
39
39
|
"peerDependenciesMeta": {
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"@pikku/better-auth": "^0.12.42",
|
|
46
|
-
"@pikku/cli": "^0.12.
|
|
46
|
+
"@pikku/cli": "^0.12.162",
|
|
47
47
|
"@pikku/core": "*",
|
|
48
48
|
"@standard-schema/spec": "^1.1.0",
|
|
49
49
|
"zod": "^4"
|