@antelopejs/auth-jwt 0.0.1 → 0.1.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 +15 -6
- package/dist/implementations/auth/beta.d.ts +2 -1
- package/dist/implementations/auth/beta.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +11 -5
package/README.md
CHANGED
|
@@ -2,20 +2,29 @@
|
|
|
2
2
|
|
|
3
3
|
# @antelopejs/auth-jwt
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
<div align="center">
|
|
6
|
+
<a href="https://www.npmjs.com/package/@antelopejs/auth-jwt"><img alt="NPM version" src="https://img.shields.io/npm/v/@antelopejs/auth-jwt.svg?style=for-the-badge&labelColor=000000"></a>
|
|
7
|
+
<a href="./LICENSE"><img alt="License" src="https://img.shields.io/npm/l/@antelopejs/auth-jwt.svg?style=for-the-badge&labelColor=000000"></a>
|
|
8
|
+
<a href="https://discord.gg/sjK28QHrA7"><img src="https://img.shields.io/badge/Discord-18181B?logo=discord&style=for-the-badge&color=000000" alt="Discord"></a>
|
|
9
|
+
<a href="https://antelopejs.com/modules/auth-jwt"><img src="https://img.shields.io/badge/Docs-18181B?style=for-the-badge&color=000000" alt="Documentation"></a>
|
|
10
|
+
</div>
|
|
8
11
|
|
|
9
12
|
A flexible authentication and authorization module that implements the Auth interface of antelopejs with JWT.
|
|
10
13
|
|
|
11
|
-
For detailed documentation on the Auth interface, please refer to the [docs](https://github.com/AntelopeJS/interface-auth).
|
|
12
|
-
|
|
13
14
|
## Installation
|
|
14
15
|
|
|
15
16
|
```bash
|
|
16
17
|
ajs project modules add @antelopejs/auth-jwt
|
|
17
18
|
```
|
|
18
19
|
|
|
20
|
+
## Interfaces
|
|
21
|
+
|
|
22
|
+
This module implements the Auth interface it can be integrated with your application to handle user authentication, token generation, verification, and access control. The interface is installed separately to maintain modularity and minimize dependencies.
|
|
23
|
+
|
|
24
|
+
| Name | Install command | |
|
|
25
|
+
| ------------- | --------------------------------------- | ------------------------------------------------------------- |
|
|
26
|
+
| Auth | `ajs module imports add auth` | [Documentation](https://github.com/AntelopeJS/interface-auth) |
|
|
27
|
+
|
|
19
28
|
## Configuration
|
|
20
29
|
|
|
21
30
|
The Auth module can be configured with the following options:
|
|
@@ -68,4 +77,4 @@ class UsersController extends Controller('/users') {
|
|
|
68
77
|
|
|
69
78
|
## License
|
|
70
79
|
|
|
71
|
-
Apache
|
|
80
|
+
This project is licensed under the Apache License 2.0 - see the [LICENSE](LICENSE) file for details.
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { VerifyOptions } from 'jsonwebtoken';
|
|
2
|
+
import { SignOptions } from '@ajs.local/auth/beta';
|
|
2
3
|
export declare namespace internal {
|
|
3
4
|
const Verify: (data?: string, options?: VerifyOptions) => Promise<any>;
|
|
4
5
|
const Sign: (data: string | Buffer | object, options?: SignOptions) => Promise<string>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"beta.js","sourceRoot":"","sources":["../../../src/implementations/auth/beta.ts"],"names":[],"mappings":";;;AACA,uCAA4C;
|
|
1
|
+
{"version":3,"file":"beta.js","sourceRoot":"","sources":["../../../src/implementations/auth/beta.ts"],"names":[],"mappings":";;;AACA,uCAA4C;AAG5C,IAAiB,QAAQ,CAQxB;AARD,WAAiB,QAAQ;IACV,eAAM,GAAG,CAAC,IAAa,EAAE,OAAuB,EAAE,EAAE;QAC/D,OAAO,IAAA,qBAAa,GAAE,CAAC,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IAC/C,CAAC,CAAC;IAEW,aAAI,GAAG,CAAC,IAA8B,EAAE,OAAqB,EAAE,EAAE;QAC5E,OAAO,IAAA,qBAAa,GAAE,CAAC,IAAI,CAAC,IAAI,EAAE,OAAyB,CAAC,CAAC;IAC/D,CAAC,CAAC;AACJ,CAAC,EARgB,QAAQ,wBAAR,QAAQ,QAQxB"}
|
package/dist/index.js
CHANGED
|
@@ -44,7 +44,7 @@ let auth;
|
|
|
44
44
|
async function construct(config) {
|
|
45
45
|
auth = new jwt_1.JWTHandler(config);
|
|
46
46
|
await auth.loadKeys();
|
|
47
|
-
|
|
47
|
+
(0, beta_1.ImplementInterface)(await Promise.resolve().then(() => __importStar(require('@ajs.local/auth/beta'))), await Promise.resolve().then(() => __importStar(require('./implementations/auth/beta'))));
|
|
48
48
|
}
|
|
49
49
|
function getJWTHandler() {
|
|
50
50
|
return auth;
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,8BAIC;AAED,sCAEC;AAED,0BAAkC;AAElC,sBAAgC;AAEhC,oBAA+B;AAnB/B,+BAAqD;AACrD,yCAAoD;AAEpD,IAAI,IAAgB,CAAC;AAEd,KAAK,UAAU,SAAS,CAAC,MAAwB;IACtD,IAAI,GAAG,IAAI,gBAAU,CAAC,MAAM,CAAC,CAAC;IAC9B,MAAM,IAAI,CAAC,QAAQ,EAAE,CAAC;IACtB,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,8BAIC;AAED,sCAEC;AAED,0BAAkC;AAElC,sBAAgC;AAEhC,oBAA+B;AAnB/B,+BAAqD;AACrD,yCAAoD;AAEpD,IAAI,IAAgB,CAAC;AAEd,KAAK,UAAU,SAAS,CAAC,MAAwB;IACtD,IAAI,GAAG,IAAI,gBAAU,CAAC,MAAM,CAAC,CAAC;IAC9B,MAAM,IAAI,CAAC,QAAQ,EAAE,CAAC;IACtB,IAAA,yBAAkB,EAAC,wDAAa,sBAAsB,GAAC,EAAE,wDAAa,6BAA6B,GAAC,CAAC,CAAC;AACxG,CAAC;AAED,SAAgB,aAAa;IAC3B,OAAO,IAAI,CAAC;AACd,CAAC;AAED,SAAgB,OAAO,KAAU,CAAC;AAElC,SAAgB,KAAK,KAAU,CAAC;AAEhC,SAAgB,IAAI,KAAU,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@antelopejs/auth-jwt",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "Authentication and authorization module that implements the Auth interface of antelopejs with JWT",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"antelope",
|
|
@@ -23,13 +23,16 @@
|
|
|
23
23
|
"license": "Apache-2.0",
|
|
24
24
|
"packageManager": "pnpm@10.6.5",
|
|
25
25
|
"scripts": {
|
|
26
|
-
"dev": "ajs project run -w -p playground",
|
|
27
26
|
"build": "tsc",
|
|
28
|
-
"
|
|
29
|
-
"
|
|
27
|
+
"dev:prepare": "cd playground && ajs module imports install",
|
|
28
|
+
"dev": "ajs project run -w -p playground",
|
|
30
29
|
"format": "prettier --write .",
|
|
30
|
+
"generate": "ajs module exports generate",
|
|
31
31
|
"lint:fix": "eslint . --ext .js,.jsx,.ts,.tsx --fix",
|
|
32
32
|
"lint": "eslint . --ext .js,.jsx,.ts,.tsx",
|
|
33
|
+
"prepack": "pnpm run build",
|
|
34
|
+
"prepare": "ajs module imports install",
|
|
35
|
+
"release": "pnpm run lint && pnpm run test && pnpm run prepack && release-it",
|
|
33
36
|
"test": "echo \"No test specified\""
|
|
34
37
|
},
|
|
35
38
|
"antelopeJs": {
|
|
@@ -38,7 +41,10 @@
|
|
|
38
41
|
"core@beta",
|
|
39
42
|
"api@beta"
|
|
40
43
|
],
|
|
41
|
-
"importsOptional": []
|
|
44
|
+
"importsOptional": [],
|
|
45
|
+
"defaultConfig": {
|
|
46
|
+
"secret": "your-secret-key"
|
|
47
|
+
}
|
|
42
48
|
},
|
|
43
49
|
"dependencies": {
|
|
44
50
|
"jsonwebtoken": "^9.0.2"
|