diff --git a/doc/SURFconext.rst b/doc/SURFconext.rst new file mode 100644 index 0000000..3af860c --- /dev/null +++ b/doc/SURFconext.rst @@ -0,0 +1,58 @@ +========== +SURFconext +========== +.. figure:: _images/SURFconext_logo.png + :align: right + :alt: SURFconext Logo + +The authentication is done by SURFconext. This is an `OpenID `_ provider for all the Universities and schools in the Netherlands. + +More documentation can be found at: https://wiki.surfnet.nl/display/SURFconextdev/Get+Conexted + +In order to use SURFconext, you need to make a configuration in SURFconext and then configure the API. + +---------- +SURFconext +---------- +.. figure:: _images/SURFconext_config.png + :align: center + :alt: SURFconext Configuration + +- **Client ID**: The name of the configuration. Use the API url as this is suggested in the GUI. +- **Redirect urls**: The urls where to redirect to after login. Use `localhost` urls for development. For production use: **https://api-vre.web.rug.nl/oidc/callback/** +- **Access token validity**: How long is the login token valid at SURFconext. SURFconext default 3600 seconds. +- **Is public client**: Do not use this. +- **Grants**: We need the `Authorization code` option +- **Subject type**: We need the `Persistent` option + +All other options are not required for making the OpenID connection with the VRE API. + +**Attention**: When you save the configuration for the first time, you will get an `Client secret`. Save this value somewhere safe. You need it later on. + +Claims +====== +In the last part of the configuration you need to setup which information you want to receive van de OpenID provider. If this is changed, then every user needs to login again, as the login has 'changed' + +More information about which claims are available can be found here: https://wiki.surfnet.nl/display/SURFconextdev/Claims + +--- +API +--- +After the OpenID configuration is created at SURFconext, you need to setup the API with the right variables. + +In the future there is a possibility that less variables are needed. Because the used library does not support `OpendID discovery yet `_ : + +For SURFconext the `well known` url is: https://connect.SURFconext.nl/oidc/.well-known/openid-configuration + +- **OIDC_RP_CLIENT_ID**: The ID that is entered in the `Client ID` field. This is based on the url of the API. +- **OIDC_RP_CLIENT_SECRET**: When you create a new configuration, you will be presented with a generated secret. Store this variable safely. It will not be shown again. +- **OIDC_RP_SIGN_ALGO**: The signing algorithm. SURFconext uses `RS256` +- **OIDC_OP_AUTHORIZATION_ENDPOINT**: Full url to the authorization endpoint. In the `well known` data it is the url at `authorization_endpoint` +- **OIDC_OP_TOKEN_ENDPOINT**: Full url to the token endpoint. In the well `known data` it is the url at `token_endpoint` +- **OIDC_OP_USER_ENDPOINT**: Full url to the user info endpoint. In the well `known data` it is the url at `userinfo_endpoint` +- **OIDC_OP_JWKS_ENDPOINT**: Full url to the certification endpoint. Needed because of the `RS256` algorithm. In the well `known data` it is the url at `jwks_uri` + +Two other settings depends on the VRE frontend which are used after login or logout actions. + +- **LOGIN_REDIRECT_URL**: Where to redirect to after the login is successfully. +- **LOGOUT_REDIRECT_URL**: Where to redirect to after the logout is successfully. diff --git a/doc/_images/SURFconext_config.png b/doc/_images/SURFconext_config.png new file mode 100644 index 0000000..14346b5 Binary files /dev/null and b/doc/_images/SURFconext_config.png differ diff --git a/doc/_images/SURFconext_logo.png b/doc/_images/SURFconext_logo.png new file mode 100644 index 0000000..c38b51c Binary files /dev/null and b/doc/_images/SURFconext_logo.png differ diff --git a/doc/documentation.pdf b/doc/documentation.pdf index 7c23d5a..6a6cd87 100644 Binary files a/doc/documentation.pdf and b/doc/documentation.pdf differ diff --git a/doc/index.rst b/doc/index.rst index b2622ba..4bb0971 100644 --- a/doc/index.rst +++ b/doc/index.rst @@ -18,6 +18,7 @@ The platform can be run inside a docker setup or just local for development. install storage models + SURFconext API authentication signals diff --git a/doc/swagger.yaml b/doc/swagger.yaml index 7b68027..9657aee 100644 --- a/doc/swagger.yaml +++ b/doc/swagger.yaml @@ -1,18 +1,18 @@ swagger: "2.0" info: title: Virtual Research Environment API - description: >- - Here you can see a list of API endpoints and actions that are available to - communicate with the VRE API + description: + Here you can see a list of API endpoints and actions that are available + to communicate with the VRE API termsOfService: https://www.rug.nl contact: email: vre_team@rug.nl license: name: MIT License version: v1 -host: api-vre.web.rug.nl +host: localhost:8000 schemes: - - https + - http basePath: /api consumes: - application/json @@ -21,22 +21,20 @@ produces: securityDefinitions: JWT: type: apiKey - description: >- - Prefix token with 'JWT '.
Ex header: - 'Authorization': 'JWT - eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ0b2tlbl90eXBlIjoiYWNjZXNzIiwiZXhwIjoxNjE2MDU2NTg0LCJqdGkiOiIwNGNhZTk0MWEyNWQ0NjU5ODA4NDg2OTU2NGQzZmZlZSIsInVzZXJfaWQiOjN9.IShrsNu0qJWASQ3xSZR7PHTD0zzRgbYG52D5iQjdRLI'
Use the + description: + "Prefix token with 'JWT '.
Ex header: 'Authorization':\ + \ 'JWT eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ0b2tlbl90eXBlIjoiYWNjZXNzIiwiZXhwIjoxNjE2MDU2NTg0LCJqdGkiOiIwNGNhZTk0MWEyNWQ0NjU5ODA4NDg2OTU2NGQzZmZlZSIsInVzZXJfaWQiOjN9.IShrsNu0qJWASQ3xSZR7PHTD0zzRgbYG52D5iQjdRLI'Use the " name: Authorization in: header Hawk: type: apiKey - description: >- - HTTP Holder-Of-Key Authentication Scheme, https://github.com/hapijs/hawk, - https://hawkrest.readthedocs.io/en/latest/
Ex - header:
'Authorization': 'Hawk - mac="F4+S9cu7yZiZEgdtqzMpOOdudvqcV2V2Yzk2WcphECc=", - hash="+7fKUX+djeQolvnLTxr0X47e//UHKbkRlajwMw3tx3w=", id="7FI5JET4", - ts="1592905433", nonce="DlV-fL"' + description: + "HTTP Holder-Of-Key Authentication Scheme, https://github.com/hapijs/hawk,\ + \ https://hawkrest.readthedocs.io/en/latest/
Ex header:'Authorization': 'Hawk mac=\"F4+S9cu7yZiZEgdtqzMpOOdudvqcV2V2Yzk2WcphECc=\"\ + , hash=\"+7fKUX+djeQolvnLTxr0X47e//UHKbkRlajwMw3tx3w=\", id=\"7FI5JET4\", ts=\"\ + 1592905433\", nonce=\"DlV-fL\"'" name: Authorization in: header security: @@ -46,11 +44,10 @@ paths: /auth/hawk/create/: post: operationId: auth_hawk_create_create - description: >- - This will let you login to the REST API. Login with your username and - password, and get a key and a secret back that is used for further - communication using HAWK signing of requests - (https://github.com/hapijs/hawk). + description: + This will let you login to the REST API. Login with your username + and password, and get a key and a secret back that is used for further communication + using HAWK signing of requests (https://github.com/hapijs/hawk). parameters: - name: data in: body @@ -69,10 +66,8 @@ paths: /auth/jwt/create/: post: operationId: auth_jwt_create_create - description: >- - Takes a set of user credentials and returns an access and refresh JSON - web - + description: |- + Takes a set of user credentials and returns an access and refresh JSON web token pair to prove the authentication of those credentials. parameters: - name: data @@ -128,10 +123,12 @@ paths: tags: - auth parameters: [] - /auth/users/: + /v1/researchers/: get: - operationId: auth_users_list - description: "" + operationId: v1_researchers_list + description: + API endpoint for getting researchers of the same faculty as the + logged in user. This is a readonly endpoint ordered by lastname. parameters: - name: page in: query @@ -160,48 +157,16 @@ paths: results: type: array items: - $ref: "#/definitions/User" - tags: - - auth - post: - operationId: auth_users_create - description: "" - parameters: - - name: data - in: body - required: true - schema: - $ref: "#/definitions/UserCreate" - responses: - "201": - description: "" - schema: - $ref: "#/definitions/UserCreate" - tags: - - auth - parameters: [] - /auth/users/activation/: - post: - operationId: auth_users_activation - description: "" - parameters: - - name: data - in: body - required: true - schema: - $ref: "#/definitions/Activation" - responses: - "201": - description: "" - schema: - $ref: "#/definitions/Activation" + $ref: "#/definitions/ResearcherDetail" tags: - - auth + - v1 parameters: [] - /auth/users/me/: + /v1/researchers/me/: get: - operationId: auth_users_me_read - description: "" + operationId: v1_researchers_me_read + description: + API endpoint for getting researchers of the same faculty as the + logged in user. This is a readonly endpoint ordered by lastname. parameters: - name: page in: query @@ -212,289 +177,25 @@ paths: "200": description: "" schema: - required: - - count - - results - type: object - properties: - count: - type: integer - next: - type: string - format: uri - x-nullable: true - previous: - type: string - format: uri - x-nullable: true - results: - type: array - items: - $ref: "#/definitions/User" - tags: - - auth - put: - operationId: auth_users_me_update - description: "" - parameters: - - name: data - in: body - required: true - schema: - $ref: "#/definitions/User" - responses: - "200": - description: "" - schema: - $ref: "#/definitions/User" - tags: - - auth - patch: - operationId: auth_users_me_partial_update - description: "" - parameters: - - name: data - in: body - required: true - schema: - $ref: "#/definitions/User" - responses: - "200": - description: "" - schema: - $ref: "#/definitions/User" - tags: - - auth - delete: - operationId: auth_users_me_delete - description: "" - parameters: [] - responses: - "204": - description: "" - tags: - - auth - parameters: [] - /auth/users/resend_activation/: - post: - operationId: auth_users_resend_activation - description: "" - parameters: - - name: data - in: body - required: true - schema: - $ref: "#/definitions/SendEmailReset" - responses: - "201": - description: "" - schema: - $ref: "#/definitions/SendEmailReset" - tags: - - auth - parameters: [] - /auth/users/reset_password/: - post: - operationId: auth_users_reset_password - description: "" - parameters: - - name: data - in: body - required: true - schema: - $ref: "#/definitions/SendEmailReset" - responses: - "201": - description: "" - schema: - $ref: "#/definitions/SendEmailReset" - tags: - - auth - parameters: [] - /auth/users/reset_password_confirm/: - post: - operationId: auth_users_reset_password_confirm - description: "" - parameters: - - name: data - in: body - required: true - schema: - $ref: "#/definitions/PasswordResetConfirm" - responses: - "201": - description: "" - schema: - $ref: "#/definitions/PasswordResetConfirm" - tags: - - auth - parameters: [] - /auth/users/reset_username/: - post: - operationId: auth_users_reset_username - description: "" - parameters: - - name: data - in: body - required: true - schema: - $ref: "#/definitions/SendEmailReset" - responses: - "201": - description: "" - schema: - $ref: "#/definitions/SendEmailReset" - tags: - - auth - parameters: [] - /auth/users/reset_username_confirm/: - post: - operationId: auth_users_reset_username_confirm - description: "" - parameters: - - name: data - in: body - required: true - schema: - $ref: "#/definitions/UsernameResetConfirm" - responses: - "201": - description: "" - schema: - $ref: "#/definitions/UsernameResetConfirm" + $ref: "#/definitions/ResearcherDetail" tags: - - auth - parameters: [] - /auth/users/set_password/: - post: - operationId: auth_users_set_password - description: "" - parameters: - - name: data - in: body - required: true - schema: - $ref: "#/definitions/SetPassword" - responses: - "201": - description: "" - schema: - $ref: "#/definitions/SetPassword" - tags: - - auth - parameters: [] - /auth/users/set_username/: - post: - operationId: auth_users_set_username - description: "" - parameters: - - name: data - in: body - required: true - schema: - $ref: "#/definitions/SetUsername" - responses: - "201": - description: "" - schema: - $ref: "#/definitions/SetUsername" - tags: - - auth - parameters: [] - /auth/users/{id}/: - get: - operationId: auth_users_read - description: "" - parameters: [] - responses: - "200": - description: "" - schema: - $ref: "#/definitions/User" - tags: - - auth + - v1 put: - operationId: auth_users_update - description: "" - parameters: - - name: data - in: body - required: true - schema: - $ref: "#/definitions/User" - responses: - "200": - description: "" - schema: - $ref: "#/definitions/User" - tags: - - auth - patch: - operationId: auth_users_partial_update - description: "" + operationId: v1_researchers_me_update + description: + API endpoint for getting researchers of the same faculty as the + logged in user. This is a readonly endpoint ordered by lastname. parameters: - name: data in: body required: true schema: - $ref: "#/definitions/User" + $ref: "#/definitions/Researcher" responses: "200": description: "" schema: - $ref: "#/definitions/User" - tags: - - auth - delete: - operationId: auth_users_delete - description: "" - parameters: [] - responses: - "204": - description: "" - tags: - - auth - parameters: - - name: id - in: path - description: A unique integer value identifying this user. - required: true - type: integer - /v1/researchers/: - get: - operationId: v1_researchers_list - description: >- - API endpoint for getting researchers of the same faculty as the logged - in user. This is a readonly endpoint ordered by lastname. - parameters: - - name: page - in: query - description: A page number within the paginated result set. - required: false - type: integer - responses: - "200": - description: "" - schema: - required: - - count - - results - type: object - properties: - count: - type: integer - next: - type: string - format: uri - x-nullable: true - previous: - type: string - format: uri - x-nullable: true - results: - type: array - items: - $ref: "#/definitions/Researcher" + $ref: "#/definitions/ResearcherDetail" tags: - v1 parameters: [] @@ -553,9 +254,9 @@ paths: /v1/studies/fields/: get: operationId: v1_studies_fields - description: >- - Get the logged in researcher his study fields based on the faculty where - he belongs to. In other words, this is the list of study fields where + description: + Get the logged in researcher his study fields based on the faculty + where he belongs to. In other words, this is the list of study fields where the logged in user can do research on. parameters: - name: page @@ -573,6 +274,26 @@ paths: tags: - v1 parameters: [] + /v1/studies/invited/: + get: + operationId: v1_studies_invited + description: Show a list of studies where the researcher is invited to. + parameters: + - name: page + in: query + description: A page number within the paginated result set. + required: false + type: integer + responses: + "200": + description: "" + schema: + type: array + items: + $ref: "#/definitions/StudyDetail" + tags: + - v1 + parameters: [] /v1/studies/roles/: get: operationId: v1_studies_roles @@ -638,8 +359,59 @@ paths: type: integer /v1/studies/{id}/contributors/: get: - operationId: v1_studies_contributors_list - description: Get all the contributors that are assigned to a study + operationId: v1_studies_contributors_list + description: + Get all the contributors that are assigned to a study of which + you are also a member of. + parameters: + - name: page + in: query + description: A page number within the paginated result set. + required: false + type: integer + responses: + "200": + description: "" + schema: + type: array + items: + $ref: "#/definitions/Contributor" + tags: + - v1 + parameters: + - name: id + in: path + description: A unique integer value identifying this study role. + required: true + type: integer + /v1/studies/{id}/invite/: + post: + operationId: v1_studies_invite_create + description: "" + parameters: + - name: data + in: body + required: true + schema: + $ref: "#/definitions/Invite" + responses: + "201": + description: "" + schema: + $ref: "#/definitions/Invite" + tags: + - v1 + parameters: + - name: id + in: path + required: true + type: string + /v1/studies/{study}/contributors/{contributor}/: + get: + operationId: v1_studies_contributors_read + description: + Get a single contributors that is assigned to a study for a study + of which you are also a member of. parameters: - name: page in: query @@ -650,62 +422,46 @@ paths: "200": description: "" schema: - required: - - count - - results - type: object - properties: - count: - type: integer - next: - type: string - format: uri - x-nullable: true - previous: - type: string - format: uri - x-nullable: true - results: - type: array - items: - $ref: "#/definitions/Contributor" + $ref: "#/definitions/Contributor" tags: - v1 - post: - operationId: v1_studies_contributors_create - summary: >- - Update contributors that are assigned to a study. The list of - contributors that are submitted will be used as the list. - description: >- - So when you remove a contributor from this list, it will be deleted from - the study. - - - You need to be an Administrator of the study to change the contributor - list + put: + operationId: v1_studies_contributors_update + description: + Update an existing contributor role. This can only be done by study + admins. parameters: - name: data in: body required: true schema: - type: array - items: - $ref: "#/definitions/ContributorUpdate" + $ref: "#/definitions/ContributorUpdate" responses: "200": description: "" schema: - type: array - items: - $ref: "#/definitions/Contributor" + $ref: "#/definitions/Contributor" + tags: + - v1 + delete: + operationId: v1_studies_contributors_delete + description: "" + parameters: [] + responses: + "204": + description: "" tags: - v1 parameters: - - name: id + - name: contributor in: path - description: A unique integer value identifying this study role. required: true - type: integer + type: string + - name: study + in: path + description: Study + required: true + type: string /v1/universities/: get: operationId: v1_universities_list @@ -786,7 +542,9 @@ paths: /v1/universities/{university}/faculties/{faculty}/study_fields/: get: operationId: v1_universities_faculties_study_fields_list - description: Give the list of all the study fields that the faculty does research on. + description: + Give the list of all the study fields that the faculty does research + on. parameters: - name: page in: query @@ -831,7 +589,7 @@ paths: /v1/virtual_machines/{provider}/gpu/: get: operationId: v1_virtual_machines_gpu_list - description: >- + description: API endpoint for listing virtual machines available GPU types filtered per provider. This is a readonly endpoint. parameters: @@ -874,7 +632,7 @@ paths: /v1/virtual_machines/{provider}/memory/: get: operationId: v1_virtual_machines_memory_list - description: >- + description: API endpoint for listing virtual machines available memory types filtered per provider. This is a readonly endpoint. parameters: @@ -917,7 +675,7 @@ paths: /v1/virtual_machines/{provider}/network/: get: operationId: v1_virtual_machines_network_list - description: >- + description: API endpoint for listing virtual machines available network types filtered per provider. This is a readonly endpoint. parameters: @@ -960,7 +718,7 @@ paths: /v1/virtual_machines/{provider}/os/: get: operationId: v1_virtual_machines_os_list - description: >- + description: API endpoint for listing virtual machines available operating systems filtered per provider. This is a readonly endpoint. parameters: @@ -1003,7 +761,7 @@ paths: /v1/virtual_machines/{provider}/profiles/: get: operationId: v1_virtual_machines_profiles_list - description: >- + description: API endpoint for listing virtual machines available profiles filtered per provider. This is a readonly endpoint. parameters: @@ -1046,7 +804,7 @@ paths: /v1/virtual_machines/{provider}/storage/: get: operationId: v1_virtual_machines_storage_list - description: >- + description: API endpoint for listing virtual machines available storage types filtered per provider. This is a readonly endpoint. parameters: @@ -1141,9 +899,9 @@ paths: /v1/virtualmachines/gpu/: get: operationId: v1_virtualmachines_gpu_list - description: >- - API endpoint for listing virtual machines available GPU types. This is a - readonly endpoint. + description: + API endpoint for listing virtual machines available GPU types. + This is a readonly endpoint. parameters: - name: page in: query @@ -1179,9 +937,9 @@ paths: /v1/virtualmachines/gpu/{id}/: get: operationId: v1_virtualmachines_gpu_read - description: >- - API endpoint for listing virtual machines available GPU types. This is a - readonly endpoint. + description: + API endpoint for listing virtual machines available GPU types. + This is a readonly endpoint. parameters: [] responses: "200": @@ -1199,9 +957,9 @@ paths: /v1/virtualmachines/memory/: get: operationId: v1_virtualmachines_memory_list - description: >- - API endpoint for listing virtual machines available memory types. This - is a readonly endpoint. + description: + API endpoint for listing virtual machines available memory types. + This is a readonly endpoint. parameters: - name: page in: query @@ -1237,9 +995,9 @@ paths: /v1/virtualmachines/memory/{id}/: get: operationId: v1_virtualmachines_memory_read - description: >- - API endpoint for listing virtual machines available memory types. This - is a readonly endpoint. + description: + API endpoint for listing virtual machines available memory types. + This is a readonly endpoint. parameters: [] responses: "200": @@ -1257,9 +1015,9 @@ paths: /v1/virtualmachines/network/: get: operationId: v1_virtualmachines_network_list - description: >- - API endpoint for listing virtual machines available network types. This - is a readonly endpoint. + description: + API endpoint for listing virtual machines available network types. + This is a readonly endpoint. parameters: - name: page in: query @@ -1295,9 +1053,9 @@ paths: /v1/virtualmachines/network/{id}/: get: operationId: v1_virtualmachines_network_read - description: >- - API endpoint for listing virtual machines available network types. This - is a readonly endpoint. + description: + API endpoint for listing virtual machines available network types. + This is a readonly endpoint. parameters: [] responses: "200": @@ -1315,7 +1073,7 @@ paths: /v1/virtualmachines/os/: get: operationId: v1_virtualmachines_os_list - description: >- + description: API endpoint for listing virtual machines available operating systems. This is a readonly endpoint. parameters: @@ -1353,7 +1111,7 @@ paths: /v1/virtualmachines/os/{id}/: get: operationId: v1_virtualmachines_os_read - description: >- + description: API endpoint for listing virtual machines available operating systems. This is a readonly endpoint. parameters: [] @@ -1367,7 +1125,7 @@ paths: parameters: - name: id in: path - description: >- + description: A unique integer value identifying this virtual machine operating system. required: true @@ -1375,9 +1133,9 @@ paths: /v1/virtualmachines/profiles/: get: operationId: v1_virtualmachines_profiles_list - description: >- - API endpoint for listing virtual machines available profiles. This is a - readonly endpoint. + description: + API endpoint for listing virtual machines available profiles. This + is a readonly endpoint. parameters: - name: page in: query @@ -1413,9 +1171,9 @@ paths: /v1/virtualmachines/profiles/{id}/: get: operationId: v1_virtualmachines_profiles_read - description: >- - API endpoint for listing virtual machines available profiles. This is a - readonly endpoint. + description: + API endpoint for listing virtual machines available profiles. This + is a readonly endpoint. parameters: [] responses: "200": @@ -1453,9 +1211,9 @@ paths: /v1/virtualmachines/storage/: get: operationId: v1_virtualmachines_storage_list - description: >- - API endpoint for listing virtual machines available storage types. This - is a readonly endpoint. + description: + API endpoint for listing virtual machines available storage types. + This is a readonly endpoint. parameters: - name: page in: query @@ -1491,9 +1249,9 @@ paths: /v1/virtualmachines/storage/{id}/: get: operationId: v1_virtualmachines_storage_read - description: >- - API endpoint for listing virtual machines available storage types. This - is a readonly endpoint. + description: + API endpoint for listing virtual machines available storage types. + This is a readonly endpoint. parameters: [] responses: "200": @@ -1621,136 +1379,6 @@ definitions: title: Token type: string minLength: 1 - User: - type: object - properties: - email: - title: Email address - type: string - format: email - maxLength: 254 - id: - title: ID - type: integer - readOnly: true - username: - title: Username - description: Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only. - type: string - readOnly: true - minLength: 1 - UserCreate: - required: - - username - - password - type: object - properties: - email: - title: Email address - type: string - format: email - maxLength: 254 - username: - title: Username - description: Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only. - type: string - pattern: ^[\w.@+-]+$ - maxLength: 150 - minLength: 1 - id: - title: ID - type: integer - readOnly: true - password: - title: Password - type: string - minLength: 1 - Activation: - required: - - uid - - token - type: object - properties: - uid: - title: Uid - type: string - minLength: 1 - token: - title: Token - type: string - minLength: 1 - SendEmailReset: - required: - - email - type: object - properties: - email: - title: Email - type: string - format: email - minLength: 1 - PasswordResetConfirm: - required: - - uid - - token - - new_password - type: object - properties: - uid: - title: Uid - type: string - minLength: 1 - token: - title: Token - type: string - minLength: 1 - new_password: - title: New password - type: string - minLength: 1 - UsernameResetConfirm: - required: - - new_username - type: object - properties: - new_username: - title: Username - description: Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only. - type: string - pattern: ^[\w.@+-]+$ - maxLength: 150 - minLength: 1 - SetPassword: - required: - - new_password - - current_password - type: object - properties: - new_password: - title: New password - type: string - minLength: 1 - current_password: - title: Current password - type: string - minLength: 1 - SetUsername: - required: - - current_password - - new_username - type: object - properties: - current_password: - title: Current password - type: string - minLength: 1 - new_username: - title: Username - description: Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only. - type: string - pattern: ^[\w.@+-]+$ - maxLength: 150 - minLength: 1 University: required: - name @@ -1784,7 +1412,7 @@ definitions: minLength: 1 university: $ref: "#/definitions/University" - Researcher: + ResearcherDetail: type: object properties: id: @@ -1806,6 +1434,12 @@ definitions: type: string readOnly: true minLength: 1 + display_name: + title: Display name + description: The full name including titles + type: string + readOnly: true + minLength: 1 university: $ref: "#/definitions/University" faculty: @@ -1822,6 +1456,83 @@ definitions: type: string format: date-time readOnly: true + mobilephone: + title: Mobile phone + description: This mobile phone number is used for 2FA + type: string + pattern: ^\+?1?\d{8,15}$ + maxLength: 16 + minLength: 1 + x-nullable: true + avatar: + title: Avatar + type: string + readOnly: true + x-nullable: true + format: uri + idnumber: + title: ID Number + description: Either an identification number (P/S number) or email address + type: string + maxLength: 50 + minLength: 1 + x-nullable: true + Researcher: + required: + - first_name + - last_name + type: object + properties: + id: + title: ID + type: integer + readOnly: true + first_name: + title: First name + type: string + minLength: 1 + last_name: + title: Last name + type: string + minLength: 1 + avatar: + title: Image file content + type: string + readOnly: false + description: Content of the image base64 encoded + format: uri + created_at: + title: Date created + description: The date and time this model has been created + type: string + format: date-time + readOnly: true + updated_at: + title: Date updated + description: The date and time this model has been updated + type: string + format: date-time + readOnly: true + mobilephone: + title: Mobile phone + description: This mobile phone number is used for 2FA + type: string + pattern: ^\+?1?\d{8,15}$ + maxLength: 16 + minLength: 1 + x-nullable: true + idnumber: + title: ID Number + description: Either an identification number (P/S number) or email address + type: string + maxLength: 50 + minLength: 1 + x-nullable: true + faculty: + title: Faculty + description: Select the faculty where this researcher belongs to + type: integer + x-nullable: true Contributor: type: object properties: @@ -1830,18 +1541,23 @@ definitions: type: integer readOnly: true researcher: - $ref: "#/definitions/Researcher" + $ref: "#/definitions/ResearcherDetail" role: title: Role description: The role withing this research study. type: string enum: - ADMIN - - RESEARCHER - - MEMBER + - CONTRIBUTOR active: title: Active + description: Is the researcher an active member of the study type: boolean + invited_at: + title: Date invited + description: The date and time when the invitation has been sent + type: string + format: date-time StudyField: required: - name @@ -1872,7 +1588,7 @@ definitions: type: integer readOnly: true owner: - $ref: "#/definitions/Researcher" + $ref: "#/definitions/ResearcherDetail" contributors: type: array items: @@ -1903,6 +1619,12 @@ definitions: description: Enter a short description for this study. type: string x-nullable: true + avatar: + title: Avatar + type: string + readOnly: true + x-nullable: true + format: uri code: title: Code description: The research study code. @@ -1925,6 +1647,12 @@ definitions: title: ID type: integer readOnly: true + avatar: + title: Image file content + type: string + readOnly: false + description: Content of the image base64 encoded + format: uri created_at: title: Date created description: The date and time this model has been created @@ -1960,7 +1688,7 @@ definitions: type: boolean owner: title: Researcher - description: >- + description: The researcher that is the owner this study. By default the researcher that has created this study. type: integer @@ -1989,22 +1717,45 @@ definitions: title: Name type: string minLength: 1 - ContributorUpdate: + Invite: required: - - researcher_id + - first_name + - last_name + - email + - role + type: object + properties: + first_name: + title: First name + type: string + maxLength: 100 + minLength: 1 + last_name: + title: Last name + type: string + maxLength: 100 + minLength: 1 + email: + title: Email + type: string + format: email + minLength: 1 + role: + title: Role + type: string + enum: + - ADMIN + - CONTRIBUTOR + ContributorUpdate: type: object properties: - researcher_id: - title: Researcher id - type: integer role: title: Role description: The role withing this research study. type: string enum: - ADMIN - - RESEARCHER - - MEMBER + - CONTRIBUTOR VirtualMachineProvider: type: object properties: @@ -2239,24 +1990,24 @@ definitions: type: string maxLength: 50 minLength: 1 + logo: + title: Logo + type: string + readOnly: true + x-nullable: true + format: uri memory_amount: title: Memory amount description: Amount of memory. Default is 1 type: integer - maximum: 32767 - minimum: 0 storage_amount: title: Storage amount description: Amount of disk storage. Default is 1 type: integer - maximum: 32767 - minimum: 0 gpu_amount: title: Gpu amount description: Amount of GPUs. Default is 0 type: integer - maximum: 32767 - minimum: 0 VirtualMachineAccess: required: - login_key @@ -2352,7 +2103,7 @@ definitions: type: string readOnly: true researcher: - $ref: "#/definitions/Researcher" + $ref: "#/definitions/ResearcherDetail" study: $ref: "#/definitions/StudyDetail" access: @@ -2382,32 +2133,22 @@ definitions: title: Base memory amount description: Amount of memory. Default is 1 type: integer - maximum: 32767 - minimum: 0 base_storage_amount: title: Base storage amount description: Amount of disk storage. Default is 1 type: integer - maximum: 32767 - minimum: 0 additional_gpu_amount: title: Additional gpu amount description: Amount of GPUs. Default is 0 type: integer - maximum: 32767 - minimum: 0 additional_memory_amount: title: Additional memory amount description: Amount of memory. Default is 0 type: integer - maximum: 32767 - minimum: 0 additional_storage_amount: title: Additional storage amount description: Amount of storage. Default is 0 type: integer - maximum: 32767 - minimum: 0 additional_gpu_type: title: Additional gpu type description: Additional GPU @@ -2441,32 +2182,22 @@ definitions: title: Base memory amount description: Amount of memory. Default is 1 type: integer - maximum: 32767 - minimum: 0 base_storage_amount: title: Base storage amount description: Amount of disk storage. Default is 1 type: integer - maximum: 32767 - minimum: 0 additional_gpu_amount: title: Additional gpu amount description: Amount of GPUs. Default is 0 type: integer - maximum: 32767 - minimum: 0 additional_memory_amount: title: Additional memory amount description: Amount of memory. Default is 0 type: integer - maximum: 32767 - minimum: 0 additional_storage_amount: title: Additional storage amount description: Amount of storage. Default is 0 type: integer - maximum: 32767 - minimum: 0 study: title: Study description: The study for which this virtual machine is used.