Skip to content

Commit

Permalink
fix lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
crdev13 committed Aug 21, 2023
1 parent 0d4bff6 commit f596606
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ export class EndorsementsValidator {
* some specific channels. That list is the endorsement list, and is validated here against the channelId.
* @returns {boolean} True is the channelId is found in the Endorsement set. False if the channelId is not found.
*/
static validate(channelId: string, endorsements = new Set<string>()): boolean {
static validate(channelId: string, endorsements: Set<string>): boolean {
// If the Activity came in and doesn't have a Channel ID then it's making no
// assertions as to who endorses it. This means it should pass.
if (channelId === null || channelId.trim() === '') {
return true;
}
if (endorsements.size === 0) {

if (!endorsements) {
throw new AuthenticationError('endorsements required', StatusCodes.UNAUTHORIZED);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,9 @@ export class JwtTokenExtractor {
const isEndorsed = EndorsementsValidator.validate(channelId, endorsements);
if (!isEndorsed) {
throw new AuthenticationError(
`Could not validate endorsement for key: ${keyId} with endorsements: ${[...endorsements].join(',')}`,
`Could not validate endorsement for key: ${keyId} with endorsements: ${[...endorsements].join(
','
)}`,
StatusCodes.UNAUTHORIZED
);
}
Expand Down

0 comments on commit f596606

Please sign in to comment.