Skip to content

srs-sudeep/MockLdap

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mock LDAP Service

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).

Features

  • Mock LDAP authentication
  • Pre-configured users with different roles
  • RESTful API interface
  • FastAPI-based implementation

Pre-configured Users

Faculty Members

  1. John Doe

    • Username: john.doe
    • Password: faculty123
    • Department: Computer Science
    • Role: Faculty
  2. Jane Smith

    • Username: jane.smith
    • Password: faculty456
    • Department: Mathematics
    • Role: Faculty

Students

  1. Alice Johnson

    • Username: alice.student
    • Password: student123
    • Department: Computer Science
    • Role: Student
  2. Bob Wilson

    • Username: bob.student
    • Password: student456
    • Department: Mathematics
    • Role: Student

Setup

Local Development

  1. Install Poetry if not already installed:

    curl -sSL https://install.python-poetry.org | python3 -
  2. Install dependencies:

    poetry install
  3. Run the service:

    poetry run uvicorn app.main:app --reload --port 8001

Docker Deployment

  1. 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
  2. Build and run the container:

    # Build and start the service
    sudo docker-compose up -d
    
    # View logs
    sudo docker-compose logs -f
  3. Stop the service:

    sudo docker-compose down

API Endpoints

Authentication

  • POST /auth
    {
      "username": "string",
      "password": "string"
    }
    Response:
    {
      "success": true,
      "user_data": {
        "uid": "string",
        "cn": "string",
        "mail": "string",
        "employee_type": "faculty|student",
        "department": "string",
        "title": "string"
      }
    }

Health Check

  • GET /health
    {
      "status": "healthy"
    }

Documentation

Once the service is running, you can access the interactive API documentation at:

About

Python Based Mock Ldap Service

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published