Skip to content

Commit

Permalink
feat(grpc-sdk,commons,security): cli security client platform, ping r…
Browse files Browse the repository at this point in the history
…oute security middleware exceptions (#207)
  • Loading branch information
kon14 committed Jun 15, 2022
1 parent 7fea6c8 commit 11b7ceb
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ export enum PlatformTypesEnum {
WINDOWS = 'WINDOWS',
MACOS = 'MACOS',
LINUX = 'LINUX',
CLI = 'CLI',
}
1 change: 1 addition & 0 deletions packages/commons/src/constants/enums/PlatformTypesEnum.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ export enum PlatformTypesEnum {
WINDOWS = 'WINDOWS',
MACOS = 'MACOS',
LINUX = 'LINUX',
CLI = 'CLI',
}
8 changes: 6 additions & 2 deletions packages/security/src/handlers/client-validation/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,12 @@ export class ClientValidator {
if (isNil((req as ConduitModelOptions).conduit))
(req as ConduitModelOptions).conduit = {};
const { clientid, clientsecret } = req.headers;
// if incoming call is a webhook or an admin call
if (req.path.indexOf('/hook') === 0 || req.path.indexOf('/admin') === 0) {
// Exclude webhooks, admin calls and http pings
if (
req.path.indexOf('/hook') === 0 ||
req.path.indexOf('/admin') === 0 ||
['/', '/health'].includes(req.path)
) {
return next();
}

Expand Down

0 comments on commit 11b7ceb

Please sign in to comment.