@kravc/dos 1.11.13 → 1.11.15

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kravc/dos",
3
- "version": "1.11.13",
3
+ "version": "1.11.15",
4
4
  "description": "Convention-based, easy-to-use library for building API-driven serverless services.",
5
5
  "keywords": [
6
6
  "Service",
@@ -25,7 +25,7 @@
25
25
  "author": "Alexander Kravets <a@kra.vc>",
26
26
  "license": "ISC",
27
27
  "dependencies": {
28
- "@kravc/schema": "^2.7.4",
28
+ "@kravc/schema": "^2.7.5",
29
29
  "cookie": "^1.0.1",
30
30
  "js-yaml": "^4.1.0",
31
31
  "jsonwebtoken": "^9.0.2",
package/src/index.d.ts CHANGED
@@ -313,3 +313,10 @@ export declare class DocumentExistsError extends CommonError {
313
313
  export declare class DocumentNotFoundError extends CommonError {
314
314
  constructor(Document: { name: string }, parameters: Record<string, unknown>);
315
315
  };
316
+
317
+ interface Identity {
318
+ sub: string;
319
+ email: string;
320
+ }
321
+
322
+ export declare function authorize(Operation, Context): Promise<Identity>;
package/src/index.js CHANGED
@@ -14,6 +14,7 @@ module.exports = {
14
14
  Component: require('./Component'),
15
15
  handler: require('./helpers/handler'),
16
16
  getOrFail: require('./helpers/getOrFail'),
17
+ authorize: require('./helpers/authorize'),
17
18
  security: require('./security'),
18
19
  verifyToken: require('./security/verifyToken'),
19
20
  JwtAuthorization: require('./security/JwtAuthorization'),