Commit Graph
8 Commits
Author SHA1 Message Date
wancat b55b7aa1ec feat: add register, checkUsername, update swagger 2023-09-12 23:01:49 +08:00
wancat 0f53696f71 feat: apply auth to container and cli client 2023-09-12 00:12:09 +08:00
wancat 030dc95e24 refactor: put passport to auth folder 2023-09-11 23:38:29 +08:00
wancat 41111f5036 feat: add jwt verification 2023-09-11 23:09:00 +08:00
wancat bcdd04715d feat: add password login 2023-09-11 22:59:41 +08:00
wancat de8d49aea3 fix: change jwt expiry time to config
* rename dockerfile env
2023-09-01 13:54:51 +08:00
wancat 3cea54ce71 feat: add new API for recording executed commands
- Add the `jsonwebtoken` dependency to the server's `package.json`
- Add a new file `commandController.js` to the server's API controllers
- Add a new route `/commands` to the server's API routes
- Add a new file `commands.js` to the server's API routes
- Modify the `index.js` file in the server's API routes to import and use the `commands.js` route
- Add a `newCommand` function to the `commandController.js` file
- Add a `Command` model to the `command.js` file in the server's models
- Add the `genSessionJWT` and `verifySessionJWT` functions to the `auth.js` file in the server's utils
- Modify the `attachContainer` function in the `docker.js` file in the server's utils to include a `token` parameter
- Modify the `swagger.yaml` file to include a new route `/commands` for recording executed commands in a session

Signed-off-by: wancat <wancat@wancat.cc>
2023-07-24 16:39:04 +08:00
wancat 95fc25d0ad feat: connect to different container by sessions
Based on the file summaries provided, the best label for this commit would be "feat". This is because the commit introduces several new features to the codebase, such as adding a new ESLint rule, adding a new property to a function, adding authentication middleware, adding a query parameter, and adding a new function to handle user authentication.: update authentication and session handling

- Add `"camelcase"` rule to ESLint configuration
- Add `containerId` property to the `newSession` object in the `createSession` function
- Add authentication middleware to the socket.io connection
- Add a query parameter `session_id` to the socket.io connection in `client.js`
- Add `defaultUser` function to handle user authentication
- Update the `authMiddleware` function to use the `defaultUser` function
- Add `defaultUser` function to handle user authentication in `auth.js`
- Update `getOrCreateContainer` function to use the `id` parameter instead of `name` parameter
2023-07-24 12:21:05 +08:00