@nest-boot/auth 8.0.5-beta.2 → 8.0.5-beta.3
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/README.md +20 -15
- package/dist/auth.module.js +0 -3
- package/dist/auth.module.js.map +1 -1
- package/dist/infrastructure/auth-ability.factory.js +13 -12
- package/dist/infrastructure/auth-ability.factory.js.map +1 -1
- package/dist/interfaces/auth-module-api-key-options.interface.d.ts +1 -1
- package/dist/services/access-control.service.d.ts +2 -0
- package/dist/services/access-control.service.js +7 -0
- package/dist/services/access-control.service.js.map +1 -1
- package/dist/services/invitation.service.js +16 -23
- package/dist/services/invitation.service.js.map +1 -1
- package/dist/services/member.service.d.ts +1 -1
- package/dist/services/member.service.js +30 -26
- package/dist/services/member.service.js.map +1 -1
- package/dist/services/session.service.js +2 -2
- package/dist/services/session.service.js.map +1 -1
- package/dist/services/user-api-key.service.js +6 -6
- package/dist/services/user-api-key.service.js.map +1 -1
- package/dist/services/user.service.js +23 -17
- package/dist/services/user.service.js.map +1 -1
- package/dist/services/workspace-api-key.service.js +7 -11
- package/dist/services/workspace-api-key.service.js.map +1 -1
- package/dist/services/workspace.service.d.ts +1 -1
- package/dist/services/workspace.service.js +20 -12
- package/dist/services/workspace.service.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/user.constants.d.ts +5 -5
- package/dist/user.constants.js +11 -13
- package/dist/user.constants.js.map +1 -1
- package/dist/utils/api-key-permissions.util.js +1 -2
- package/dist/utils/api-key-permissions.util.js.map +1 -1
- package/dist/workspace.constants.d.ts +7 -7
- package/dist/workspace.constants.js +18 -18
- package/dist/workspace.constants.js.map +1 -1
- package/package.json +7 -7
package/dist/user.constants.d.ts
CHANGED
|
@@ -3,11 +3,11 @@ export declare const DEFAULT_USER_ROLE = "user";
|
|
|
3
3
|
/** Roles classified as administrators by default. */
|
|
4
4
|
export declare const DEFAULT_USER_ADMIN_ROLES: readonly ["admin"];
|
|
5
5
|
/** Permissions available to the default user roles. */
|
|
6
|
-
export declare const DEFAULT_USER_PERMISSIONS: readonly ["user:create", "user:
|
|
7
|
-
/**
|
|
6
|
+
export declare const DEFAULT_USER_PERMISSIONS: readonly ["user:create", "user:read", "user:set-roles", "user:set-permissions", "user:ban", "user:impersonate", "user:impersonate-admin", "user:delete", "user:set-password", "user:set-email", "user:update", "session:read", "session:revoke", "user-api-key:read", "user-api-key:write", "workspace:create"];
|
|
7
|
+
/** Explicit default grants for user-scoped administration and workspace creation. */
|
|
8
8
|
export declare const DEFAULT_USER_ROLES: {
|
|
9
9
|
/** Grants every default user permission. */
|
|
10
|
-
readonly admin: readonly ["user:create", "user:
|
|
11
|
-
/**
|
|
12
|
-
readonly user: readonly [];
|
|
10
|
+
readonly admin: readonly ["user:create", "user:read", "user:set-roles", "user:set-permissions", "user:ban", "user:impersonate", "user:impersonate-admin", "user:delete", "user:set-password", "user:set-email", "user:update", "session:read", "session:revoke", "user-api-key:read", "user-api-key:write", "workspace:create"];
|
|
11
|
+
/** Allows signed-in users to create workspaces, without user-administration grants. */
|
|
12
|
+
readonly user: readonly ["workspace:create"];
|
|
13
13
|
};
|
package/dist/user.constants.js
CHANGED
|
@@ -5,29 +5,27 @@ export const DEFAULT_USER_ADMIN_ROLES = ["admin"];
|
|
|
5
5
|
/** Permissions available to the default user roles. */
|
|
6
6
|
export const DEFAULT_USER_PERMISSIONS = [
|
|
7
7
|
"user:create",
|
|
8
|
-
"user:
|
|
9
|
-
"user:set-
|
|
8
|
+
"user:read",
|
|
9
|
+
"user:set-roles",
|
|
10
|
+
"user:set-permissions",
|
|
10
11
|
"user:ban",
|
|
11
12
|
"user:impersonate",
|
|
12
|
-
"user:impersonate-
|
|
13
|
+
"user:impersonate-admin",
|
|
13
14
|
"user:delete",
|
|
14
15
|
"user:set-password",
|
|
15
16
|
"user:set-email",
|
|
16
|
-
"user:get",
|
|
17
17
|
"user:update",
|
|
18
|
-
"session:
|
|
18
|
+
"session:read",
|
|
19
19
|
"session:revoke",
|
|
20
|
-
"
|
|
21
|
-
"api-key:
|
|
22
|
-
"
|
|
23
|
-
"api-key:update",
|
|
24
|
-
"api-key:delete",
|
|
20
|
+
"user-api-key:read",
|
|
21
|
+
"user-api-key:write",
|
|
22
|
+
"workspace:create",
|
|
25
23
|
];
|
|
26
|
-
/**
|
|
24
|
+
/** Explicit default grants for user-scoped administration and workspace creation. */
|
|
27
25
|
export const DEFAULT_USER_ROLES = {
|
|
28
26
|
/** Grants every default user permission. */
|
|
29
27
|
admin: DEFAULT_USER_PERMISSIONS,
|
|
30
|
-
/**
|
|
31
|
-
user: [],
|
|
28
|
+
/** Allows signed-in users to create workspaces, without user-administration grants. */
|
|
29
|
+
user: ["workspace:create"],
|
|
32
30
|
};
|
|
33
31
|
//# sourceMappingURL=user.constants.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"user.constants.js","sourceRoot":"","sources":["../src/user.constants.ts"],"names":[],"mappings":"AAEA,yCAAyC;AACzC,MAAM,CAAC,MAAM,iBAAiB,GAAG,MAAM,CAAC;AAExC,qDAAqD;AACrD,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,OAAO,CAAU,CAAC;AAE3D,uDAAuD;AACvD,MAAM,CAAC,MAAM,wBAAwB,GAAG;IACtC,aAAa;IACb,WAAW;IACX,
|
|
1
|
+
{"version":3,"file":"user.constants.js","sourceRoot":"","sources":["../src/user.constants.ts"],"names":[],"mappings":"AAEA,yCAAyC;AACzC,MAAM,CAAC,MAAM,iBAAiB,GAAG,MAAM,CAAC;AAExC,qDAAqD;AACrD,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,OAAO,CAAU,CAAC;AAE3D,uDAAuD;AACvD,MAAM,CAAC,MAAM,wBAAwB,GAAG;IACtC,aAAa;IACb,WAAW;IACX,gBAAgB;IAChB,sBAAsB;IACtB,UAAU;IACV,kBAAkB;IAClB,wBAAwB;IACxB,aAAa;IACb,mBAAmB;IACnB,gBAAgB;IAChB,aAAa;IACb,cAAc;IACd,gBAAgB;IAChB,mBAAmB;IACnB,oBAAoB;IACpB,kBAAkB;CACV,CAAC;AAEX,qFAAqF;AACrF,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,4CAA4C;IAC5C,KAAK,EAAE,wBAAwB;IAC/B,uFAAuF;IACvF,IAAI,EAAE,CAAC,kBAAkB,CAAC;CACQ,CAAC"}
|
|
@@ -17,8 +17,7 @@ export function resolveApiKeyPermissionCatalog(options, scope) {
|
|
|
17
17
|
defaults: Object.freeze([
|
|
18
18
|
...(options.apiKey?.[scope]?.defaultPermissions ?? []),
|
|
19
19
|
]),
|
|
20
|
-
allowed: Object.freeze(permissions.filter((permission) => allowlist.has(permission)
|
|
21
|
-
(scope !== "workspace" || permission !== "invitation:create"))),
|
|
20
|
+
allowed: Object.freeze(permissions.filter((permission) => allowlist.has(permission))),
|
|
22
21
|
});
|
|
23
22
|
scopes[scope] = catalog;
|
|
24
23
|
catalogs.set(options, scopes);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api-key-permissions.util.js","sourceRoot":"","sources":["../../src/utils/api-key-permissions.util.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAEpE,MAAM,QAAQ,GAAG,IAAI,OAAO,EAQzB,CAAC;AAEJ,yFAAyF;AACzF,MAAM,UAAU,8BAA8B,CAC5C,OAA0B,EAC1B,KAA2B;IAM3B,MAAM,MAAM,GAAG,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC;IAC3C,MAAM,MAAM,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;IAC7B,IAAI,MAAM;QAAE,OAAO,MAAM,CAAC;IAC1B,MAAM,KAAK,GAAG,kBAAkB,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,WAAW,CAAC;IAC9D,MAAM,UAAU,GAAG,kBAAkB,CAAC,OAAO,EAAE,WAAW,CA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,CAAC;IACxE,MAAM,WAAW,GAAG;QAClB,GAAG,IAAI,GAAG,CAAC,KAAK,KAAK,MAAM,CAAC,CAAC,CAAC,CAAC,GAAG,KAAK,EAAE,GAAG,UAAU,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC;KACtE,CAAC;IACF,MAAM,SAAS,GAAG,IAAI,GAAG,CACvB,OAAO,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,EAAE,kBAAkB,IAAI,WAAW,CAC3D,CAAC;IACF,MAAM,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC;QAC5B,WAAW,EAAE,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC;QACvC,QAAQ,EAAE,MAAM,CAAC,MAAM,CAAC;YACtB,GAAG,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,EAAE,kBAAkB,IAAI,EAAE,CAAC;SACvD,CAAC;QACF,OAAO,EAAE,MAAM,CAAC,MAAM,CACpB,WAAW,CAAC,MAAM,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,SAAS,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,CAC9D;KACF,CAAC,CAAC;IACH,MAAM,CAAC,KAAK,CAAC,GAAG,OAAO,CAAC;IACxB,QAAQ,CAAC,GAAG,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;IAC9B,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
|
@@ -3,13 +3,13 @@ export declare const DEFAULT_WORKSPACE_ROLE = "member";
|
|
|
3
3
|
/** Role assigned to workspace creators by default. */
|
|
4
4
|
export declare const DEFAULT_WORKSPACE_CREATOR_ROLE = "owner";
|
|
5
5
|
/** Permissions available to the default workspace roles. */
|
|
6
|
-
export declare const DEFAULT_WORKSPACE_PERMISSIONS: readonly ["workspace:
|
|
7
|
-
/**
|
|
6
|
+
export declare const DEFAULT_WORKSPACE_PERMISSIONS: readonly ["workspace:read", "workspace:update", "workspace:delete", "member:read", "member:write", "member:set-roles", "member:set-permissions", "member:invite", "workspace-api-key:read", "workspace-api-key:write"];
|
|
7
|
+
/** Explicit grants for workspace administration and ordinary membership. */
|
|
8
8
|
export declare const DEFAULT_WORKSPACE_ROLES: {
|
|
9
9
|
/** Grants every default workspace permission. */
|
|
10
|
-
readonly owner: readonly ["workspace:
|
|
11
|
-
/** Grants
|
|
12
|
-
readonly admin: readonly ["workspace:update", "member:
|
|
13
|
-
/**
|
|
14
|
-
readonly member: readonly [];
|
|
10
|
+
readonly owner: readonly ["workspace:read", "workspace:update", "workspace:delete", "member:read", "member:write", "member:set-roles", "member:set-permissions", "member:invite", "workspace-api-key:read", "workspace-api-key:write"];
|
|
11
|
+
/** Grants membership/invitation administration without workspace deletion or key management. */
|
|
12
|
+
readonly admin: readonly ["workspace:read", "workspace:update", "member:read", "member:write", "member:set-roles", "member:set-permissions", "member:invite"];
|
|
13
|
+
/** Allows members to read workspace and member profiles, but not invitations. */
|
|
14
|
+
readonly member: readonly ["workspace:read", "member:read"];
|
|
15
15
|
};
|
|
@@ -4,32 +4,32 @@ export const DEFAULT_WORKSPACE_ROLE = "member";
|
|
|
4
4
|
export const DEFAULT_WORKSPACE_CREATOR_ROLE = "owner";
|
|
5
5
|
/** Permissions available to the default workspace roles. */
|
|
6
6
|
export const DEFAULT_WORKSPACE_PERMISSIONS = [
|
|
7
|
+
"workspace:read",
|
|
7
8
|
"workspace:update",
|
|
8
9
|
"workspace:delete",
|
|
9
|
-
"member:
|
|
10
|
-
"member:
|
|
11
|
-
"member:
|
|
12
|
-
"
|
|
13
|
-
"
|
|
14
|
-
"api-key:read",
|
|
15
|
-
"api-key:
|
|
16
|
-
"api-key:update",
|
|
17
|
-
"api-key:delete",
|
|
10
|
+
"member:read",
|
|
11
|
+
"member:write",
|
|
12
|
+
"member:set-roles",
|
|
13
|
+
"member:set-permissions",
|
|
14
|
+
"member:invite",
|
|
15
|
+
"workspace-api-key:read",
|
|
16
|
+
"workspace-api-key:write",
|
|
18
17
|
];
|
|
19
|
-
/**
|
|
18
|
+
/** Explicit grants for workspace administration and ordinary membership. */
|
|
20
19
|
export const DEFAULT_WORKSPACE_ROLES = {
|
|
21
20
|
/** Grants every default workspace permission. */
|
|
22
21
|
owner: DEFAULT_WORKSPACE_PERMISSIONS,
|
|
23
|
-
/** Grants
|
|
22
|
+
/** Grants membership/invitation administration without workspace deletion or key management. */
|
|
24
23
|
admin: [
|
|
24
|
+
"workspace:read",
|
|
25
25
|
"workspace:update",
|
|
26
|
-
"member:
|
|
27
|
-
"member:
|
|
28
|
-
"member:
|
|
29
|
-
"
|
|
30
|
-
"
|
|
26
|
+
"member:read",
|
|
27
|
+
"member:write",
|
|
28
|
+
"member:set-roles",
|
|
29
|
+
"member:set-permissions",
|
|
30
|
+
"member:invite",
|
|
31
31
|
],
|
|
32
|
-
/**
|
|
33
|
-
member: [],
|
|
32
|
+
/** Allows members to read workspace and member profiles, but not invitations. */
|
|
33
|
+
member: ["workspace:read", "member:read"],
|
|
34
34
|
};
|
|
35
35
|
//# sourceMappingURL=workspace.constants.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workspace.constants.js","sourceRoot":"","sources":["../src/workspace.constants.ts"],"names":[],"mappings":"AAEA,6DAA6D;AAC7D,MAAM,CAAC,MAAM,sBAAsB,GAAG,QAAQ,CAAC;AAE/C,sDAAsD;AACtD,MAAM,CAAC,MAAM,8BAA8B,GAAG,OAAO,CAAC;AAEtD,4DAA4D;AAC5D,MAAM,CAAC,MAAM,6BAA6B,GAAG;IAC3C,kBAAkB;IAClB,kBAAkB;IAClB,
|
|
1
|
+
{"version":3,"file":"workspace.constants.js","sourceRoot":"","sources":["../src/workspace.constants.ts"],"names":[],"mappings":"AAEA,6DAA6D;AAC7D,MAAM,CAAC,MAAM,sBAAsB,GAAG,QAAQ,CAAC;AAE/C,sDAAsD;AACtD,MAAM,CAAC,MAAM,8BAA8B,GAAG,OAAO,CAAC;AAEtD,4DAA4D;AAC5D,MAAM,CAAC,MAAM,6BAA6B,GAAG;IAC3C,gBAAgB;IAChB,kBAAkB;IAClB,kBAAkB;IAClB,aAAa;IACb,cAAc;IACd,kBAAkB;IAClB,wBAAwB;IACxB,eAAe;IACf,wBAAwB;IACxB,yBAAyB;CACjB,CAAC;AAEX,4EAA4E;AAC5E,MAAM,CAAC,MAAM,uBAAuB,GAAG;IACrC,iDAAiD;IACjD,KAAK,EAAE,6BAA6B;IACpC,gGAAgG;IAChG,KAAK,EAAE;QACL,gBAAgB;QAChB,kBAAkB;QAClB,aAAa;QACb,cAAc;QACd,kBAAkB;QAClB,wBAAwB;QACxB,eAAe;KAChB;IACD,iFAAiF;IACjF,MAAM,EAAE,CAAC,gBAAgB,EAAE,aAAa,CAAC;CACP,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nest-boot/auth",
|
|
3
|
-
"version": "8.0.5-beta.
|
|
3
|
+
"version": "8.0.5-beta.3",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/nest-boot/nest-boot.git",
|
|
@@ -53,13 +53,13 @@
|
|
|
53
53
|
"zod": "^4.3.6",
|
|
54
54
|
"@nest-boot/eslint-config": "^8.0.1-beta.0",
|
|
55
55
|
"@nest-boot/eslint-plugin": "^8.0.1-beta.0",
|
|
56
|
-
"@nest-boot/graphql-connection": "^8.0.1-beta.3",
|
|
57
56
|
"@nest-boot/hash": "^8.0.1-beta.0",
|
|
57
|
+
"@nest-boot/graphql-connection": "^8.0.1-beta.3",
|
|
58
58
|
"@nest-boot/mailer": "^8.0.1-beta.0",
|
|
59
59
|
"@nest-boot/middleware": "^8.0.1-beta.0",
|
|
60
60
|
"@nest-boot/request-context": "^8.0.1-beta.0",
|
|
61
|
-
"@nest-boot/tsconfig": "^8.0.0-beta.4",
|
|
62
61
|
"@nest-boot/validator": "^8.0.4-beta.0",
|
|
62
|
+
"@nest-boot/tsconfig": "^8.0.0-beta.4",
|
|
63
63
|
"@nest-boot/graphql": "^8.0.1-beta.0"
|
|
64
64
|
},
|
|
65
65
|
"peerDependencies": {
|
|
@@ -76,13 +76,13 @@
|
|
|
76
76
|
"@nestjs/graphql": "^14.0.0",
|
|
77
77
|
"graphql": "^16.0.0",
|
|
78
78
|
"zod": "^4.0.0",
|
|
79
|
-
"@nest-boot/
|
|
79
|
+
"@nest-boot/hash": "^8.0.1-beta.0",
|
|
80
80
|
"@nest-boot/mailer": "^8.0.1-beta.0",
|
|
81
81
|
"@nest-boot/request-context": "^8.0.1-beta.0",
|
|
82
|
+
"@nest-boot/graphql-connection": "^8.0.1-beta.3",
|
|
82
83
|
"@nest-boot/validator": "^8.0.4-beta.0",
|
|
83
|
-
"@nest-boot/
|
|
84
|
-
"@nest-boot/graphql": "^8.0.1-beta.0"
|
|
85
|
-
"@nest-boot/middleware": "^8.0.1-beta.0"
|
|
84
|
+
"@nest-boot/middleware": "^8.0.1-beta.0",
|
|
85
|
+
"@nest-boot/graphql": "^8.0.1-beta.0"
|
|
86
86
|
},
|
|
87
87
|
"publishConfig": {
|
|
88
88
|
"access": "public"
|