You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
forms --store/get/delete completed form<br/>update delivery status--> rds
41
+
forms --store/get/delete submission<br/>update delivery status--> rds
42
42
43
43
ses --delivery<br />notification--> sns
44
44
@@ -62,36 +62,33 @@ graph LR
62
62
63
63
## Uploading a file when completing a form
64
64
65
+
### User completes a file upload question
66
+
65
67
```mermaid
66
68
67
69
---
68
-
title: GOV.UK Forms File Upload
70
+
title: User completes a file upload question
69
71
---
70
72
71
73
sequenceDiagram
72
74
73
75
autonumber
74
76
75
-
actor user
77
+
actor user as User
76
78
77
-
participant browser
79
+
participant browser as Browser
78
80
79
-
participant runner as forms-runner
81
+
participant runner as Forms Runner
80
82
participant s3 as Amazon S3
81
83
participant guard as Amazon GuardDuty
82
-
participant ses as Amazon SES
83
-
participant inbox as email inbox
84
-
85
-
actor processor
86
84
87
85
user->>browser: navigate to file upload page
88
86
browser->>runner: GET file upload page
89
87
runner->>runner: render file upload page
90
-
note over runner: can use "accept"<br />HTML attribute to<br />limit file type(s)
91
-
runner->>browser: HTTP response
88
+
runner->>browser: HTTP 200 response
92
89
browser->>user: display file upload page
93
90
94
-
note over user: users sees "File upload" component<br/>from GOV.UK Design System
91
+
note over user: User sees "File upload" component<br/>from GOV.UK Design System
95
92
96
93
user->>browser: select "Choose file"
97
94
browser->>user: display file dialog
@@ -100,12 +97,13 @@ browser->>user: display filename of selected file
100
97
user->>browser: select "Continue"
101
98
102
99
browser->>runner: POST file
103
-
note over runner: Need to check memory requirements if holding files in memory
104
100
105
-
runner->>runner: check filesize
106
-
note over runner: is check done during upload or after upload?
101
+
runner->>runner: validate file size and type
107
102
108
-
note over runner: how to handle file size too big?
103
+
opt Invalid file
104
+
runner->>browser: HTTP 422 response
105
+
browser->>user: display file upload page with error message
106
+
end
109
107
110
108
runner->>s3: write file
111
109
runner->>runner: associate file with user session
@@ -114,97 +112,155 @@ s3->>guard: new object event
114
112
note over guard: GuardDuty<br />Malware Protection<br />for S3
115
113
guard->>s3: scan
116
114
117
-
runner->>s3: GetObjectTagging
118
-
s3->>runner: return TagSet
119
-
120
-
note over runner: poll until tags returned
121
-
122
115
alt No malware detected
123
-
guard->>s3: tag object NO_THREATS_FOUND
116
+
guard->>s3: tag object NO_THREATS_FOUND
124
117
else otherwise
125
-
guard->>s3: tag object
118
+
guard->>s3: tag object
126
119
end
127
120
128
-
runner->>s3: GetObjectTagging
129
-
s3->>runner: return TagSet
121
+
loop poll until GuardDuty tag is returned
122
+
runner->>s3: GetObjectTagging
123
+
s3->>runner: return TagSet
124
+
end
130
125
131
-
note over user,guard: will user wait until file upload and checks have completed?
126
+
note over runner,guard: We may want to change how we get the GuardDuty status if making<br/>the user wait while we poll causes issues
132
127
133
-
opt file not OK
134
-
runner->>browser: redirect to error
135
-
browser->>runner: GET file upload page with error (following redirect)
136
-
runner->>browser: HTTP response
137
-
browser->>user: display error message
138
-
note over user: now what?<br />allow user to try again?
128
+
opt GuardDuty status is not NO_THREATS_FOUND
129
+
runner->>browser: HTTP 422 response
130
+
browser->>user: display file upload page with error message
139
131
end
140
132
141
-
runner->>browser: redirect to next page
142
-
browser->>runner: GET next page (following redirect)
143
-
runner->>browser: HTTP reponse
133
+
runner->>browser: HTTP 302 redirect response
134
+
browser->>runner: GET review file page
135
+
browser->>user: display review file page with uploaded filename
136
+
note over user,browser: User can choose to remove their file. If they<br/>do they are shown a confirmation page, and taken<br/>back to the file upload page if they confirm.
137
+
138
+
user->>browser: select "Continue"
139
+
140
+
runner->>browser: HTTP 302 redirect response
141
+
142
+
note over user,runner: User completes the rest of the questions
0 commit comments