Skip to content

Create a minimal HTTP service that exposes the user and group information on a UNIX-like system that is usually locked away in the UNIX /etc/passwd and /etc/groups file. For a Services Challenge Interview.

Notifications You must be signed in to change notification settings

nickswang/PasswdAsAService

 
 

Repository files navigation

Brain Corp Service

Password as a Service

Usage

Get /users

Return a list of all users on the system, as defined in the /etc/passwd file.

[
  {
    “name”: “root”, “uid”: 0, “gid”: 0, “comment”: “root”, “home”: “/root”,
    “shell”: “/bin/bash”
  },
  {
    “name”: “dwoodlins”, “uid”: 1001, “gid”: 1001, “comment”: “”, “home”:
    “/home/dwoodlins”, “shell”: “/bin/false”
  }
]

GET /users/query[?name=][&uid=][&gid=][&comment=][&home=][&shell=<sq]

Where Parameter list values are: * name * uid * gid * comment * home * shell

Only exact matches need to be supported.

Example Query:

GET /users/query?shell=%2Fbin%22Ffalse

Example Response:

[
  {
    "name": "dwoodlins", "uid": 1001, "gid":1001, "comment": "", "home": "/home/dwoodlins", "shell": "/bin/false"
  }
]

GET /users/

Return a single user with . Return 404 if not found.

Example Response:

{
  “name”: “dwoodlins”, “uid”: 1001, “gid”: 1001, “comment”: “”, “home”: “/home/dwoodlins”, “shell”: “/bin/false”
}

GET /users//groups

Return all the groups for a given user.

Example Response:

[
  {
    “name”: “docker”, “gid”: 1002, “members”: [“dwoodlins”]
  }
]

GET /groups

Return a list of all groups on the system, defined by /etc/group.

Example Response:

[
  {
    “name”: “_analyticsusers”, “gid”: 250, “members”: [“_analyticsd’,”_networkd”,”_timed”]
  },
  {
    “name”: “docker”, “gid”: 1002, “members”: []
  }
]

About

Create a minimal HTTP service that exposes the user and group information on a UNIX-like system that is usually locked away in the UNIX /etc/passwd and /etc/groups file. For a Services Challenge Interview.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 98.1%
  • Dockerfile 1.9%