@thisisagile/easy-test-web 8.5.0 → 8.5.4
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 +3 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -241,7 +241,7 @@ During the execution of a request, lots of things can go wrong. Here as some com
|
|
|
241
241
|
|
|
242
242
|
* For starters, you might not reach the endpoint, because you've typed in the wrong URL. If this happens, and you still reach your microservice, **easy** handles this in the `NotFoundHandler`, which is plugged-in by default.
|
|
243
243
|
* If you are not allowed to execute an endpoint, for instance because it is secured with one of the security decorators in **easy**, such as `@requires.useCase()`, `@requires.Scope()` or `@requires.token`, the endpoint will not execute, and you will receive a 403. In this case the middleware from the `SecurityHandler` already breaks the loop, and the code in you microservices is not executed at all.
|
|
244
|
-
* All other failures are handled by the `ErrorHandler`,
|
|
244
|
+
* All other failures are handled by the `ErrorHandler`, and can result in any custom HTTP status code, most likely a 400, or a 500. In case the caller makes a mistake, the code should come from the 400 range, in cases the microservice makes the mistake, the code comes from the 500 range.
|
|
245
245
|
|
|
246
246
|
## Utilities
|
|
247
247
|
Additionally, this library contains utility classes for standardizing e.g. uri's, and ids, constructors, lists, queries, and errors. Quite often these are constructed as monads, which renders robust code.
|
|
@@ -276,5 +276,7 @@ Access to endpoints is configured using the `@requires` decorator group. If mult
|
|
|
276
276
|
add = (req: Req): Promise<Product> => this.manage.add(req.body as Json);
|
|
277
277
|
}
|
|
278
278
|
|
|
279
|
+
The `@requires` decorator group also contains `@requires.labCoat()` this decorator can be added to endpoints you only want to be available on your development environment, for example a `delete`.
|
|
280
|
+
|
|
279
281
|
To use these decorators, the generic `security` middleware must be loaded first. In most cases, it should be added to the `pre` list of handlers of a service.
|
|
280
282
|
The security middleware takes an optional configuration object, which is documented [in code](packages/easy-express/src/express/SecurityHandler.ts).
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thisisagile/easy-test-web",
|
|
3
|
-
"version": "8.5.
|
|
3
|
+
"version": "8.5.4",
|
|
4
4
|
"description": "Straightforward wrapper library for web testing frameworks",
|
|
5
5
|
"author": "Sander Hoogendoorn",
|
|
6
6
|
"license": "MIT",
|
|
@@ -34,6 +34,6 @@
|
|
|
34
34
|
"access": "public"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@thisisagile/easy": "8.5.
|
|
37
|
+
"@thisisagile/easy": "8.5.4"
|
|
38
38
|
}
|
|
39
39
|
}
|