digitaltwin-core 0.9.0 → 0.9.2
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/auth/apisix_parser.d.ts +24 -0
- package/dist/auth/apisix_parser.d.ts.map +1 -1
- package/dist/auth/apisix_parser.js +28 -0
- package/dist/auth/apisix_parser.js.map +1 -1
- package/dist/auth/auth_config.d.ts +26 -0
- package/dist/auth/auth_config.d.ts.map +1 -1
- package/dist/auth/auth_config.js +35 -0
- package/dist/auth/auth_config.js.map +1 -1
- package/dist/components/assets_manager.d.ts +202 -9
- package/dist/components/assets_manager.d.ts.map +1 -1
- package/dist/components/assets_manager.js +552 -491
- package/dist/components/assets_manager.js.map +1 -1
- package/dist/components/types.d.ts +169 -19
- package/dist/components/types.d.ts.map +1 -1
- package/dist/components/types.js +6 -0
- package/dist/components/types.js.map +1 -1
- package/dist/database/adapters/knex_database_adapter.d.ts +10 -0
- package/dist/database/adapters/knex_database_adapter.d.ts.map +1 -1
- package/dist/database/adapters/knex_database_adapter.js +86 -0
- package/dist/database/adapters/knex_database_adapter.js.map +1 -1
- package/dist/database/database_adapter.d.ts +116 -7
- package/dist/database/database_adapter.d.ts.map +1 -1
- package/dist/database/database_adapter.js +41 -1
- package/dist/database/database_adapter.js.map +1 -1
- package/dist/engine/digital_twin_engine.d.ts +12 -0
- package/dist/engine/digital_twin_engine.d.ts.map +1 -1
- package/dist/engine/digital_twin_engine.js +4 -2
- package/dist/engine/digital_twin_engine.js.map +1 -1
- package/dist/engine/initializer.d.ts +8 -5
- package/dist/engine/initializer.d.ts.map +1 -1
- package/dist/engine/initializer.js +32 -13
- package/dist/engine/initializer.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/types/data_record.d.ts +8 -0
- package/dist/types/data_record.d.ts.map +1 -1
- package/dist/utils/http_responses.d.ts +155 -0
- package/dist/utils/http_responses.d.ts.map +1 -0
- package/dist/utils/http_responses.js +190 -0
- package/dist/utils/http_responses.js.map +1 -0
- package/dist/utils/index.d.ts +2 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +1 -0
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/map_to_data_record.d.ts.map +1 -1
- package/dist/utils/map_to_data_record.js +4 -1
- package/dist/utils/map_to_data_record.js.map +1 -1
- package/package.json +1 -2
|
@@ -118,5 +118,29 @@ export declare class ApisixAuthParser {
|
|
|
118
118
|
* ```
|
|
119
119
|
*/
|
|
120
120
|
static getUserRoles(headers: Record<string, string>): string[];
|
|
121
|
+
/**
|
|
122
|
+
* Checks if a user has the admin role.
|
|
123
|
+
*
|
|
124
|
+
* Determines if the authenticated user has administrative privileges by checking
|
|
125
|
+
* if their roles include the configured admin role name (default: "admin").
|
|
126
|
+
*
|
|
127
|
+
* The admin role name can be configured via DIGITALTWIN_ADMIN_ROLE_NAME environment variable.
|
|
128
|
+
*
|
|
129
|
+
* @param headers - HTTP request headers
|
|
130
|
+
* @returns true if user has admin role, false otherwise
|
|
131
|
+
*
|
|
132
|
+
* @example
|
|
133
|
+
* ```typescript
|
|
134
|
+
* if (ApisixAuthParser.isAdmin(req.headers)) {
|
|
135
|
+
* // User has full administrative access
|
|
136
|
+
* // Can view all assets including private assets owned by others
|
|
137
|
+
* console.log('Admin user detected')
|
|
138
|
+
* }
|
|
139
|
+
*
|
|
140
|
+
* // With custom admin role name (DIGITALTWIN_ADMIN_ROLE_NAME=administrator)
|
|
141
|
+
* const isAdmin = ApisixAuthParser.isAdmin(req.headers)
|
|
142
|
+
* ```
|
|
143
|
+
*/
|
|
144
|
+
static isAdmin(headers: Record<string, string>): boolean;
|
|
121
145
|
}
|
|
122
146
|
//# sourceMappingURL=apisix_parser.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apisix_parser.d.ts","sourceRoot":"","sources":["../../src/auth/apisix_parser.ts"],"names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O,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,MAAM,GAAG,IAAI;IAShE;;;;;;;;;;;;;;;;;;OAkBG;IACH,MAAM,CAAC,YAAY,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,MAAM,EAAE;IAU9D;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACH,MAAM,CAAC,OAAO,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,OAAO;CAK3D"}
|
|
@@ -153,5 +153,33 @@ export class ApisixAuthParser {
|
|
|
153
153
|
const rolesString = headers['x-user-roles'] || '';
|
|
154
154
|
return rolesString ? rolesString.split(',').map(role => role.trim()) : [];
|
|
155
155
|
}
|
|
156
|
+
/**
|
|
157
|
+
* Checks if a user has the admin role.
|
|
158
|
+
*
|
|
159
|
+
* Determines if the authenticated user has administrative privileges by checking
|
|
160
|
+
* if their roles include the configured admin role name (default: "admin").
|
|
161
|
+
*
|
|
162
|
+
* The admin role name can be configured via DIGITALTWIN_ADMIN_ROLE_NAME environment variable.
|
|
163
|
+
*
|
|
164
|
+
* @param headers - HTTP request headers
|
|
165
|
+
* @returns true if user has admin role, false otherwise
|
|
166
|
+
*
|
|
167
|
+
* @example
|
|
168
|
+
* ```typescript
|
|
169
|
+
* if (ApisixAuthParser.isAdmin(req.headers)) {
|
|
170
|
+
* // User has full administrative access
|
|
171
|
+
* // Can view all assets including private assets owned by others
|
|
172
|
+
* console.log('Admin user detected')
|
|
173
|
+
* }
|
|
174
|
+
*
|
|
175
|
+
* // With custom admin role name (DIGITALTWIN_ADMIN_ROLE_NAME=administrator)
|
|
176
|
+
* const isAdmin = ApisixAuthParser.isAdmin(req.headers)
|
|
177
|
+
* ```
|
|
178
|
+
*/
|
|
179
|
+
static isAdmin(headers) {
|
|
180
|
+
const roles = this.getUserRoles(headers);
|
|
181
|
+
const adminRoleName = AuthConfig.getAdminRoleName();
|
|
182
|
+
return roles.includes(adminRoleName);
|
|
183
|
+
}
|
|
156
184
|
}
|
|
157
185
|
//# sourceMappingURL=apisix_parser.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apisix_parser.js","sourceRoot":"","sources":["../../src/auth/apisix_parser.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAE7C;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,OAAO,gBAAgB;IACzB;;;;;;;;;;;;;;;;;;;;;;;;;;;OA2BG;IACH,MAAM,CAAC,gBAAgB,CAAC,OAA+B;QACnD,uDAAuD;QACvD,IAAI,UAAU,CAAC,cAAc,EAAE,EAAE,CAAC;YAC9B,OAAO,UAAU,CAAC,gBAAgB,EAAE,CAAA;QACxC,CAAC;QAED,MAAM,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,CAAA;QACnC,IAAI,CAAC,MAAM,EAAE,CAAC;YACV,OAAO,IAAI,CAAA;QACf,CAAC;QAED,0CAA0C;QAC1C,MAAM,WAAW,GAAG,OAAO,CAAC,cAAc,CAAC,IAAI,EAAE,CAAA;QACjD,MAAM,KAAK,GAAG,WAAW,CAAC,CAAC,CAAC,WAAW,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAA;QAEhF,OAAO;YACH,EAAE,EAAE,MAAM;YACV,KAAK,EAAE,KAAK;SACf,CAAA;IACL,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACH,MAAM,CAAC,YAAY,CAAC,OAA+B;QAC/C,wDAAwD;QACxD,IAAI,UAAU,CAAC,cAAc,EAAE,EAAE,CAAC;YAC9B,OAAO,IAAI,CAAA;QACf,CAAC;QAED,OAAO,CAAC,CAAC,OAAO,CAAC,WAAW,CAAC,CAAA;IACjC,CAAC;IAED;;;;;;;;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,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAA;IAC7E,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACH,MAAM,CAAC,OAAO,CAAC,OAA+B;QAC1C,MAAM,KAAK,GAAG,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,CAAA;QACxC,MAAM,aAAa,GAAG,UAAU,CAAC,gBAAgB,EAAE,CAAA;QACnD,OAAO,KAAK,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAA;IACxC,CAAC;CACJ"}
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
* Environment variables:
|
|
9
9
|
* - DIGITALTWIN_DISABLE_AUTH: Set to "true" or "1" to disable authentication (default: false)
|
|
10
10
|
* - DIGITALTWIN_ANONYMOUS_USER_ID: User ID to use when auth is disabled (default: "anonymous")
|
|
11
|
+
* - DIGITALTWIN_ADMIN_ROLE_NAME: Name of the admin role in Keycloak (default: "admin")
|
|
11
12
|
*
|
|
12
13
|
* @example
|
|
13
14
|
* ```bash
|
|
@@ -15,6 +16,9 @@
|
|
|
15
16
|
* export DIGITALTWIN_DISABLE_AUTH=true
|
|
16
17
|
* export DIGITALTWIN_ANONYMOUS_USER_ID=dev-user-123
|
|
17
18
|
*
|
|
19
|
+
* # Configure admin role name
|
|
20
|
+
* export DIGITALTWIN_ADMIN_ROLE_NAME=administrator
|
|
21
|
+
*
|
|
18
22
|
* # Enable authentication (default)
|
|
19
23
|
* export DIGITALTWIN_DISABLE_AUTH=false
|
|
20
24
|
* ```
|
|
@@ -28,6 +32,9 @@
|
|
|
28
32
|
* const anonymousUser = AuthConfig.getAnonymousUser()
|
|
29
33
|
* console.log(`Using anonymous user: ${anonymousUser.id}`)
|
|
30
34
|
* }
|
|
35
|
+
*
|
|
36
|
+
* const adminRole = AuthConfig.getAdminRoleName()
|
|
37
|
+
* console.log(`Admin role is: ${adminRole}`)
|
|
31
38
|
* ```
|
|
32
39
|
*/
|
|
33
40
|
export declare class AuthConfig {
|
|
@@ -90,6 +97,25 @@ export declare class AuthConfig {
|
|
|
90
97
|
id: string;
|
|
91
98
|
roles: string[];
|
|
92
99
|
};
|
|
100
|
+
/**
|
|
101
|
+
* Gets the name of the admin role configured for the system.
|
|
102
|
+
*
|
|
103
|
+
* This role name is used to determine if a user has full administrative
|
|
104
|
+
* access to all resources, including private assets owned by other users.
|
|
105
|
+
*
|
|
106
|
+
* @returns The admin role name (default: "admin")
|
|
107
|
+
*
|
|
108
|
+
* @example
|
|
109
|
+
* ```typescript
|
|
110
|
+
* const adminRole = AuthConfig.getAdminRoleName()
|
|
111
|
+
* console.log(`Admin role: ${adminRole}`) // "admin" by default
|
|
112
|
+
*
|
|
113
|
+
* // Check if user has admin role
|
|
114
|
+
* const userRoles = ['user', 'admin', 'moderator']
|
|
115
|
+
* const isAdmin = userRoles.includes(adminRole)
|
|
116
|
+
* ```
|
|
117
|
+
*/
|
|
118
|
+
static getAdminRoleName(): string;
|
|
93
119
|
/**
|
|
94
120
|
* Resets the cached configuration (useful for testing).
|
|
95
121
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth_config.d.ts","sourceRoot":"","sources":["../../src/auth/auth_config.ts"],"names":[],"mappings":"AAEA
|
|
1
|
+
{"version":3,"file":"auth_config.d.ts","sourceRoot":"","sources":["../../src/auth/auth_config.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,qBAAa,UAAU;IACnB,OAAO,CAAC,MAAM,CAAC,OAAO,CAIP;IAEf;;;OAGG;IACH,OAAO,CAAC,MAAM,CAAC,UAAU;IAqCzB;;;OAGG;IACH,OAAO,CAAC,MAAM,CAAC,SAAS;IAQxB;;;;;;;;;;;OAWG;IACH,MAAM,CAAC,cAAc,IAAI,OAAO;IAIhC;;;;OAIG;IACH,MAAM,CAAC,aAAa,IAAI,OAAO;IAI/B;;;;;;;;;;OAUG;IACH,MAAM,CAAC,kBAAkB,IAAI,MAAM;IAInC;;;;;;;;;;;;OAYG;IACH,MAAM,CAAC,gBAAgB;;;;IAOvB;;;;;;;;;;;;;;;;;OAiBG;IACH,MAAM,CAAC,gBAAgB,IAAI,MAAM;IAIjC;;;;OAIG;IACH,MAAM,CAAC,YAAY;CAGtB"}
|
package/dist/auth/auth_config.js
CHANGED
|
@@ -9,6 +9,7 @@ import { Env } from '../env/env.js';
|
|
|
9
9
|
* Environment variables:
|
|
10
10
|
* - DIGITALTWIN_DISABLE_AUTH: Set to "true" or "1" to disable authentication (default: false)
|
|
11
11
|
* - DIGITALTWIN_ANONYMOUS_USER_ID: User ID to use when auth is disabled (default: "anonymous")
|
|
12
|
+
* - DIGITALTWIN_ADMIN_ROLE_NAME: Name of the admin role in Keycloak (default: "admin")
|
|
12
13
|
*
|
|
13
14
|
* @example
|
|
14
15
|
* ```bash
|
|
@@ -16,6 +17,9 @@ import { Env } from '../env/env.js';
|
|
|
16
17
|
* export DIGITALTWIN_DISABLE_AUTH=true
|
|
17
18
|
* export DIGITALTWIN_ANONYMOUS_USER_ID=dev-user-123
|
|
18
19
|
*
|
|
20
|
+
* # Configure admin role name
|
|
21
|
+
* export DIGITALTWIN_ADMIN_ROLE_NAME=administrator
|
|
22
|
+
*
|
|
19
23
|
* # Enable authentication (default)
|
|
20
24
|
* export DIGITALTWIN_DISABLE_AUTH=false
|
|
21
25
|
* ```
|
|
@@ -29,6 +33,9 @@ import { Env } from '../env/env.js';
|
|
|
29
33
|
* const anonymousUser = AuthConfig.getAnonymousUser()
|
|
30
34
|
* console.log(`Using anonymous user: ${anonymousUser.id}`)
|
|
31
35
|
* }
|
|
36
|
+
*
|
|
37
|
+
* const adminRole = AuthConfig.getAdminRoleName()
|
|
38
|
+
* console.log(`Admin role is: ${adminRole}`)
|
|
32
39
|
* ```
|
|
33
40
|
*/
|
|
34
41
|
export class AuthConfig {
|
|
@@ -47,12 +54,19 @@ export class AuthConfig {
|
|
|
47
54
|
}),
|
|
48
55
|
DIGITALTWIN_ANONYMOUS_USER_ID: Env.schema.string({
|
|
49
56
|
optional: true
|
|
57
|
+
}),
|
|
58
|
+
DIGITALTWIN_ADMIN_ROLE_NAME: Env.schema.string({
|
|
59
|
+
optional: true
|
|
50
60
|
})
|
|
51
61
|
});
|
|
52
62
|
// Set default anonymous user ID if not provided
|
|
53
63
|
if (!config.DIGITALTWIN_ANONYMOUS_USER_ID) {
|
|
54
64
|
config.DIGITALTWIN_ANONYMOUS_USER_ID = 'anonymous';
|
|
55
65
|
}
|
|
66
|
+
// Set default admin role name if not provided
|
|
67
|
+
if (!config.DIGITALTWIN_ADMIN_ROLE_NAME) {
|
|
68
|
+
config.DIGITALTWIN_ADMIN_ROLE_NAME = 'admin';
|
|
69
|
+
}
|
|
56
70
|
this._config = config;
|
|
57
71
|
}
|
|
58
72
|
/**
|
|
@@ -122,6 +136,27 @@ export class AuthConfig {
|
|
|
122
136
|
roles: ['anonymous']
|
|
123
137
|
};
|
|
124
138
|
}
|
|
139
|
+
/**
|
|
140
|
+
* Gets the name of the admin role configured for the system.
|
|
141
|
+
*
|
|
142
|
+
* This role name is used to determine if a user has full administrative
|
|
143
|
+
* access to all resources, including private assets owned by other users.
|
|
144
|
+
*
|
|
145
|
+
* @returns The admin role name (default: "admin")
|
|
146
|
+
*
|
|
147
|
+
* @example
|
|
148
|
+
* ```typescript
|
|
149
|
+
* const adminRole = AuthConfig.getAdminRoleName()
|
|
150
|
+
* console.log(`Admin role: ${adminRole}`) // "admin" by default
|
|
151
|
+
*
|
|
152
|
+
* // Check if user has admin role
|
|
153
|
+
* const userRoles = ['user', 'admin', 'moderator']
|
|
154
|
+
* const isAdmin = userRoles.includes(adminRole)
|
|
155
|
+
* ```
|
|
156
|
+
*/
|
|
157
|
+
static getAdminRoleName() {
|
|
158
|
+
return this.getConfig().DIGITALTWIN_ADMIN_ROLE_NAME;
|
|
159
|
+
}
|
|
125
160
|
/**
|
|
126
161
|
* Resets the cached configuration (useful for testing).
|
|
127
162
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth_config.js","sourceRoot":"","sources":["../../src/auth/auth_config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,eAAe,CAAA;AAEnC
|
|
1
|
+
{"version":3,"file":"auth_config.js","sourceRoot":"","sources":["../../src/auth/auth_config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,eAAe,CAAA;AAEnC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,MAAM,OAAO,UAAU;aACJ,YAAO,GAIX,IAAI,CAAA;IAEf;;;OAGG;IACK,MAAM,CAAC,UAAU;QACrB,IAAI,IAAI,CAAC,OAAO,KAAK,IAAI;YAAE,OAAM;QAEjC,MAAM,MAAM,GAAG,GAAG,CAAC,QAAQ,CAAC;YACxB,wBAAwB,EAAE,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC;gBACzC,QAAQ,EAAE,IAAI;gBACd,OAAO,EAAE,KAAK;aACjB,CAAC;YACF,6BAA6B,EAAE,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC;gBAC7C,QAAQ,EAAE,IAAI;aACjB,CAAC;YACF,2BAA2B,EAAE,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC;gBAC3C,QAAQ,EAAE,IAAI;aACjB,CAAC;SACL,CAIA,CAAA;QAED,gDAAgD;QAChD,IAAI,CAAC,MAAM,CAAC,6BAA6B,EAAE,CAAC;YACxC,MAAM,CAAC,6BAA6B,GAAG,WAAW,CAAA;QACtD,CAAC;QAED,8CAA8C;QAC9C,IAAI,CAAC,MAAM,CAAC,2BAA2B,EAAE,CAAC;YACtC,MAAM,CAAC,2BAA2B,GAAG,OAAO,CAAA;QAChD,CAAC;QAED,IAAI,CAAC,OAAO,GAAG,MAId,CAAA;IACL,CAAC;IAED;;;OAGG;IACK,MAAM,CAAC,SAAS;QACpB,IAAI,CAAC,UAAU,EAAE,CAAA;QACjB,IAAI,IAAI,CAAC,OAAO,KAAK,IAAI,EAAE,CAAC;YACxB,MAAM,IAAI,KAAK,CAAC,6CAA6C,CAAC,CAAA;QAClE,CAAC;QACD,OAAO,IAAI,CAAC,OAAO,CAAA;IACvB,CAAC;IAED;;;;;;;;;;;OAWG;IACH,MAAM,CAAC,cAAc;QACjB,OAAO,IAAI,CAAC,SAAS,EAAE,CAAC,wBAAwB,CAAA;IACpD,CAAC;IAED;;;;OAIG;IACH,MAAM,CAAC,aAAa;QAChB,OAAO,CAAC,IAAI,CAAC,cAAc,EAAE,CAAA;IACjC,CAAC;IAED;;;;;;;;;;OAUG;IACH,MAAM,CAAC,kBAAkB;QACrB,OAAO,IAAI,CAAC,SAAS,EAAE,CAAC,6BAA6B,CAAA;IACzD,CAAC;IAED;;;;;;;;;;;;OAYG;IACH,MAAM,CAAC,gBAAgB;QACnB,OAAO;YACH,EAAE,EAAE,IAAI,CAAC,kBAAkB,EAAE;YAC7B,KAAK,EAAE,CAAC,WAAW,CAAC;SACvB,CAAA;IACL,CAAC;IAED;;;;;;;;;;;;;;;;;OAiBG;IACH,MAAM,CAAC,gBAAgB;QACnB,OAAO,IAAI,CAAC,SAAS,EAAE,CAAC,2BAA2B,CAAA;IACvD,CAAC;IAED;;;;OAIG;IACH,MAAM,CAAC,YAAY;QACf,IAAI,CAAC,OAAO,GAAG,IAAI,CAAA;IACvB,CAAC"}
|
|
@@ -22,7 +22,8 @@ import { UserService } from '../auth/user_service.js';
|
|
|
22
22
|
* description: '3D building model',
|
|
23
23
|
* source: 'https://example.com/data-source',
|
|
24
24
|
* owner_id: 123,
|
|
25
|
-
* filename: 'building.glb'
|
|
25
|
+
* filename: 'building.glb',
|
|
26
|
+
* is_public: true
|
|
26
27
|
* }
|
|
27
28
|
* ```
|
|
28
29
|
*/
|
|
@@ -35,6 +36,8 @@ export interface AssetMetadataRow extends MetadataRow {
|
|
|
35
36
|
owner_id: number | null;
|
|
36
37
|
/** Original filename provided by the user */
|
|
37
38
|
filename: string;
|
|
39
|
+
/** Whether the asset is publicly accessible (true) or private (false) */
|
|
40
|
+
is_public: boolean;
|
|
38
41
|
}
|
|
39
42
|
/**
|
|
40
43
|
* Request payload for creating a new asset.
|
|
@@ -48,7 +51,8 @@ export interface AssetMetadataRow extends MetadataRow {
|
|
|
48
51
|
* source: 'https://city-data.example.com/buildings',
|
|
49
52
|
* owner_id: 'user123',
|
|
50
53
|
* filename: 'building.glb',
|
|
51
|
-
* file: fileBuffer
|
|
54
|
+
* file: fileBuffer,
|
|
55
|
+
* is_public: true
|
|
52
56
|
* }
|
|
53
57
|
* ```
|
|
54
58
|
*/
|
|
@@ -63,6 +67,8 @@ export interface CreateAssetRequest {
|
|
|
63
67
|
filename: string;
|
|
64
68
|
/** File content as Buffer */
|
|
65
69
|
file: Buffer;
|
|
70
|
+
/** Whether the asset is publicly accessible (default: true) */
|
|
71
|
+
is_public?: boolean;
|
|
66
72
|
}
|
|
67
73
|
/**
|
|
68
74
|
* Request payload for updating asset metadata.
|
|
@@ -73,7 +79,8 @@ export interface CreateAssetRequest {
|
|
|
73
79
|
* ```typescript
|
|
74
80
|
* const updates: UpdateAssetRequest = {
|
|
75
81
|
* description: 'Updated building model with new textures',
|
|
76
|
-
* source: 'https://updated-source.example.com'
|
|
82
|
+
* source: 'https://updated-source.example.com',
|
|
83
|
+
* is_public: false
|
|
77
84
|
* }
|
|
78
85
|
* ```
|
|
79
86
|
*/
|
|
@@ -82,6 +89,8 @@ export interface UpdateAssetRequest {
|
|
|
82
89
|
description?: string;
|
|
83
90
|
/** Updated source URL (optional, validated if provided) */
|
|
84
91
|
source?: string;
|
|
92
|
+
/** Updated visibility (optional) */
|
|
93
|
+
is_public?: boolean;
|
|
85
94
|
}
|
|
86
95
|
/**
|
|
87
96
|
* Abstract base class for Assets Manager components with authentication and access control.
|
|
@@ -150,14 +159,20 @@ export declare abstract class AssetsManager implements Component, Servable {
|
|
|
150
159
|
*
|
|
151
160
|
* @param {DatabaseAdapter} db - The database adapter for metadata storage
|
|
152
161
|
* @param {StorageService} storage - The storage service for file persistence
|
|
162
|
+
* @param {UserService} [userService] - Optional user service for authentication (created automatically if not provided)
|
|
153
163
|
*
|
|
154
164
|
* @example
|
|
155
165
|
* ```typescript
|
|
166
|
+
* // Standard usage (UserService created automatically)
|
|
156
167
|
* const assetsManager = new MyAssetsManager()
|
|
157
168
|
* assetsManager.setDependencies(databaseAdapter, storageService)
|
|
169
|
+
*
|
|
170
|
+
* // For testing (inject mock UserService)
|
|
171
|
+
* const mockUserService = new MockUserService()
|
|
172
|
+
* assetsManager.setDependencies(databaseAdapter, storageService, mockUserService)
|
|
158
173
|
* ```
|
|
159
174
|
*/
|
|
160
|
-
setDependencies(db: DatabaseAdapter, storage: StorageService): void;
|
|
175
|
+
setDependencies(db: DatabaseAdapter, storage: StorageService, userService?: UserService): void;
|
|
161
176
|
/**
|
|
162
177
|
* Returns the configuration of the assets manager.
|
|
163
178
|
*
|
|
@@ -219,6 +234,104 @@ export declare abstract class AssetsManager implements Component, Servable {
|
|
|
219
234
|
* ```
|
|
220
235
|
*/
|
|
221
236
|
private validateFileExtension;
|
|
237
|
+
/**
|
|
238
|
+
* Validates that a string is valid base64-encoded data.
|
|
239
|
+
*
|
|
240
|
+
* Used internally to ensure file data in batch uploads is properly base64-encoded
|
|
241
|
+
* before attempting to decode it.
|
|
242
|
+
*
|
|
243
|
+
* @private
|
|
244
|
+
* @param {any} data - Data to validate as base64
|
|
245
|
+
* @returns {boolean} True if data is a valid base64 string, false otherwise
|
|
246
|
+
*
|
|
247
|
+
* @example
|
|
248
|
+
* ```typescript
|
|
249
|
+
* this.validateBase64('SGVsbG8gV29ybGQ=') // returns true
|
|
250
|
+
* this.validateBase64('not-base64!@#') // returns false
|
|
251
|
+
* this.validateBase64(123) // returns false (not a string)
|
|
252
|
+
* this.validateBase64('') // returns false (empty string)
|
|
253
|
+
* ```
|
|
254
|
+
*/
|
|
255
|
+
private validateBase64;
|
|
256
|
+
/**
|
|
257
|
+
* Authenticates a request and returns the user record.
|
|
258
|
+
*
|
|
259
|
+
* This method consolidates the authentication flow:
|
|
260
|
+
* 1. Validates APISIX headers are present
|
|
261
|
+
* 2. Parses authentication headers
|
|
262
|
+
* 3. Finds or creates user record in database
|
|
263
|
+
*
|
|
264
|
+
* @param req - HTTP request object
|
|
265
|
+
* @returns AuthResult with either userRecord on success or DataResponse on failure
|
|
266
|
+
*
|
|
267
|
+
* @example
|
|
268
|
+
* ```typescript
|
|
269
|
+
* const authResult = await this.authenticateRequest(req)
|
|
270
|
+
* if (!authResult.success) {
|
|
271
|
+
* return authResult.response
|
|
272
|
+
* }
|
|
273
|
+
* const userRecord = authResult.userRecord
|
|
274
|
+
* ```
|
|
275
|
+
*/
|
|
276
|
+
private authenticateRequest;
|
|
277
|
+
/**
|
|
278
|
+
* Extracts upload data from multipart form request.
|
|
279
|
+
*
|
|
280
|
+
* @param req - HTTP request object with body and file
|
|
281
|
+
* @returns UploadData object with extracted fields
|
|
282
|
+
*/
|
|
283
|
+
private extractUploadData;
|
|
284
|
+
/**
|
|
285
|
+
* Validates required fields for asset upload and returns validated data.
|
|
286
|
+
*
|
|
287
|
+
* @param data - Upload data to validate
|
|
288
|
+
* @returns UploadValidationResult with validated data on success or error response on failure
|
|
289
|
+
*/
|
|
290
|
+
private validateUploadFields;
|
|
291
|
+
/**
|
|
292
|
+
* Reads file content from temporary upload path.
|
|
293
|
+
*
|
|
294
|
+
* @param filePath - Path to temporary file
|
|
295
|
+
* @returns Buffer with file content
|
|
296
|
+
* @throws Error if file cannot be read
|
|
297
|
+
*/
|
|
298
|
+
private readTempFile;
|
|
299
|
+
/**
|
|
300
|
+
* Cleans up temporary file after processing.
|
|
301
|
+
* Silently ignores cleanup errors.
|
|
302
|
+
*
|
|
303
|
+
* @param filePath - Path to temporary file
|
|
304
|
+
*/
|
|
305
|
+
private cleanupTempFile;
|
|
306
|
+
/**
|
|
307
|
+
* Validates ownership of an asset.
|
|
308
|
+
*
|
|
309
|
+
* @param asset - Asset record to check
|
|
310
|
+
* @param userId - User ID to validate against
|
|
311
|
+
* @returns DataResponse with error if not owner, undefined if valid
|
|
312
|
+
*/
|
|
313
|
+
private validateOwnership;
|
|
314
|
+
/**
|
|
315
|
+
* Checks if a user can access a private asset.
|
|
316
|
+
*
|
|
317
|
+
* @param asset - Asset record to check
|
|
318
|
+
* @param req - HTTP request for authentication context
|
|
319
|
+
* @returns DataResponse with error if access denied, undefined if allowed
|
|
320
|
+
*/
|
|
321
|
+
private checkPrivateAssetAccess;
|
|
322
|
+
/**
|
|
323
|
+
* Fetches an asset by ID with full access control validation.
|
|
324
|
+
*
|
|
325
|
+
* This method consolidates the common logic for retrieving an asset:
|
|
326
|
+
* 1. Validates that ID is provided
|
|
327
|
+
* 2. Fetches the asset from database
|
|
328
|
+
* 3. Verifies the asset belongs to this component
|
|
329
|
+
* 4. Checks access permissions for private assets
|
|
330
|
+
*
|
|
331
|
+
* @param req - HTTP request with params.id
|
|
332
|
+
* @returns Object with asset on success, or DataResponse on failure
|
|
333
|
+
*/
|
|
334
|
+
private fetchAssetWithAccessCheck;
|
|
222
335
|
/**
|
|
223
336
|
* Upload a new asset file with metadata.
|
|
224
337
|
*
|
|
@@ -235,7 +348,8 @@ export declare abstract class AssetsManager implements Component, Servable {
|
|
|
235
348
|
* source: 'https://city-data.example.com/buildings',
|
|
236
349
|
* owner_id: 'user123',
|
|
237
350
|
* filename: 'building.glb',
|
|
238
|
-
* file: fileBuffer
|
|
351
|
+
* file: fileBuffer,
|
|
352
|
+
* is_public: true
|
|
239
353
|
* })
|
|
240
354
|
* ```
|
|
241
355
|
*/
|
|
@@ -246,9 +360,28 @@ export declare abstract class AssetsManager implements Component, Servable {
|
|
|
246
360
|
* Returns a JSON list of all assets with their metadata, following the
|
|
247
361
|
* framework pattern but adapted for assets management.
|
|
248
362
|
*
|
|
363
|
+
* Access control:
|
|
364
|
+
* - Unauthenticated users: Can only see public assets
|
|
365
|
+
* - Authenticated users: Can see public assets + their own private assets
|
|
366
|
+
* - Admin users: Can see all assets (public and private from all users)
|
|
367
|
+
*
|
|
249
368
|
* @returns {Promise<DataResponse>} JSON response with all assets
|
|
250
369
|
*/
|
|
251
|
-
retrieve(): Promise<DataResponse>;
|
|
370
|
+
retrieve(req?: any): Promise<DataResponse>;
|
|
371
|
+
/**
|
|
372
|
+
* Gets the authenticated user's database ID from request headers.
|
|
373
|
+
*
|
|
374
|
+
* @param req - HTTP request object
|
|
375
|
+
* @returns User ID or null if not authenticated
|
|
376
|
+
*/
|
|
377
|
+
private getAuthenticatedUserId;
|
|
378
|
+
/**
|
|
379
|
+
* Formats assets for API response with metadata and URLs.
|
|
380
|
+
*
|
|
381
|
+
* @param assets - Array of asset records
|
|
382
|
+
* @returns Formatted assets array ready for JSON serialization
|
|
383
|
+
*/
|
|
384
|
+
private formatAssetsForResponse;
|
|
252
385
|
/**
|
|
253
386
|
* Get all assets for this component type.
|
|
254
387
|
*
|
|
@@ -282,7 +415,7 @@ export declare abstract class AssetsManager implements Component, Servable {
|
|
|
282
415
|
/**
|
|
283
416
|
* Update asset metadata by ID.
|
|
284
417
|
*
|
|
285
|
-
* Updates the metadata (description and/or
|
|
418
|
+
* Updates the metadata (description, source, and/or visibility) of a specific asset.
|
|
286
419
|
* Asset metadata is stored as dedicated columns in the database.
|
|
287
420
|
*
|
|
288
421
|
* @param {string} id - The ID of the asset to update
|
|
@@ -293,7 +426,8 @@ export declare abstract class AssetsManager implements Component, Servable {
|
|
|
293
426
|
* ```typescript
|
|
294
427
|
* await assetsManager.updateAssetMetadata('123', {
|
|
295
428
|
* description: 'Updated building model with new textures',
|
|
296
|
-
* source: 'https://updated-source.example.com'
|
|
429
|
+
* source: 'https://updated-source.example.com',
|
|
430
|
+
* is_public: false
|
|
297
431
|
* })
|
|
298
432
|
* ```
|
|
299
433
|
*/
|
|
@@ -375,7 +509,33 @@ export declare abstract class AssetsManager implements Component, Servable {
|
|
|
375
509
|
responseType?: string;
|
|
376
510
|
}>;
|
|
377
511
|
/**
|
|
378
|
-
* Handle upload
|
|
512
|
+
* Handle single asset upload via HTTP POST.
|
|
513
|
+
*
|
|
514
|
+
* Flow:
|
|
515
|
+
* 1. Validate request structure and authentication
|
|
516
|
+
* 2. Extract user identity from Apache APISIX headers
|
|
517
|
+
* 3. Validate file extension and read uploaded file
|
|
518
|
+
* 4. Store file via storage service and metadata in database
|
|
519
|
+
* 5. Set owner_id to authenticated user (prevents ownership spoofing)
|
|
520
|
+
* 6. Apply is_public setting (defaults to true if not specified)
|
|
521
|
+
*
|
|
522
|
+
* Authentication: Required
|
|
523
|
+
* Ownership: Automatically set to authenticated user
|
|
524
|
+
*
|
|
525
|
+
* @param req - HTTP request with multipart/form-data file upload
|
|
526
|
+
* @returns HTTP response with success/error status
|
|
527
|
+
*
|
|
528
|
+
* @example
|
|
529
|
+
* POST /assets
|
|
530
|
+
* Content-Type: multipart/form-data
|
|
531
|
+
* x-user-id: user-uuid
|
|
532
|
+
* x-user-roles: user,premium
|
|
533
|
+
*
|
|
534
|
+
* Form data:
|
|
535
|
+
* - file: <binary file>
|
|
536
|
+
* - description: "3D model of building"
|
|
537
|
+
* - source: "https://source.com"
|
|
538
|
+
* - is_public: true
|
|
379
539
|
*/
|
|
380
540
|
handleUpload(req: any): Promise<DataResponse>;
|
|
381
541
|
/**
|
|
@@ -399,6 +559,11 @@ export declare abstract class AssetsManager implements Component, Servable {
|
|
|
399
559
|
* Returns the file content of a specific asset by ID for display/use in front-end.
|
|
400
560
|
* No download headers - just the raw file content.
|
|
401
561
|
*
|
|
562
|
+
* Access control:
|
|
563
|
+
* - Public assets: Accessible to everyone
|
|
564
|
+
* - Private assets: Accessible only to owner
|
|
565
|
+
* - Admin users: Can access all assets (public and private)
|
|
566
|
+
*
|
|
402
567
|
* @param {any} req - HTTP request object with params.id
|
|
403
568
|
* @returns {Promise<DataResponse>} HTTP response with file content
|
|
404
569
|
*
|
|
@@ -415,6 +580,11 @@ export declare abstract class AssetsManager implements Component, Servable {
|
|
|
415
580
|
* Downloads the file content of a specific asset by ID with download headers.
|
|
416
581
|
* Forces browser to download the file rather than display it.
|
|
417
582
|
*
|
|
583
|
+
* Access control:
|
|
584
|
+
* - Public assets: Accessible to everyone
|
|
585
|
+
* - Private assets: Accessible only to owner
|
|
586
|
+
* - Admin users: Can download all assets (public and private)
|
|
587
|
+
*
|
|
418
588
|
* @param {any} req - HTTP request object with params.id
|
|
419
589
|
* @returns {Promise<DataResponse>} HTTP response with file content and download headers
|
|
420
590
|
*
|
|
@@ -443,9 +613,32 @@ export declare abstract class AssetsManager implements Component, Servable {
|
|
|
443
613
|
* Handle batch upload endpoint
|
|
444
614
|
*/
|
|
445
615
|
handleUploadBatch(req: any): Promise<DataResponse>;
|
|
616
|
+
/**
|
|
617
|
+
* Validates all requests in a batch upload.
|
|
618
|
+
*
|
|
619
|
+
* @param requests - Array of upload requests to validate
|
|
620
|
+
* @returns DataResponse with error if validation fails, undefined if valid
|
|
621
|
+
*/
|
|
622
|
+
private validateBatchRequests;
|
|
623
|
+
/**
|
|
624
|
+
* Processes batch upload requests.
|
|
625
|
+
*
|
|
626
|
+
* @param requests - Array of upload requests
|
|
627
|
+
* @param ownerId - Owner user ID
|
|
628
|
+
* @returns Array of results for each upload
|
|
629
|
+
*/
|
|
630
|
+
private processBatchUploads;
|
|
446
631
|
/**
|
|
447
632
|
* Handle batch delete endpoint
|
|
448
633
|
*/
|
|
449
634
|
handleDeleteBatch(req: any): Promise<DataResponse>;
|
|
635
|
+
/**
|
|
636
|
+
* Processes batch delete requests.
|
|
637
|
+
*
|
|
638
|
+
* @param ids - Array of asset IDs to delete
|
|
639
|
+
* @param userId - User ID for ownership validation
|
|
640
|
+
* @returns Array of results for each deletion
|
|
641
|
+
*/
|
|
642
|
+
private processBatchDeletes;
|
|
450
643
|
}
|
|
451
644
|
//# sourceMappingURL=assets_manager.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"assets_manager.d.ts","sourceRoot":"","sources":["../../src/components/assets_manager.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAA;AAC1D,OAAO,KAAK,EAAE,0BAA0B,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAC1E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AACxD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAA;AACnE,OAAO,KAAK,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAA;AACnF,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAA;
|
|
1
|
+
{"version":3,"file":"assets_manager.d.ts","sourceRoot":"","sources":["../../src/components/assets_manager.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAA;AAC1D,OAAO,KAAK,EAAE,0BAA0B,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAC1E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AACxD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAA;AACnE,OAAO,KAAK,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAA;AACnF,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAA;AAGzD,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAgDrD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,WAAW,gBAAiB,SAAQ,WAAW;IACjD,8CAA8C;IAC9C,WAAW,EAAE,MAAM,CAAA;IACnB,kFAAkF;IAClF,MAAM,EAAE,MAAM,CAAA;IACd,8DAA8D;IAC9D,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAA;IACvB,6CAA6C;IAC7C,QAAQ,EAAE,MAAM,CAAA;IACh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