Open damoodamoo opened 1 year ago
Looks good. One question, typically the DAR comes before a workspace has been requested. How does this tie in with this user story?
As a TRE Implementer, I want to be able to create a number of Data Access Request forms per workspace type.
Not sure we need per workspace forms? Is there a use case for other types of request?
@marrobi - this is the main question I have too, and this design takes an opinion that a workspace needs to exist before a DAR is performed. The end of a DAR would trigger a provisioning process to move the data over into the workspace, so it would either need to exist already, or we'd a wider process to create the workspace and then trigger the data provisioning.
This requests mechanism could support a "Project initiation" style workflow too, with requests being raised at the top level of the TRE and resulting in a new workspace. That, in my view, would be a next step after this is in place, as we need to support getting data into an existing workspace either way.
I would also expect that we would want per-workspace forms. Each form would define a trigger to run when the request is approved, which might well be different between workspace types.
As discussed, closing this as building a Data Access Request mechanism into the TRE is not on the roadmap.
As discussed, closing this as building a Data Access Request mechanism into the TRE is not on the roadmap.
I wouldn't say it isn't on the roadmap, it's being requested by many users, the issue is we don't have the resource to support beyond initial implementation. This may change.
Going to reopen, as it is a requested feature, so shows up on backlog.
@damoodamoo I'm back in this space again. Looking at your (and team's) work here - https://github.com/SAFEHR-data/Data-Access-Request-Seedling .
The ask is for this to happen pre workspace creation, the concept of project has been discussed, but I'm seeing this as 1:1 match with "data access request". Welcome a discussion on how much of the seedling work could be reused. UI is out of scope, so the forms work would likely have to wait, but the request APIs are a good starting point.
Context
It's common that a Researcher needs to request access for a specific data set on which to perform their research. The way this happens across projects, organisations and industries are myriad, so a core TRE Data Access Request mechanism must provide:
User Stories
Differences to Airlock
The airlock process is a more rigid and custom process. It contains lots of logic around reviews - creating review VMs, wiring up a Review Workspace, providing mechanisms to actually move files, generate SAS links etc. Whilst the new DAR mechanism will be informed by Airlock, and will be integrated in the UX, it will not reuse the airlock API endpoints. Efforts will be made to reduce code duplication - such as refactoring the concept of a
status
away from being airlock specific, and shared by all request types.Could this be used for any type of approval process, such as requesting a VM?
Potentially. However, the primary use case is Data Access Requests, and that will be the focus in the UI. There will be a single
requests
service, which handles the database interactions and CRUD operations, and then it will be up to the endpoints to build upon that service to enforce any custom model structures and decision making applicable to that request type.Managing Form Templates
Each organisation will need to be able to build and manage a number of custom form templates. These will be heavily inspired from the resource templates. In the repo, a new directory named
forms
will be created under./templates
. This will house any number of JSON schema documents.Each form template will contain the following fields:
$schema
,$id
,title
,description
: Same as resource templatesform
:required
,properties
,allOf
/oneOf
(etc) blocks: Same as resource templates, defining the fieldsuiSchema
to order fields and provide extra UI hintstriggers
: a new list block specifically for forms. These entries will be used by the API logic to trigger webhook URLs upon status changes.name
: string - friendly name of the triggerstatus
: string - if therequest
status equals this, fire the below URIURI
: string - may contain sensitive data. Will not be surfaced inget
requests.formType
: string - Used to lookup, for instance "all Data Access Request forms".isGlobal
: boolean - Indicates whether this form could show up anywhere in the TREworkspaceTypes
: Optional. A list of strings matching the workspace definition names (iebase
). Used to recall forms only meant for a particular type of workspace.To support the new
forms
concept, we'll need the underlying plumbing:Forms
cosmos collectionforms
API and service:create
/update
/delete
operations accessible only by TRE Adminget
/list
operations accessible to TRE Admins. If a form is scoped to a particular type of workspace, the user requesting the form will need to be authenticated to a workspace of that type.Requests API Design
request
modelA model to contain a fixed and flexible structure to store data for all requests
title
(string)description
(string)requestor
(user object)status
(string / enum)request_type
(string / enum)requested_when
(datetime)workspace_id
(guid, optional)messages
(list)message
(string)user
(user object)message_when
(datetime)updates
(list - each item capturing the diff made to the overall object)update
(dict of fields submitted for update)user
(user object)updated_when
(datetime)triggers
(list - each item capturing details about a fired trigger)trigger_name
status
response
triggered_when
(datetime)request_data
(dict - acts as a flexible property bag to store any custom request data. Likely populated from form data defined in theform
above)requests
serviceA single service to handle the CRUD operations for
request
models. This service will handle shared logic around creating, updating, and listing requests. The service will be intentionally 'dumb'. It will be up to the calling code to enforce any permission restrictions, data structure checks (for any customrequest_data
) etc.create_request
Accept a
request
model.check_and_fire_triggers
get_request
Accept a
request_id
, return the object from the database.list_requests_for_workspace
Accept a
workspace_id
. Return a date ordered list of allrequest
objects matching theworkspace_id
.list_my_requests
Accept an optional
workspace_id
. Return a date-ordered list of allrequest
objects where therequestor.user_id
== current user ID.update_request
Accept a
request_id
,user
, anddiff
object (dict) containing only the changes to make (ie. aPUT
).request
object viaget_request
diff
object to theupdates
list in the requestcheck_and_fire_triggers
diff
object with therequest
object to make the changesrequest
model back to the databasecheck_and_fire_triggers
Internal to this service. Accept the
request
,status
and theform_template
.status
is INform_template.triggers
:request
object to theURI
defined as aPOST
POST
succeededadd_message
Accept a
request_id
andmessage
(string).request
object viaget_request
messages
listrequest
model back to the databaseIndicative UI Mockups
Viewing all requests within a given workspace:
Starting a new request. The UI offers all the
forms
available for this workspace, of typedata_access_request
:Selecting a particular type of form allows the requestor to complete the details and submit. Following submission, the
request
is marked asin_review
, and triggers a background workflow to collect approvals as needed: