@twin.org/api-auth-entity-storage-service 0.0.1-next.12 → 0.0.1-next.14
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/cjs/index.cjs
CHANGED
@@ -244,13 +244,13 @@ class AuthHeaderProcessor {
|
|
244
244
|
if ((responseAuthOperation === "login" || responseAuthOperation === "refresh") &&
|
245
245
|
core.Is.stringValue(response.body?.token)) {
|
246
246
|
response.headers ??= {};
|
247
|
-
response.headers[
|
247
|
+
response.headers[web.HeaderTypes.SetCookie] =
|
248
248
|
`${this._cookieName}=${response.body.token}; Secure; HttpOnly; SameSite=None; Path=/`;
|
249
249
|
delete response.body.token;
|
250
250
|
}
|
251
251
|
else if (responseAuthOperation === "logout") {
|
252
252
|
response.headers ??= {};
|
253
|
-
response.headers[
|
253
|
+
response.headers[web.HeaderTypes.SetCookie] =
|
254
254
|
`${this._cookieName}=; Max-Age=0; Secure; HttpOnly; SameSite=None; Path=/`;
|
255
255
|
}
|
256
256
|
}
|
package/dist/esm/index.mjs
CHANGED
@@ -242,13 +242,13 @@ class AuthHeaderProcessor {
|
|
242
242
|
if ((responseAuthOperation === "login" || responseAuthOperation === "refresh") &&
|
243
243
|
Is.stringValue(response.body?.token)) {
|
244
244
|
response.headers ??= {};
|
245
|
-
response.headers[
|
245
|
+
response.headers[HeaderTypes.SetCookie] =
|
246
246
|
`${this._cookieName}=${response.body.token}; Secure; HttpOnly; SameSite=None; Path=/`;
|
247
247
|
delete response.body.token;
|
248
248
|
}
|
249
249
|
else if (responseAuthOperation === "logout") {
|
250
250
|
response.headers ??= {};
|
251
|
-
response.headers[
|
251
|
+
response.headers[HeaderTypes.SetCookie] =
|
252
252
|
`${this._cookieName}=; Max-Age=0; Secure; HttpOnly; SameSite=None; Path=/`;
|
253
253
|
}
|
254
254
|
}
|
@@ -1,9 +1,9 @@
|
|
1
|
-
import { type
|
1
|
+
import { type IBaseRoute, type IBaseRouteProcessor, type IHttpRequestIdentity, type IHttpResponse, type IHttpServerRequest } from "@twin.org/api-models";
|
2
2
|
import type { IAuthHeaderProcessorConfig } from "../models/IAuthHeaderProcessorConfig";
|
3
3
|
/**
|
4
4
|
* Handle a JWT token in the authorization header or cookies and validate it to populate request context identity.
|
5
5
|
*/
|
6
|
-
export declare class AuthHeaderProcessor implements
|
6
|
+
export declare class AuthHeaderProcessor implements IBaseRouteProcessor {
|
7
7
|
/**
|
8
8
|
* Runtime name for the class.
|
9
9
|
*/
|
@@ -33,7 +33,7 @@ export declare class AuthHeaderProcessor implements IHttpRestRouteProcessor {
|
|
33
33
|
* @param requestIdentity The identity context for the request.
|
34
34
|
* @param processorState The state handed through the processors.
|
35
35
|
*/
|
36
|
-
pre(request: IHttpServerRequest, response: IHttpResponse, route:
|
36
|
+
pre(request: IHttpServerRequest, response: IHttpResponse, route: IBaseRoute | undefined, requestIdentity: IHttpRequestIdentity, processorState: {
|
37
37
|
[id: string]: unknown;
|
38
38
|
}): Promise<void>;
|
39
39
|
/**
|
@@ -44,7 +44,7 @@ export declare class AuthHeaderProcessor implements IHttpRestRouteProcessor {
|
|
44
44
|
* @param requestIdentity The identity context for the request.
|
45
45
|
* @param processorState The state handed through the processors.
|
46
46
|
*/
|
47
|
-
post(request: IHttpServerRequest, response: IHttpResponse, route:
|
47
|
+
post(request: IHttpServerRequest, response: IHttpResponse, route: IBaseRoute | undefined, requestIdentity: IHttpRequestIdentity, processorState: {
|
48
48
|
[id: string]: unknown;
|
49
49
|
}): Promise<void>;
|
50
50
|
}
|
package/docs/changelog.md
CHANGED
@@ -4,7 +4,7 @@ Handle a JWT token in the authorization header or cookies and validate it to pop
|
|
4
4
|
|
5
5
|
## Implements
|
6
6
|
|
7
|
-
- `
|
7
|
+
- `IBaseRouteProcessor`
|
8
8
|
|
9
9
|
## Constructors
|
10
10
|
|
@@ -42,7 +42,7 @@ Runtime name for the class.
|
|
42
42
|
|
43
43
|
#### Implementation of
|
44
44
|
|
45
|
-
`
|
45
|
+
`IBaseRouteProcessor.CLASS_NAME`
|
46
46
|
|
47
47
|
## Methods
|
48
48
|
|
@@ -70,7 +70,7 @@ Nothing.
|
|
70
70
|
|
71
71
|
#### Implementation of
|
72
72
|
|
73
|
-
`
|
73
|
+
`IBaseRouteProcessor.start`
|
74
74
|
|
75
75
|
***
|
76
76
|
|
@@ -90,7 +90,7 @@ The incoming request.
|
|
90
90
|
|
91
91
|
The outgoing response.
|
92
92
|
|
93
|
-
• **route**: `undefined` \| `
|
93
|
+
• **route**: `undefined` \| `IBaseRoute`
|
94
94
|
|
95
95
|
The route to process.
|
96
96
|
|
@@ -108,7 +108,7 @@ The state handed through the processors.
|
|
108
108
|
|
109
109
|
#### Implementation of
|
110
110
|
|
111
|
-
`
|
111
|
+
`IBaseRouteProcessor.pre`
|
112
112
|
|
113
113
|
***
|
114
114
|
|
@@ -128,7 +128,7 @@ The incoming request.
|
|
128
128
|
|
129
129
|
The outgoing response.
|
130
130
|
|
131
|
-
• **route**: `undefined` \| `
|
131
|
+
• **route**: `undefined` \| `IBaseRoute`
|
132
132
|
|
133
133
|
The route to process.
|
134
134
|
|
@@ -146,4 +146,4 @@ The state handed through the processors.
|
|
146
146
|
|
147
147
|
#### Implementation of
|
148
148
|
|
149
|
-
`
|
149
|
+
`IBaseRouteProcessor.post`
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@twin.org/api-auth-entity-storage-service",
|
3
|
-
"version": "0.0.1-next.
|
3
|
+
"version": "0.0.1-next.14",
|
4
4
|
"description": "Auth Entity Storage contract implementation and REST endpoint definitions",
|
5
5
|
"repository": {
|
6
6
|
"type": "git",
|
@@ -14,9 +14,9 @@
|
|
14
14
|
"node": ">=20.0.0"
|
15
15
|
},
|
16
16
|
"dependencies": {
|
17
|
-
"@twin.org/api-auth-entity-storage-models": "0.0.1-next.
|
18
|
-
"@twin.org/api-core": "0.0.1-next.
|
19
|
-
"@twin.org/api-models": "0.0.1-next.
|
17
|
+
"@twin.org/api-auth-entity-storage-models": "0.0.1-next.14",
|
18
|
+
"@twin.org/api-core": "0.0.1-next.14",
|
19
|
+
"@twin.org/api-models": "0.0.1-next.14",
|
20
20
|
"@twin.org/core": "next",
|
21
21
|
"@twin.org/crypto": "next",
|
22
22
|
"@twin.org/entity": "next",
|