@whook/oauth2 8.5.1 → 10.0.0
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 +106 -70
- package/dist/handlers/getOAuth2Authorize.d.ts +8 -6
- package/dist/handlers/getOAuth2Authorize.js +122 -165
- package/dist/handlers/getOAuth2Authorize.js.map +1 -1
- package/dist/handlers/getOAuth2Authorize.test.js +117 -103
- package/dist/handlers/getOAuth2Authorize.test.js.map +1 -1
- package/dist/handlers/postAuthLogin.d.ts +3 -3
- package/dist/handlers/postAuthLogin.js +83 -120
- package/dist/handlers/postAuthLogin.js.map +1 -1
- package/dist/handlers/postAuthLogin.test.js +42 -44
- package/dist/handlers/postAuthLogin.test.js.map +1 -1
- package/dist/handlers/postAuthLogout.d.ts +1 -1
- package/dist/handlers/postAuthLogout.js +26 -42
- package/dist/handlers/postAuthLogout.js.map +1 -1
- package/dist/handlers/postAuthLogout.test.js +19 -21
- package/dist/handlers/postAuthLogout.test.js.map +1 -1
- package/dist/handlers/postAuthRefresh.d.ts +4 -4
- package/dist/handlers/postAuthRefresh.js +93 -131
- package/dist/handlers/postAuthRefresh.js.map +1 -1
- package/dist/handlers/postAuthRefresh.test.js +47 -49
- package/dist/handlers/postAuthRefresh.test.js.map +1 -1
- package/dist/handlers/postOAuth2Acknowledge.d.ts +11 -8
- package/dist/handlers/postOAuth2Acknowledge.js +119 -151
- package/dist/handlers/postOAuth2Acknowledge.js.map +1 -1
- package/dist/handlers/postOAuth2Acknowledge.test.js +139 -125
- package/dist/handlers/postOAuth2Acknowledge.test.js.map +1 -1
- package/dist/handlers/postOAuth2Token.d.ts +4 -4
- package/dist/handlers/postOAuth2Token.js +200 -232
- package/dist/handlers/postOAuth2Token.js.map +1 -1
- package/dist/handlers/postOAuth2Token.test.js +156 -153
- package/dist/handlers/postOAuth2Token.test.js.map +1 -1
- package/dist/index.d.ts +16 -16
- package/dist/index.js +14 -229
- package/dist/index.js.map +1 -1
- package/dist/index.test.js +697 -620
- package/dist/index.test.js.map +1 -1
- package/dist/services/authCookies.d.ts +8 -4
- package/dist/services/authCookies.js +40 -71
- package/dist/services/authCookies.js.map +1 -1
- package/dist/services/authCookies.test.js +57 -62
- package/dist/services/authCookies.test.js.map +1 -1
- package/dist/services/oAuth2ClientCredentialsGranter.d.ts +2 -2
- package/dist/services/oAuth2ClientCredentialsGranter.js +34 -52
- package/dist/services/oAuth2ClientCredentialsGranter.js.map +1 -1
- package/dist/services/oAuth2CodeGranter.d.ts +1 -1
- package/dist/services/oAuth2CodeGranter.js +66 -109
- package/dist/services/oAuth2CodeGranter.js.map +1 -1
- package/dist/services/oAuth2CodeGranter.test.js +65 -64
- package/dist/services/oAuth2CodeGranter.test.js.map +1 -1
- package/dist/services/oAuth2Granters.d.ts +22 -19
- package/dist/services/oAuth2Granters.js +131 -138
- package/dist/services/oAuth2Granters.js.map +1 -1
- package/dist/services/oAuth2PasswordGranter.d.ts +1 -1
- package/dist/services/oAuth2PasswordGranter.js +27 -52
- package/dist/services/oAuth2PasswordGranter.js.map +1 -1
- package/dist/services/oAuth2RefreshTokenGranter.d.ts +1 -1
- package/dist/services/oAuth2RefreshTokenGranter.js +34 -58
- package/dist/services/oAuth2RefreshTokenGranter.js.map +1 -1
- package/dist/services/oAuth2TokenGranter.d.ts +1 -1
- package/dist/services/oAuth2TokenGranter.js +50 -86
- package/dist/services/oAuth2TokenGranter.js.map +1 -1
- package/package.json +54 -96
- package/src/__snapshots__/index.test.ts.snap +23 -22
- package/src/handlers/__snapshots__/postOAuth2Acknowledge.test.ts.snap +1 -1
- package/src/handlers/getOAuth2Authorize.test.ts +49 -13
- package/src/handlers/getOAuth2Authorize.ts +17 -16
- package/src/handlers/postAuthLogin.test.ts +9 -5
- package/src/handlers/postAuthLogin.ts +8 -7
- package/src/handlers/postAuthLogout.test.ts +8 -4
- package/src/handlers/postAuthLogout.ts +2 -2
- package/src/handlers/postAuthRefresh.test.ts +10 -6
- package/src/handlers/postAuthRefresh.ts +8 -7
- package/src/handlers/postOAuth2Acknowledge.test.ts +83 -35
- package/src/handlers/postOAuth2Acknowledge.ts +48 -30
- package/src/handlers/postOAuth2Token.test.ts +79 -19
- package/src/handlers/postOAuth2Token.ts +7 -7
- package/src/index.test.ts +116 -72
- package/src/index.ts +21 -19
- package/src/services/authCookies.test.ts +2 -2
- package/src/services/authCookies.ts +10 -5
- package/src/services/oAuth2ClientCredentialsGranter.ts +28 -24
- package/src/services/oAuth2CodeGranter.test.ts +42 -18
- package/src/services/oAuth2CodeGranter.ts +68 -62
- package/src/services/oAuth2Granters.ts +59 -29
- package/src/services/oAuth2PasswordGranter.ts +25 -24
- package/src/services/oAuth2RefreshTokenGranter.ts +30 -26
- package/src/services/oAuth2TokenGranter.ts +45 -43
- package/dist/handlers/getOAuth2Authorize.mjs +0 -160
- package/dist/handlers/getOAuth2Authorize.mjs.map +0 -1
- package/dist/handlers/getOAuth2Authorize.test.mjs +0 -114
- package/dist/handlers/getOAuth2Authorize.test.mjs.map +0 -1
- package/dist/handlers/postAuthLogin.mjs +0 -108
- package/dist/handlers/postAuthLogin.mjs.map +0 -1
- package/dist/handlers/postAuthLogin.test.mjs +0 -85
- package/dist/handlers/postAuthLogin.test.mjs.map +0 -1
- package/dist/handlers/postAuthLogout.mjs +0 -33
- package/dist/handlers/postAuthLogout.mjs.map +0 -1
- package/dist/handlers/postAuthLogout.test.mjs +0 -30
- package/dist/handlers/postAuthLogout.test.mjs.map +0 -1
- package/dist/handlers/postAuthRefresh.mjs +0 -121
- package/dist/handlers/postAuthRefresh.mjs.map +0 -1
- package/dist/handlers/postAuthRefresh.test.mjs +0 -94
- package/dist/handlers/postAuthRefresh.test.mjs.map +0 -1
- package/dist/handlers/postOAuth2Acknowledge.mjs +0 -150
- package/dist/handlers/postOAuth2Acknowledge.mjs.map +0 -1
- package/dist/handlers/postOAuth2Acknowledge.test.mjs +0 -140
- package/dist/handlers/postOAuth2Acknowledge.test.mjs.map +0 -1
- package/dist/handlers/postOAuth2Token.mjs +0 -231
- package/dist/handlers/postOAuth2Token.mjs.map +0 -1
- package/dist/handlers/postOAuth2Token.test.mjs +0 -160
- package/dist/handlers/postOAuth2Token.test.mjs.map +0 -1
- package/dist/index.mjs +0 -15
- package/dist/index.mjs.map +0 -1
- package/dist/index.test.mjs +0 -748
- package/dist/index.test.mjs.map +0 -1
- package/dist/services/authCookies.mjs +0 -58
- package/dist/services/authCookies.mjs.map +0 -1
- package/dist/services/authCookies.test.mjs +0 -77
- package/dist/services/authCookies.test.mjs.map +0 -1
- package/dist/services/oAuth2ClientCredentialsGranter.mjs +0 -41
- package/dist/services/oAuth2ClientCredentialsGranter.mjs.map +0 -1
- package/dist/services/oAuth2CodeGranter.mjs +0 -98
- package/dist/services/oAuth2CodeGranter.mjs.map +0 -1
- package/dist/services/oAuth2CodeGranter.test.mjs +0 -81
- package/dist/services/oAuth2CodeGranter.test.mjs.map +0 -1
- package/dist/services/oAuth2Granters.mjs +0 -127
- package/dist/services/oAuth2Granters.mjs.map +0 -1
- package/dist/services/oAuth2PasswordGranter.mjs +0 -40
- package/dist/services/oAuth2PasswordGranter.mjs.map +0 -1
- package/dist/services/oAuth2RefreshTokenGranter.mjs +0 -47
- package/dist/services/oAuth2RefreshTokenGranter.mjs.map +0 -1
- package/dist/services/oAuth2TokenGranter.mjs +0 -78
- package/dist/services/oAuth2TokenGranter.mjs.map +0 -1
|
@@ -1,28 +1,31 @@
|
|
|
1
1
|
import type { WhookAPIHandlerDefinition, WhookErrorsDescriptors } from '@whook/whook';
|
|
2
|
-
import type { CheckApplicationService, OAuth2GranterService } from '../services/oAuth2Granters';
|
|
2
|
+
import type { CheckApplicationService, OAuth2GranterService } from '../services/oAuth2Granters.js';
|
|
3
3
|
import type { LogService } from 'common-services';
|
|
4
4
|
import type { BaseAuthenticationData } from '@whook/authorization';
|
|
5
5
|
export declare const definition: WhookAPIHandlerDefinition;
|
|
6
|
-
declare
|
|
6
|
+
export declare type HandlerDependencies<AUTHENTICATION_DATA extends BaseAuthenticationData<string, string>> = {
|
|
7
7
|
ERRORS_DESCRIPTORS: WhookErrorsDescriptors;
|
|
8
|
-
oAuth2Granters: OAuth2GranterService<Record<string, unknown>, Record<string, unknown>, Record<string, unknown>,
|
|
8
|
+
oAuth2Granters: OAuth2GranterService<Record<string, unknown>, Record<string, unknown>, Record<string, unknown>, AUTHENTICATION_DATA>[];
|
|
9
9
|
checkApplication: CheckApplicationService;
|
|
10
10
|
log: LogService;
|
|
11
|
-
}
|
|
11
|
+
};
|
|
12
|
+
declare type HandlerParameters<AUTHENTICATION_DATA> = {
|
|
12
13
|
authenticationData: AUTHENTICATION_DATA;
|
|
13
14
|
body: {
|
|
14
|
-
[name: string]: unknown;
|
|
15
15
|
responseType: string;
|
|
16
16
|
clientId: string;
|
|
17
17
|
redirectURI: string;
|
|
18
18
|
scope: string;
|
|
19
19
|
state: string;
|
|
20
20
|
acknowledged: boolean;
|
|
21
|
+
[name: string]: unknown;
|
|
21
22
|
};
|
|
22
|
-
}
|
|
23
|
+
};
|
|
24
|
+
declare const _default: <AUTHENTICATION_DATA extends BaseAuthenticationData<string, string> = BaseAuthenticationData<string, string>>(dependencies: HandlerDependencies<AUTHENTICATION_DATA>) => (parameters: HandlerParameters<AUTHENTICATION_DATA>) => ReturnType<typeof postOAuth2Acknowledge>;
|
|
25
|
+
export default _default;
|
|
26
|
+
declare function postOAuth2Acknowledge<AUTHENTICATION_DATA extends BaseAuthenticationData = BaseAuthenticationData>({ ERRORS_DESCRIPTORS, oAuth2Granters, checkApplication, log, }: HandlerDependencies<AUTHENTICATION_DATA>, { authenticationData, body: { responseType, clientId, redirectURI, scope: demandedScope, state, acknowledged, ...additionalParameters }, }: HandlerParameters<AUTHENTICATION_DATA>): Promise<{
|
|
23
27
|
status: number;
|
|
24
28
|
headers: {
|
|
25
29
|
location: string;
|
|
26
30
|
};
|
|
27
|
-
}
|
|
28
|
-
export default _default;
|
|
31
|
+
}>;
|
|
@@ -1,165 +1,133 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.definition = exports.default = void 0;
|
|
7
|
-
|
|
8
|
-
var _knifecycle = require("knifecycle");
|
|
9
|
-
|
|
10
|
-
var _yerror = _interopRequireDefault(require("yerror"));
|
|
11
|
-
|
|
12
|
-
var _getOAuth2Authorize = require("./getOAuth2Authorize");
|
|
13
|
-
|
|
14
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
|
-
|
|
1
|
+
import { autoHandler } from 'knifecycle';
|
|
2
|
+
import { YError } from 'yerror';
|
|
3
|
+
import { setURLError } from './getOAuth2Authorize.js';
|
|
16
4
|
/* Architecture Note #2: OAuth2 acknowledge
|
|
17
5
|
This endpoint is to be used by the authentication SSR frontend
|
|
18
6
|
to acknowlege that the user accepted the client request in it.
|
|
19
7
|
*/
|
|
20
|
-
const definition = {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
8
|
+
export const definition = {
|
|
9
|
+
method: 'post',
|
|
10
|
+
path: '/oauth2/acknowledge',
|
|
11
|
+
operation: {
|
|
12
|
+
operationId: 'postOAuth2Acknowledge',
|
|
13
|
+
summary: `Implements the logic that allow the authentication frontend
|
|
26
14
|
to get the [Redirection Endpoint](https://tools.ietf.org/html/rfc6749#section-3.1.2).`,
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
15
|
+
tags: ['oauth2'],
|
|
16
|
+
'x-whook': {
|
|
17
|
+
private: true,
|
|
18
|
+
},
|
|
19
|
+
requestBody: {
|
|
20
|
+
required: true,
|
|
21
|
+
content: {
|
|
22
|
+
'application/json': {
|
|
23
|
+
schema: {
|
|
24
|
+
type: 'object',
|
|
25
|
+
required: [
|
|
26
|
+
'responseType',
|
|
27
|
+
'clientId',
|
|
28
|
+
'redirectURI',
|
|
29
|
+
'scope',
|
|
30
|
+
'state',
|
|
31
|
+
'acknowledged',
|
|
32
|
+
],
|
|
33
|
+
properties: {
|
|
34
|
+
responseType: {
|
|
35
|
+
type: 'string',
|
|
36
|
+
},
|
|
37
|
+
clientId: {
|
|
38
|
+
type: 'string',
|
|
39
|
+
},
|
|
40
|
+
redirectURI: {
|
|
41
|
+
type: 'string',
|
|
42
|
+
pattern: '^https?://',
|
|
43
|
+
format: 'uri',
|
|
44
|
+
},
|
|
45
|
+
scope: {
|
|
46
|
+
type: 'string',
|
|
47
|
+
description: 'See https://tools.ietf.org/html/rfc6749#section-3.3',
|
|
48
|
+
},
|
|
49
|
+
state: {
|
|
50
|
+
type: 'string',
|
|
51
|
+
},
|
|
52
|
+
acknowledged: {
|
|
53
|
+
type: 'boolean',
|
|
54
|
+
description: 'Wether the user acknowledged the delegation or not.',
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
responses: {
|
|
62
|
+
'201': {
|
|
63
|
+
description: 'Redirection endpoint URI computed.',
|
|
64
|
+
content: {
|
|
65
|
+
'application/json': {
|
|
66
|
+
schema: {
|
|
67
|
+
type: 'object',
|
|
68
|
+
required: ['redirectURI'],
|
|
69
|
+
properties: {
|
|
70
|
+
redirectURI: {
|
|
71
|
+
type: 'string',
|
|
72
|
+
pattern: '^https?://',
|
|
73
|
+
format: 'uri',
|
|
74
|
+
},
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
},
|
|
78
|
+
},
|
|
79
|
+
},
|
|
80
|
+
},
|
|
30
81
|
},
|
|
31
|
-
requestBody: {
|
|
32
|
-
required: true,
|
|
33
|
-
content: {
|
|
34
|
-
'application/json': {
|
|
35
|
-
schema: {
|
|
36
|
-
type: 'object',
|
|
37
|
-
required: ['responseType', 'clientId', 'redirectURI', 'scope', 'state', 'acknowledged'],
|
|
38
|
-
properties: {
|
|
39
|
-
responseType: {
|
|
40
|
-
type: 'string'
|
|
41
|
-
},
|
|
42
|
-
clientId: {
|
|
43
|
-
type: 'string'
|
|
44
|
-
},
|
|
45
|
-
redirectURI: {
|
|
46
|
-
type: 'string',
|
|
47
|
-
pattern: '^https?://',
|
|
48
|
-
format: 'uri'
|
|
49
|
-
},
|
|
50
|
-
scope: {
|
|
51
|
-
type: 'string',
|
|
52
|
-
description: 'See https://tools.ietf.org/html/rfc6749#section-3.3'
|
|
53
|
-
},
|
|
54
|
-
state: {
|
|
55
|
-
type: 'string'
|
|
56
|
-
},
|
|
57
|
-
acknowledged: {
|
|
58
|
-
type: 'boolean',
|
|
59
|
-
description: 'Wether the user acknowledged the delegation or not.'
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
},
|
|
66
|
-
responses: {
|
|
67
|
-
'201': {
|
|
68
|
-
description: 'Redirection endpoint URI computed.',
|
|
69
|
-
content: {
|
|
70
|
-
'application/json': {
|
|
71
|
-
schema: {
|
|
72
|
-
type: 'object',
|
|
73
|
-
required: ['redirectURI'],
|
|
74
|
-
properties: {
|
|
75
|
-
redirectURI: {
|
|
76
|
-
type: 'string',
|
|
77
|
-
pattern: '^https?://',
|
|
78
|
-
format: 'uri'
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
82
|
};
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
exports.default = _default;
|
|
93
|
-
|
|
94
|
-
async function postOAuth2Acknowledge({
|
|
95
|
-
ERRORS_DESCRIPTORS,
|
|
96
|
-
oAuth2Granters,
|
|
97
|
-
checkApplication,
|
|
98
|
-
log
|
|
99
|
-
}, {
|
|
100
|
-
authenticationData,
|
|
101
|
-
body: {
|
|
102
|
-
responseType,
|
|
103
|
-
clientId,
|
|
104
|
-
redirectURI,
|
|
105
|
-
scope: demandedScope,
|
|
106
|
-
state,
|
|
107
|
-
acknowledged = false,
|
|
108
|
-
...additionalParameters
|
|
109
|
-
}
|
|
110
|
-
}) {
|
|
111
|
-
if (!authenticationData) {
|
|
112
|
-
throw new _yerror.default('E_UNAUTHORIZED');
|
|
113
|
-
} // Here we check the applicationId has the right to authenticate a user
|
|
114
|
-
// with the special type 'root'
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
await checkApplication({
|
|
118
|
-
applicationId: authenticationData.applicationId,
|
|
119
|
-
type: 'root',
|
|
120
|
-
scope: ''
|
|
121
|
-
});
|
|
122
|
-
const url = new URL(redirectURI);
|
|
123
|
-
|
|
124
|
-
try {
|
|
125
|
-
if (!acknowledged) {
|
|
126
|
-
throw new _yerror.default('E_ACCESS_DENIED', clientId);
|
|
83
|
+
export default autoHandler(postOAuth2Acknowledge);
|
|
84
|
+
async function postOAuth2Acknowledge({ ERRORS_DESCRIPTORS, oAuth2Granters, checkApplication, log, }, { authenticationData, body: { responseType, clientId, redirectURI, scope: demandedScope, state, acknowledged = false, ...additionalParameters }, }) {
|
|
85
|
+
if (!authenticationData) {
|
|
86
|
+
throw new YError('E_UNAUTHORIZED');
|
|
127
87
|
}
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
88
|
+
// Here we check the applicationId has the right to authenticate a user
|
|
89
|
+
// with the special type 'root'
|
|
90
|
+
await checkApplication({
|
|
91
|
+
applicationId: authenticationData.applicationId,
|
|
92
|
+
type: 'root',
|
|
93
|
+
scope: '',
|
|
94
|
+
});
|
|
95
|
+
const url = new URL(redirectURI);
|
|
96
|
+
try {
|
|
97
|
+
if (!acknowledged) {
|
|
98
|
+
throw new YError('E_ACCESS_DENIED', clientId);
|
|
99
|
+
}
|
|
100
|
+
const granter = oAuth2Granters.find((granter) => granter.acknowledger &&
|
|
101
|
+
granter.acknowledger.acknowledgmentType === responseType);
|
|
102
|
+
if (!granter || !granter.acknowledger) {
|
|
103
|
+
throw new YError('E_UNKNOWN_ACKNOWLEDGOR_TYPE', responseType);
|
|
104
|
+
}
|
|
105
|
+
const { applicationId, scope, ...additionalProperties } = await granter.acknowledger.acknowledge(authenticationData, {
|
|
106
|
+
clientId,
|
|
107
|
+
redirectURI,
|
|
108
|
+
scope: demandedScope,
|
|
109
|
+
}, additionalParameters);
|
|
110
|
+
url.searchParams.set('client_id', applicationId);
|
|
111
|
+
url.searchParams.set('scope', scope);
|
|
112
|
+
url.searchParams.set('state', state);
|
|
113
|
+
Object.keys(additionalProperties).forEach((key) => url.searchParams.set(snakeCase(key), additionalProperties[key]));
|
|
133
114
|
}
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
...additionalProperties
|
|
139
|
-
} = await granter.acknowledger.acknowledge(authenticationData, {
|
|
140
|
-
clientId,
|
|
141
|
-
redirectURI,
|
|
142
|
-
scope: demandedScope
|
|
143
|
-
}, additionalParameters);
|
|
144
|
-
url.searchParams.set('client_id', applicationId);
|
|
145
|
-
url.searchParams.set('scope', scope);
|
|
146
|
-
url.searchParams.set('state', state);
|
|
147
|
-
Object.keys(additionalProperties).forEach(key => url.searchParams.set(snakeCase(key), additionalProperties[key]));
|
|
148
|
-
} catch (err) {
|
|
149
|
-
log('debug', '👫 - OAuth2 acknowledge error', err.code);
|
|
150
|
-
log('debug-stack', err.stack);
|
|
151
|
-
(0, _getOAuth2Authorize.setURLError)(url, err, ERRORS_DESCRIPTORS[err.code] || ERRORS_DESCRIPTORS.E_OAUTH2);
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
return {
|
|
155
|
-
status: 302,
|
|
156
|
-
headers: {
|
|
157
|
-
location: url.href
|
|
115
|
+
catch (err) {
|
|
116
|
+
log('debug', '👫 - OAuth2 acknowledge error', err.code);
|
|
117
|
+
log('debug-stack', err.stack || 'no_stack_trace');
|
|
118
|
+
setURLError(url, err, ERRORS_DESCRIPTORS[err.code] || ERRORS_DESCRIPTORS.E_OAUTH2);
|
|
158
119
|
}
|
|
159
|
-
|
|
120
|
+
return {
|
|
121
|
+
status: 302,
|
|
122
|
+
headers: {
|
|
123
|
+
location: url.href,
|
|
124
|
+
},
|
|
125
|
+
};
|
|
160
126
|
}
|
|
161
|
-
|
|
162
127
|
function snakeCase(s) {
|
|
163
|
-
|
|
128
|
+
return s
|
|
129
|
+
.split(/(?=(?<![A-Z])[A-Z])|[^a-zA-Z]+/)
|
|
130
|
+
.map((s) => s.toLowerCase())
|
|
131
|
+
.join('_');
|
|
164
132
|
}
|
|
165
133
|
//# sourceMappingURL=postOAuth2Acknowledge.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/handlers/postOAuth2Acknowledge.ts"],"names":[
|
|
1
|
+
{"version":3,"file":"postOAuth2Acknowledge.js","sourceRoot":"","sources":["../../src/handlers/postOAuth2Acknowledge.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAYtD;;;EAGE;AAEF,MAAM,CAAC,MAAM,UAAU,GAA8B;IACnD,MAAM,EAAE,MAAM;IACd,IAAI,EAAE,qBAAqB;IAC3B,SAAS,EAAE;QACT,WAAW,EAAE,uBAAuB;QACpC,OAAO,EAAE;uFAC0E;QACnF,IAAI,EAAE,CAAC,QAAQ,CAAC;QAChB,SAAS,EAAE;YACT,OAAO,EAAE,IAAI;SACd;QACD,WAAW,EAAE;YACX,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE;gBACP,kBAAkB,EAAE;oBAClB,MAAM,EAAE;wBACN,IAAI,EAAE,QAAQ;wBACd,QAAQ,EAAE;4BACR,cAAc;4BACd,UAAU;4BACV,aAAa;4BACb,OAAO;4BACP,OAAO;4BACP,cAAc;yBACf;wBACD,UAAU,EAAE;4BACV,YAAY,EAAE;gCACZ,IAAI,EAAE,QA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