@whook/oauth2 8.3.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/LICENSE +20 -0
- package/README.md +384 -0
- package/dist/handlers/getOAuth2Authorize.d.ts +26 -0
- package/dist/handlers/getOAuth2Authorize.js +192 -0
- package/dist/handlers/getOAuth2Authorize.js.map +1 -0
- package/dist/handlers/getOAuth2Authorize.mjs +169 -0
- package/dist/handlers/getOAuth2Authorize.mjs.map +1 -0
- package/dist/handlers/getOAuth2Authorize.test.d.ts +1 -0
- package/dist/handlers/getOAuth2Authorize.test.js +122 -0
- package/dist/handlers/getOAuth2Authorize.test.js.map +1 -0
- package/dist/handlers/getOAuth2Authorize.test.mjs +114 -0
- package/dist/handlers/getOAuth2Authorize.test.mjs.map +1 -0
- package/dist/handlers/postAuthLogin.d.ts +45 -0
- package/dist/handlers/postAuthLogin.js +125 -0
- package/dist/handlers/postAuthLogin.js.map +1 -0
- package/dist/handlers/postAuthLogin.mjs +108 -0
- package/dist/handlers/postAuthLogin.mjs.map +1 -0
- package/dist/handlers/postAuthLogin.test.d.ts +1 -0
- package/dist/handlers/postAuthLogin.test.js +90 -0
- package/dist/handlers/postAuthLogin.test.js.map +1 -0
- package/dist/handlers/postAuthLogin.test.mjs +85 -0
- package/dist/handlers/postAuthLogin.test.mjs.map +1 -0
- package/dist/handlers/postAuthLogout.d.ts +12 -0
- package/dist/handlers/postAuthLogout.js +46 -0
- package/dist/handlers/postAuthLogout.js.map +1 -0
- package/dist/handlers/postAuthLogout.mjs +33 -0
- package/dist/handlers/postAuthLogout.mjs.map +1 -0
- package/dist/handlers/postAuthLogout.test.d.ts +1 -0
- package/dist/handlers/postAuthLogout.test.js +35 -0
- package/dist/handlers/postAuthLogout.test.js.map +1 -0
- package/dist/handlers/postAuthLogout.test.mjs +30 -0
- package/dist/handlers/postAuthLogout.test.mjs.map +1 -0
- package/dist/handlers/postAuthRefresh.d.ts +45 -0
- package/dist/handlers/postAuthRefresh.js +140 -0
- package/dist/handlers/postAuthRefresh.js.map +1 -0
- package/dist/handlers/postAuthRefresh.mjs +122 -0
- package/dist/handlers/postAuthRefresh.mjs.map +1 -0
- package/dist/handlers/postAuthRefresh.test.d.ts +1 -0
- package/dist/handlers/postAuthRefresh.test.js +99 -0
- package/dist/handlers/postAuthRefresh.test.js.map +1 -0
- package/dist/handlers/postAuthRefresh.test.mjs +94 -0
- package/dist/handlers/postAuthRefresh.test.mjs.map +1 -0
- package/dist/handlers/postOAuth2Acknowledge.d.ts +28 -0
- package/dist/handlers/postOAuth2Acknowledge.js +165 -0
- package/dist/handlers/postOAuth2Acknowledge.js.map +1 -0
- package/dist/handlers/postOAuth2Acknowledge.mjs +150 -0
- package/dist/handlers/postOAuth2Acknowledge.mjs.map +1 -0
- package/dist/handlers/postOAuth2Acknowledge.test.d.ts +1 -0
- package/dist/handlers/postOAuth2Acknowledge.test.js +148 -0
- package/dist/handlers/postOAuth2Acknowledge.test.js.map +1 -0
- package/dist/handlers/postOAuth2Acknowledge.test.mjs +140 -0
- package/dist/handlers/postOAuth2Acknowledge.test.mjs.map +1 -0
- package/dist/handlers/postOAuth2Token.d.ts +36 -0
- package/dist/handlers/postOAuth2Token.js +263 -0
- package/dist/handlers/postOAuth2Token.js.map +1 -0
- package/dist/handlers/postOAuth2Token.mjs +242 -0
- package/dist/handlers/postOAuth2Token.mjs.map +1 -0
- package/dist/handlers/postOAuth2Token.test.d.ts +1 -0
- package/dist/handlers/postOAuth2Token.test.js +166 -0
- package/dist/handlers/postOAuth2Token.test.js.map +1 -0
- package/dist/handlers/postOAuth2Token.test.mjs +160 -0
- package/dist/handlers/postOAuth2Token.test.mjs.map +1 -0
- package/dist/index.d.ts +17 -0
- package/dist/index.js +230 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +15 -0
- package/dist/index.mjs.map +1 -0
- package/dist/index.test.d.ts +1 -0
- package/dist/index.test.js +759 -0
- package/dist/index.test.js.map +1 -0
- package/dist/index.test.mjs +748 -0
- package/dist/index.test.mjs.map +1 -0
- package/dist/services/authCookies.d.ts +26 -0
- package/dist/services/authCookies.js +74 -0
- package/dist/services/authCookies.js.map +1 -0
- package/dist/services/authCookies.mjs +58 -0
- package/dist/services/authCookies.mjs.map +1 -0
- package/dist/services/authCookies.test.d.ts +1 -0
- package/dist/services/authCookies.test.js +82 -0
- package/dist/services/authCookies.test.js.map +1 -0
- package/dist/services/authCookies.test.mjs +77 -0
- package/dist/services/authCookies.test.mjs.map +1 -0
- package/dist/services/oAuth2ClientCredentialsGranter.d.ts +17 -0
- package/dist/services/oAuth2ClientCredentialsGranter.js +56 -0
- package/dist/services/oAuth2ClientCredentialsGranter.js.map +1 -0
- package/dist/services/oAuth2ClientCredentialsGranter.mjs +41 -0
- package/dist/services/oAuth2ClientCredentialsGranter.mjs.map +1 -0
- package/dist/services/oAuth2CodeGranter.d.ts +17 -0
- package/dist/services/oAuth2CodeGranter.js +115 -0
- package/dist/services/oAuth2CodeGranter.js.map +1 -0
- package/dist/services/oAuth2CodeGranter.mjs +98 -0
- package/dist/services/oAuth2CodeGranter.mjs.map +1 -0
- package/dist/services/oAuth2CodeGranter.test.d.ts +1 -0
- package/dist/services/oAuth2CodeGranter.test.js +86 -0
- package/dist/services/oAuth2CodeGranter.test.js.map +1 -0
- package/dist/services/oAuth2CodeGranter.test.mjs +81 -0
- package/dist/services/oAuth2CodeGranter.test.mjs.map +1 -0
- package/dist/services/oAuth2Granters.d.ts +79 -0
- package/dist/services/oAuth2Granters.js +140 -0
- package/dist/services/oAuth2Granters.js.map +1 -0
- package/dist/services/oAuth2Granters.mjs +127 -0
- package/dist/services/oAuth2Granters.mjs.map +1 -0
- package/dist/services/oAuth2PasswordGranter.d.ts +16 -0
- package/dist/services/oAuth2PasswordGranter.js +55 -0
- package/dist/services/oAuth2PasswordGranter.js.map +1 -0
- package/dist/services/oAuth2PasswordGranter.mjs +40 -0
- package/dist/services/oAuth2PasswordGranter.mjs.map +1 -0
- package/dist/services/oAuth2RefreshTokenGranter.d.ts +15 -0
- package/dist/services/oAuth2RefreshTokenGranter.js +62 -0
- package/dist/services/oAuth2RefreshTokenGranter.js.map +1 -0
- package/dist/services/oAuth2RefreshTokenGranter.mjs +47 -0
- package/dist/services/oAuth2RefreshTokenGranter.mjs.map +1 -0
- package/dist/services/oAuth2TokenGranter.d.ts +15 -0
- package/dist/services/oAuth2TokenGranter.js +92 -0
- package/dist/services/oAuth2TokenGranter.js.map +1 -0
- package/dist/services/oAuth2TokenGranter.mjs +78 -0
- package/dist/services/oAuth2TokenGranter.mjs.map +1 -0
- package/package.json +205 -0
- package/src/__snapshots__/index.test.ts.snap +396 -0
- package/src/handlers/__snapshots__/getOAuth2Authorize.test.ts.snap +38 -0
- package/src/handlers/__snapshots__/postOAuth2Acknowledge.test.ts.snap +61 -0
- package/src/handlers/__snapshots__/postOAuth2Token.test.ts.snap +52 -0
- package/src/handlers/getOAuth2Authorize.test.ts +142 -0
- package/src/handlers/getOAuth2Authorize.ts +222 -0
- package/src/handlers/postAuthLogin.test.ts +88 -0
- package/src/handlers/postAuthLogin.ts +123 -0
- package/src/handlers/postAuthLogout.test.ts +33 -0
- package/src/handlers/postAuthLogout.ts +38 -0
- package/src/handlers/postAuthRefresh.test.ts +97 -0
- package/src/handlers/postAuthRefresh.ts +146 -0
- package/src/handlers/postOAuth2Acknowledge.test.ts +175 -0
- package/src/handlers/postOAuth2Acknowledge.ts +209 -0
- package/src/handlers/postOAuth2Token.test.ts +153 -0
- package/src/handlers/postOAuth2Token.ts +302 -0
- package/src/index.test.ts +936 -0
- package/src/index.ts +105 -0
- package/src/services/__snapshots__/oAuth2CodeGranter.test.ts.snap +49 -0
- package/src/services/authCookies.test.ts +93 -0
- package/src/services/authCookies.ts +82 -0
- package/src/services/oAuth2ClientCredentialsGranter.ts +76 -0
- package/src/services/oAuth2CodeGranter.test.ts +94 -0
- package/src/services/oAuth2CodeGranter.ts +133 -0
- package/src/services/oAuth2Granters.ts +274 -0
- package/src/services/oAuth2PasswordGranter.ts +75 -0
- package/src/services/oAuth2RefreshTokenGranter.ts +77 -0
- package/src/services/oAuth2TokenGranter.ts +105 -0
|
@@ -0,0 +1,302 @@
|
|
|
1
|
+
import { autoHandler } from 'knifecycle';
|
|
2
|
+
import { camelCaseObjectProperties } from './getOAuth2Authorize';
|
|
3
|
+
import { noop } from '@whook/whook';
|
|
4
|
+
import YError from 'yerror';
|
|
5
|
+
import type { OpenAPIV3 } from 'openapi-types';
|
|
6
|
+
import type { LogService, TimeService } from 'common-services';
|
|
7
|
+
import type {
|
|
8
|
+
WhookAPISchemaDefinition,
|
|
9
|
+
WhookAPIHandlerDefinition,
|
|
10
|
+
} from '@whook/whook';
|
|
11
|
+
import type {
|
|
12
|
+
OAuth2GranterService,
|
|
13
|
+
OAuth2AccessTokenService,
|
|
14
|
+
OAuth2RefreshTokenService,
|
|
15
|
+
} from '../services/oAuth2Granters';
|
|
16
|
+
import type { BaseAuthenticationData } from '@whook/authorization';
|
|
17
|
+
|
|
18
|
+
/* Architecture Note #2: OAuth2 acknowledge
|
|
19
|
+
This endpoint is to be used by the authentication server page
|
|
20
|
+
to acknowlege that the user accepted the client request.
|
|
21
|
+
*/
|
|
22
|
+
export const authorizationCodeTokenRequestBodySchema: WhookAPISchemaDefinition =
|
|
23
|
+
{
|
|
24
|
+
name: 'AuthorizationCodeRequestBody',
|
|
25
|
+
schema: {
|
|
26
|
+
type: 'object',
|
|
27
|
+
description:
|
|
28
|
+
'Authorization code grant, see https://tools.ietf.org/html/rfc6749#section-4.1',
|
|
29
|
+
required: ['grant_type'],
|
|
30
|
+
properties: {
|
|
31
|
+
grant_type: {
|
|
32
|
+
type: 'string',
|
|
33
|
+
enum: ['authorization_code'],
|
|
34
|
+
},
|
|
35
|
+
code: {
|
|
36
|
+
type: 'string',
|
|
37
|
+
},
|
|
38
|
+
client_id: {
|
|
39
|
+
type: 'string',
|
|
40
|
+
},
|
|
41
|
+
redirect_uri: {
|
|
42
|
+
type: 'string',
|
|
43
|
+
pattern: '^https?://',
|
|
44
|
+
format: 'uri',
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
export const passwordTokenRequestBodySchema: WhookAPISchemaDefinition = {
|
|
51
|
+
name: 'PasswordRequestBody',
|
|
52
|
+
schema: {
|
|
53
|
+
type: 'object',
|
|
54
|
+
description:
|
|
55
|
+
'Resource owner password credentials grant, see https://tools.ietf.org/html/rfc6749#section-4.3',
|
|
56
|
+
required: ['grant_type', 'username', 'password'],
|
|
57
|
+
properties: {
|
|
58
|
+
grant_type: {
|
|
59
|
+
type: 'string',
|
|
60
|
+
enum: ['password'],
|
|
61
|
+
},
|
|
62
|
+
username: {
|
|
63
|
+
type: 'string',
|
|
64
|
+
},
|
|
65
|
+
password: {
|
|
66
|
+
type: 'string',
|
|
67
|
+
},
|
|
68
|
+
scope: {
|
|
69
|
+
type: 'string',
|
|
70
|
+
description: 'See https://tools.ietf.org/html/rfc6749#section-3.3',
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
export const clientCredentialsTokenRequestBodySchema: WhookAPISchemaDefinition =
|
|
77
|
+
{
|
|
78
|
+
name: 'ClientCredentialsRequestBody',
|
|
79
|
+
schema: {
|
|
80
|
+
type: 'object',
|
|
81
|
+
description:
|
|
82
|
+
'Client credentials grant, see https://tools.ietf.org/html/rfc6749#section-4.4',
|
|
83
|
+
required: ['grant_type'],
|
|
84
|
+
properties: {
|
|
85
|
+
grant_type: {
|
|
86
|
+
type: 'string',
|
|
87
|
+
enum: ['client_credentials'],
|
|
88
|
+
},
|
|
89
|
+
scope: {
|
|
90
|
+
type: 'string',
|
|
91
|
+
description: 'See https://tools.ietf.org/html/rfc6749#section-3.3',
|
|
92
|
+
},
|
|
93
|
+
},
|
|
94
|
+
},
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
export const refreshTokenRequestBodySchema: WhookAPISchemaDefinition = {
|
|
98
|
+
name: 'RefreshTokenRequestBody',
|
|
99
|
+
schema: {
|
|
100
|
+
type: 'object',
|
|
101
|
+
description:
|
|
102
|
+
'Token refresh grant type, see https://tools.ietf.org/html/rfc6749#section-6 .',
|
|
103
|
+
required: ['grant_type', 'refresh_token'],
|
|
104
|
+
properties: {
|
|
105
|
+
grant_type: {
|
|
106
|
+
type: 'string',
|
|
107
|
+
enum: ['refresh_token'],
|
|
108
|
+
},
|
|
109
|
+
refresh_token: {
|
|
110
|
+
type: 'string',
|
|
111
|
+
},
|
|
112
|
+
scope: {
|
|
113
|
+
type: 'string',
|
|
114
|
+
description: 'See https://tools.ietf.org/html/rfc6749#section-3.3',
|
|
115
|
+
},
|
|
116
|
+
},
|
|
117
|
+
},
|
|
118
|
+
};
|
|
119
|
+
|
|
120
|
+
export const tokenBodySchema: WhookAPISchemaDefinition = {
|
|
121
|
+
name: 'TokenRequestBody',
|
|
122
|
+
schema: {
|
|
123
|
+
oneOf: [
|
|
124
|
+
{
|
|
125
|
+
$ref: `#/components/schemas/${passwordTokenRequestBodySchema.name}`,
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
$ref: `#/components/schemas/${authorizationCodeTokenRequestBodySchema.name}`,
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
$ref: `#/components/schemas/${clientCredentialsTokenRequestBodySchema.name}`,
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
$ref: `#/components/schemas/${refreshTokenRequestBodySchema.name}`,
|
|
135
|
+
},
|
|
136
|
+
],
|
|
137
|
+
} as OpenAPIV3.SchemaObject,
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
export const definition: WhookAPIHandlerDefinition = {
|
|
141
|
+
method: 'post',
|
|
142
|
+
path: '/oauth2/token',
|
|
143
|
+
operation: {
|
|
144
|
+
operationId: 'postOAuth2Token',
|
|
145
|
+
summary: `Implements the [Token Endpoint](https://tools.ietf.org/html/rfc6749#section-3.2)
|
|
146
|
+
as defined per the OAuth2 RFC.`,
|
|
147
|
+
tags: ['oauth2'],
|
|
148
|
+
parameters: [],
|
|
149
|
+
requestBody: {
|
|
150
|
+
required: true,
|
|
151
|
+
content: {
|
|
152
|
+
'application/x-www-form-urlencoded': {
|
|
153
|
+
schema: {
|
|
154
|
+
$ref: `#/components/schemas/${tokenBodySchema.name}`,
|
|
155
|
+
},
|
|
156
|
+
},
|
|
157
|
+
'application/json': {
|
|
158
|
+
schema: {
|
|
159
|
+
$ref: `#/components/schemas/${tokenBodySchema.name}`,
|
|
160
|
+
},
|
|
161
|
+
},
|
|
162
|
+
},
|
|
163
|
+
},
|
|
164
|
+
responses: {
|
|
165
|
+
'200': {
|
|
166
|
+
description:
|
|
167
|
+
'Token successfully issued, see https://tools.ietf.org/html/rfc6749#section-5 .',
|
|
168
|
+
content: {
|
|
169
|
+
'application/json': {
|
|
170
|
+
schema: {
|
|
171
|
+
type: 'object',
|
|
172
|
+
required: ['access_token', 'token_type'],
|
|
173
|
+
properties: {
|
|
174
|
+
access_token: { type: 'string' },
|
|
175
|
+
token_type: {
|
|
176
|
+
description:
|
|
177
|
+
'See https://tools.ietf.org/html/rfc6749#section-7.1',
|
|
178
|
+
type: 'string',
|
|
179
|
+
enum: ['bearer', 'mac'],
|
|
180
|
+
},
|
|
181
|
+
expires_in: {
|
|
182
|
+
description: 'The lifetime in seconds of the access token',
|
|
183
|
+
type: 'number',
|
|
184
|
+
},
|
|
185
|
+
refresh_token: {
|
|
186
|
+
description:
|
|
187
|
+
'See https://tools.ietf.org/html/rfc6749#section-6',
|
|
188
|
+
type: 'string',
|
|
189
|
+
},
|
|
190
|
+
},
|
|
191
|
+
},
|
|
192
|
+
},
|
|
193
|
+
},
|
|
194
|
+
},
|
|
195
|
+
'400': {
|
|
196
|
+
description:
|
|
197
|
+
'Access token error response, see https://tools.ietf.org/html/rfc6749#section-5.2',
|
|
198
|
+
content: {
|
|
199
|
+
'application/json': {
|
|
200
|
+
schema: {
|
|
201
|
+
type: 'object',
|
|
202
|
+
required: ['error'],
|
|
203
|
+
properties: {
|
|
204
|
+
error: {
|
|
205
|
+
type: 'string',
|
|
206
|
+
enum: [
|
|
207
|
+
'invalid_request',
|
|
208
|
+
'invalid_client',
|
|
209
|
+
'invalid_grant',
|
|
210
|
+
'unauthorized_client',
|
|
211
|
+
'unsupported_grant_type',
|
|
212
|
+
'invalid_scope',
|
|
213
|
+
],
|
|
214
|
+
},
|
|
215
|
+
error_description: { type: 'string' },
|
|
216
|
+
error_uri: { type: 'string' },
|
|
217
|
+
},
|
|
218
|
+
},
|
|
219
|
+
},
|
|
220
|
+
},
|
|
221
|
+
},
|
|
222
|
+
},
|
|
223
|
+
},
|
|
224
|
+
};
|
|
225
|
+
|
|
226
|
+
export default autoHandler(postOAuth2Token);
|
|
227
|
+
|
|
228
|
+
async function postOAuth2Token<
|
|
229
|
+
AUTHENTICATION_DATA extends BaseAuthenticationData = BaseAuthenticationData,
|
|
230
|
+
>(
|
|
231
|
+
{
|
|
232
|
+
oAuth2Granters,
|
|
233
|
+
oAuth2AccessToken,
|
|
234
|
+
oAuth2RefreshToken,
|
|
235
|
+
time = Date.now.bind(Date),
|
|
236
|
+
log = noop,
|
|
237
|
+
}: {
|
|
238
|
+
oAuth2Granters: OAuth2GranterService[];
|
|
239
|
+
oAuth2AccessToken: OAuth2AccessTokenService;
|
|
240
|
+
oAuth2RefreshToken: OAuth2RefreshTokenService;
|
|
241
|
+
log: LogService;
|
|
242
|
+
time: TimeService;
|
|
243
|
+
},
|
|
244
|
+
{
|
|
245
|
+
body: { grant_type: grantType, ...grantParameters },
|
|
246
|
+
authenticationData,
|
|
247
|
+
}: {
|
|
248
|
+
body: {
|
|
249
|
+
grant_type: string;
|
|
250
|
+
[name: string]: unknown;
|
|
251
|
+
};
|
|
252
|
+
authenticationData: AUTHENTICATION_DATA;
|
|
253
|
+
},
|
|
254
|
+
) {
|
|
255
|
+
try {
|
|
256
|
+
const granter = oAuth2Granters.find(
|
|
257
|
+
(granter) =>
|
|
258
|
+
granter.authenticator && granter.authenticator.grantType === grantType,
|
|
259
|
+
);
|
|
260
|
+
|
|
261
|
+
if (!granter) {
|
|
262
|
+
throw new YError('E_UNKNOWN_AUTHENTICATOR_TYPE', grantType);
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
const newAuthenticationData = await granter.authenticator.authenticate(
|
|
266
|
+
camelCaseObjectProperties(grantParameters),
|
|
267
|
+
authenticationData,
|
|
268
|
+
);
|
|
269
|
+
|
|
270
|
+
const [
|
|
271
|
+
{ token: accessToken, expiresAt: accessTokenExpiresAt },
|
|
272
|
+
{ token: refreshToken, expiresAt: refreshTokenExpiresAt },
|
|
273
|
+
] = await Promise.all([
|
|
274
|
+
oAuth2AccessToken.create(authenticationData, newAuthenticationData),
|
|
275
|
+
oAuth2RefreshToken.create(authenticationData, newAuthenticationData),
|
|
276
|
+
]);
|
|
277
|
+
const currentTime = time();
|
|
278
|
+
|
|
279
|
+
return {
|
|
280
|
+
status: 200,
|
|
281
|
+
headers: {},
|
|
282
|
+
body: {
|
|
283
|
+
access_token: accessToken,
|
|
284
|
+
token_type: 'bearer',
|
|
285
|
+
expires_in: Math.ceil((accessTokenExpiresAt - currentTime) / 1000),
|
|
286
|
+
expiration_date: new Date(accessTokenExpiresAt).toISOString(),
|
|
287
|
+
refresh_token: refreshToken,
|
|
288
|
+
refresh_token_expires_in: Math.ceil(
|
|
289
|
+
(refreshTokenExpiresAt - currentTime) / 1000,
|
|
290
|
+
),
|
|
291
|
+
refresh_token_expiration_date: new Date(
|
|
292
|
+
refreshTokenExpiresAt,
|
|
293
|
+
).toISOString(),
|
|
294
|
+
},
|
|
295
|
+
};
|
|
296
|
+
} catch (err) {
|
|
297
|
+
log('debug', '👫 - OAuth2 token issuing error', err.code);
|
|
298
|
+
log('debug-stack', err.stack);
|
|
299
|
+
|
|
300
|
+
throw YError.cast(err, 'E_OAUTH2');
|
|
301
|
+
}
|
|
302
|
+
}
|