{"openapi":"3.0.2","info":{"title":"Service Auth","description":"Service for user authentication and authorization","version":"2.2.30"},"paths":{"/v1/users/auth":{"post":{"tags":["v1/auth"],"summary":"make the user authentication and return the access token","description":"Summary:\n    The api is using keycloak api to authenticate user and return\n    the access_token and refresh_token. The user with disabled status\n    cannot be login\n\nPayload:\n    - username(string): The login string for user\n    - password(string): login credential stored in keycloak\n\nReturn:\n    - access token\n    - refresh token","operationId":"post_v1_users_auth_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserAuthPOST"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/users/refresh":{"post":{"tags":["v1/auth"],"summary":"refresh the user token and issue a new one","description":"Summary:\n    The api is using keycloak api to return a new refresh\n    token for futher usage\n\nPayload:\n    - refreshtoken(string): The expiring refresh token from\n        same issuer/client in keycloak\n\nReturn:\n    - refresh token","operationId":"post_v1_users_refresh_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserTokenRefreshPOST"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/user/project-role":{"put":{"tags":["v1/auth"],"summary":"change a users project role","description":"Summary:\n    The api is using keycloak api to add a user into existing keyclaok realm role and remove then from there\n    previous role group\n\nPayload:\n    - email(string): The unique email for the user to identiy\n    - project_role(string): The target realm role for new role\n\nReturn:\n    - 200 success","operationId":"change_role_v1_user_project_role_put","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserProjectRolePUT"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["v1/auth"],"summary":"list the project role for given user","description":"Summary:\n    The api is using keycloak api to add a user into existing\n    keyclaok realm role\n\nPayload:\n    - email(string): The unique email for the user to identiy\n    - project_role(string): The target realm role\n\nReturn:\n    - 200 success","operationId":"post_v1_user_project_role_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserProjectRolePOST"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["v1/auth"],"summary":"remove the project role for given user","description":"Summary:\n    The api is using keycloak api to add a user into existing\n    keyclaok realm role\n\nParameter:\n    - email(string): The unique email for the user to identiy\n    - project_role(string): The target realm role\n    - operator(string): The operator that remove the user\n    - project_code(string): The project code that user takes place\n\nReturn:\n    - 200 success","operationId":"delete_v1_user_project_role_delete","parameters":[{"required":true,"schema":{"title":"Email","type":"string"},"name":"email","in":"query"},{"required":true,"schema":{"title":"Project Role","type":"string"},"name":"project_role","in":"query"},{"required":true,"schema":{"title":"Operator","type":"string"},"name":"operator","in":"query"},{"required":true,"schema":{"title":"Project Code","type":"string"},"name":"project_code","in":"query"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/users":{"get":{"tags":["v1/auth"],"summary":"list users from keycloak","description":"Summary:\n    The api is used to the keycloak api and python to list all\n    user under the platform.\n    for now the api does not support the exact search and status check\n    This will need to be wait until keycloak is upto v16\n    The native api does not support join/sorting, so I temporary do them manually\n    ALL the in memory sorting, searching, mapping are the temporary solution\n    at the end, they will be sync to some primary db\n\nParameter:\n    - order_by(string optional): the field will be ordered by.\n    - order_type(string optional): default=asc. support asc or desc.\n    - page(int): default=0, the pagination to indicate current page.\n    - page_size(int): default=10, the return user size.\n    - username(string optional): if payload has username, the api will\n        return all user contains target username.\n    - email(string optional): if payload has email, the api will\n        return all user contains target email.\n    - status(string): not support yet\n\nReturn:\n    - user list\n        - username\n        - id\n        - email\n        - status","operationId":"get_v1_users_get","parameters":[{"required":false,"schema":{"title":"Username","type":"string"},"name":"username","in":"query"},{"required":false,"schema":{"title":"Email","type":"string"},"name":"email","in":"query"},{"required":false,"schema":{"title":"Page","type":"integer","default":0},"name":"page","in":"query"},{"required":false,"schema":{"title":"Page Size","type":"integer","default":10},"name":"page_size","in":"query"},{"required":false,"schema":{"title":"Status","type":"string"},"name":"status","in":"query"},{"required":false,"schema":{"title":"Role","type":"string"},"name":"role","in":"query"},{"required":false,"schema":{"title":"Order By","type":"string"},"name":"order_by","in":"query"},{"required":false,"schema":{"title":"Order Type","type":"string","default":"asc"},"name":"order_type","in":"query"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/user/group":{"put":{"tags":["v1/user/account"],"summary":"add the target user to ad group","description":"Summary:\n    The api is used to directly add the user to ldap group.\n    inside ldap the group name will be <prefix>-<group_code>\n\nPayload(UserManagementV1PUT):\n    - operation_type(string): only accept remove or add\n    - user_email(string): the target user email\n    - group_code(string): the group code define by upperstream\n\nReturn:\n    200 updated","operationId":"put_v1_user_group_put","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserADGroupOperationsPUT"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["v1/user/account"],"summary":"create a ad/ldap group","description":"Summary:\n    create a ad/ldap group\n\nPayload:\n    - group_name(string): Group name without a prefix\n    - description (string): Group description\n\nReturn:\n    200","operationId":"post_v1_user_group_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ADGroupCreatePOST"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ADGroupCreatePOSTResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["v1/user/account"],"summary":"delete a ad/ldap group","description":"Summary:\n    delete a ad/ldap group\n\nPayload:\n    - group_name(string): Group name without a prefix\n\nReturn:\n    200","operationId":"delete_v1_user_group_delete","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ADGroupCreateDELETE"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ADGroupCreateDELETEResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/user/account":{"put":{"tags":["v1/user/account"],"summary":"add the new user to ad","description":"Summary:\n    The api is used to disable/enable users in portal. It is using\n    keycloak api to setup the `status` of user attribute in keyloack\n    to reflect disable or enable. user will be removed from ALL assigned\n    realm role(all permissions)\n    The ldap client is alse used to remove the user from corresponding DN\n    in ldap\n\nPayload(UserManagementV1PUT):\n    - operation_type(string): only accept disable or enable\n    - user_email(string): the target user email\n\nReturn:\n    204 updated","operationId":"put_v1_user_account_put","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserManagementV1PUT"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/vm/hbac":{"get":{"tags":["VM"],"summary":"find rule by name","description":"Summary:\n    The api is used to find an HBAC rule by name.\n\nParameters:\n    - name(string): HBAC rule name\n\nReturn:\n    Full rule description","operationId":"find_hbac_v1_vm_hbac_get","parameters":[{"required":true,"schema":{"title":"Name","type":"string"},"name":"name","in":"query"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/vm/hbac/add":{"post":{"tags":["VM"],"summary":"add the target user to hbac rule","description":"Summary:\n    The api is used to directly add the user to HBAC rule.\n\nPayload:\n    - email(string): user email\n    - rule(string): HBAC rule name\n\nReturn:\n    200 added","operationId":"add_user_to_hbac_v1_vm_hbac_add_post","parameters":[{"required":true,"schema":{"title":"Username","type":"string"},"name":"username","in":"query"},{"required":true,"schema":{"title":"Rule","type":"string"},"name":"rule","in":"query"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/vm/hbac/remove":{"delete":{"tags":["VM"],"summary":"remove the target user from hbac rule","description":"Summary:\n    The api is used to remove the user from HBAC rule.\n\nPayload:\n    - username(string): username\n    - rule(string): HBAC rule name\n\nReturn:\n    200 removed","operationId":"remove_user_from_hbac_v1_vm_hbac_remove_delete","parameters":[{"required":true,"schema":{"title":"Username","type":"string"},"name":"username","in":"query"},{"required":true,"schema":{"title":"Rule","type":"string"},"name":"rule","in":"query"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/vm/user":{"get":{"tags":["VM"],"summary":"Find VM user by username","operationId":"find_user_v1_vm_user_get","parameters":[{"required":true,"schema":{"title":"Username","type":"string"},"name":"username","in":"query"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["VM"],"summary":"Create or modify user to have access to projects VM","operationId":"create_or_modify_user_v1_vm_user_put","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VMUserCreatePOST"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["VM"],"summary":"Directly create new user for VM","operationId":"create_user_v1_vm_user_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VMUserCreatePOST"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/vm/user/reset":{"post":{"tags":["VM"],"summary":"Reset user password for VM","operationId":"reset_password_v1_vm_user_reset_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VMUserPasswordResetPOST"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/authorize":{"get":{"tags":["/v1/authorize"],"summary":"check the authorization for the user","operationId":"get_v1_authorize_get","parameters":[{"required":true,"schema":{"title":"Role","type":"string"},"name":"role","in":"query"},{"required":true,"schema":{"title":"Zone","type":"string"},"name":"zone","in":"query"},{"required":true,"schema":{"title":"Resource","type":"string"},"name":"resource","in":"query"},{"required":true,"schema":{"title":"Operation","type":"string"},"name":"operation","in":"query"},{"required":false,"schema":{"title":"Project Code","type":"string","default":"pilotdefault"},"name":"project_code","in":"query"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/admin/user":{"get":{"tags":["/v1/admin"],"summary":"get user infomation by one of email, username, user_id","description":"Summary:\n    The api is used to the keycloak api to get user info\n    including attributes\n\nParameter:\n    - email(string): the email from target user\n    - username(string): the useranme from target user\n    - user_id(string): the hash id from keycloak\n\nReturn:\n    - user information(dict)","operationId":"get_v1_admin_user_get","parameters":[{"required":false,"schema":{"title":"Email","type":"string"},"name":"email","in":"query"},{"required":false,"schema":{"title":"Username","type":"string"},"name":"username","in":"query"},{"required":false,"schema":{"title":"User Id","type":"string"},"name":"user_id","in":"query"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["/v1/admin"],"summary":"currently only support update user attribute of                      last login_time and announcement","description":"Summary:\n    The api is used to the keycloak api to update user\n    attributes\n\nParameter:\n    - last_login(bool optional): indicate if api need to update `last_login`\n        attribute. The format will be \"%Y-%m-%dT%H:%M:%S\"\n    - announcement(dict optional): the useranme from target user\n        - project_code(string): the unique identifier of project\n        - announcement_pk(string): the unique id for announcement\n    - username(string): unique username in the keycloak\n\nReturn:\n    - user information(dict)","operationId":"put_v1_admin_user_put","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserOpsPOST"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/admin/users/group":{"post":{"tags":["/v1/admin"],"summary":"add user to existing group","description":"Summary:\n    the api will add the user to the target keycloak group.\n    create a new group if the target group is not exist\n\nPayload:\n    - username(string): the useranme from keycloak\n    - groupname(string): the unique groupname from keycloak\n\nReturn:\n    200 succuss","operationId":"post_v1_admin_users_group_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserGroupPOST"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["/v1/admin"],"summary":"add user to existing group","description":"Summary:\n    the function will remove the target user from the\n    given keycloak group\n\nParameter:\n    - username(string): the useranme from keycloak\n    - groupname(string): the unique groupname from keycloak\n\nReturn:\n    200 succuss","operationId":"delete_v1_admin_users_group_delete","parameters":[{"required":true,"schema":{"title":"Username","type":"string"},"name":"username","in":"query"},{"required":true,"schema":{"title":"Groupname","type":"string"},"name":"groupname","in":"query"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/admin/users/realm-roles":{"get":{"tags":["/v1/admin"],"summary":"get user's realm roles","description":"Summary:\n    The api is used to the keycloak api to fetch\n    specific user's realm roles\n\nParameter:\n    - username(string): the useranme from target user\n\nReturn:\n    - realms infomation(list)","operationId":"get_v1_admin_users_realm_roles_get","parameters":[{"required":true,"schema":{"title":"Username","type":"string"},"name":"username","in":"query"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["/v1/admin"],"summary":"add new realm roles in keycloak","description":"Summary:\n    The api is used to the keycloak api to create\n    realm roles. The new name will be `<project_code>-\n    <project_roles>`.\n\nParameter:\n    - project_roles(list): the list of roles to create in keycloak.\n    - project_code(string): the unique code of project.\n\nReturn:\n    - 200 success","operationId":"post_v1_admin_users_realm_roles_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RealmRolesPOST"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/admin/roles/users":{"post":{"tags":["/v1/admin"],"summary":"Post","description":"Summary:\n    The api is used to the keycloak api and python to query\n    user list under target realm roles.\n    The native api does not support any seaching/join/sorting/pagination,\n    so I temporary do them manually.\n    ALL the in memory sorting, searching, mapping are the temporary solution\n    at the end, they will be sync to some primary db.\n\nParameter:\n    - order_by(string optional): the field will be ordered by.\n    - order_type(string optional): default=asc. support asc or desc.\n    - page(int): default=0, the pagination to indicate current page.\n    - page_size(int): default=10, the return user size.\n    - username(string optional): if payload has username, the api will\n        return all user contains target username.\n    - email(string optional): if payload has email, the api will\n        return all user contains target email.\n    - status(string): not support yet\n\nReturn:\n    - 200 list of users\n        - username\n        - email\n        - attributes","operationId":"post_v1_admin_roles_users_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserInRolePOST"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/admin/roles/users/stats":{"get":{"tags":["/v1/admin"],"summary":"Get user number per realm role for a project","description":"Summary:\n    Uses keycloak api to retrieve number of users under all realm roles for a given project.\n\nReturn:\n    - 200 dictionary of number of users per realm role","operationId":"get_v1_admin_roles_users_stats_get","parameters":[{"required":true,"schema":{"title":"Project Code","type":"string"},"name":"project_code","in":"query"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GETUserStatsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/invitations":{"post":{"tags":["Invitation"],"summary":"Creates an new invitation","operationId":"create_invitation_v1_invitations_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvitationPOST"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvitationPOSTResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/invitation/check/{email}":{"get":{"tags":["Invitation"],"summary":"This method allow to get user's detail on the platform.","operationId":"check_user_v1_invitation_check__email__get","parameters":[{"required":true,"schema":{"title":"Email","type":"string"},"name":"email","in":"path"},{"required":false,"schema":{"title":"Project Code","type":"string","default":""},"name":"project_code","in":"query"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvitationPOSTResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/invitation-list":{"post":{"tags":["Invitation"],"summary":"list invitations from psql","operationId":"invitation_list_v1_invitation_list_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvitationListPOST"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvitationPOSTResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/invitation/{invite_id}":{"put":{"tags":["Invitation"],"summary":"update a single invite","operationId":"invitation_update_v1_invitation__invite_id__put","parameters":[{"required":true,"schema":{"title":"Invite Id","type":"string"},"name":"invite_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvitationPUT"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvitationPOSTResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/events":{"get":{"tags":["Event"],"summary":"list events","description":"Lists events from psql event table of actions on user account such as invites or roles changes.","operationId":"list_events_v1_events_get","parameters":[{"required":false,"schema":{"title":"Page","type":"integer","default":0},"name":"page","in":"query"},{"required":false,"schema":{"title":"Page Size","type":"integer","default":25},"name":"page_size","in":"query"},{"required":false,"schema":{"title":"Order By","type":"string","default":"timestamp"},"name":"order_by","in":"query"},{"required":false,"schema":{"title":"Order Type","type":"string","default":"asc"},"name":"order_type","in":"query"},{"required":false,"schema":{"title":"Project Code","type":"string","default":""},"name":"project_code","in":"query"},{"required":false,"schema":{"title":"User Id","type":"string","default":""},"name":"user_id","in":"query"},{"required":false,"schema":{"title":"Invitation Id","type":"string","default":""},"name":"invitation_id","in":"query"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EventGETResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["Event"],"summary":"Creates a new event","description":"Create event in psql event table of actions on user account such as invites or roles changes.","operationId":"create_event_v1_events_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EventPOST"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EventPOSTResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/health":{"get":{"tags":["Health","Health"],"summary":"Health check","operationId":"get_v1_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/v1/admin/users":{"post":{"tags":["/v1/admin"],"summary":"Create a new user in LDAP","operationId":"post_v1_admin_users_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserCreatePOST"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/invitations/external":{"get":{"tags":["Invitation"],"summary":"Returns whether external registration is enabled","operationId":"check_external_v1_invitations_external_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExternalResponse"}}}}}}},"/v1/permissions/metadata":{"get":{"tags":["/v1/permission/metadata"],"summary":"List permission metadata","description":"List permission metadata.","operationId":"get_v1_permissions_metadata_get","parameters":[{"required":false,"schema":{"title":"Page","type":"integer","default":0},"name":"page","in":"query"},{"required":false,"schema":{"title":"Page Size","type":"integer","default":25},"name":"page_size","in":"query"},{"required":false,"schema":{"title":"Order By","type":"string","default":"category"},"name":"order_by","in":"query"},{"required":false,"schema":{"title":"Order Type","type":"string","default":"asc"},"name":"order_type","in":"query"},{"required":true,"schema":{"title":"Project Code","type":"string"},"name":"project_code","in":"query"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListPermissionsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/permissions/roles":{"get":{"tags":["/v1/permission/metadata"],"summary":"list roles in project","description":"List project roles.","operationId":"get_list_roles_v1_permissions_roles_get","parameters":[{"required":true,"schema":{"title":"Project Code","type":"string"},"name":"project_code","in":"query"},{"required":false,"schema":{"title":"Order By","type":"string","default":"time_created"},"name":"order_by","in":"query"},{"required":false,"schema":{"title":"Order Type","type":"string","default":"asc"},"name":"order_type","in":"query"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/defaultroles":{"post":{"tags":["/v1/defaultroles"],"summary":"create default roles for a project","operationId":"post_v1_defaultroles_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateDefaultRoles"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"ADGroupCreateDELETE":{"title":"ADGroupCreateDELETE","required":["group_name"],"type":"object","properties":{"group_name":{"title":"Group Name","type":"string"}}},"ADGroupCreateDELETEResponse":{"title":"ADGroupCreateDELETEResponse","required":["result"],"type":"object","properties":{"code":{"allOf":[{"$ref":"#/components/schemas/app__models__base_models__EAPIResponseCode"}],"default":200},"error_msg":{"title":"Error Msg","type":"string","default":""},"page":{"title":"Page","type":"integer","default":0},"total":{"title":"Total","type":"integer","default":1},"num_of_pages":{"title":"Num Of Pages","type":"integer","default":1},"result":{"title":"Result","type":"string","example":"success"}}},"ADGroupCreatePOST":{"title":"ADGroupCreatePOST","required":["group_name"],"type":"object","properties":{"group_name":{"title":"Group Name","type":"string"},"description":{"title":"Description","type":"string","default":""}}},"ADGroupCreatePOSTResponse":{"title":"ADGroupCreatePOSTResponse","required":["result"],"type":"object","properties":{"code":{"allOf":[{"$ref":"#/components/schemas/app__models__base_models__EAPIResponseCode"}],"default":200},"error_msg":{"title":"Error Msg","type":"string","default":""},"page":{"title":"Page","type":"integer","default":0},"total":{"title":"Total","type":"integer","default":1},"num_of_pages":{"title":"Num Of Pages","type":"integer","default":1},"result":{"title":"Result","type":"string","example":"success"}}},"Announcement":{"title":"Announcement","required":["project_code","announcement_pk"],"type":"object","properties":{"project_code":{"title":"Project Code","type":"string"},"announcement_pk":{"title":"Announcement Pk","type":"string"}}},"CreateDefaultRoles":{"title":"CreateDefaultRoles","required":["project_code"],"type":"object","properties":{"project_code":{"title":"Project Code","type":"string"}}},"EventGETResponse":{"title":"EventGETResponse","type":"object","properties":{"code":{"allOf":[{"$ref":"#/components/schemas/app__models__base_models__EAPIResponseCode"}],"default":200},"error_msg":{"title":"Error Msg","type":"string","default":""},"page":{"title":"Page","type":"integer","default":0},"total":{"title":"Total","type":"integer","default":1},"num_of_pages":{"title":"Num Of Pages","type":"integer","default":1},"result":{"title":"Result","type":"object","default":{},"example":{"code":200,"error_msg":"","num_of_pages":2,"page":0,"result":[{"detail":{"from":"contributor","project_code":"indoctestproject","to":"contributor"},"event_type":"ROLE_CHANGE","id":"eb28391b-7eb5-4373-b36f-2c919295763c","operator":"admin","operator_id":"eef51a4b-d8ac-4526-8811-1d5fc1aaa998","target_user":"exampleuser","target_user_id":"18ab20c1-173d-404a-826c-af619cd7a1ed","timestamp":"2022-04-07 18:38:41.891580"},{"detail":{"project_code":"indoctestproject"},"event_type":"ADDED_TO_TEST_PROJECT","id":"ce395904-d4a2-43a4-8704-4b8f001b4743","operator":"","operator_id":"","target_user":"exampleuser","target_user_id":"18ab20c1-173d-404a-826c-af619cd7a1ed","timestamp":"2024-04-07 18:38:41.891580"},{"detail":{"invitation_id":"5afdae38-c4d4-4d84-812e-918b7ae5ce0a","platform_role":"admin"},"event_type":"INVITE_TO_PLATFORM","id":"ce395904-d4a2-43a4-8704-4b8f001b4743","operator":"admin","operator_id":"eef51a4b-d8ac-4526-8811-1d5fc1aaa998","target_user":"exampleuser","target_user_id":"18ab20c1-173d-404a-826c-af619cd7a1ed","timestamp":"2022-04-06 14:06:48.474718"},{"detail":{},"event_type":"ACCOUNT_ACTIVATED","id":"b63a1c33-2523-45ba-9881-4a9cc07e2001","operator":"admin","operator_id":"eef51a4b-d8ac-4526-8811-1d5fc1aaa998","target_user":"exampleuser","target_user_id":"18ab20c1-173d-404a-826c-af619cd7a1ed","timestamp":"2022-04-06 13:59:29.574938"},{"detail":{},"event_type":"ACCOUNT_DISABLE","id":"7b5b9212-a55d-4d18-988c-d2729a610931","operator":"admin","operator_id":"eef51a4b-d8ac-4526-8811-1d5fc1aaa998","target_user":"exampleuser","target_user_id":"18ab20c1-173d-404a-826c-af619cd7a1ed","timestamp":"2022-04-06 13:59:16.828590"}],"total":7}}}},"EventPOST":{"title":"EventPOST","required":["operator","event_type"],"type":"object","properties":{"target_user_id":{"title":"Target User Id","type":"string","default":""},"target_user":{"title":"Target User","type":"string","default":""},"operator_id":{"title":"Operator Id","type":"string","default":""},"operator":{"title":"Operator","type":"string"},"event_type":{"title":"Event Type","type":"string"},"detail":{"title":"Detail","type":"object","default":{}}}},"EventPOSTResponse":{"title":"EventPOSTResponse","type":"object","properties":{"code":{"allOf":[{"$ref":"#/components/schemas/app__models__base_models__EAPIResponseCode"}],"default":200},"error_msg":{"title":"Error Msg","type":"string","default":""},"page":{"title":"Page","type":"integer","default":0},"total":{"title":"Total","type":"integer","default":1},"num_of_pages":{"title":"Num Of Pages","type":"integer","default":1},"result":{"title":"Result","type":"object","default":{},"example":{}}}},"ExternalResponse":{"title":"ExternalResponse","type":"object","properties":{"code":{"allOf":[{"$ref":"#/components/schemas/app__models__base_models__EAPIResponseCode"}],"default":200},"error_msg":{"title":"Error Msg","type":"string","default":""},"page":{"title":"Page","type":"integer","default":0},"total":{"title":"Total","type":"integer","default":1},"num_of_pages":{"title":"Num Of Pages","type":"integer","default":1},"result":{"title":"Result","type":"object","default":{},"example":{"allow_external_registration":true}}}},"GETUserStatsResponse":{"title":"GETUserStatsResponse","type":"object","properties":{"code":{"allOf":[{"$ref":"#/components/schemas/app__models__api_response__EAPIResponseCode"}],"default":200},"error_msg":{"title":"Error Msg","type":"string","default":""},"page":{"title":"Page","type":"integer","default":0},"total":{"title":"Total","type":"integer","default":1},"num_of_pages":{"title":"Num Of Pages","type":"integer","default":1},"result":{"title":"Result","type":"object","default":{},"example":{"admin":20,"contributor":5,"collaborator":10}}}},"HTTPValidationError":{"title":"HTTPValidationError","type":"object","properties":{"detail":{"title":"Detail","type":"array","items":{"$ref":"#/components/schemas/ValidationError"}}}},"InvitationListPOST":{"title":"InvitationListPOST","type":"object","properties":{"page":{"title":"Page","type":"integer","default":0},"page_size":{"title":"Page Size","type":"integer","default":25},"order_by":{"title":"Order By","type":"string","default":"create_timestamp"},"order_type":{"title":"Order Type","type":"string","default":"asc"},"filters":{"title":"Filters","type":"object","default":{}}}},"InvitationPOST":{"title":"InvitationPOST","required":["email","platform_role","invited_by"],"type":"object","properties":{"email":{"title":"Email","type":"string"},"platform_role":{"title":"Platform Role","type":"string"},"relationship":{"title":"Relationship","type":"object","default":{}},"invited_by":{"title":"Invited By","type":"string"},"inviter_project_role":{"title":"Inviter Project Role","type":"string","default":""}}},"InvitationPOSTResponse":{"title":"InvitationPOSTResponse","type":"object","properties":{"code":{"allOf":[{"$ref":"#/components/schemas/app__models__base_models__EAPIResponseCode"}],"default":200},"error_msg":{"title":"Error Msg","type":"string","default":""},"page":{"title":"Page","type":"integer","default":0},"total":{"title":"Total","type":"integer","default":1},"num_of_pages":{"title":"Num Of Pages","type":"integer","default":1},"result":{"title":"Result","type":"object","default":{},"example":{}}}},"InvitationPUT":{"title":"InvitationPUT","type":"object","properties":{"status":{"title":"Status","type":"string","default":""}}},"ListPermissionsResponse":{"title":"ListPermissionsResponse","type":"object","properties":{"code":{"allOf":[{"$ref":"#/components/schemas/app__models__base_models__EAPIResponseCode"}],"default":200},"error_msg":{"title":"Error Msg","type":"string","default":""},"page":{"title":"Page","type":"integer","default":0},"total":{"title":"Total","type":"integer","default":1},"num_of_pages":{"title":"Num Of Pages","type":"integer","default":1},"result":{"title":"Result","type":"object","default":{},"example":{}}}},"RealmRolesPOST":{"title":"RealmRolesPOST","required":["project_roles","project_code"],"type":"object","properties":{"project_roles":{"title":"Project Roles","type":"array","items":{}},"project_code":{"title":"Project Code","type":"string"}}},"UserADGroupOperationsPUT":{"title":"UserADGroupOperationsPUT","required":["operation_type","group_code","user_email"],"type":"object","properties":{"operation_type":{"title":"Operation Type","type":"string"},"group_code":{"title":"Group Code","type":"string"},"user_email":{"title":"User Email","type":"string"}},"description":"User authentication model."},"UserAuthPOST":{"title":"UserAuthPOST","required":["username","password"],"type":"object","properties":{"username":{"title":"Username","type":"string"},"password":{"title":"Password","type":"string"}},"description":"User authentication model."},"UserCreatePOST":{"title":"UserCreatePOST","required":["username","email","password","first_name","last_name"],"type":"object","properties":{"username":{"title":"Username","type":"string"},"email":{"title":"Email","type":"string"},"password":{"title":"Password","type":"string"},"first_name":{"title":"First Name","type":"string"},"last_name":{"title":"Last Name","type":"string"},"project_code":{"title":"Project Code","type":"string","default":""},"project_role":{"title":"Project Role","type":"string","default":""}}},"UserGroupPOST":{"title":"UserGroupPOST","required":["username","groupname"],"type":"object","properties":{"username":{"title":"Username","type":"string"},"groupname":{"title":"Groupname","type":"string"}}},"UserInRolePOST":{"title":"UserInRolePOST","required":["role_names"],"type":"object","properties":{"role_names":{"title":"Role Names","type":"array","items":{}},"username":{"title":"Username","type":"string"},"email":{"title":"Email","type":"string"},"page":{"title":"Page","type":"integer","default":0},"page_size":{"title":"Page Size","type":"integer","default":10},"order_by":{"title":"Order By","type":"string"},"order_type":{"title":"Order Type","type":"string","default":"asc"},"status":{"title":"Status","type":"string","default":"active"}}},"UserManagementV1PUT":{"title":"UserManagementV1PUT","required":["operation_type","user_email"],"type":"object","properties":{"operation_type":{"title":"Operation Type","type":"string"},"user_email":{"title":"User Email","type":"string"},"operator":{"title":"Operator","type":"string","default":""}}},"UserOpsPOST":{"title":"UserOpsPOST","required":["username"],"type":"object","properties":{"username":{"title":"Username","type":"string"},"last_login":{"title":"Last Login","type":"boolean"},"announcement":{"$ref":"#/components/schemas/Announcement"}}},"UserProjectRolePOST":{"title":"UserProjectRolePOST","required":["email","project_role"],"type":"object","properties":{"email":{"title":"Email","type":"string"},"project_role":{"title":"Project Role","type":"string"},"operator":{"title":"Operator","type":"string","default":""},"project_code":{"title":"Project Code","type":"string","default":""},"invite_event":{"title":"Invite Event","type":"boolean","default":false}}},"UserProjectRolePUT":{"title":"UserProjectRolePUT","required":["email","project_role","operator","project_code"],"type":"object","properties":{"email":{"title":"Email","type":"string"},"project_role":{"title":"Project Role","type":"string"},"operator":{"title":"Operator","type":"string"},"project_code":{"title":"Project Code","type":"string"}}},"UserTokenRefreshPOST":{"title":"UserTokenRefreshPOST","required":["refreshtoken"],"type":"object","properties":{"refreshtoken":{"title":"Refreshtoken","type":"string"}},"description":"User token refresh model."},"VMUserCreatePOST":{"title":"VMUserCreatePOST","required":["username","email","password","first_name","last_name"],"type":"object","properties":{"username":{"title":"Username","type":"string"},"email":{"title":"Email","type":"string"},"password":{"title":"Password","type":"string"},"first_name":{"title":"First Name","type":"string"},"last_name":{"title":"Last Name","type":"string"},"project_code":{"title":"Project Code","type":"string","default":""}}},"VMUserPasswordResetPOST":{"title":"VMUserPasswordResetPOST","required":["username"],"type":"object","properties":{"username":{"title":"Username","type":"string"}}},"ValidationError":{"title":"ValidationError","required":["loc","msg","type"],"type":"object","properties":{"loc":{"title":"Location","type":"array","items":{"anyOf":[{"type":"string"},{"type":"integer"}]}},"msg":{"title":"Message","type":"string"},"type":{"title":"Error Type","type":"string"}}},"app__models__api_response__EAPIResponseCode":{"title":"EAPIResponseCode","enum":[200,500,400,404,401,403,409],"description":"An enumeration."},"app__models__base_models__EAPIResponseCode":{"title":"EAPIResponseCode","enum":[200,500,400,404,403,401,409,202],"description":"An enumeration."}}}}