@betterportal/auth-default 0.0.1
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 +12 -0
- package/bsb-plugin.json +23 -0
- package/bsb-tests.json +14 -0
- package/lib/defaultAuthManifest.d.ts +41 -0
- package/lib/defaultAuthManifest.d.ts.map +1 -0
- package/lib/defaultAuthManifest.js +67 -0
- package/lib/defaultAuthManifest.js.map +1 -0
- package/lib/index.d.ts +4 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +4 -0
- package/lib/index.js.map +1 -0
- package/lib/plugins/service-betterportal-auth-default/.bp-generated/registry.d.ts +3 -0
- package/lib/plugins/service-betterportal-auth-default/.bp-generated/registry.d.ts.map +1 -0
- package/lib/plugins/service-betterportal-auth-default/.bp-generated/registry.js +122 -0
- package/lib/plugins/service-betterportal-auth-default/.bp-generated/registry.js.map +1 -0
- package/lib/plugins/service-betterportal-auth-default/bp-routes/login/_theme.bootstrap1/_nav.profile.d.ts +5 -0
- package/lib/plugins/service-betterportal-auth-default/bp-routes/login/_theme.bootstrap1/_nav.profile.d.ts.map +1 -0
- package/lib/plugins/service-betterportal-auth-default/bp-routes/login/_theme.bootstrap1/_nav.profile.js +10 -0
- package/lib/plugins/service-betterportal-auth-default/bp-routes/login/_theme.bootstrap1/_nav.profile.js.map +1 -0
- package/lib/plugins/service-betterportal-auth-default/bp-routes/login/_theme.bootstrap1/index.d.ts +4 -0
- package/lib/plugins/service-betterportal-auth-default/bp-routes/login/_theme.bootstrap1/index.d.ts.map +1 -0
- package/lib/plugins/service-betterportal-auth-default/bp-routes/login/_theme.bootstrap1/index.js +81 -0
- package/lib/plugins/service-betterportal-auth-default/bp-routes/login/_theme.bootstrap1/index.js.map +1 -0
- package/lib/plugins/service-betterportal-auth-default/bp-routes/login/index.d.ts +89 -0
- package/lib/plugins/service-betterportal-auth-default/bp-routes/login/index.d.ts.map +1 -0
- package/lib/plugins/service-betterportal-auth-default/bp-routes/login/index.js +186 -0
- package/lib/plugins/service-betterportal-auth-default/bp-routes/login/index.js.map +1 -0
- package/lib/plugins/service-betterportal-auth-default/bp-routes/logout/_theme.bootstrap1/index.d.ts +5 -0
- package/lib/plugins/service-betterportal-auth-default/bp-routes/logout/_theme.bootstrap1/index.d.ts.map +1 -0
- package/lib/plugins/service-betterportal-auth-default/bp-routes/logout/_theme.bootstrap1/index.js +7 -0
- package/lib/plugins/service-betterportal-auth-default/bp-routes/logout/_theme.bootstrap1/index.js.map +1 -0
- package/lib/plugins/service-betterportal-auth-default/bp-routes/logout/index.d.ts +25 -0
- package/lib/plugins/service-betterportal-auth-default/bp-routes/logout/index.d.ts.map +1 -0
- package/lib/plugins/service-betterportal-auth-default/bp-routes/logout/index.js +38 -0
- package/lib/plugins/service-betterportal-auth-default/bp-routes/logout/index.js.map +1 -0
- package/lib/plugins/service-betterportal-auth-default/bp-routes/refresh/index.d.ts +31 -0
- package/lib/plugins/service-betterportal-auth-default/bp-routes/refresh/index.d.ts.map +1 -0
- package/lib/plugins/service-betterportal-auth-default/bp-routes/refresh/index.js +92 -0
- package/lib/plugins/service-betterportal-auth-default/bp-routes/refresh/index.js.map +1 -0
- package/lib/plugins/service-betterportal-auth-default/bp-routes/register/_theme.bootstrap1/index.400.d.ts +7 -0
- package/lib/plugins/service-betterportal-auth-default/bp-routes/register/_theme.bootstrap1/index.400.d.ts.map +1 -0
- package/lib/plugins/service-betterportal-auth-default/bp-routes/register/_theme.bootstrap1/index.400.js +7 -0
- package/lib/plugins/service-betterportal-auth-default/bp-routes/register/_theme.bootstrap1/index.400.js.map +1 -0
- package/lib/plugins/service-betterportal-auth-default/bp-routes/register/_theme.bootstrap1/index.d.ts +4 -0
- package/lib/plugins/service-betterportal-auth-default/bp-routes/register/_theme.bootstrap1/index.d.ts.map +1 -0
- package/lib/plugins/service-betterportal-auth-default/bp-routes/register/_theme.bootstrap1/index.js +63 -0
- package/lib/plugins/service-betterportal-auth-default/bp-routes/register/_theme.bootstrap1/index.js.map +1 -0
- package/lib/plugins/service-betterportal-auth-default/bp-routes/register/index.d.ts +64 -0
- package/lib/plugins/service-betterportal-auth-default/bp-routes/register/index.d.ts.map +1 -0
- package/lib/plugins/service-betterportal-auth-default/bp-routes/register/index.js +106 -0
- package/lib/plugins/service-betterportal-auth-default/bp-routes/register/index.js.map +1 -0
- package/lib/plugins/service-betterportal-auth-default/index.d.ts +115 -0
- package/lib/plugins/service-betterportal-auth-default/index.d.ts.map +1 -0
- package/lib/plugins/service-betterportal-auth-default/index.js +121 -0
- package/lib/plugins/service-betterportal-auth-default/index.js.map +1 -0
- package/lib/schemas/service-betterportal-auth-default.json +145 -0
- package/lib/schemas/service-betterportal-auth-default.plugin.json +158 -0
- package/lib/userStore.d.ts +52 -0
- package/lib/userStore.d.ts.map +1 -0
- package/lib/userStore.js +132 -0
- package/lib/userStore.js.map +1 -0
- package/package.json +68 -0
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
export interface StoredUser {
|
|
2
|
+
id: string;
|
|
3
|
+
username: string;
|
|
4
|
+
passwordHash: string;
|
|
5
|
+
email?: string;
|
|
6
|
+
name?: string;
|
|
7
|
+
picture?: string;
|
|
8
|
+
tenantId: string;
|
|
9
|
+
appRoles: Record<string, string[]>;
|
|
10
|
+
enabled: boolean;
|
|
11
|
+
createdAt: number;
|
|
12
|
+
updatedAt: number;
|
|
13
|
+
}
|
|
14
|
+
export interface AuthenticatedUser {
|
|
15
|
+
id: string;
|
|
16
|
+
username: string;
|
|
17
|
+
email?: string;
|
|
18
|
+
name?: string;
|
|
19
|
+
picture?: string;
|
|
20
|
+
tenantId: string;
|
|
21
|
+
roles: string[];
|
|
22
|
+
}
|
|
23
|
+
export interface CreateUserInput {
|
|
24
|
+
username: string;
|
|
25
|
+
password: string;
|
|
26
|
+
tenantId: string;
|
|
27
|
+
email?: string;
|
|
28
|
+
name?: string;
|
|
29
|
+
picture?: string;
|
|
30
|
+
appRoles?: Record<string, string[]>;
|
|
31
|
+
}
|
|
32
|
+
export declare class UserStore {
|
|
33
|
+
private readonly filePath;
|
|
34
|
+
private cache;
|
|
35
|
+
constructor(filePath: string);
|
|
36
|
+
createUser(input: CreateUserInput): Promise<StoredUser>;
|
|
37
|
+
/**
|
|
38
|
+
* True when no users exist. Bootstrap flows use this to allow open registration
|
|
39
|
+
* for the first admin user only. Once any user exists, registration is closed.
|
|
40
|
+
*/
|
|
41
|
+
hasNoUsers(): boolean;
|
|
42
|
+
userCount(): number;
|
|
43
|
+
authenticate(tenantId: string, appId: string, username: string, password: string): Promise<AuthenticatedUser | null>;
|
|
44
|
+
findById(id: string): StoredUser | null;
|
|
45
|
+
resolveRolesForApp(userId: string, appId: string): string[];
|
|
46
|
+
setPassword(userId: string, newPassword: string): Promise<void>;
|
|
47
|
+
setEnabled(userId: string, enabled: boolean): void;
|
|
48
|
+
setAppRoles(userId: string, appId: string, roles: string[]): void;
|
|
49
|
+
private load;
|
|
50
|
+
private save;
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=userStore.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"userStore.d.ts","sourceRoot":"","sources":["../src/userStore.ts"],"names":[],"mappings":"AAOA,MAAM,WAAW,UAAU;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;IACnC,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,iBAAiB;IAChC,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EA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AC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,IAAI;IASjE,OAAO,CAAC,IAAI;IAeZ,OAAO,CAAC,IAAI;CAKb"}
|
package/lib/userStore.js
ADDED
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import bcrypt from "bcrypt";
|
|
2
|
+
import { readFileSync, writeFileSync, existsSync, mkdirSync } from "node:fs";
|
|
3
|
+
import { dirname } from "node:path";
|
|
4
|
+
import { uuidv7 } from "@betterportal/framework";
|
|
5
|
+
const BCRYPT_ROUNDS = 12;
|
|
6
|
+
export class UserStore {
|
|
7
|
+
filePath;
|
|
8
|
+
cache = null;
|
|
9
|
+
constructor(filePath) {
|
|
10
|
+
this.filePath = filePath;
|
|
11
|
+
}
|
|
12
|
+
async createUser(input) {
|
|
13
|
+
const file = this.load();
|
|
14
|
+
if (file.users.some((user) => user.username === input.username && user.tenantId === input.tenantId)) {
|
|
15
|
+
throw new Error(`User ${input.username} already exists for tenant ${input.tenantId}`);
|
|
16
|
+
}
|
|
17
|
+
const now = Date.now();
|
|
18
|
+
const passwordHash = await bcrypt.hash(input.password, BCRYPT_ROUNDS);
|
|
19
|
+
const user = {
|
|
20
|
+
id: generateUserId(),
|
|
21
|
+
username: input.username,
|
|
22
|
+
passwordHash,
|
|
23
|
+
email: input.email,
|
|
24
|
+
name: input.name,
|
|
25
|
+
picture: input.picture,
|
|
26
|
+
tenantId: input.tenantId,
|
|
27
|
+
appRoles: input.appRoles ?? {},
|
|
28
|
+
enabled: true,
|
|
29
|
+
createdAt: now,
|
|
30
|
+
updatedAt: now
|
|
31
|
+
};
|
|
32
|
+
file.users.push(user);
|
|
33
|
+
this.save(file);
|
|
34
|
+
return user;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* True when no users exist. Bootstrap flows use this to allow open registration
|
|
38
|
+
* for the first admin user only. Once any user exists, registration is closed.
|
|
39
|
+
*/
|
|
40
|
+
hasNoUsers() {
|
|
41
|
+
return this.load().users.length === 0;
|
|
42
|
+
}
|
|
43
|
+
userCount() {
|
|
44
|
+
return this.load().users.length;
|
|
45
|
+
}
|
|
46
|
+
async authenticate(tenantId, appId, username, password) {
|
|
47
|
+
const file = this.load();
|
|
48
|
+
const user = file.users.find((entry) => entry.username === username && entry.tenantId === tenantId);
|
|
49
|
+
if (!user) {
|
|
50
|
+
await bcrypt.compare(password, "$2b$12$invalidsaltinvalidsaltinvalidsaltinvalidsaltinvalidsa");
|
|
51
|
+
return null;
|
|
52
|
+
}
|
|
53
|
+
if (!user.enabled) {
|
|
54
|
+
return null;
|
|
55
|
+
}
|
|
56
|
+
const ok = await bcrypt.compare(password, user.passwordHash);
|
|
57
|
+
if (!ok) {
|
|
58
|
+
return null;
|
|
59
|
+
}
|
|
60
|
+
const roles = user.appRoles[appId] ?? [];
|
|
61
|
+
return {
|
|
62
|
+
id: user.id,
|
|
63
|
+
username: user.username,
|
|
64
|
+
email: user.email,
|
|
65
|
+
name: user.name,
|
|
66
|
+
picture: user.picture,
|
|
67
|
+
tenantId: user.tenantId,
|
|
68
|
+
roles
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
findById(id) {
|
|
72
|
+
const file = this.load();
|
|
73
|
+
return file.users.find((user) => user.id === id) ?? null;
|
|
74
|
+
}
|
|
75
|
+
resolveRolesForApp(userId, appId) {
|
|
76
|
+
const user = this.findById(userId);
|
|
77
|
+
if (!user || !user.enabled)
|
|
78
|
+
return [];
|
|
79
|
+
return user.appRoles[appId] ?? [];
|
|
80
|
+
}
|
|
81
|
+
async setPassword(userId, newPassword) {
|
|
82
|
+
const file = this.load();
|
|
83
|
+
const user = file.users.find((entry) => entry.id === userId);
|
|
84
|
+
if (!user)
|
|
85
|
+
throw new Error(`User ${userId} not found`);
|
|
86
|
+
user.passwordHash = await bcrypt.hash(newPassword, BCRYPT_ROUNDS);
|
|
87
|
+
user.updatedAt = Date.now();
|
|
88
|
+
this.save(file);
|
|
89
|
+
}
|
|
90
|
+
setEnabled(userId, enabled) {
|
|
91
|
+
const file = this.load();
|
|
92
|
+
const user = file.users.find((entry) => entry.id === userId);
|
|
93
|
+
if (!user)
|
|
94
|
+
throw new Error(`User ${userId} not found`);
|
|
95
|
+
user.enabled = enabled;
|
|
96
|
+
user.updatedAt = Date.now();
|
|
97
|
+
this.save(file);
|
|
98
|
+
}
|
|
99
|
+
setAppRoles(userId, appId, roles) {
|
|
100
|
+
const file = this.load();
|
|
101
|
+
const user = file.users.find((entry) => entry.id === userId);
|
|
102
|
+
if (!user)
|
|
103
|
+
throw new Error(`User ${userId} not found`);
|
|
104
|
+
user.appRoles[appId] = roles;
|
|
105
|
+
user.updatedAt = Date.now();
|
|
106
|
+
this.save(file);
|
|
107
|
+
}
|
|
108
|
+
load() {
|
|
109
|
+
if (this.cache)
|
|
110
|
+
return this.cache;
|
|
111
|
+
if (!existsSync(this.filePath)) {
|
|
112
|
+
this.cache = { version: 1, users: [] };
|
|
113
|
+
return this.cache;
|
|
114
|
+
}
|
|
115
|
+
const raw = readFileSync(this.filePath, "utf8");
|
|
116
|
+
const parsed = JSON.parse(raw);
|
|
117
|
+
if (parsed.version !== 1 || !Array.isArray(parsed.users)) {
|
|
118
|
+
throw new Error(`User store ${this.filePath} is malformed`);
|
|
119
|
+
}
|
|
120
|
+
this.cache = parsed;
|
|
121
|
+
return this.cache;
|
|
122
|
+
}
|
|
123
|
+
save(file) {
|
|
124
|
+
mkdirSync(dirname(this.filePath), { recursive: true });
|
|
125
|
+
writeFileSync(this.filePath, JSON.stringify(file, null, 2), { mode: 0o600 });
|
|
126
|
+
this.cache = file;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
function generateUserId() {
|
|
130
|
+
return uuidv7();
|
|
131
|
+
}
|
|
132
|
+
//# sourceMappingURL=userStore.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"userStore.js","sourceRoot":"","sources":["../src/userStore.ts"],"names":[],"mappings":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E,KAAK,EAAE,EAAE,EAAE,CAAC;YACvC,OAAO,IAAI,CAAC,KAAK,CAAC;QACpB,CAAC;QACD,MAAM,GAAG,GAAG,YAAY,CAAC,IAAI,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;QAChD,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAkB,CAAC;QAChD,IAAI,MAAM,CAAC,OAAO,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC;YACzD,MAAM,IAAI,KAAK,CAAC,cAAc,IAAI,CAAC,QAAQ,eAAe,CAAC,CAAC;QAC9D,CAAC;QACD,IAAI,CAAC,KAAK,GAAG,MAAM,CAAC;QACpB,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;IAEO,IAAI,CAAC,IAAmB;QAC9B,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;QACvD,aAAa,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC;QAC7E,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;IACpB,CAAC;CACF;AAED,SAAS,cAAc;IACrB,OAAO,MAAM,EAAE,CAAC;AAClB,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@betterportal/auth-default",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "BetterPortal v10 default auth service for Node.js",
|
|
5
|
+
"main": "lib/index.js",
|
|
6
|
+
"types": "src/index.ts",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"bp-codegen": "bp-codegen",
|
|
9
|
+
"build": "bsb-plugin-cli build",
|
|
10
|
+
"clean": "bsb-plugin-cli clean",
|
|
11
|
+
"start": "bsb-plugin-cli start",
|
|
12
|
+
"dev": "bsb-plugin-cli dev",
|
|
13
|
+
"test": "tsx --test tests/*.test.ts",
|
|
14
|
+
"prepublishOnly": "npm run build"
|
|
15
|
+
},
|
|
16
|
+
"keywords": [
|
|
17
|
+
"betterportal",
|
|
18
|
+
"auth",
|
|
19
|
+
"jwt",
|
|
20
|
+
"jwks",
|
|
21
|
+
"platform-service"
|
|
22
|
+
],
|
|
23
|
+
"author": "BetterCorp",
|
|
24
|
+
"license": "(AGPL-3.0-only OR Commercial)",
|
|
25
|
+
"type": "module",
|
|
26
|
+
"devDependencies": {
|
|
27
|
+
"@bsb/base": "^9.5.0",
|
|
28
|
+
"@types/bcrypt": "^5.0.2",
|
|
29
|
+
"@types/node": "^24.12.2",
|
|
30
|
+
"tsx": "^4.21.0",
|
|
31
|
+
"typescript": "^5.9.3"
|
|
32
|
+
},
|
|
33
|
+
"dependencies": {
|
|
34
|
+
"@betterportal/framework": "0.0.1",
|
|
35
|
+
"@betterportal/plugin-bsb": "0.0.1",
|
|
36
|
+
"anyvali": "^1.0.6",
|
|
37
|
+
"bcrypt": "^5.1.1",
|
|
38
|
+
"jsx-htmx": "4.0.0-beta2"
|
|
39
|
+
},
|
|
40
|
+
"files": [
|
|
41
|
+
"lib/**/*",
|
|
42
|
+
"README.md",
|
|
43
|
+
"bsb-plugin.json",
|
|
44
|
+
"bsb-tests.json"
|
|
45
|
+
],
|
|
46
|
+
"bsb": {
|
|
47
|
+
"hooks": {
|
|
48
|
+
"afterSchemas": "bp-codegen"
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
"betterportal": {
|
|
52
|
+
"routes": [
|
|
53
|
+
"src/plugins/service-betterportal-auth-default/bp-routes/"
|
|
54
|
+
]
|
|
55
|
+
},
|
|
56
|
+
"homepage": "https://github.com/BetterCorp/BetterPortal#readme",
|
|
57
|
+
"repository": {
|
|
58
|
+
"type": "git",
|
|
59
|
+
"url": "git+https://github.com/BetterCorp/BetterPortal.git",
|
|
60
|
+
"directory": "services/nodejs/auth-default"
|
|
61
|
+
},
|
|
62
|
+
"bugs": {
|
|
63
|
+
"url": "https://github.com/BetterCorp/BetterPortal/issues"
|
|
64
|
+
},
|
|
65
|
+
"publishConfig": {
|
|
66
|
+
"access": "public"
|
|
67
|
+
}
|
|
68
|
+
}
|