Skip to content

Commit

Permalink
Adjust README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
ziegler-daniel committed Dec 17, 2024
1 parent f37ff51 commit 659b135
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,11 @@ app.http('example-function', {
methods: ['POST'],
authLevel: 'anonymous',
route: 'example',
handler: middleware([AppInsightForHttpTrigger.setup, requestBodyValidation(requestBodySchema)], httpHandler, [
AppInsightForHttpTrigger.finalize,
]),
handler: middleware(
[AppInsightForHttpTrigger.setup, requestBodyValidation(requestBodySchema)],
httpHandler,
[AppInsightForHttpTrigger.finalize]
),
});

```
Expand Down Expand Up @@ -185,12 +187,14 @@ app.http('example-function', {
```

By default, an error is logged if the response body does not match the provided schema.
There is an additional parameter to customize the behavior of `requestQueryParamsValidation` (see [requestQueryParamsValidation.ts](src/validation/requestQueryParamsValidation.ts)).
There is an additional parameter to customize the behavior of `responseBodyValidation` (see [responseBodyValidation.ts](src/validation/responseBodyValidation.ts)).

### Authorization

The authorization function verifies request parameters against JWT Bearer Tokens, employing customizable extraction functions for flexible security checks.

**IMPORTANT**: The signature of the JWT is not validated. Any well-formed JWT can be decoded (see [jwt-decode](https://www.npmjs.com/package/jwt-decode)).

```typescript
import { HttpHandler, HttpRequestParams, app } from '@azure/functions';
import { jwtAuthorization, middleware } from '@senacor/azure-function-middleware';
Expand Down

0 comments on commit 659b135

Please sign in to comment.