-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
added 3 functions for public and private vendor queries. #126
added 3 functions for public and private vendor queries. #126
Conversation
…or. Now get all vendors route is admin protected.
@@ -28,11 +31,20 @@ | |||
router.post('/login', getVendor, authenticateVendor, signToken, sendSuccessResponse); | |||
|
|||
// Fetches all vendors | |||
router.get('/', getVendors, sendSuccessResponse); | |||
router.get('/', verify('admin'), getVendors, sendSuccessResponse); |
Check failure
Code scanning / CodeQL
Missing rate limiting High
authorization
This route handler performs
authorization
This route handler performs
authorization
This route handler performs
authorization
@@ -28,11 +31,20 @@ | |||
router.post('/login', getVendor, authenticateVendor, signToken, sendSuccessResponse); | |||
|
|||
// Fetches all vendors | |||
router.get('/', getVendors, sendSuccessResponse); | |||
router.get('/', verify('admin'), getVendors, sendSuccessResponse); |
Check failure
Code scanning / CodeQL
Missing rate limiting High
a database access
router.get('/', verify('admin'), getVendors, sendSuccessResponse); | ||
|
||
// Fetches public vendors | ||
router.get('/public', getPublicVendors, sendSuccessResponse); |
Check failure
Code scanning / CodeQL
Missing rate limiting High
a database access
|
||
// Fetches a single vendor by ID | ||
router.get('/:vendorId', getVendorById, sendSuccessResponse); | ||
|
||
// Fetches a single vendor by ID that is public | ||
router.get('/public/:vendorId', verify('admin'), getPublicVendorById, sendSuccessResponse); |
Check failure
Code scanning / CodeQL
Missing rate limiting High
authorization
This route handler performs
authorization
This route handler performs
authorization
This route handler performs
authorization
|
||
// Fetches a single vendor by ID | ||
router.get('/:vendorId', getVendorById, sendSuccessResponse); | ||
|
||
// Fetches a single vendor by ID that is public | ||
router.get('/public/:vendorId', verify('admin'), getPublicVendorById, sendSuccessResponse); |
Check failure
Code scanning / CodeQL
Missing rate limiting High
a database access
router.get('/public/:vendorId', verify('admin'), getPublicVendorById, sendSuccessResponse); | ||
|
||
// Fetches vendor that is self | ||
router.get('/self', verify('vendor'), getSelfVendor, sendSuccessResponse); |
Check failure
Code scanning / CodeQL
Missing rate limiting High
authorization
This route handler performs
authorization
This route handler performs
authorization
This route handler performs
authorization
router.get('/public/:vendorId', verify('admin'), getPublicVendorById, sendSuccessResponse); | ||
|
||
// Fetches vendor that is self | ||
router.get('/self', verify('vendor'), getSelfVendor, sendSuccessResponse); |
Check failure
Code scanning / CodeQL
Missing rate limiting High
added 3 functions, getPublicVendors, getPublicVendorById, getSelfVendor. Now get all vendors route is admin protected.