metadata_presenter 3.3.24 → 3.3.26

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c820cccd9aed599a87d7f383a7464504fb73470e11ea2aa47c107d8660474833
4
- data.tar.gz: d73786672c233b5ca1371c65d24844eae9c9f63cbe7e144ed59d3dad71575a48
3
+ metadata.gz: c4128ca5849214bffa20458c1686435b7131ea590e5492eaf0d19e6fdf70c65d
4
+ data.tar.gz: ea857a69f931411cb61863f2bc132b98013f6d6ca78fa0a236ca920af760541b
5
5
  SHA512:
6
- metadata.gz: 60cd34263a60622ede633dad425c2049b6df5d2dd1163674cc22eb82a68e6eaf07664bb435b93cb31af2c48aacfc3023a387fee84b170ca9b7d3a57d8bbee270
7
- data.tar.gz: 4dd4eef3fe6c479c1e962bc41ca4f7db41a1e8959a19e9974319d30afa801b7e0e1352248d7184e131b44c4858cdd30a18cc02e443e0397345b14bb0c9296988
6
+ metadata.gz: 9f638b02ffbb4ff7d6d1d54d907c29aa66f9cc3060f2d3533b0aaf308f6441395b3b96cc90622483ec704ead43aec2110c52692344e2bff8eb2ac6a2bd8dc0be
7
+ data.tar.gz: c7176a4d6b65509aba6523e705fd4eb2dbbd34e1bfd551f3e1c2e0f59fea146fa216b621a5ca9afc807771364e5e84510c388fd6decd320131663ff35f7d07a7
@@ -0,0 +1,48 @@
1
+ module MetadataPresenter
2
+ class AuthController < EngineController
3
+ PRODUCTION_ENVS = %w[test-production live-production].freeze
4
+
5
+ skip_before_action :require_basic_auth
6
+ before_action :check_session_is_authorised
7
+
8
+ def show
9
+ @auth_form = AuthForm.new
10
+ end
11
+
12
+ def create
13
+ @auth_form = AuthForm.new(auth_params)
14
+
15
+ if @auth_form.valid?
16
+ authorised_session!
17
+ redirect_to root_path
18
+ else
19
+ render :show
20
+ end
21
+ end
22
+
23
+ private
24
+
25
+ def allow_analytics?
26
+ false
27
+ end
28
+
29
+ def show_cookie_request?
30
+ false
31
+ end
32
+
33
+ def check_session_is_authorised
34
+ redirect_to root_path if session_authorised?
35
+ end
36
+
37
+ def production_env?
38
+ PRODUCTION_ENVS.include?("#{ENV['PLATFORM_ENV']}-#{ENV['DEPLOYMENT_ENV']}")
39
+ end
40
+ helper_method :production_env?
41
+
42
+ def auth_params
43
+ params.require(:auth_form).permit(
44
+ :username, :password
45
+ )
46
+ end
47
+ end
48
+ end
@@ -6,7 +6,11 @@ module MetadataPresenter
6
6
  default_form_builder GOVUKDesignSystemFormBuilder::FormBuilder
7
7
 
8
8
  around_action :switch_locale
9
- before_action :show_maintenance_page
9
+ before_action :show_maintenance_page, :require_basic_auth
10
+
11
+ def require_basic_auth
12
+ redirect_to auth_path unless session_authorised?
13
+ end
10
14
 
11
15
  def reload_user_data
12
16
  # :nocov:
@@ -124,6 +128,18 @@ module MetadataPresenter
124
128
  ENV['MAINTENANCE_MODE'].present? && ENV['MAINTENANCE_MODE'] == '1'
125
129
  end
126
130
 
131
+ def session_authorised?
132
+ return true if ENV['BASIC_AUTH_USER'].blank? || ENV['BASIC_AUTH_PASS'].blank?
133
+
134
+ !!cookies.signed[:_fb_authorised]
135
+ end
136
+
137
+ def authorised_session!
138
+ cookies.signed[:_fb_authorised] = {
139
+ value: 1, same_site: :strict, httponly: true
140
+ }
141
+ end
142
+
127
143
  def external_or_relative_link(link)
128
144
  uri = URI.parse(link)
129
145
  return link if uri.scheme.present? && uri.host.present?
@@ -4,6 +4,8 @@ module MetadataPresenter
4
4
 
5
5
  helper_method :get_service_name, :get_uuid, :pages_presenters
6
6
 
7
+ skip_before_action :require_basic_auth
8
+
7
9
  def return
8
10
  response = get_saved_progress(get_uuid)
9
11
 
@@ -49,6 +51,9 @@ module MetadataPresenter
49
51
 
50
52
  invalidate_record(@saved_form.id)
51
53
 
54
+ # authorise user as to not ask them again for credentials, if set
55
+ authorised_session! unless session_authorised?
56
+
52
57
  if @saved_form.service_version == service.version_id
