@thzero/library_server_koa 0.15.38 → 0.15.39

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.
@@ -1,83 +1,83 @@
1
- import LibraryConstants from '@thzero/library_server/constants';
2
- import LibraryCommonServiceConstants from '@thzero/library_common_service/constants';
3
-
4
- import injector from '@thzero/library_common/utility/injector';
5
-
6
- const separator = ': ';
7
-
8
- function getAuthToken(context) {
9
- if (!context)
10
- return null;
11
-
12
- const logger = injector.getService(LibraryCommonServiceConstants.InjectorKeys.SERVICE_LOGGER);
13
- const token = context.get(LibraryConstants.Headers.AuthKeys.AUTH);
14
- logger.debug('middleware', 'getAuthToken', 'token', token, context.correlationId);
15
- if (!String.isNullOrEmpty(token)) {
16
- const split = token.split(LibraryConstants.Headers.AuthKeys.AUTH_BEARER + separator);
17
- logger.debug('middleware', 'getAuthToken', 'split', split, context.correlationId);
18
- logger.debug('middleware', 'getAuthToken', 'split.length', split.length, context.correlationId);
19
- if (split.length > 1)
20
- return split[1];
21
- }
22
-
23
- logger.debug('middleware', 'getAuthToken', 'fail', null, context.correlationId);
24
- return null;
25
- }
26
-
27
- const authentication = (required) => {
28
- return async (ctx, next) => {
29
- const logger = injector.getService(LibraryCommonServiceConstants.InjectorKeys.SERVICE_LOGGER);
30
-
31
- const token = getAuthToken(ctx);
32
- logger.debug('middleware', 'authentication', 'token', token, ctx.correlationId);
33
- logger.debug('middleware', 'authentication', 'required', required, ctx.correlationId);
34
- const valid = ((required && !String.isNullOrEmpty(token)) || !required);
35
- logger.debug('middleware', 'authentication', 'valid1', (required && !String.isNullOrEmpty(token)), request.correlationId);
36
- if (required && !String.isNullOrEmpty(token)) {
37
- const service = injector.getService(LibraryConstants.InjectorKeys.SERVICE_AUTH);
38
- const results = await service.verifyToken(ctx.correlationId, token);
39
- logger.debug('middleware', 'authentication', 'results', results, ctx.correlationId);
40
- if (!results || !results.success) {
41
- logger.warn('middleware', 'authentication', 'Unauthenticated... invalid token', null, ctx.correlationId);
42
- ctx.throw(401);
43
- return;
44
- }
45
-
46
- ctx.state.token = token;
47
- ctx.state.user = results.user;
48
- ctx.state.claims = results.claims;
49
-
50
- await next();
51
- return;
52
- }
53
- logger.debug('middleware', 'authentication', 'valid2', !required, request.correlationId);
54
- if (!required) {
55
- await next();
56
- return;
57
- }
58
-
59
- (async () => {
60
- const usageMetrics = {
61
- url: ctx.request.path,
62
- correlationId: ctx.correlationId,
63
- href: ctx.request.href,
64
- headers: ctx.request.headers,
65
- host: ctx.request.host,
66
- hostname: ctx.request.hostname,
67
- querystring: ctx.request.querystring,
68
- type: ctx.request.type,
69
- token: ctx.request.token
70
- };
71
- const serviceUsageMetrics = injector.getService(LibraryConstants.InjectorKeys.SERVICE_USAGE_METRIC);
72
- await serviceUsageMetrics.register(usageMetrics).catch((err) => {
73
- const logger = injector.getService(LibraryCommonServiceConstants.InjectorKeys.SERVICE_LOGGER);
74
- logger.error('middleware', 'authentication', err, null, ctx.correlationId);
75
- });
76
- })();
77
-
78
- logger.warn('middleware', 'authentication', 'Unauthorized... authentication unknown', null, ctx.correlationId);
79
- ctx.throw(401);
80
- }
81
- }
82
-
83
- export default authentication;
1
+ import LibraryConstants from '@thzero/library_server/constants';
2
+ import LibraryCommonServiceConstants from '@thzero/library_common_service/constants';
3
+
4
+ import injector from '@thzero/library_common/utility/injector';
5
+
6
+ const separator = ': ';
7
+
8
+ function getAuthToken(context) {
9
+ if (!context)
10
+ return null;
11
+
12
+ const logger = injector.getService(LibraryCommonServiceConstants.InjectorKeys.SERVICE_LOGGER);
13
+ const token = context.get(LibraryConstants.Headers.AuthKeys.AUTH);
14
+ logger.debug('middleware', 'getAuthToken', 'token', token, context.correlationId);
15
+ if (!String.isNullOrEmpty(token)) {
16
+ const split = token.split(LibraryConstants.Headers.AuthKeys.AUTH_BEARER + separator);
17
+ logger.debug('middleware', 'getAuthToken', 'split', split, context.correlationId);
18
+ logger.debug('middleware', 'getAuthToken', 'split.length', split.length, context.correlationId);
19
+ if (split.length > 1)
20
+ return split[1];
21
+ }
22
+
23
+ logger.debug('middleware', 'getAuthToken', 'fail', null, context.correlationId);
24
+ return null;
25
+ }
26
+
27
+ const authentication = (required) => {
28
+ return async (ctx, next) => {
29
+ const logger = injector.getService(LibraryCommonServiceConstants.InjectorKeys.SERVICE_LOGGER);
30
+
31
+ const token = getAuthToken(ctx);
32
+ logger.debug('middleware', 'authentication', 'token', token, ctx.correlationId);
33
+ logger.debug('middleware', 'authentication', 'required', required, ctx.correlationId);
34
+ const valid = ((required && !String.isNullOrEmpty(token)) || !required);
35
+ logger.debug('middleware', 'authentication', 'valid1', (required && !String.isNullOrEmpty(token)), request.correlationId);
36
+ if (required && !String.isNullOrEmpty(token)) {
37
+ const service = injector.getService(LibraryConstants.InjectorKeys.SERVICE_AUTH);
38
+ const results = await service.verifyToken(ctx.correlationId, token);
39
+ logger.debug('middleware', 'authentication', 'results', results, ctx.correlationId);
40
+ if (!results || !results.success) {
41
+ logger.warn('middleware', 'authentication', 'Unauthenticated... invalid token', null, ctx.correlationId);
42
+ ctx.throw(401);
43
+ return;
44
+ }
45
+
46
+ ctx.state.token = token;
47
+ ctx.state.user = results.user;
48
+ ctx.state.claims = results.claims;
49
+
50
+ await next();
51
+ return;
52
+ }
53
+ logger.debug('middleware', 'authentication', 'valid2', !required, request.correlationId);
54
+ if (!required) {
55
+ await next();
56
+ return;
57
+ }
58
+
59
+ (async () => {
60
+ const usageMetrics = {
61
+ url: ctx.request.path,
62
+ correlationId: ctx.correlationId,
63
+ href: ctx.request.href,
64
+ headers: ctx.request.headers,
65
+ host: ctx.request.host,
66
+ hostname: ctx.request.hostname,
67
+ querystring: ctx.request.querystring,
68
+ type: ctx.request.type,
69
+ token: ctx.request.token
70
+ };
71
+ const serviceUsageMetrics = injector.getService(LibraryConstants.InjectorKeys.SERVICE_USAGE_METRIC);
72
+ await serviceUsageMetrics.register(usageMetrics).catch((err) => {
73
+ const logger = injector.getService(LibraryCommonServiceConstants.InjectorKeys.SERVICE_LOGGER);
74
+ logger.error('middleware', 'authentication', err, null, ctx.correlationId);
75
+ });
76
+ })();
77
+
78
+ logger.warn('middleware', 'authentication', 'Unauthorized... authentication unknown', null, ctx.correlationId);
79
+ ctx.throw(401);
80
+ }
81
+ }
82
+
83
+ export default authentication;
@@ -1,191 +1,191 @@
1
- import LibraryConstants from '@thzero/library_server/constants';
2
- import LibraryCommonServiceConstants from '@thzero/library_common_service/constants';
3
-
4
- import injector from '@thzero/library_common/utility/injector';
5
-
6
- // require('../utility/string.cjs');
7
- String.isNullOrEmpty = function(value) {
8
- //return !(typeof value === 'string' && value.length > 0)
9
- return !value;
10
- }
11
-
12
- String.isString = function(value) {
13
- return (typeof value === "string" || value instanceof String);
14
- }
15
-
16
- String.trim = function(value) {
17
- if (!value || !String.isString(value))
18
- return value;
19
- return value.trim();
20
- }
21
-
22
- const logicalAnd = 'and';
23
- const logicalOr = 'or';
24
-
25
- const authorizationCheckClaims = async (ctx, success, logical, security, logger) => {
26
- if (!ctx)
27
- return false;
28
- if (!(ctx.state.claims && Array.isArray(ctx.state.claims)))
29
- return false;
30
-
31
- let result;
32
- let roleAct;
33
- let roleObj;
34
- let roleParts;
35
- for (const claim of ctx.state.claims) {
36
- logger.debug('middleware', 'authorization', 'authorization.claim', claim, ctx.correlationId);
37
-
38
- for (const role of ctx.state.roles) {
39
- logger.debug('middleware', 'authorization', 'role', role, ctx.correlationId);
40
-
41
- roleParts = role.split('.');
42
- if (roleParts && roleParts.length < 1)
43
- success = false;
44
-
45
- roleObj = roleParts[0];
46
- roleAct = roleParts.length >= 2 ? roleParts[1] : null
47
-
48
- result = await security.validate(claim, null, roleObj, roleAct);
49
- logger.debug('middleware', 'authorization', 'result', result, ctx.correlationId);
50
- if (logical === logicalOr)
51
- success = success || result;
52
- else
53
- success = success && result;
54
- }
55
- }
56
-
57
- return success;
58
- }
59
-
60
- const authorizationCheckRoles = async (ctx, success, logical, security, logger) => {
61
- if (!ctx)
62
- return false;
63
-
64
- logger.debug('middleware', 'authorizationCheckRoles', 'user', ctx.state.user, ctx.correlationId);
65
- if (!(ctx.state.user && ctx.state.user.roles && Array.isArray(ctx.state.user.roles)))
66
- return false;
67
-
68
- logger.debug('middleware', 'authorizationCheckRoles', 'logical', logical, ctx.correlationId);
69
-
70
- let result;
71
- let roleAct;
72
- let roleObj;
73
- let roleParts;
74
- for (const userRole of ctx.state.user.roles) {
75
- logger.debug('middleware', 'authorizationCheckRoles', 'userRole', userRole, ctx.correlationId);
76
-
77
- for (const role of ctx.state.roles) {
78
- logger.debug('middleware', 'authorizationCheckRoles', 'role', role, ctx.correlationId);
79
-
80
- roleParts = role.split('.');
81
- if (roleParts && roleParts.length < 1)
82
- success = false;
83
-
84
- roleObj = roleParts[0];
85
- roleAct = roleParts.length >= 2 ? roleParts[1] : null
86
-
87
- result = await security.validate(userRole, null, roleObj, roleAct);
88
- logger.debug('middleware', 'authorizationCheckRoles', 'result', result, ctx.correlationId);
89
- if (logical === logicalOr) {
90
- if (result)
91
- return result;
92
-
93
- success = false;
94
- }
95
- else
96
- success = success && result;
97
- }
98
- }
99
-
100
- return success;
101
- }
102
-
103
- const initalizeRoles = (ctx, roles, logger) => {
104
- if (Array.isArray(roles)) {
105
- // logger.debug('middleware', 'initalizeRoles', 'roles1a', roles);
106
- ctx.state.roles = roles;
107
- }
108
- else if ((typeof(roles) === 'string') || (roles instanceof String)) {
109
- // logger.debug('middleware', 'initalizeRoles', 'roles1b', roles);
110
- ctx.state.roles = roles.split(',');
111
- ctx.state.roles.map(item => item ? item.trim() : item);
112
- }
113
- }
114
-
115
- const authorization = (roles, logical) => {
116
- if (String.isNullOrEmpty(logical) || (logical !== logicalAnd) || (logical !== logicalOr))
117
- logical = logicalOr;
118
-
119
- return async (ctx, next) => {
120
- const config = injector.getService(LibraryCommonServiceConstants.InjectorKeys.SERVICE_CONFIG);
121
- const logger = injector.getService(LibraryCommonServiceConstants.InjectorKeys.SERVICE_LOGGER);
122
- const security = injector.getService(LibraryConstants.InjectorKeys.SERVICE_SECURITY);
123
-
124
- // logger.debug('token', ctx.state.token);
125
- logger.debug('middleware', 'authorization', 'user', ctx.state.user, ctx.correlationId);
126
- logger.debug('middleware', 'authorization', 'claims', ctx.state.claims, ctx.correlationId);
127
- logger.debug('middleware', 'authorization', 'roles1', roles, ctx.correlationId);
128
- ctx.state.roles = [];
129
- if (roles) {
130
- // logger.debug('authorization.roles1', roles);
131
- // logger.debug('authorization.roles1', (typeof roles));
132
- // logger.debug('authorization.roles1', Array.isArray(roles));
133
- // logger.debug('authorization.roles1', ((typeof(roles) === 'string') || (roles instanceof String)));
134
- // if (Array.isArray(roles)) {
135
- // // logger.debug('authorization.roles1a', roles);
136
- // ctx.state.roles = roles;
137
- // }
138
- // else if ((typeof(roles) === 'string') || (roles instanceof String)) {
139
- // // logger.debug('authorization.roles1b', roles);
140
- // ctx.state.roles = roles.split(',');
141
- // ctx.state.roles.map(item => item ? item.trim() : item);
142
- // }
143
- initalizeRoles(ctx, roles, logger);
144
- }
145
- logger.debug('middleware', 'authorization', 'roles2', ctx.state.roles, ctx.correlationId);
146
-
147
- let success = false; //(logical === logicalOr ? false : true);
148
- if (ctx.state.roles && Array.isArray(ctx.state.roles) && (ctx.state.roles.length > 0)) {
149
- const auth = config.get('auth');
150
- if (auth) {
151
- logger.debug('middleware', 'authorization', 'auth.claims', auth.claims, ctx.correlationId);
152
- logger.debug('middleware', 'authorization', 'auth.claims.check', auth.claims.check, ctx.correlationId);
153
- }
154
- if (auth && auth.claims && auth.claims.check)
155
- success = await authorizationCheckClaims(ctx, (logical === logicalOr ? false : true), logical, security, logger);
156
-
157
- if (!success)
158
- success = await authorizationCheckRoles(ctx, (logical === logicalOr ? false : true), logical, security, logger);
159
- }
160
-
161
- logger.debug('middleware', 'authorization', 'success', null, ctx.state.success, ctx.correlationId);
162
- if (success) {
163
- await next();
164
- return;
165
- }
166
-
167
- (async () => {
168
- const serviceUsageMetrics = injector.getService(LibraryConstants.InjectorKeys.SERVICE_USAGE_METRIC);
169
- const usageMetrics = {
170
- url: ctx.request.path,
171
- correlationId: ctx.correlationId,
172
- href: ctx.request.href,
173
- headers: ctx.request.headers,
174
- host: ctx.request.host,
175
- hostname: ctx.request.hostname,
176
- querystring: ctx.request.querystring,
177
- type: ctx.request.type,
178
- token: ctx.request.token
179
- };
180
- await serviceUsageMetrics.register(usageMetrics).catch((err) => {
181
- const logger = injector.getService(LibraryCommonServiceConstants.InjectorKeys.SERVICE_LOGGER);
182
- logger.error(null, err);
183
- });
184
- })();
185
-
186
- logger.warn('middleware', 'authorization', 'Unauthorized... authorization unknown', null, ctx.correlationId);
187
- ctx.throw(401);
188
- }
189
- }
190
-
191
- export default authorization;
1
+ import LibraryConstants from '@thzero/library_server/constants';
2
+ import LibraryCommonServiceConstants from '@thzero/library_common_service/constants';
3
+
4
+ import injector from '@thzero/library_common/utility/injector';
5
+
6
+ // require('../utility/string.cjs');
7
+ String.isNullOrEmpty = function(value) {
8
+ //return !(typeof value === 'string' && value.length > 0)
9
+ return !value;
10
+ }
11
+
12
+ String.isString = function(value) {
13
+ return (typeof value === "string" || value instanceof String);
14
+ }
15
+
16
+ String.trim = function(value) {
17
+ if (!value || !String.isString(value))
18
+ return value;
19
+ return value.trim();
20
+ }
21
+
22
+ const logicalAnd = 'and';
23
+ const logicalOr = 'or';
24
+
25
+ const authorizationCheckClaims = async (ctx, success, logical, security, logger) => {
26
+ if (!ctx)
27
+ return false;
28
+ if (!(ctx.state.claims && Array.isArray(ctx.state.claims)))
29
+ return false;
30
+
31
+ let result;
32
+ let roleAct;
33
+ let roleObj;
34
+ let roleParts;
35
+ for (const claim of ctx.state.claims) {
36
+ logger.debug('middleware', 'authorization', 'authorization.claim', claim, ctx.correlationId);
37
+
38
+ for (const role of ctx.state.roles) {
39
+ logger.debug('middleware', 'authorization', 'role', role, ctx.correlationId);
40
+
41
+ roleParts = role.split('.');
42
+ if (roleParts && roleParts.length < 1)
43
+ success = false;
44
+
45
+ roleObj = roleParts[0];
46
+ roleAct = roleParts.length >= 2 ? roleParts[1] : null
47
+
48
+ result = await security.validate(claim, null, roleObj, roleAct);
49
+ logger.debug('middleware', 'authorization', 'result', result, ctx.correlationId);
50
+ if (logical === logicalOr)
51
+ success = success || result;
52
+ else
53
+ success = success && result;
54
+ }
55
+ }
56
+
57
+ return success;
58
+ }
59
+
60
+ const authorizationCheckRoles = async (ctx, success, logical, security, logger) => {
61
+ if (!ctx)
62
+ return false;
63
+
64
+ logger.debug('middleware', 'authorizationCheckRoles', 'user', ctx.state.user, ctx.correlationId);
65
+ if (!(ctx.state.user && ctx.state.user.roles && Array.isArray(ctx.state.user.roles)))
66
+ return false;
67
+
68
+ logger.debug('middleware', 'authorizationCheckRoles', 'logical', logical, ctx.correlationId);
69
+
70
+ let result;
71
+ let roleAct;
72
+ let roleObj;
73
+ let roleParts;
74
+ for (const userRole of ctx.state.user.roles) {
75
+ logger.debug('middleware', 'authorizationCheckRoles', 'userRole', userRole, ctx.correlationId);
76
+
77
+ for (const role of ctx.state.roles) {
78
+ logger.debug('middleware', 'authorizationCheckRoles', 'role', role, ctx.correlationId);
79
+
80
+ roleParts = role.split('.');
81
+ if (roleParts && roleParts.length < 1)
82
+ success = false;
83
+
84
+ roleObj = roleParts[0];
85
+ roleAct = roleParts.length >= 2 ? roleParts[1] : null
86
+
87
+ result = await security.validate(userRole, null, roleObj, roleAct);
88
+ logger.debug('middleware', 'authorizationCheckRoles', 'result', result, ctx.correlationId);
89
+ if (logical === logicalOr) {
90
+ if (result)
91
+ return result;
92
+
93
+ success = false;
94
+ }
95
+ else
96
+ success = success && result;
97
+ }
98
+ }
99
+
100
+ return success;
101
+ }
102
+
103
+ const initalizeRoles = (ctx, roles, logger) => {
104
+ if (Array.isArray(roles)) {
105
+ // logger.debug('middleware', 'initalizeRoles', 'roles1a', roles);
106
+ ctx.state.roles = roles;
107
+ }
108
+ else if ((typeof(roles) === 'string') || (roles instanceof String)) {
109
+ // logger.debug('middleware', 'initalizeRoles', 'roles1b', roles);
110
+ ctx.state.roles = roles.split(',');
111
+ ctx.state.roles.map(item => item ? item.trim() : item);
112
+ }
113
+ }
114
+
115
+ const authorization = (roles, logical) => {
116
+ if (String.isNullOrEmpty(logical) || (logical !== logicalAnd) || (logical !== logicalOr))
117
+ logical = logicalOr;
118
+
119
+ return async (ctx, next) => {
120
+ const config = injector.getService(LibraryCommonServiceConstants.InjectorKeys.SERVICE_CONFIG);
121
+ const logger = injector.getService(LibraryCommonServiceConstants.InjectorKeys.SERVICE_LOGGER);
122
+ const security = injector.getService(LibraryConstants.InjectorKeys.SERVICE_SECURITY);
123
+
124
+ // logger.debug('token', ctx.state.token);
125
+ logger.debug('middleware', 'authorization', 'user', ctx.state.user, ctx.correlationId);
126
+ logger.debug('middleware', 'authorization', 'claims', ctx.state.claims, ctx.correlationId);
127
+ logger.debug('middleware', 'authorization', 'roles1', roles, ctx.correlationId);
128
+ ctx.state.roles = [];
129
+ if (roles) {
130
+ // logger.debug('authorization.roles1', roles);
131
+ // logger.debug('authorization.roles1', (typeof roles));
132
+ // logger.debug('authorization.roles1', Array.isArray(roles));
133
+ // logger.debug('authorization.roles1', ((typeof(roles) === 'string') || (roles instanceof String)));
134
+ // if (Array.isArray(roles)) {
135
+ // // logger.debug('authorization.roles1a', roles);
136
+ // ctx.state.roles = roles;
137
+ // }
138
+ // else if ((typeof(roles) === 'string') || (roles instanceof String)) {
139
+ // // logger.debug('authorization.roles1b', roles);
140
+ // ctx.state.roles = roles.split(',');
141
+ // ctx.state.roles.map(item => item ? item.trim() : item);
142
+ // }
143
+ initalizeRoles(ctx, roles, logger);
144
+ }
145
+ logger.debug('middleware', 'authorization', 'roles2', ctx.state.roles, ctx.correlationId);
146
+
147
+ let success = false; //(logical === logicalOr ? false : true);
148
+ if (ctx.state.roles && Array.isArray(ctx.state.roles) && (ctx.state.roles.length > 0)) {
149
+ const auth = config.get('auth');
150
+ if (auth) {
151
+ logger.debug('middleware', 'authorization', 'auth.claims', auth.claims, ctx.correlationId);
152
+ logger.debug('middleware', 'authorization', 'auth.claims.check', auth.claims.check, ctx.correlationId);
153
+ }
154
+ if (auth && auth.claims && auth.claims.check)
155
+ success = await authorizationCheckClaims(ctx, (logical === logicalOr ? false : true), logical, security, logger);
156
+
157
+ if (!success)
158
+ success = await authorizationCheckRoles(ctx, (logical === logicalOr ? false : true), logical, security, logger);
159
+ }
160
+
161
+ logger.debug('middleware', 'authorization', 'success', null, ctx.state.success, ctx.correlationId);
162
+ if (success) {
163
+ await next();
164
+ return;
165
+ }
166
+
167
+ (async () => {
168
+ const serviceUsageMetrics = injector.getService(LibraryConstants.InjectorKeys.SERVICE_USAGE_METRIC);
169
+ const usageMetrics = {
170
+ url: ctx.request.path,
171
+ correlationId: ctx.correlationId,
172
+ href: ctx.request.href,
173
+ headers: ctx.request.headers,
174
+ host: ctx.request.host,
175
+ hostname: ctx.request.hostname,
176
+ querystring: ctx.request.querystring,
177
+ type: ctx.request.type,
178
+ token: ctx.request.token
179
+ };
180
+ await serviceUsageMetrics.register(usageMetrics).catch((err) => {
181
+ const logger = injector.getService(LibraryCommonServiceConstants.InjectorKeys.SERVICE_LOGGER);
182
+ logger.error(null, err);
183
+ });
184
+ })();
185
+
186
+ logger.warn('middleware', 'authorization', 'Unauthorized... authorization unknown', null, ctx.correlationId);
187
+ ctx.throw(401);
188
+ }
189
+ }
190
+
191
+ export default authorization;
package/package.json CHANGED
@@ -1,40 +1,40 @@
1
- {
2
- "name": "@thzero/library_server_koa",
3
- "type": "module",
4
- "version": "0.15.38",
5
- "version_major": 0,
6
- "version_minor": 15,
7
- "version_patch": 38,
8
- "version_date": "11/25/2022",
9
- "description": "An opinionated library of common functionality to bootstrap a Koa based API application.",
10
- "author": "thZero",
11
- "license": "MIT",
12
- "repository": {
13
- "type": "git",
14
- "url": "git+https://github.com/thzero/library_server_koa.git"
15
- },
16
- "bugs": {
17
- "url": "https://github.com/thzero/library_server_koa/issues"
18
- },
19
- "homepage": "https://github.com/thzero/library_server_koa#readme",
20
- "engines": {
21
- "node": ">=12.8.3"
22
- },
23
- "scripts": {
24
- "cli-update": "library-cli --updateversion --pi",
25
- "test": "echo \"Error: no test specified\" && exit 1"
26
- },
27
- "dependencies": {
28
- "@koa/cors": "^4.0.0",
29
- "@koa/router": "^12.0.0",
30
- "koa": "^2.13.4",
31
- "koa-body": "^6.0.1",
32
- "koa-helmet": "^6.1.0",
33
- "koa-static": "^5.0.0"
34
- },
35
- "peerDependencies": {
36
- "@thzero/library_common": "^0.15",
37
- "@thzero/library_common_service": "^0.15",
38
- "@thzero/library_server": "^0.15"
39
- }
1
+ {
2
+ "name": "@thzero/library_server_koa",
3
+ "type": "module",
4
+ "version": "0.15.39",
5
+ "version_major": 0,
6
+ "version_minor": 15,
7
+ "version_patch": 39,
8
+ "version_date": "12/11/2022",
9
+ "description": "An opinionated library of common functionality to bootstrap a Koa based API application.",
10
+ "author": "thZero",
11
+ "license": "MIT",
12
+ "repository": {
13
+ "type": "git",
14
+ "url": "git+https://github.com/thzero/library_server_koa.git"
15
+ },
16
+ "bugs": {
17
+ "url": "https://github.com/thzero/library_server_koa/issues"
18
+ },
19
+ "homepage": "https://github.com/thzero/library_server_koa#readme",
20
+ "engines": {
21
+ "node": ">=12.8.3"
22
+ },
23
+ "scripts": {
24
+ "cli-update": "library-cli --updateversion --pi",
25
+ "test": "echo \"Error: no test specified\" && exit 1"
26
+ },
27
+ "dependencies": {
28
+ "@koa/cors": "^4.0.0",
29
+ "@koa/router": "^12.0.0",
30
+ "koa": "^2.14.1",
31
+ "koa-body": "^6.0.1",
32
+ "koa-helmet": "^6.1.0",
33
+ "koa-static": "^5.0.0"
34
+ },
35
+ "peerDependencies": {
36
+ "@thzero/library_common": "^0.15",
37
+ "@thzero/library_common_service": "^0.15",
38
+ "@thzero/library_server": "^0.15"
39
+ }
40
40
  }