Access Management is a specialized security framework designed to handle user authentication, role-based access control (RBAC), and permission management. This project provides a centralized backend to manage who can access specific resources, ensuring that organizational data remains secure and accessible only to authorized personnel.
- Backend: Python with Flask (REST API architecture)
- Database: MongoDB (for flexible user profiles and permission schemas)
- Security: JWT (JSON Web Tokens) for stateless authentication
- Environment Management:
python-dotenvfor securing secret keys and database URIs - Validation: Marshmallow / Cerberus for strict request body validation
- Role-Based Access Control (RBAC): Define granular permissions for different user levels (e.g., Admin, Manager, Viewer).
- Token-Based Authentication: Secure login system using JWT with configurable expiration.
- Resource Protection: Middleware-driven decorators to protect specific API routes.
- User Lifecycle Management: Full CRUD operations for managing user accounts and assigned roles.
- Audit Ready: Structured logging of access attempts and permission changes.
- Python 3.10+
- MongoDB (Local or Atlas)
Clone the repository:
git clone https://github.com/Sundaraj0828/access_management_nfs.git
cd access_management_nfsCreate a .env file in the root directory:
MONGO_URI=mongodb://localhost:27017/access_mgmt_db
JWT_SECRET_KEY=your_secure_secret_key
DEBUG=Truepip install -r requirements.txtflask run├── app/
│ ├── auth/ # JWT and Login logic
│ ├── routes/ # Access control endpoints
│ ├── models/ # User and Role schemas (MongoDB)
│ └── middleware/ # Permission check decorators
├── .env # Configuration
├── app.py # Application entry point
├── requirements.txt # Dependencies
└── README.md # Documentation
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/auth/login |
Authenticate user and receive JWT |
| GET | /api/users |
List all users (Admin only) |
| POST | /api/roles |
Create a new permission role |
| PATCH | /api/access/grant |
Update permissions for a specific user |
Distributed under the MIT License.
Developed with ❤️ by [Sundaraj0828]