Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

v0.14.1 #190

Merged
merged 21 commits into from
Dec 26, 2022
Merged

v0.14.1 #190

merged 21 commits into from
Dec 26, 2022

Conversation

tycrek
Copy link
Owner

@tycrek tycrek commented Dec 26, 2022

Checklist

  • I have read the Contributing Guidelines
  • I acknowledge that any submitted code will be licensed under the ISC License
  • I confirm that submitted code is my own work
  • I have tested the code, and confirm that it works

Enviroment

  • Operating System: Win 10
  • Node version: 16
  • npm version: 8

Description

All changes:

@tycrek tycrek added the enhancement New feature or request label Dec 26, 2022
@tycrek tycrek self-assigned this Dec 26, 2022
@tycrek tycrek marked this pull request as draft December 26, 2022 06:13
src/routers/api.ts Fixed Show fixed Hide fixed
// Get a user (must be last as it's a catch-all)
// Admin only
userRouter.get('/:id', adminAuthMiddleware, (req: Request, res: Response) =>
userFinder(res, users.find(user => user.unid === req.params.id || user.username === req.params.id)));

// Delete a user
// Admin only
userRouter.delete('/:id', adminAuthMiddleware, (req: Request, res: Response) => {

Check failure

Code scanning / CodeQL

Missing rate limiting

This route handler performs [authorization](1), but is not rate-limited.

// Update a user meta key/value (/meta can be after /:id because they are not HTTP GET)
// Admin only
userRouter.put('/meta/:id', adminAuthMiddleware, (req: Request, res: Response) => {

Check failure

Code scanning / CodeQL

Missing rate limiting

This route handler performs [authorization](1), but is not rate-limited.

// Delete a user meta key
// Admin only
userRouter.delete('/meta/:id', adminAuthMiddleware, (req: Request, res: Response) => {

Check failure

Code scanning / CodeQL

Missing rate limiting

This route handler performs [authorization](1), but is not rate-limited.

// Sets a username
// Admin only
userRouter.put('/username/:id', adminAuthMiddleware, (req: Request, res: Response) => {

Check failure

Code scanning / CodeQL

Missing rate limiting

This route handler performs [authorization](1), but is not rate-limited.

// Resets a token
// Admin only
userRouter.put('/token/:id', adminAuthMiddleware, (req: Request, res: Response) => {

Check failure

Code scanning / CodeQL

Missing rate limiting

This route handler performs [authorization](1), but is not rate-limited.
code = 500;
}

return res.status(code).type('text').send(err.message ?? err);

Check warning

Code scanning / CodeQL

Exception text reinterpreted as HTML

[Exception text](1) is reinterpreted as HTML without escaping meta-characters. [Exception text](2) is reinterpreted as HTML without escaping meta-characters.
// Admin only
userRouter.get('/all', adminAuthMiddleware, (req: Request, res: Response) => res.json(users));
userRouter.get('/', adminAuthMiddleware, (req: Request, res: Response) => res.json(users));

Check failure

Code scanning / CodeQL

Missing rate limiting

This route handler performs [authorization](1), but is not rate-limited.
userRouter.post('/reset', adminAuthMiddleware, (req: Request, res: Response) => {
const id = req.body.id;
// todo: user-resets using existing password
userRouter.post('/password/reset/:id', adminAuthMiddleware, (req: Request, res: Response) => {

Check failure

Code scanning / CodeQL

Missing rate limiting

This route handler performs [authorization](1), but is not rate-limited.
});

// Create a new user
// Admin only
userRouter.post('/new', adminAuthMiddleware, (req: Request, res: Response) => {
userRouter.post('/', adminAuthMiddleware, (req: Request, res: Response) => {

Check failure

Code scanning / CodeQL

Missing rate limiting

This route handler performs [authorization](1), but is not rate-limited.
@tycrek tycrek marked this pull request as ready for review December 26, 2022 21:33
@tycrek tycrek merged commit e38adca into master Dec 26, 2022
@tycrek tycrek deleted the 0.14.1/stage branch December 26, 2022 21:54
# for free to join this conversation on GitHub. Already have an account? # to comment