A mock LDAP service for development and testing purposes. This service simulates an LDAP server with pre-configured users having different roles (Faculty and Student).
- Mock LDAP authentication
- Pre-configured users with different roles
- RESTful API interface
- FastAPI-based implementation
-
John Doe
- Username: john.doe
- Password: faculty123
- Department: Computer Science
- Role: Faculty
-
Jane Smith
- Username: jane.smith
- Password: faculty456
- Department: Mathematics
- Role: Faculty
-
Alice Johnson
- Username: alice.student
- Password: student123
- Department: Computer Science
- Role: Student
-
Bob Wilson
- Username: bob.student
- Password: student456
- Department: Mathematics
- Role: Student
-
Install Poetry if not already installed:
curl -sSL https://install.python-poetry.org | python3 -
-
Install dependencies:
poetry install
-
Run the service:
poetry run uvicorn app.main:app --reload --port 8001
-
Install Docker and Docker Compose on Ubuntu:
# Install Docker sudo apt-get update sudo apt-get install docker.io # Install Docker Compose sudo apt-get install docker-compose
-
Build and run the container:
# Build and start the service sudo docker-compose up -d # View logs sudo docker-compose logs -f
-
Stop the service:
sudo docker-compose down
- POST
/auth
Response:{ "username": "string", "password": "string" }
{ "success": true, "user_data": { "uid": "string", "cn": "string", "mail": "string", "employee_type": "faculty|student", "department": "string", "title": "string" } }
- GET
/health
{ "status": "healthy" }
Once the service is running, you can access the interactive API documentation at:
- Swagger UI: http://localhost:8001/docs
- ReDoc: http://localhost:8001/redoc