@meistrari/data-token 0.0.1 → 0.0.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/README.md +5 -3
- package/dist/adapters/hono.d.ts +2 -2
- package/dist/types.d.ts +2 -2
- package/package.json +3 -9
package/README.md
CHANGED
|
@@ -26,10 +26,12 @@ import { Hono } from 'hono'
|
|
|
26
26
|
import { DataTokenContext, createDataTokenMiddleware } from '@meistrari/data-token/hono'
|
|
27
27
|
|
|
28
28
|
// Combine DataTokenContext with your own context type
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
type Env = {
|
|
30
|
+
Variables: {
|
|
31
|
+
customProp: string
|
|
32
|
+
}
|
|
31
33
|
}
|
|
32
|
-
type AppContext =
|
|
34
|
+
type AppContext = Env & DataTokenContext
|
|
33
35
|
|
|
34
36
|
const app = new Hono<AppContext>()
|
|
35
37
|
const dataToken = createDataTokenMiddleware('https://some.api.com/well-known/jwks.json')
|
package/dist/adapters/hono.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { Context } from 'hono';
|
|
2
2
|
import type { DataToken } from '../types';
|
|
3
|
-
export
|
|
3
|
+
export type DataTokenContext = {
|
|
4
4
|
Variables: {
|
|
5
5
|
authData?: DataToken;
|
|
6
6
|
};
|
|
7
|
-
}
|
|
7
|
+
};
|
|
8
8
|
/**
|
|
9
9
|
* Create a data token middleware for Hono
|
|
10
10
|
* @param url - The URL of the JWKS endpoint
|
package/dist/types.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@meistrari/data-token",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.
|
|
5
|
-
"packageManager": "pnpm@9.0.1",
|
|
4
|
+
"version": "0.0.3",
|
|
6
5
|
"description": "Internal library to verify and decode the API Gateway data token",
|
|
7
6
|
"author": "Roz <roz@meistrari.com>",
|
|
8
7
|
"license": "UNLICENSED",
|
|
@@ -24,12 +23,8 @@
|
|
|
24
23
|
"prepare": "husky",
|
|
25
24
|
"lint": "eslint src",
|
|
26
25
|
"lint:fix": "eslint src --fix",
|
|
27
|
-
"check": "
|
|
28
|
-
"prepack": "
|
|
29
|
-
},
|
|
30
|
-
"peerDependencies": {
|
|
31
|
-
"elysia": "^1.1.9",
|
|
32
|
-
"hono": "^4.5.9"
|
|
26
|
+
"check": "bun run lint && bun tsc --noEmit",
|
|
27
|
+
"prepack": "bun run build"
|
|
33
28
|
},
|
|
34
29
|
"dependencies": {
|
|
35
30
|
"jose": "^5.8.0",
|
|
@@ -42,7 +37,6 @@
|
|
|
42
37
|
"hono": "^4.5.9",
|
|
43
38
|
"husky": "^9.1.5",
|
|
44
39
|
"lint-staged": "^15.2.9",
|
|
45
|
-
"pnpm": "^9.9.0",
|
|
46
40
|
"typescript": "^5.5.4"
|
|
47
41
|
},
|
|
48
42
|
"lint-staged": {
|