This is a simple ticket system built using the Rust Axum framework. The system provides endpoints for user authentication, ticket creation, listing all tickets, and deleting tickets.
- Handles user authentication through a POST request.
- Hardcoded username and password for now.
- Upon successful login, a cookie is assigned to the user.
- Creates a new ticket through a POST request.
- Requires authentication (cookie check).
- Retrieves a list of all tickets on the server.
- Requires authentication (cookie check).
- Deletes a ticket with the specified ID through a DELETE request.
- Requires authentication (cookie check).
- All endpoints under "/api/tickets" are layered with a middleware that ensures authentication.
- Authentication is verified by checking for the existence of a valid cookie, which is obtained after a successful login from "/api/login".
All routes in the system are equipped with a middleware that maps server errors to client errors. This middleware ensures that confidential information is logged on the server side without revealing any sensitive details to clients.
- The error handling middleware intercepts server errors and transforms them into client-friendly error responses.
- Confidential information is logged on the server for debugging purposes without exposing it to clients.
- Server-side logs capture detailed information about errors for troubleshooting.
- Ensure that sensitive information is appropriately redacted or masked in the logs.
For a detailed tutorial on building this ticket system with Rust Axum, check out the video tutorial:
The original repository for this project can be found on GitHub.
This project is dual-licensed under the MIT License and the Apache License 2.0. See the MIT LICENSE and APACHE LICENSE files for details.
