@rebasepro/server 0.9.1-canary.ff338b5 → 0.10.0
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/api/errors.d.ts +16 -1
- package/dist/api/rest/write-validation.d.ts +3 -0
- package/dist/api/types.d.ts +2 -2
- package/dist/auth/admin-users-route.d.ts +3 -3
- package/dist/auth/auth-hooks.d.ts +7 -7
- package/dist/auth/interfaces.d.ts +28 -28
- package/dist/auth/jwt.d.ts +8 -3
- package/dist/auth/magic-link-routes.d.ts +2 -2
- package/dist/auth/mfa-routes.d.ts +1 -1
- package/dist/auth/middleware.d.ts +3 -3
- package/dist/auth/reset-password-admin.d.ts +1 -1
- package/dist/auth/session-routes.d.ts +2 -2
- package/dist/index.es.js +507 -172
- package/dist/index.es.js.map +1 -1
- package/dist/init.d.ts +1 -1
- package/dist/{jwt-BJzQOa8a.js → jwt-B3zjddCa.js} +5 -5
- package/dist/{jwt-BJzQOa8a.js.map → jwt-B3zjddCa.js.map} +1 -1
- package/dist/src-CsHhSKbi.js.map +1 -1
- package/dist/storage/types.d.ts +1 -1
- package/dist/utils/sql.d.ts +2 -2
- package/package.json +5 -5
package/dist/init.d.ts
CHANGED
|
@@ -300,7 +300,7 @@ export interface RebaseBackendConfig {
|
|
|
300
300
|
* storageAuthorize: async ({ key, user, operation }) => {
|
|
301
301
|
* if (!user) return false;
|
|
302
302
|
* const [ownerId] = key.split("/");
|
|
303
|
-
* return ownerId === user.
|
|
303
|
+
* return ownerId === user.uid || operation === "read";
|
|
304
304
|
* }
|
|
305
305
|
* ```
|
|
306
306
|
*
|
|
@@ -4218,10 +4218,10 @@ function configureJwt(config) {
|
|
|
4218
4218
|
/**
|
|
4219
4219
|
* Generate an access token (short-lived, 1 hour by default)
|
|
4220
4220
|
*/
|
|
4221
|
-
function generateAccessToken(
|
|
4221
|
+
function generateAccessToken(uid, roles, aal = "aal1", customClaims) {
|
|
4222
4222
|
if (!jwtConfig.secret) throw new Error("JWT secret not configured. Call configureJwt() first.");
|
|
4223
4223
|
const payload = {
|
|
4224
|
-
|
|
4224
|
+
uid,
|
|
4225
4225
|
roles,
|
|
4226
4226
|
aal,
|
|
4227
4227
|
...customClaims
|
|
@@ -4274,14 +4274,14 @@ function verifyAccessToken(token) {
|
|
|
4274
4274
|
logger.error("[JWT] Verification failed: a purpose-scoped token is not an access token", { purpose: decoded.purpose });
|
|
4275
4275
|
return null;
|
|
4276
4276
|
}
|
|
4277
|
-
const id = decoded.
|
|
4277
|
+
const id = decoded.uid || decoded.userId || decoded.sub;
|
|
4278
4278
|
if (!id) {
|
|
4279
4279
|
logger.error("[JWT] Verification failed: missing id in payload", { detail: decoded });
|
|
4280
4280
|
return null;
|
|
4281
4281
|
}
|
|
4282
4282
|
const aal = decoded.aal === "aal1" || decoded.aal === "aal2" ? decoded.aal : "aal1";
|
|
4283
4283
|
return {
|
|
4284
|
-
|
|
4284
|
+
uid: id,
|
|
4285
4285
|
roles: decoded.roles || [],
|
|
4286
4286
|
aal
|
|
4287
4287
|
};
|
|
@@ -4365,4 +4365,4 @@ function verifyDownloadToken(token) {
|
|
|
4365
4365
|
//#endregion
|
|
4366
4366
|
export { getAccessTokenExpiry as a, jwt_exports as c, require_jsonwebtoken as d, __commonJSMin as f, __toESM as h, generateRefreshToken as i, verifyAccessToken as l, __require as m, generateAccessToken as n, getRefreshTokenExpiry as o, __exportAll as p, generateDownloadToken as r, hashRefreshToken as s, configureJwt as t, verifyDownloadToken as u };
|
|
4367
4367
|
|
|
4368
|
-
//# sourceMappingURL=jwt-
|
|
4368
|
+
//# sourceMappingURL=jwt-B3zjddCa.js.map
|