Skip to content

Identity API

gosha20777 edited this page Oct 7, 2020 · 3 revisions

Обзор модуля

Identity API - представляет собой сервис реализующий следующий функционал:

  • Регистрацию пользователей в системе
  • Аутентификацию пользователей в системе
  • Авторизацию пользователей в системе
  • Управление пользователями

Описание API

/api/vX.Y.Z (X.Y.Z >= 0.1.0)

  • GET /ping

    • response
    {
        "pong": "API version X.Y.Z"
    }
  • GET /users?page=0&count=50

    • response
    {
    	"max_page": 0,
    	"users": [
    		"user-uuid-1",
    		"user-uuid-2",
    		....
    		"user-uuni-N"
    	]
    }
  • POST /user

    • request
    {
        "nick_name": "gosha20777",
        "first_name": "Georgy",
        "last_name": "Perevozchikov",
        "sur_name": null,
        "email": "[email protected]",
        "password": "P@ssw0rd",
        "roles": ["admin", "user"]
    }
    • response
    {
        "id": "3745576a-06f4-11eb-9d06-10e7c6e703cb",
        "status": "user created"
    }
  • GET /user/{uuid}

    • response
    {
        "id": "3745576a-06f4-11eb-9d06-10e7c6e703cb",
        "nick_name": "gosha20777",
        "first_name": "Georgy",
        "last_name": "Perevozchikov",
        "sur_name": null,
        "email": "[email protected]",
        "roles": ["admin", "user"],
        "projects": [ "3745576a-06f4-11eb-9d06-10e7c6e703cx" ],
        "active_tasks": [
            "3745576a-06f4-11eb-9d06-10e7c6e703cx",
            "3745576a-06f4-11eb-9d06-10e7c6e703cy"
        ],
        "active_sessions": [
            "3745576a-06f4-11eb-9d06-10e7c6e703cx",
            "3745576a-06f4-11eb-9d06-10e7c6e703cy"
        ]
    }
  • PUT /user/{uuid}

    • request
    {
        "first_name": "Georgy",
        "last_name": "Perevozchikov",
        "sur_name": "pavlovich",
        "password": "P@ssw0rd2",
        "projects": [ 
            "3745576a-06f4-11eb-9d06-10e7c6e703cx",
            "3745576a-06f4-11eb-9d06-10e7c6e703cy"
            ],
        "roles": ["root", "admin", "user"]
    }
    • response
    { 
        "status": "user updated"
    }
  • DELETE /user/{uuid}

    • response
    { 
        "status": "user removed"
    }
  • POST /access_token

    • request
    {
        "email":"[email protected] (or nick_name)",
        "password":"pass"
    }
    • response
    {
        "access_token": {
            "aud": "https://api.lacmus.org",
            "iss": "https://lacmus.org",
            "sub": "1234567890qwertyuio",
            "jti": "mnb23vcsrt756yuiomnbvcx98ertyuiop",
            "roles": ["user", "admin"],
            "exp": 1735689600
        },
        "exp": 1735689600,
        "user_id": "3745576a-06f4-11eb-9d06-10e7c6e703cb"
    }
  • PUT /access_token

    • request
    {
    	"access_token": "access.token.string"
    }
    • response
    {
        "access_token": {
            "aud": "https://api.lacmus.org",
            "iss": "https://lacmus.org",
            "sub": "1234567890qwertyuio",
            "jti": "mnb23vcsrt756yuiomnbvcx98ertyuiop",
            "roles": ["user", "admin"],
            "exp": 1735689600
        },
        "exp": 1735689600,
        "user_id": "3745576a-06f4-11eb-9d06-10e7c6e703cb"
    }
  • home
  • identity-api
  • predict-api
Clone this wiki locally