b23-lib 1.2.2 → 1.2.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/dist/index.d.mts CHANGED
@@ -248,9 +248,9 @@ type AuthUtilityConfig = {
248
248
  adminPublicKeys?: StringifiedJSONArray;
249
249
  };
250
250
  type AuthMiddlewareConfig = {
251
- allowAnonymous: boolean;
252
- allowSystem: boolean;
253
- allowUser: boolean;
251
+ allowAnonymous?: boolean;
252
+ allowSystem?: boolean;
253
+ allowUser?: boolean;
254
254
  };
255
255
  declare class AuthUtility {
256
256
  private maxTokenAge;
package/dist/index.d.ts CHANGED
@@ -248,9 +248,9 @@ type AuthUtilityConfig = {
248
248
  adminPublicKeys?: StringifiedJSONArray;
249
249
  };
250
250
  type AuthMiddlewareConfig = {
251
- allowAnonymous: boolean;
252
- allowSystem: boolean;
253
- allowUser: boolean;
251
+ allowAnonymous?: boolean;
252
+ allowSystem?: boolean;
253
+ allowUser?: boolean;
254
254
  };
255
255
  declare class AuthUtility {
256
256
  private maxTokenAge;
package/dist/index.js CHANGED
@@ -667,7 +667,7 @@ var AuthUtility = class {
667
667
  (0, import_assert.default)(payload.type === "Admin", ErrorTypes_default.INVALID_AUTH_TYPE);
668
668
  return payload;
669
669
  }
670
- AuthMiddleware({ allowAnonymous, allowSystem, allowUser } = DefaultAuthMiddlewareConfig) {
670
+ AuthMiddleware({ allowAnonymous = false, allowSystem = true, allowUser = true } = DefaultAuthMiddlewareConfig) {
671
671
  return async (req, res, next) => {
672
672
  try {
673
673
  const [authType, token] = req.get("Authorization")?.split(" ");
package/dist/index.mjs CHANGED
@@ -640,7 +640,7 @@ var AuthUtility = class {
640
640
  assert(payload.type === "Admin", ErrorTypes_default.INVALID_AUTH_TYPE);
641
641
  return payload;
642
642
  }
643
- AuthMiddleware({ allowAnonymous, allowSystem, allowUser } = DefaultAuthMiddlewareConfig) {
643
+ AuthMiddleware({ allowAnonymous = false, allowSystem = true, allowUser = true } = DefaultAuthMiddlewareConfig) {
644
644
  return async (req, res, next) => {
645
645
  try {
646
646
  const [authType, token] = req.get("Authorization")?.split(" ");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "b23-lib",
3
- "version": "1.2.2",
3
+ "version": "1.2.3",
4
4
  "description": "This repo hold common classes, type and util functiona",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",