53
58
  redirect_to '/resume_progress' and return
54
59
  else
@@ -1,5 +1,7 @@
1
1
  module MetadataPresenter
2
2
  class SessionController < EngineController
3
+ skip_before_action :require_basic_auth
4
+
3
5
  def expired; end
4
6
 
5
7
  def complete; end
@@ -0,0 +1,33 @@
1
+ module MetadataPresenter
2
+ class AuthForm
3
+ include ActiveModel::Model
4
+
5
+ attr_accessor :username, :password
6
+
7
+ validates :username, :password,
8
+ presence: true, allow_blank: false
9
+
10
+ validate :valid_credentials
11
+
12
+ private
13
+
14
+ def valid_credentials
15
+ errors.add(:base, :unauthorised) unless errors.any? || authorised?
16
+ end
17
+
18
+ def authorised?
19
+ # This comparison uses & so that it doesn't short circuit and
20
+ # uses `secure_compare` so that length information isn't leaked.
21
+ ActiveSupport::SecurityUtils.secure_compare(env_username, username) &
22
+ ActiveSupport::SecurityUtils.secure_compare(env_password, password)
23
+ end
24
+
25
+ def env_username
26
+ ENV['BASIC_AUTH_USER'].to_s
27
+ end
28
+
29
+ def env_password
30
+ ENV['BASIC_AUTH_PASS'].to_s
31
+ end
32
+ end
33
+ end
@@ -0,0 +1,8 @@
1
+ module MetadataPresenter
2
+ class PatternValidator < BaseValidator
3
+ def invalid_answer?
4
+ regex = component.validation[schema_key]
5
+ !user_answer.to_s.match(regex)
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,37 @@
1
+ <div class="fb-main-grid-wrapper">
2
+ <div class="govuk-grid-row">
3
+ <div class="govuk-grid-column-two-thirds">
4
+ <%= form_for @auth_form, url: { action: :create } do |f| %>
5
+ <%= f.govuk_error_summary(t('presenter.errors.summary_heading'), link_base_errors_to: :username) %>
6
+
7
+ <h1 id="page-heading" class="govuk-heading-xl">
8
+ <%= t('presenter.authorisation.heading') %>
9
+ </h1>
10
+
11
+ <p class="govuk-body">
12
+ <%= t('presenter.authorisation.lede') %>
13
+ </p>
14
+
15
+ <% unless production_env? %>
16
+ <div class="govuk-warning-text">
17
+ <span class="govuk-warning-text__icon" aria-hidden="true">!</span>
18
+ <strong class="govuk-warning-text__text">
19
+ <span class="govuk-visually-hidden"><%= t('presenter.notification_banners.warning') %></span>
20
+ <%= t('presenter.authorisation.warning') %>
21
+ </strong>
22
+ </div>
23
+ <% end %>
24
+
25
+ <%= f.govuk_text_field :username, width: 'one-third', autocorrect: 'off',
26
+ label: { text: t('presenter.authorisation.labels.username') } %>
27
+
28
+ <%= f.govuk_password_field :password, width: 'one-third', autocorrect: 'off',
29
+ label: { text: t('presenter.authorisation.labels.password') } %>
30
+
31
+ <div class="govuk-button-group">
32
+ <%= f.govuk_submit t('presenter.actions.sign_in') %>
33
+ </div>
34
+ <% end %>
35
+ </div>
36
+ </div>
37
+ </div>
@@ -14,6 +14,7 @@ cy:
14
14
  start: Dechrau nawr
15
15
  continue: Parhau
16
16
  submit: Cyflwyno
17
+ sign_in: Sign in
17
18
  upload_options: Llwytho opsiynau
18
19
  change_html: Newid <span class="govuk-visually-hidden">eich ateb ar gyfer %{question}</span>
19
20
  errors:
@@ -38,6 +39,13 @@ cy:
38
39
  maintenance:
39
40
  maintenance_page_heading: Mae’n ddrwg gennym, nid yw’r ffurflen hon ar gael
40
41
  maintenance_page_content: "Os oeddech chi yng nghanol llenwi’r ffurflen, nid yw eich data wedi’i chadw.\r\n\r\nBydd y ffurflen ar gael eto o 9am ar ddydd Llun 19 Tachwedd.\r\n\r\n\r\n\r\n### Other ways to apply\r\n\r\nCysylltwch â ni os yw eich cais yn frys \r\n\r\nEmail: \r\nTelephone: \r\nDydd Llun i ddydd Gwener, 9am i 5pm \r\n[Gwybodaeth am gost galwadau](https://www.gov.uk/costau-galwadau)"
42
+ authorisation:
43
+ heading: Sign in
44
+ lede: This form has its own username and password. Contact the form owner if you are unsure what these are.
45
+ warning: This is a Test version of the form and should not be shared without the form owner’s permission.
46
+ labels:
47
+ username: Username
48
+ password: Password
41
49
  session_timeout_warning:
