Skip to content
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

Merged

Conversation

Eric-Fithian
Copy link
Collaborator

added 3 functions, getPublicVendors, getPublicVendorById, getSelfVendor. Now get all vendors route is admin protected.

…or. Now get all vendors route is admin protected.
@Eric-Fithian Eric-Fithian requested a review from nh602 April 10, 2024 22:51
@Eric-Fithian Eric-Fithian linked an issue Apr 10, 2024 that may be closed by this pull request
@@ -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

This route handler performs
authorization
, but is not rate-limited.
This route handler performs
authorization
, but is not rate-limited.
This route handler performs
authorization
, but is not rate-limited.
This route handler performs
authorization
, but is not rate-limited.
@@ -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

This route handler performs
a database access
, but is not rate-limited.
router.get('/', verify('admin'), getVendors, sendSuccessResponse);

// Fetches public vendors
router.get('/public', getPublicVendors, sendSuccessResponse);

Check failure

Code scanning / CodeQL

Missing rate limiting High

This route handler performs
a database access
, but is not rate-limited.

// 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

This route handler performs
authorization
, but is not rate-limited.
This route handler performs
authorization
, but is not rate-limited.
This route handler performs
authorization
, but is not rate-limited.
This route handler performs
authorization
, but is not rate-limited.

// 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

This route handler performs
a database access
, but is not rate-limited.
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

This route handler performs
authorization
, but is not rate-limited.
This route handler performs
authorization
, but is not rate-limited.
This route handler performs
authorization
, but is not rate-limited.
This route handler performs
authorization
, but is not rate-limited.
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

This route handler performs
a database access
, but is not rate-limited.
@nh602 nh602 merged commit 74d2235 into main Jun 20, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Vendors Page - Make access public aka a vendors directory
2 participants