Skip to content
This repository has been archived by the owner on Aug 22, 2024. It is now read-only.

Commit

Permalink
Fixing broken test due to async fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
klcodanr committed Jun 1, 2023
1 parent f1b0901 commit 22a4a02
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
11 changes: 7 additions & 4 deletions docs/API.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,18 +81,21 @@ Loads schemas from this project in the <code>schemas</code> directory and suppor
objects against the schemas.

**Kind**: global class
<a name="SchemaValidator+validateIngestionRequest"></a>
<a name="SchemaValidator+validateObject"></a>

### schemaValidator.validateIngestionRequest(ingestionRequest, additionalRequiredData)
Validates the <code>ingestionRequest</code> object against the Ingestion Request schema
### schemaValidator.validateObject(obj, schemaName, additionalRequiredData)
Validates an object against the schema specified by <code>schemaName</code>
as specified in https://wiki.corp.adobe.com/display/WEM/Ingestor+API+Contract

Throws <code>Error</code> if request does not match

**Kind**: instance method of [<code>SchemaValidator</code>](#SchemaValidator)
**See**: https://wiki.corp.adobe.com/display/WEM/Ingestor+API+Contract?

| Param | Type |
| --- | --- |
| ingestionRequest | <code>any</code> |
| obj | <code>any</code> |
| schemaName | <code>string</code> |
| additionalRequiredData | <code>Array.&lt;string&gt;</code> |

<a name="extractAwsConfig"></a>
Expand Down
7 changes: 6 additions & 1 deletion src/security.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,12 @@ export class Security {
async authorize(req) {
this.#getRequiredHeader(req, 'x-space-id');
const token = this.#getToken(req);
await this.#verifyToken(token);
try {
await this.#verifyToken(token);
} catch (err) {
this.#log.warn('Unable to verify token due to exception', err);
throw new RestError(401);
}
}

/**
Expand Down

0 comments on commit 22a4a02

Please sign in to comment.