42
50
  heading: Ydych chi eisiau mwy o amser?
43
51
  timer: Byddwn yn ailosod eich ffurflen ac yn dileu eich gwybodaeth os na fyddwch yn parhau mewn
@@ -169,6 +177,15 @@ cy:
169
177
  errors:
170
178
  messages:
171
179
  blank: 'Rhowch ateb i "%{attribute}"'
180
+ models:
181
+ metadata_presenter/auth_form:
182
+ attributes:
183
+ base:
184
+ unauthorised: The username and password do not match. Try again
185
+ username:
186
+ blank: Enter a username
187
+ password:
188
+ blank: Enter a password
172
189
  attributes:
173
190
  metadata_presenter/saved_form:
174
191
  secret_question: Cwestiwn cudd
@@ -5,6 +5,7 @@ en:
5
5
  start: Start now
6
6
  continue: Continue
7
7
  submit: Submit
8
+ sign_in: Sign in
8
9
  upload_options: Upload options
9
10
  change_html: Change <span class="govuk-visually-hidden">Your answer for %{question}</span>
10
11
  errors:
@@ -29,6 +30,13 @@ en:
29
30
  maintenance:
30
31
  maintenance_page_heading: 'Sorry, this form is unavailable'
31
32
  maintenance_page_content: "If you were in the middle of completing the form, your data has not been saved.\r\n\r\nThe form will be available again from 9am on Monday 19 November 2018.\r\n\r\n\r\n\r\n### Other ways to apply\r\n\r\nContact us if your application is urgent \r\n\r\nEmail: \r\nTelephone: \r\nMonday to Friday, 9am to 5pm \r\n[Find out about call charges](https://www.gov.uk/call-charges)"
33
+ authorisation:
34
+ heading: Sign in
35
+ lede: This form has its own username and password. Contact the form owner if you are unsure what these are.
36
+ warning: This is a Test version of the form and should not be shared without the form owner’s permission.
37
+ labels:
38
+ username: Username
39
+ password: Password
32
40
  session_timeout_warning:
33
41
  heading: Do you need more time?
34
42
  timer: We will reset your form and delete your information if you do not continue in
@@ -205,6 +213,15 @@ en:
205
213
  errors:
206
214
  messages:
207
215
  blank: 'Enter an answer for "%{attribute}"'
216
+ models:
217
+ metadata_presenter/auth_form:
218
+ attributes:
219
+ base:
220
+ unauthorised: The username and password do not match. Try again
221
+ username:
222
+ blank: Enter a username
223
+ password:
224
+ blank: Enter a password
208
225
  attributes:
209
226
  metadata_presenter/saved_form:
210
227
  secret_question: Secret question
data/config/routes.rb CHANGED
@@ -1,6 +1,9 @@
1
1
  MetadataPresenter::Engine.routes.draw do
2
2
  root to: 'service#start'
3
3
 
4
+ get '/auth', to: 'auth#show'
5
+ post '/auth', to: 'auth#create'
6
+
4
7
  post '/reserved/submissions', to: 'submissions#create', as: :reserved_submissions
5
8
  get '/reserved/change-answer', to: 'change_answer#create', as: :change_answer
6
9
 
@@ -0,0 +1,7 @@
1
+ {
2
+ "_id": "error.pattern",
3
+ "_type": "string.error",
4
+ "description": "Input (string) does not match with the regular expression",
5
+ "value:en": "Your answer for \"%{control}\" must match the required format",
6
+ "value:cy": "(cy) Your answer for \"%{control}\" must match the required format"
7
+ }
@@ -0,0 +1 @@
1
+ { "pattern": "*" }
@@ -0,0 +1,211 @@
1
+ {
2
+ "_id": "service.base",
3
+ "flow": {
4
+ "121183c6-7ee8-4b5d-b74a-dacee8aa4cd5": {
5
+ "next": {
6
+ "default": "2fe3302d-8398-4294-b759-eeb35846f693"
7
+ },
8
+ "_type": "flow.page"
9
+ },
10
+ "2fe3302d-8398-4294-b759-eeb35846f693": {
11
+ "next": {
12
+ "default": "6fa2cad9-1425-4759-8a0a-4e75025ae06b"
13
+ },
14
+ "_type": "flow.page"
15
+ },
16
+ "31dd081d-805e-43f2-a155-f3b336d7fec7": {
17
+ "next": {
18
+ "default": "9a5f489d-fc9c-4130-b30d-968f47e1ee7d"
19
+ },
20
+ "_type": "flow.page"
21
+ },
22
+ "6fa2cad9-1425-4759-8a0a-4e75025ae06b": {
23
+ "next": {
24
+ "default": ""
25
+ },
26
+ "_type": "flow.page"
27
+ },
28
+ "9a5f489d-fc9c-4130-b30d-968f47e1ee7d": {
29
+ "next": {
30
+ "default": "121183c6-7ee8-4b5d-b74a-dacee8aa4cd5"
31
+ },
32
+ "_type": "flow.page"
33
+ }
34
+ },
35
+ "_type": "service.base",
36
+ "pages": [
37
+ {
38
+ "_id": "page.start",
39
+ "url": "/",
40
+ "body": "Use this service to apply for a service or contact us about a case.\r\n\r\n## Before you start\r\nYou will need:\r\n\r\n* your 8-digit reference number\r\n* a copy of your photo ID\r\n* something else\r\n\r\nThis form will take around 5 minutes to complete. We will reply within 10 working days.",
41
+ "_type": "page.start",
42
+ "_uuid": "31dd081d-805e-43f2-a155-f3b336d7fec7",
43
+ "heading": "Service name goes here",
44
+ "before_you_start": "## Other ways to get in touch\r\nYou can also apply or contact us about your case by:\r\n\r\n* telephone: 01234 567889\r\n* email: <example.service@justice.gov.uk>\r\n\r\nThis form is also [available in Welsh (Cymraeg)](https://example-service.form.service.justice.gov.uk/)."
45
+ },
46
+ {
47
+ "_id": "page.multipage",
48
+ "url": "multipage",
49
+ "_type": "page.multiplequestions",
50
+ "_uuid": "9a5f489d-fc9c-4130-b30d-968f47e1ee7d",
51
+ "heading": "multi",
52
+ "components": [
53
+ {
54
+ "_id": "multipage_text_1",
55
+ "hint": "[A-Z]",
56
+ "name": "multipage_text_1",
57
+ "_type": "text",
58
+ "_uuid": "2e667725-4e71-46cf-b360-67f5b991196d",
59
+ "label": "capitals",
60
+ "errors": {
61
+ },
62
+ "collection": "components",
63
+ "validation": {
64
+ "pattern": "[A-Z]",
65
+ "required": true
66
+ }
67
+ },
68
+ {
69
+ "_id": "multipage_text_2",
70
+ "hint": "\\d+",
71
+ "name": "multipage_text_2",
72
+ "_type": "text",
73
+ "_uuid": "2e5ce932-5d9e-4fff-8bf9-ffecada388ae",
74
+ "label": "digits",
75
+ "errors": {
76
+ },
77
+ "collection": "components",
78
+ "validation": {
79
+ "pattern": "\\d+",
80
+ "required": true
81
+ }
82
+ }
83
+ ],
84
+ "add_component": "text",
85
+ "section_heading": ""
86
+ },
87
+ {
88
+ "_id": "page.regex",
89
+ "url": "regex",
90
+ "body": "",
91
+ "lede": "",
92
+ "_type": "page.singlequestion",
93
+ "_uuid": "121183c6-7ee8-4b5d-b74a-dacee8aa4cd5",
94
+ "heading": "",
95
+ "components": [
96
+ {
97
+ "_id": "regex_text_1",
98
+ "hint": "\\D+",
99
+ "name": "regex_text_1",
100
+ "_type": "text",
101
+ "_uuid": "375b6aa9-6548-4d71-ab69-6ff6c68a9d2f",
102
+ "label": "No number (optional)",
103
+ "errors": {
104
+ },
105
+ "collection": "components",
106
+ "validation": {
107
+ "pattern": "\\D+",
108
+ "required": false
109
+ }
110
+ }
111
+ ],
112
+ "section_heading": ""
113
+ },
114
+ {
115
+ "_id": "page.checkanswers",
116
+ "url": "check-answers",
117
+ "_type": "page.checkanswers",
118
+ "_uuid": "2fe3302d-8398-4294-b759-eeb35846f693",
119
+ "heading": "Check your answers",
120
+ "send_body": "By submitting this application you confirm that, to the best of your knowledge, the details you are providing are correct.",
121
+ "components": [
122
+
123
+ ],
124
+ "send_heading": "Now send your application",
125
+ "extra_components": [
126
+
127
+ ]
128
+ },
129
+ {
130
+ "_id": "page.confirmation",
131
+ "url": "form-sent",
132
+ "_type": "page.confirmation",
133
+ "_uuid": "6fa2cad9-1425-4759-8a0a-4e75025ae06b",
134
+ "heading": "Application complete",
135
+ "components": [
136
+
137
+ ]
138
+ }
139
+ ],
140
+ "locale": "en",
141
+ "created_at": "2024-03-12T13:11:40Z",
142
+ "created_by": "60bc2c45-01ca-4520-9958-866e4d0063c2",
143
+ "service_id": "5e64a1b4-9d5b-44f0-8fe5-d669ac0ca336",
144
+ "version_id": "b43ec7be-f86a-4f71-be61-4d095f10e10e",
145
+ "service_name": "regex",
146
+ "configuration": {
147
+ "meta": {
148
+ "_id": "config.meta",
149
+ "_type": "config.meta",
150
+ "items": [
151
+ {
152
+ "_id": "config.meta--link",
153
+ "href": "/cookies",
154
+ "text": "Cookies",
155
+ "_type": "link"
156
+ },
157
+ {
158
+ "_id": "config.meta--link--2",
159
+ "href": "/privacy",
160
+ "text": "Privacy",
161
+ "_type": "link"
162
+ },
163
+ {
164
+ "_id": "config.meta--link--3",
165
+ "href": "/accessibility",
166
+ "text": "Accessibility",
167
+ "_type": "link"
168
+ }
169
+ ]
170
+ },
171
+ "service": {
172
+ "_id": "config.service",
173
+ "_type": "config.service"
174
+ }
175
+ },
176
+ "standalone_pages": [
177
+ {
178
+ "_id": "page.cookies",
179
+ "url": "cookies",
180
+ "body": "This form saves small files (known as 'cookies') onto your device.\r\n \r\nCookies are used to:\r\n \r\n* remember your progress\r\n* measure how you use the form so it can be updated and improved based on your needs\r\n \r\nThese cookies are not used to identify you personally.\r\n \r\nYou will normally see a message on the form before we store a cookie on your computer. Essential cookies are necessary for the form to work but you can still complete the form if you choose not to accept analytics cookies.\r\n \r\nFind out more about [how to manage cookies](https://www.aboutcookies.org/).\r\n \r\n## Essential cookies\r\n \r\nEssential cookies are required to make this form work and keep your information secure while you use it.\r\n \r\nWe use the following essential cookies: \r\n \r\n| Name | Purpose | Expires |\r\n|---|---|---|\r\n| \\_fb\\_runner\\_session | Saves your current progress on this computer and tracks inactivity periods | After 30 minutes of inactivity or when you close your browser |\r\n| analytics | Remembers whether you accept or reject analytics cookies on this form | After 1 year |\r\n \r\n## Analytics cookies\r\n \r\nAnalytics cookies collect information about how you use this form. This helps us make sure the form is meeting the needs of its users and to help us make improvements.\r\n \r\nWe use Google Analytics to learn about:\r\n \r\n* the pages you visit\r\n* how long you spend on each page\r\n* how you got to the form\r\n* what you click on while you are using the form\r\n \r\nWe do not collect or store your personal information (for example your name or address) so this information can't be used to identify who you are. We do not allow third parties to use or share our analytics data.\r\n \r\nThis form may use different versions of Google Analytics and could save some or all of the following cookies:\r\n \r\n| Name | Purpose | Expires |\r\n|---|---|---|\r\n| \\_ga | Helps us count how many people visit this form | 2 years |\r\n| \\_gid | Helps us count how many people visit this form | 1 day |\r\n| \\_ga\\_\\<container-id> | Used to persist session state | 2 years |\r\n| \\_gac\\_gb\\_\\<container-id> | Contains campaign-related information | 90 days |\r\n| \\_gat | Used to throttle request rate | 1 minute |\r\n| \\_dc\\_gtm\\_\\<property-id>| Used to throttle request rate | 1 minute |\r\n| AMP\\_TOKEN | Contains a token that can be used to retrieve a Client ID from AMP Client ID service | 30 seconds to 1 year |\r\n| \\_gac\\_\\<property-id> | Contains campaign related information | 90 days |\r\n \r\nYou can use a browser addon to [opt out of Google Analytics cookies](https://tools.google.com/dlpage/gaoptout) on all websites.",
181
+ "_type": "page.standalone",
182
+ "_uuid": "29778a2d-e5c2-4d97-b131-5456e3396145",
183
+ "heading": "Cookies",
184
+ "components": [
185
+
186
+ ]
187
+ },
188
+ {
189
+ "_id": "page.privacy",
190
+ "url": "privacy",
191
+ "body": "[[Guidance notes on completing this notice](https://intranet.justice.gov.uk/documents/2018/03/privacy-notice-guidance.pdf) - delete before publishing]\r\n\r\n## [Name of your form or service]\r\n\r\nThe Ministry of Justice (MoJ) is committed to the protection and security of your personal information.\r\n\r\nIt is important that you read this notice so that you are aware of how and why we are using such information. This privacy notice describes how we collect and use personal information during and after your relationship with us, in accordance with data protection law. \r\n\r\n[Insert name – delete if not an EA or ALB] is an Executive Agency/Arm’s Length Body of the MoJ. MoJ is the data controller for the personal data used for the purposes of [Insert overarching purpose].\r\n\r\n### The type of personal data we process\r\n\r\nWe currently collect and use the following information:\r\n\r\n[list the type of personal data used e.g. name, address, contact details etc]\r\n\r\nWe also collect special categories of information, such as [delete this section if not applicable]:\r\n\r\n* race or ethnicity \r\n* political opinions\r\n* religious or philosophical beliefs\r\n* trade union membership\r\n* health, sex life or sexual orientation \r\n* genetics or biometrics\r\n* criminal convictions\r\n\r\n\r\n### How we get your personal data and why we have it\r\n\r\nMost of the personal information we process is provided to us directly by you for one of the following reasons: [List reasons e.g. providing an online service]\r\n\r\nWe also receive personal information indirectly, from the following sources in the following scenarios: [Include details of the source of the personal data unless the data is collected directly from the data subject]\r\n\r\nWe use the personal data we receive in order to: [list how you use the personal data] \r\n\r\nWe may share this information with: [enter organisations or individuals]\r\n\r\nUnder the UK General Data Protection Regulation (UK GDPR), the lawful bases we rely on for processing this information are: [delete as appropriate]\r\n\r\n* Your consent. You may withdraw your consent at any time by contacting [enter contact details].\r\n* We have a contractual obligation.\r\n* We have a legal obligation.\r\n* We have a vital interest.\r\n* We need it to perform a public task.\r\n* We have a legitimate interest.\r\n\r\n[Explain the purpose and lawful basis for processing the personal data you collect. If lawful basis is a legal obligation or public task, explain what this is e.g. refer to legislation or policy.] \r\n\r\nThe legal bases on which the MoJ processes special categories of information you have provided, is on the basis of: [delete this section if not applicable]\r\n\r\n* Your explicit consent. You may withdraw your consent at any time by contacting [insert contact details].\r\n* The processing being necessary for the MoJ in the field of employment, social security and social protection law.\r\n* The information being manifestly made public by you.\r\n* The processing being necessary for the establishment, exercise or defence of legal claims.\r\n* The substantial public interest in the MoJ [tailor as required and choose relevant [substantial public interest condition](https://ico.org.uk/for-organisations/guide-to-data-protection/guide-to-the-general-data-protection-regulation-gdpr/special-category-data/what-are-the-substantial-public-interest-conditions/)]. \r\n* The processing is necessary for historical research purposes/statistical purposes.\r\n\r\n### International data transfers\r\n\r\n[Delete one of the following paragraphs as appropriate]\r\n\r\nPersonal data is transferred to [insert name of country] for the purpose of [insert purpose]. This international transfer complies with UK data protection law [delete as appropriate].\r\n\r\n\r\nThere are no international transfers.\r\n\r\n### How we store your personal data\r\n\r\n[set out how long the information is retained, or the criteria used to determine how long the information is retained]\r\n\r\nPersonal data is stored securely and in accordance with our data retention schedule [insert link to the schedule or details of retention periods]. At the end of this period your data is [insert with it is retained as a public record or whether it is disposed of].\r\n\r\n### Your rights\r\n\r\n[This section lists all data subject rights found in the UKGDPR and the Data Protection Act 2018. You should only include those relevant to your lawful basis for processing. [Find out more about which rights apply and when](https://ico.org.uk/for-organisations/guide-to-data-protection/guide-to-the-general-data-protection-regulation-gdpr/individual-rights/)]\r\n\r\n* Your right of access - You have the right to ask us for copies of your personal information. \r\n* Your right to rectification - You have the right to ask us to rectify personal information you think is inaccurate. You also have the right to ask us to complete information you think is incomplete. \r\n* Your right to erasure - You have the right to ask us to erase your personal information in certain circumstances. \r\n* Your right to restriction of processing - You have the right to ask us to restrict the processing of your personal information in certain circumstances. \r\n* Your right to object to processing - You have the right to object to the processing of your personal information in certain circumstances. \r\n* Your right to data portability - You have the right to ask that we transfer the personal information you gave us to another organisation, or to you, in certain circumstances. \r\n\r\nDepending on the lawful basis on which your personal data is being processed, not all rights will apply.\r\n\r\nYou are not required to pay any charge for exercising your rights. If you make a request, we have one month to respond to you. If you wish to exercise your data protection rights please contact one of these teams.\r\n\r\nIf you have ever been convicted of a criminal offence, contact:\r\n\r\n\r\nBranston Registry<br> \r\nBuilding 16, S & T Store<br> \r\nBurton Road<br>\r\nBranston<br>\r\nBurton-on-Trent<br> \r\nStaffordshire<br>\r\nDE14 3EG\r\nEmail: <data.access1@justice.gov.uk>\r\n\r\nOtherwise, contact:\r\n\r\n\r\nDisclosure Team<br>\r\nPost point 10.38<br>\r\n102 petty France<br>\r\nLondon<br>\r\nSW1H 9AJ\r\nEmail: <data.access@justice.gov.uk> \r\n\r\n### How to complain\r\n\r\nIf you have any concerns about our use of your personal data, you can contact the MoJ data protection officer:\r\n\r\nData Protection Officer<br>\r\nMinistry of Justice<br>\r\n3rd Floor, Post Point 3.20<br>\r\n10 South Colonnades<br>\r\nCanary Wharf<br>\r\nLondon<br>\r\nE14 4PU\r\n\r\nEmail: <dpo@justice.gov.uk> \r\n\r\n\r\nYou can also complain to the Information Commissioner’s Office (ICO) if you are unhappy with how we have used your data:\r\n\r\n\r\nInformation Commissioner’s Office<br>\r\nWycliffe House<br>\r\nWater Lane<br>\r\nWilmslow<br>\r\nCheshire<br>\r\nSK9 5AF\r\n\r\nTelephone: 0303 123 1113<br>\r\n[ICO website](https://www.ico.org.uk)\r\n\r\nDate of last review: [Insert publication or update date]",
192
+ "_type": "page.standalone",
193
+ "_uuid": "2d6ce913-5c4c-4c43-b77a-2fcda5ef06df",
194
+ "heading": "Privacy notice",
195
+ "components": [
196
+
197
+ ]
198
+ },
199
+ {
200
+ "_id": "page.accessibility",
201
+ "url": "accessibility",
202
+ "body": "This accessibility statement applies to [describe your form here - for example, the general enquiries form for the CICA].\r\n\r\n## Using this form\r\n\r\nThis form was built using MoJ Forms, a tool developed by the Ministry of Justice (MoJ), and uses components from the [GOV.UK Design System](https://design-system.service.gov.uk).\r\n\r\n[insert your team or organisation here] is responsible for the content of this online form. The Ministry of Justice and MoJ Forms team are responsible for its technical aspects.\r\n\r\nWe want as many people as possible to be able to use this online form. For example, that means you should be able to:\r\n\r\n- change colours, contrast levels and fonts\r\n- zoom in up to 300% without the text spilling off the screen\r\n- navigate the form using just a keyboard\r\n- navigate the form using speech recognition software\r\n- listen to the form using a screen reader (including recent versions of JAWS, NVDA and VoiceOver)\r\n\r\nWe have also made the text as simple as possible to understand.\r\n\r\n[AbilityNet](https://mcmw.abilitynet.org.uk) has advice on making your device easier to use if you have a disability.\r\n\r\n## How accessible this form is\r\n\r\nWe have tested this form for accessibility using a range of browsers and technologies including screen readers. It meets the [Web Content Accessibility Guidelines version 2.2](https://www.w3.org/TR/WCAG22/) AA standard.\r\n\r\n## Feedback and contact information\r\n\r\nIf you have problems using this form or need additional support, contact:\r\n\r\n[insert your contact details for user requests here - add other channels, such as text phones or Relay UK, as required]\r\n\r\n- email: [<your@email.address>]\r\n- call: [your telephone number]\r\n- [Hours - e.g. Monday to Friday, 9am to 5pm]\r\n\r\nWe'll consider your request and get back to you in [add your SLA - e.g. a week or 5 working days].\r\n\r\n## Reporting accessibility problems with this form\r\n\r\nWe’re always looking to improve the accessibility of this form. If you find any problems or think we’re not meeting accessibility requirements, contact the MoJ Forms team at <contact-moj-forms@digital.justice.gov.uk>.\r\n\r\n## Enforcement procedure\r\n\r\nThe Equality and Human Rights Commission (EHRC) is responsible for enforcing the Public Sector Bodies (Websites and Mobile Applications) (No. 2) Accessibility Regulations 2018 (the ‘accessibility regulations’). If you’re not happy with how we respond to your complaint, contact the [Equality Advisory and Support Service (EASS)](https://www.equalityadvisoryservice.com).\r\n\r\n## Technical information about this online form’s accessibility\r\n\r\nWe are committed to making this form accessible, in accordance with the Public Sector Bodies (Websites and Mobile Applications) (No. 2) Accessibility Regulations 2018.\r\n\r\n### Compliance status\r\n\r\nThis website is fully compliant with the [Web Content Accessibility Guidelines version 2.2](https://www.w3.org/TR/WCAG22/) AA standard.\r\n\r\n## What we’re doing to improve accessibility\r\n\r\nWe review the content and performance of this form regularly. In addition, the MoJ Forms team monitors the accessibility of the MoJ Forms platform on an ongoing basis and fixes any accessibility issues reported to them.\r\n\r\n## Preparation of this accessibility statement\r\n\r\nThis statement was prepared on [date when it was first published]. It was last reviewed on [date when it was last reviewed. Delete this sentence if you are publishing a form for the first time].\r\n\r\nIn order to test the compliance of all forms built using the MoJ Forms tool, the Ministry of Justice commissioned User Vision to carry out a WCAG 2.1 AA level audit of a sample form. This included extensive automated and manual testing on a range of browsers and assistive technologies. The audit was performed on 24 July 2023. The audit highlighted a number of non-compliance issues which were fixed in August 2023. In addition, User Vision performed a spot check of WCAG 2.2 criteria on 7 November 2023.",
203
+ "_type": "page.standalone",
204
+ "_uuid": "b2a02f6f-7287-4d0a-973a-50af76e437e0",
205
+ "heading": "Accessibility statement",
206
+ "components": [
207
+
208
+ ]
209
+ }
210
+ ]
211
+ }
@@ -1,3 +1,3 @@
1
1
  module MetadataPresenter
2
- VERSION = '3.3.24'.freeze
2
+ VERSION = '3.3.26'.freeze
3
3
  end
@@ -15,6 +15,9 @@
15
15
  },
16
16
  {
17
17
  "$ref": "definition.width_class.input"
18
+ },
19
+ {
20
+ "$ref": "validations#/definitions/string_bundle"
18
21
  }
19
22
  ]
20
23
  }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metadata_presenter
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.3.24
4
+ version: 3.3.26
5
5
  platform: ruby
6
6
  authors:
7
7
  - MoJ Forms
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-03-11 00:00:00.000000000 Z
11
+ date: 2024-03-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: govuk_design_system_formbuilder
@@ -330,6 +330,7 @@ files:
330
330
  - app/assets/config/metadata_presenter_manifest.js
331
331
  - app/assets/stylesheets/metadata_presenter/application.css
332
332
  - app/controllers/metadata_presenter/answers_controller.rb
333
+ - app/controllers/metadata_presenter/auth_controller.rb
333
334
  - app/controllers/metadata_presenter/change_answer_controller.rb
334
335
  - app/controllers/metadata_presenter/concerns/save_and_return.rb
335
336
  - app/controllers/metadata_presenter/engine_controller.rb
@@ -345,6 +346,7 @@ files:
345
346
  - app/helpers/metadata_presenter/default_text.rb
346
347
  - app/jobs/metadata_presenter/application_job.rb
347
348
  - app/models/metadata_presenter/address_fieldset.rb
349
+ - app/models/metadata_presenter/auth_form.rb
348
350
  - app/models/metadata_presenter/autocomplete_item.rb
349
351
  - app/models/metadata_presenter/branch_destinations.rb
350
352
  - app/models/metadata_presenter/column_number.rb
@@ -407,6 +409,7 @@ files:
407
409
  - app/validators/metadata_presenter/minimum_validator.rb
408
410
  - app/validators/metadata_presenter/multiupload_validator.rb
409
411
  - app/validators/metadata_presenter/number_validator.rb
412
+ - app/validators/metadata_presenter/pattern_validator.rb
410
413
  - app/validators/metadata_presenter/postcode_validator.rb
411
414
  - app/validators/metadata_presenter/required_validator.rb
412
415
  - app/validators/metadata_presenter/validate_answers.rb
@@ -432,6 +435,7 @@ files:
432
435
  - app/views/metadata_presenter/attribute/_heading.html.erb
433
436
  - app/views/metadata_presenter/attribute/_lede.html.erb
434
437
  - app/views/metadata_presenter/attribute/_section_heading.html.erb
438
+ - app/views/metadata_presenter/auth/show.html.erb
435
439
  - app/views/metadata_presenter/component/_address.html.erb
436
440
  - app/views/metadata_presenter/component/_autocomplete.html.erb
437
441
  - app/views/metadata_presenter/component/_checkboxes.html.erb
@@ -529,6 +533,7 @@ files:
529
533
  - default_metadata/string/error.minimum.json
530
534
  - default_metadata/string/error.multiupload.json
531
535
  - default_metadata/string/error.number.json
536
+ - default_metadata/string/error.pattern.json
532
537
  - default_metadata/string/error.postcode.json
533
538
  - default_metadata/string/error.required.json
534
539
  - default_metadata/string/error.virus_scan.json
@@ -541,6 +546,7 @@ files:
541
546
  - default_metadata/validations/min_length.json
542
547
  - default_metadata/validations/min_word.json
543
548
  - default_metadata/validations/minimum.json
549
+ - default_metadata/validations/pattern.json
544
550
  - default_text/content.json
545
551
  - fixtures/branching.json
546
552
  - fixtures/branching_10.json
@@ -573,6 +579,7 @@ files:
573
579
  - fixtures/multiple_cya_confirmation.json
574
580
  - fixtures/no_component_page.json
575
581
  - fixtures/non_finished_service.json
582
+ - fixtures/regex.json
576
583
  - fixtures/service.json
577
584
  - fixtures/version.json
578
585
  - lib/metadata_presenter.rb