decidim-trusted_ids 0.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE-AGPLv3.txt +661 -0
  3. data/README.md +344 -0
  4. data/Rakefile +40 -0
  5. data/app/commands/concerns/decidim/trusted_ids/system/create_organization_override.rb +22 -0
  6. data/app/commands/concerns/decidim/trusted_ids/system/needs_census_config.rb +29 -0
  7. data/app/commands/concerns/decidim/trusted_ids/system/update_organization_override.rb +21 -0
  8. data/app/controllers/concerns/decidim/trusted_ids/admin/impersonations_controller_override.rb +31 -0
  9. data/app/controllers/concerns/decidim/trusted_ids/check_existing_authorizations.rb +40 -0
  10. data/app/controllers/concerns/decidim/trusted_ids/check_omniauth_email_on_login.rb +25 -0
  11. data/app/controllers/concerns/decidim/trusted_ids/needs_trusted_ids_snippets.rb +26 -0
  12. data/app/events/decidim/trusted_ids/verifications/invalid_notification.rb +10 -0
  13. data/app/events/decidim/trusted_ids/verifications/success_notification.rb +33 -0
  14. data/app/forms/concerns/decidim/trusted_ids/system/organization_form_override.rb +93 -0
  15. data/app/forms/decidim/trusted_ids/verifications/trusted_ids_handler.rb +65 -0
  16. data/app/forms/decidim/via_oberta/verifications/via_oberta_handler.rb +103 -0
  17. data/app/jobs/decidim/trusted_ids/application_job.rb +8 -0
  18. data/app/jobs/decidim/trusted_ids/omniauth_verification_job.rb +76 -0
  19. data/app/jobs/decidim/trusted_ids/system/propagate_census_config_job.rb +29 -0
  20. data/app/jobs/decidim/trusted_ids/system/propagate_census_settings_job.rb +29 -0
  21. data/app/models/concerns/decidim/trusted_ids/authorization_override.rb +21 -0
  22. data/app/models/concerns/decidim/trusted_ids/organization_override.rb +17 -0
  23. data/app/models/decidim/trusted_ids/organization_config.rb +20 -0
  24. data/app/overrides/decidim/devise/sessions/new/add_trusted_id_buttons.html.erb.deface +3 -0
  25. data/app/overrides/decidim/devise/sessions/new/wrap_default_login_form.html.erb.deface +4 -0
  26. data/app/overrides/decidim/devise/shared/_omniauth_buttons/replace_button_content.html.erb.deface +17 -0
  27. data/app/overrides/decidim/devise/shared/_omniauth_buttons/skip_trusted_ids_provider.html.erb.deface +3 -0
  28. data/app/overrides/decidim/system/organizations/_advanced_settings/settings_form.html.erb.deface +3 -0
  29. data/app/overrides/decidim/system/organizations/_omniauth_provider/add_icon_placeholder.html.erb.deface +3 -0
  30. data/app/overrides/layouts/decidim/_head/add_trusted_ids_tags.html.erb.deface +11 -0
  31. data/app/packs/entrypoints/decidim_trusted_ids.js +3 -0
  32. data/app/packs/images/idcat_mobil-icon.svg +8 -0
  33. data/app/packs/images/valid-icon.png +0 -0
  34. data/app/packs/stylesheets/decidim/trusted_ids/oauth_icons.scss +75 -0
  35. data/app/services/decidim/via_oberta/api/request.rb +156 -0
  36. data/app/services/decidim/via_oberta/api/response.rb +67 -0
  37. data/app/views/decidim/trusted_ids/devise/sessions/_login_box.html.erb +30 -0
  38. data/app/views/decidim/trusted_ids/system/organizations/_icon_path_placeholder.html.erb +10 -0
  39. data/app/views/decidim/trusted_ids/system/organizations/_settings_form.html.erb +25 -0
  40. data/app/views/decidim/trusted_ids/verifications/_form.html.erb +39 -0
  41. data/app/views/decidim/via_oberta/verifications/_form.html.erb +56 -0
  42. data/config/assets.rb +16 -0
  43. data/config/i18n-tasks.yml +12 -0
  44. data/config/locales/ca.yml +132 -0
  45. data/config/locales/de.yml +168 -0
  46. data/config/locales/en.yml +169 -0
  47. data/config/locales/es.yml +132 -0
  48. data/config/locales/fr.yml +168 -0
  49. data/config/locales/it.yml +168 -0
  50. data/config/locales/oc.yml +132 -0
  51. data/config/locales/zz_fallbacks.rb +45 -0
  52. data/db/migrate/20230718082548_create_organization_trusted_ids_config.rb +14 -0
  53. data/lib/decidim/trusted_ids/engine.rb +181 -0
  54. data/lib/decidim/trusted_ids/test/factories.rb +21 -0
  55. data/lib/decidim/trusted_ids/verifications.rb +10 -0
  56. data/lib/decidim/trusted_ids/version.rb +10 -0
  57. data/lib/decidim/trusted_ids.rb +69 -0
  58. data/lib/omniauth/strategies/valid.rb +134 -0
  59. data/lib/omniauth/strategies.rb +7 -0
  60. data/lib/tasks/decidim_trusted_ids_upgrade_tasks.rake +5 -0
  61. data/package-lock.json +29154 -0
  62. data/package.json +43 -0
  63. metadata +200 -0
@@ -0,0 +1,156 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Decidim
4
+ module ViaOberta
5
+ module Api
6
+ DOCUMENT_TYPE = {
7
+ nif: 1,
8
+ passport: 2,
9
+ residence_card: 3,
10
+ nie: 4
11
+ }.freeze
12
+
13
+ class Request
14
+ def initialize(document_id:, document_type:, organization:)
15
+ @document_id = document_id
16
+ @document_type = document_type
17
+ @organization = organization
18
+ @env = TrustedIds.census_authorization[:env]
19
+ @api_url = TrustedIds.census_authorization[:api_url]
20
+ end
21
+
22
+ attr_accessor :env, :api_url, :document_id, :document_type, :organization
23
+
24
+ def response
25
+ return @response if defined?(@response)
26
+
27
+ begin
28
+ response ||= Faraday.post(url) do |request|
29
+ request.headers["Content-Type"] = "text/xml;charset=UTF-8"
30
+ request.headers["SOAPAction"] = "procesa"
31
+ request.body = request_body
32
+ end
33
+ rescue Faraday::Error => e
34
+ Rails.logger.error "WEBSERVICE CONNECTION ERROR: #{e.message}"
35
+ raise e
36
+ end
37
+ @response ||= Response.new(response)
38
+ end
39
+
40
+ def url
41
+ @url ||= if @api_url.present?
42
+ @api_url
43
+ elsif @env == "production"
44
+ "https://serveis3.iop.aoc.cat/siri-proxy/services/Sincron?wsdl"
45
+ else
46
+ "https://serveis3-pre.iop.aoc.cat/siri-proxy/services/Sincron?wsdl"
47
+ end
48
+ end
49
+
50
+ def purpose
51
+ @purpose ||= ENV.fetch("VIA_OBERTA_PURPOSE", nil)
52
+ end
53
+
54
+ def organization_name
55
+ @organization_name ||= organization.trusted_ids_census_config&.settings&.dig("organization_name") || organization.name
56
+ end
57
+
58
+ def ine
59
+ @ine ||= organization.trusted_ids_census_config&.settings&.dig("ine")
60
+ end
61
+
62
+ def nif
63
+ @nif ||= organization.trusted_ids_census_config&.settings&.dig("nif")
64
+ end
65
+
66
+ def province_code
67
+ @province_code ||= organization.trusted_ids_census_config&.settings&.dig("province_code")
68
+ end
69
+
70
+ def municipal_code
71
+ @municipal_code ||= organization.trusted_ids_census_config&.settings&.dig("municipal_code")
72
+ end
73
+
74
+ def time_stamp
75
+ @time_stamp ||= Time.current.strftime("%Y-%m-%dT%H:%M:%S")
76
+ end
77
+
78
+ def request_id
79
+ @request_id ||= SecureRandom.uuid
80
+ end
81
+
82
+ def document_type_id
83
+ @document_type_id ||= DOCUMENT_TYPE[document_type] || 3
84
+ end
85
+
86
+ def request_body
87
+ @request_body ||= <<~XML
88
+ <?xml version="1.0" encoding="UTF-8"?>
89
+ <soapenv:Envelope
90
+ xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
91
+ xmlns:open="http://www.openuri.org/"
92
+ xmlns:pet="http://gencat.net/scsp/esquemes/peticion">
93
+ <soapenv:Header/>
94
+ <soapenv:Body>
95
+ <open:procesa>
96
+ <ns1:Peticion xmlns:ns1="http://gencat.net/scsp/esquemes/peticion">
97
+ <ns1:Atributos>
98
+ <ns1:IdPeticion>#{request_id}</ns1:IdPeticion>
99
+ <ns1:NumElementos>1</ns1:NumElementos>
100
+ <ns1:TimeStamp>#{time_stamp}</ns1:TimeStamp>
101
+ <ns1:Estado/>
102
+ <ns1:CodigoCertificado>RESIDENT_MUNICIPI</ns1:CodigoCertificado>
103
+ <ns1:CodigoProducto>PADRO</ns1:CodigoProducto>
104
+ <ns1:DatosAutorizacion>
105
+ <ns1:IdentificadorSolicitante>#{ine}</ns1:IdentificadorSolicitante>
106
+ <ns1:NombreSolicitante>#{organization_name}</ns1:NombreSolicitante>
107
+ <ns1:Finalidad>#{purpose}</ns1:Finalidad>
108
+ </ns1:DatosAutorizacion>
109
+ <ns1:Emisor>
110
+ <ns1:NifEmisor>#{nif}</ns1:NifEmisor>
111
+ <ns1:NombreEmisor>#{organization_name}</ns1:NombreEmisor>
112
+ </ns1:Emisor>
113
+ <ns1:IdSolicitanteOriginal>MAP</ns1:IdSolicitanteOriginal>
114
+ <ns1:NomSolicitanteOriginal>MAP</ns1:NomSolicitanteOriginal>
115
+ </ns1:Atributos>
116
+ <ns1:Solicitudes>
117
+ <ns1:SolicitudTransmision>
118
+ <ns1:DatosGenericos>
119
+ <ns1:Emisor>
120
+ <ns1:NifEmisor>#{nif}</ns1:NifEmisor>
121
+ <ns1:NombreEmisor>#{organization_name}</ns1:NombreEmisor>
122
+ </ns1:Emisor>
123
+ <ns1:Solicitante>
124
+ <ns1:IdentificadorSolicitante>#{ine}</ns1:IdentificadorSolicitante>
125
+ <ns1:NombreSolicitante>#{organization_name}</ns1:NombreSolicitante>
126
+ <ns1:Finalidad>#{purpose}</ns1:Finalidad>
127
+ <ns1:Consentimiento>Si</ns1:Consentimiento>
128
+ </ns1:Solicitante>
129
+ <ns1:Transmision>
130
+ <ns1:CodigoCertificado>RESIDENT_MUNICIPI</ns1:CodigoCertificado>
131
+ <ns1:IdSolicitud>#{request_id}</ns1:IdSolicitud>
132
+ <ns1:FechaGeneracion>#{time_stamp[0..9]}</ns1:FechaGeneracion>
133
+ </ns1:Transmision>
134
+ </ns1:DatosGenericos>
135
+ <ns1:DatosEspecificos>
136
+ <ns2:peticionResidenteMunicipio xmlns:ns2="http://www.aocat.net/padro">
137
+ <ns2:numExpediente>#{request_id}</ns2:numExpediente>
138
+ <ns2:tipoDocumentacion>#{document_type_id}</ns2:tipoDocumentacion>
139
+ <ns2:documentacion>#{document_id}</ns2:documentacion>
140
+ <ns2:codigoMunicipio>#{municipal_code}</ns2:codigoMunicipio>
141
+ <ns2:codigoProvincia>#{province_code}</ns2:codigoProvincia>
142
+ <ns2:idescat>0</ns2:idescat>
143
+ </ns2:peticionResidenteMunicipio>
144
+ </ns1:DatosEspecificos>
145
+ </ns1:SolicitudTransmision>
146
+ </ns1:Solicitudes>
147
+ </ns1:Peticion>
148
+ </open:procesa>
149
+ </soapenv:Body>
150
+ </soapenv:Envelope>
151
+ XML
152
+ end
153
+ end
154
+ end
155
+ end
156
+ end
@@ -0,0 +1,67 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Decidim
4
+ module ViaOberta
5
+ module Api
6
+ class Response
7
+ RESULT_CODES = {
8
+ "1" => "CONSTA",
9
+ "2" => "NO CONSTA",
10
+ "3" => "ERROR",
11
+ "4" => "MUNICIPI NO ADHERIT"
12
+ }.freeze
13
+ def initialize(response)
14
+ @response = response
15
+ end
16
+
17
+ attr_reader :response
18
+
19
+ def body
20
+ @body ||= Nokogiri::XML(response.body).remove_namespaces!
21
+ end
22
+
23
+ def raw_body
24
+ @raw_body ||= response.body
25
+ end
26
+
27
+ def slim_body
28
+ @slim_body ||= body.search("Body").children
29
+ end
30
+
31
+ def code
32
+ @code ||= slim_body.xpath("//CodigoEstado").text.presence || slim_body.xpath("//faultcode").text.presence || response.status
33
+ end
34
+
35
+ def error
36
+ @error ||= if success?
37
+ result_code_string
38
+ else
39
+ slim_body.xpath("//LiteralError").text.presence || slim_body.xpath("//faultstring").text.presence || body.xpath("//title").text
40
+ end
41
+ end
42
+
43
+ # if no problems during the request
44
+ def success?
45
+ slim_body.xpath("//LiteralError").text == "OK"
46
+ end
47
+
48
+ # if the user is in the census
49
+ def found?
50
+ result_code == RESULT_CODES.key("CONSTA")
51
+ end
52
+
53
+ def resident_data
54
+ @resident_data ||= slim_body.xpath("//respuestaResidenteMunicipio")
55
+ end
56
+
57
+ def result_code
58
+ @result_code ||= resident_data.xpath("//codigoResultado").text
59
+ end
60
+
61
+ def result_code_string
62
+ @result_code_string ||= RESULT_CODES[result_code]
63
+ end
64
+ end
65
+ end
66
+ end
67
+ end
@@ -0,0 +1,30 @@
1
+ <%
2
+ provider = Decidim::TrustedIds.omniauth_provider&.to_sym
3
+ provider_str = t("decidim.authorization_handlers.trusted_ids_handler.name")
4
+ icon_path = current_organization.enabled_omniauth_providers[provider]&.dig(:icon_path)
5
+ override_login = Decidim::TrustedIds.custom_login_screen? && Devise.mappings[:user].omniauthable? && current_organization.enabled_omniauth_providers&.include?(provider)
6
+ %>
7
+
8
+ <% if override_login %>
9
+ <div class="login__info trusted-ids-login-box">
10
+ <h2 class="h2"><%= t("decidim.trusted_ids.devise.sessions.new.login") %></h2>
11
+ <p><%= t("decidim.trusted_ids.devise.sessions.new.login_subtitle") %></p>
12
+ <h6><%= t("decidim.trusted_ids.devise.sessions.new.verified_identity", provider: provider_str) %></h6>
13
+ <%= t("decidim.trusted_ids.devise.sessions.new.verified_identity_html") %>
14
+ <p><%= link_to decidim.send("user_#{provider}_omniauth_authorize_path"), class: "button button--social button--#{normalize_provider_name(provider)}", method: :post do %>
15
+ <span class="button--social__icon">
16
+ <%= external_icon icon_path.presence || Decidim::TrustedIds.omniauth[:icon_path] %>
17
+ </span>
18
+ <span class="button--social__text">
19
+ <%= t("decidim.trusted_ids.devise.sessions.new.verified_login") %>
20
+ </span>
21
+ <% end %></p>
22
+ <hr>
23
+ <p><%= link_to t("decidim.trusted_ids.devise.sessions.new.unverified_login"), "#", class: "button button__lg button__transparent-secondary w-full button--unverified-login", onclick: "document.querySelectorAll('.decidim-login').forEach((el) => el.classList.toggle('hide'));return false" %></p>
24
+ </div>
25
+ <div class="decidim-login hide">
26
+ <%= render partial: "decidim/devise/shared/omniauth_buttons", locals: { is_horizontal: true } %>
27
+ </div>
28
+ <% else %>
29
+ <%= render partial: "decidim/devise/shared/omniauth_buttons", locals: { is_horizontal: true } %>
30
+ <% end %>
@@ -0,0 +1,10 @@
1
+ <%
2
+ placeholder = if provider.to_s == Decidim::TrustedIds.omniauth_provider.to_s && setting.to_s == "icon_path"
3
+ Decidim::TrustedIds.omniauth[:icon_path].presence ||
4
+ "media/images/#{Decidim::TrustedIds.omniauth_provider.downcase}-icon.png"
5
+ end
6
+ %>
7
+ <%= f.text_field("omniauth_settings_#{provider}_#{setting}", label: I18n.t(
8
+ ".#{setting}",
9
+ scope: [:icon, :icon_path].include?(setting) ? i18n_scope : "#{i18n_scope}.#{provider}"
10
+ ), placeholder: placeholder) %>
@@ -0,0 +1,25 @@
1
+ <% if Decidim::TrustedIds.census_config_attributes.present? %>
2
+ <div class="border-2 rounded border-background p-4 form__wrapper mt-8 first:mt-0 last:pb-4">
3
+ <h3 class="h4"><%= t("decidim.trusted_ids.system.settings", handler: t("decidim.authorization_handlers.trusted_ids_census_handler.name")) %></h3>
4
+
5
+ <%= f.fields_for :trusted_ids_census_settings do |fields| %>
6
+ <% Decidim::TrustedIds.census_config_attributes.each do |setting, _type| %>
7
+ <%= fields.text_field setting.to_sym, value: f.object.trusted_ids_census_settings[setting&.to_s], label: t("activemodel.attributes.trusted_ids_census_config.settings.#{setting}") %>
8
+ <% end %>
9
+ <% end %>
10
+ <div class="field">
11
+ <%= f.number_field :trusted_ids_census_expiration_days, label: t("activemodel.attributes.trusted_ids_census_config.settings.expiration_days", days: @form.default_expiration_days), placeholder: @form.default_expiration_days.to_s %>
12
+ <%= f.check_box :census_expiration_apply_all_tenants, label: t("activemodel.attributes.trusted_ids_census_config.census_expiration_apply_all_tenants") %>
13
+ </div>
14
+ <div class="field">
15
+ <%= f.translated :editor, :trusted_ids_census_tos, label: t("activemodel.attributes.trusted_ids_census_config.settings.tos") %>
16
+ <div style="background:#f0f0f0;padding:1em;font-size: 0.8em;">
17
+ <h6><%= t("activemodel.attributes.trusted_ids_census_config.tos_if_empty_html") %></h6>
18
+ <%= t("decidim.via_oberta.verifications.tos.content_html") %>
19
+ </div>
20
+ <%= f.check_box :census_tos_apply_all_tenants, label: t("activemodel.attributes.trusted_ids_census_config.census_tos_apply_all_tenants") %>
21
+ </div>
22
+ </div>
23
+ <% end %>
24
+
25
+ <%= render partial: "layouts/decidim/admin/js_configuration" %>
@@ -0,0 +1,39 @@
1
+ <%
2
+ provider = Decidim::TrustedIds.omniauth_provider&.to_sym
3
+ provider_str = t("decidim.authorization_handlers.trusted_ids_handler.name")
4
+ %>
5
+ <% if Devise.mappings[:user].omniauthable? && current_organization.enabled_omniauth_providers.dig(provider, :enabled) %>
6
+
7
+ <h5><%= t("decidim.authorization_handlers.trusted_ids_handler.explanation") %></h5>
8
+
9
+ <p><%= t(".description_html", provider: provider_str, link: t("devise.shared.links.log_in_with_provider", provider: provider_str)) %></p>
10
+ <div class="callout secondary"><%= t(".warning_html", email: current_user.email, provider: provider_str) %></div>
11
+
12
+ <div class="social-register">
13
+ <%= link_to decidim.send("user_#{provider}_omniauth_authorize_path"), class: "w-full button button--social button--#{normalize_provider_name(provider)}", method: :post do %>
14
+ <span class="button--social__icon">
15
+ <%= oauth_icon provider %>
16
+ </span>
17
+ <span class="button--social__text">
18
+ <%= t("devise.shared.links.log_in_with_provider", provider: provider_str) %>
19
+ </span>
20
+ <% end %>
21
+ </div>
22
+ <% else %>
23
+ <p><%= t(".error_provider_html", provider: provider_str) %></p>
24
+ <% end %>
25
+
26
+ <div class="cancel">
27
+ <%= form.submit t(".cancel"), class: "button button__lg button__transparent-secondary w-full" %>
28
+ </div>
29
+
30
+ <style>
31
+ .social-register,.cancel {
32
+ margin: 2em 0;
33
+ padding: 0;
34
+ }
35
+ /* Send and Back buttons are hidden as this page is only informative */
36
+ #new_authorization_handler .form__wrapper-block {
37
+ display: none;
38
+ }
39
+ </style>
@@ -0,0 +1,56 @@
1
+ <div class="row column">
2
+ <% if handler.response_error %>
3
+ <div class="callout alert">
4
+ <h5><%= t ".error" %></h5>
5
+ <p><%= handler.response_error %><br><%= t ".code", code: handler.response_code %></p>
6
+ </div>
7
+ <% end %>
8
+ <%= t ".description_html", organization_name: current_organization.trusted_ids_census_config&.settings&.dig("organization_name") || current_organization.name %>
9
+ </div>
10
+ <h4><%= t ".data" %></h4>
11
+
12
+ <dl>
13
+ <dt><%= t ".document_id" %>:</dt>
14
+ <dd><% if controller_name == "impersonations" %>
15
+ <%= form.text_field :document_id %>
16
+ <% else %>
17
+ <%= handler.document_id %>
18
+ <% end %></dd>
19
+ <dt><%= t ".document_type" %>:</dt>
20
+ <dd>
21
+ <% if handler.document_type_from_metadata.present? %>
22
+ <%= handler.document_type_string %>
23
+ <% else %>
24
+ <%= form.select :document_type, handler.document_types, include_blank: true %>
25
+ <% end %>
26
+ </dd>
27
+ </dl>
28
+
29
+ <div class="card" id="card__tos">
30
+ <div class="card__content">
31
+ <fieldset>
32
+ <legend><%= t "title", scope: "decidim.via_oberta.verifications.tos" %></legend>
33
+ <p class="tos-text"><%= current_organization.trusted_ids_census_config&.translated_tos&.html_safe || I18n.t("content_html", scope: "decidim.via_oberta.verifications.tos").html_safe %></p>
34
+ </fieldset>
35
+
36
+ <div class="field">
37
+ <% label = t "agreement", scope: "decidim.via_oberta.verifications.tos" %>
38
+ <%= form.check_box :tos_agreement, label: label %>
39
+ </div>
40
+ </div>
41
+ </div>
42
+
43
+ <%= form.hidden_field :handler_name %>
44
+
45
+ <style>
46
+ legend {
47
+ font-weight: 600;
48
+ }
49
+ dl {
50
+ margin: 1rem;
51
+ }
52
+ dl dd {
53
+ margin-left: 1rem;
54
+ margin-bottom: .5rem;
55
+ }
56
+ </style>
data/config/assets.rb ADDED
@@ -0,0 +1,16 @@
1
+ # frozen_string_literal: true
2
+
3
+ # This file is located at `config/assets.rb` of your module.
4
+
5
+ base_path = File.expand_path("..", __dir__)
6
+
7
+ # Register the additional path for Shakapacker in order to make the module's
8
+ # stylesheets available for inclusion.
9
+ Decidim::Shakapacker.register_path("#{base_path}/app/packs")
10
+
11
+ # Register the main application's stylesheet include statement:
12
+ # Decidim::Shakapacker.register_stylesheet_import("stylesheets/decidim/your_component/your_component")
13
+ # Register the admin panel's stylesheet include statement:
14
+
15
+ # Register JS entrypoints
16
+ Decidim::Shakapacker.register_entrypoints(decidim_trusted_ids: "#{base_path}/app/packs/entrypoints/decidim_trusted_ids.js")
@@ -0,0 +1,12 @@
1
+ ---
2
+
3
+ base_locale: en
4
+ locales: [en]
5
+
6
+ data:
7
+ external:
8
+ - "<%= %x[bundle info decidim-core --path].chomp %>/config/locales/%{locale}.yml"
9
+ - "<%= %x[bundle info decidim-verifications --path].chomp %>/config/locales/%{locale}.yml"
10
+
11
+ ignore_missing:
12
+ - decidim.authorization_handlers.trusted_ids_census_handler.*
@@ -0,0 +1,132 @@
1
+ ---
2
+ ca:
3
+ activemodel:
4
+ errors:
5
+ messages:
6
+ invalid_icon_path_format: ha de tenir el format media/images/filename
7
+ icon_path_not_found: el fitxer de la icona no existeix a les rutes d'assets registrades
8
+ attributes:
9
+ trusted_ids_census_config:
10
+ census_expiration_apply_all_tenants: 'Aplica a tots els "tenants" (això estableix els mateixos dies de caducitat per a totes les organitzacions d''aquesta plataforma). Avís: els valors buits també es propaguen'
11
+ census_tos_apply_all_tenants: 'Aplica a tots els "tenants" (això estableix els mateixos "Termes d''ús i condicions" per a totes les organitzacions d''aquesta plataforma). Avís: els valors buits també es propaguen'
12
+ settings:
13
+ expiration_days: Expira en (dies). Si és buit, els dies per defecte són %{days}.
14
+ ine: Identificador del sol·licitant (INE)
15
+ municipal_code: Codi municipal
16
+ nif: NIF
17
+ organization_name: Nom públic de l'organització
18
+ province_code: Codi de província
19
+ tos: Termes d'ús i servei per consultar el cens
20
+ tos_if_empty_html: 'Si està buit, les condicions del servei predeterminades s''extreuran de la clau I18n <code>decidim.via_oberta.verifications.tos.content_html</code>. Actualment:'
21
+ via_oberta_handler:
22
+ document_type: 'No s''ha pogut obtenir automàticament. Seleccioneu-ne un de la llista:'
23
+ decidim:
24
+ authorization_handlers:
25
+ trusted_ids_handler:
26
+ explanation: Aquesta autorització s'atorga a tots els usuaris que utilitzen un mètode d'inici de sessió amb identificador fefaent.
27
+ fields:
28
+ extra: Informació addicional
29
+ provider: Proveïdor
30
+ uid: ID
31
+ name: Identificador fefaent
32
+ via_oberta_handler:
33
+ explanation: Aquesta autorització s'atorga a tots els usuaris que es troben a la base de dades del cens de Via Oberta.
34
+ fields:
35
+ document_id: DNI/NIF
36
+ name: Via Oberta
37
+ events:
38
+ trusted_ids:
39
+ verifications:
40
+ invalid:
41
+ email_intro: No ha estat possible concedir-vos l'autorització "%{handler_name}".
42
+ email_outro: Si us plau, poseu-vos en contacte amb el suport de la plataforma per comprovar l'error que s'ha produït.
43
+ email_subject: Error d'autorització
44
+ notification_title: Autorització no vàlida amb el mètode "%{handler_name}"
45
+ ok:
46
+ email_intro: Se't ha concedit l'autorització "%{handler_name}".
47
+ email_outro: Ara podeu realitzar totes les accions que requereixin l'autorització "%{handler_name}".
48
+ email_subject: S'ha autoritzat correctament
49
+ notification_title: Autorització correcta amb el mètode "%{handler_name}"
50
+ system:
51
+ organizations:
52
+ omniauth_settings:
53
+ valid:
54
+ client_id: Client ID
55
+ client_secret: Clau secreta del Client
56
+ icon_path: Ruta de la icona. Si és buit, agafarà la icona per defecte.
57
+ scope: Àmbit
58
+ site: URL del proveïdor
59
+ trusted_ids:
60
+ devise:
61
+ sessions:
62
+ new:
63
+ login: Inicia la sessió
64
+ login_subtitle: Inicia sessió a Decidim i participa.
65
+ unverified_login: Altres mètodes d'identificació no verificada
66
+ verified_identity: Identificació digital verificada amb %{provider}
67
+ verified_identity_html: |
68
+ <p>Accedeix amb sistemes reconeguts per proveïdors oficials que acrediten la teva identitat a la xarxa, per autenticacions més segures.</p>
69
+ <ul>
70
+ <li>idCat Mòbil</li>
71
+ <li>idCat Certificat</li>
72
+ <li>DNIe</li>
73
+ <li>Cl@ve PIN</li>
74
+ </ul>
75
+ verified_login: Continuar amb identificació verificada
76
+ providers:
77
+ default:
78
+ description: Aquesta autorització s'atorga a tots els usuaris que utilitzen un mètode d'inici de sessió amb identificador fefaent.
79
+ name: Identificador fefaent
80
+ valid:
81
+ description: El VÀLid és un servei que l’AOC posa a disposició de les administracions públiques catalanes amb la finalitat d’integrar els diferents mecanismes d’identificació digital disponibles (idCAT Mòbil, certificats digitals i Cl@ve).
82
+ name: VÀLid
83
+ sessions:
84
+ different_omniauth_emails: Esteu provant d'iniciar la sessió amb un correu electrònic diferent del vostre compte. Accediu amb el mateix correu electrònic o tanqueu la sessió i registreu-vos amb el botó directe per crear un usuari nou.
85
+ system:
86
+ settings: "%{handler} configuració"
87
+ verifications:
88
+ form:
89
+ cancel: Cancel·la la verificació
90
+ description_html: Per obtenir aquesta autorització, heu de verificar la vostra identitat amb el servei %{provider}. Per fer-ho, feu clic al botó "%{link}".<br><br>
91
+ error_provider_html: "<b>%{provider} no està disponible.</b> Sembla que aquest mètode d'inici de sessió/autorització no s'ha activat. Poseu-vos en contacte amb el suport de la plataforma per solucionar-ho."
92
+ warning_html: Assegureu-vos que el correu electrònic que teniu en aquesta aplicació (<em>%{email}</em>) sigui el mateix que el que us proporciona el servei %{provider}. En cas contrari, la verificació fallarà.
93
+ verifications:
94
+ authorizations:
95
+ errors:
96
+ already_verified: Ja heu verificat la vostra identitat amb aquest mètode.
97
+ pending_authorization: Aquest mètode d'autorització requereix tenir prèviament l'autorització %{handler_name}.
98
+ first_login:
99
+ actions:
100
+ trusted_ids_generic: Verifica't amb %{provider}
101
+ via_oberta_handler: Verifica't amb Via Oberta
102
+ trusted_ids:
103
+ errors:
104
+ invalid_census: No s'ha pogut verificar. És possible que les dades proporcionades a la passarel·la del cens no siguin vàlides.
105
+ invalid_id: No s'ha pogut verificar. L'identificador del document no és vàlid o no es troba en el cens.
106
+ invalid_method: No us heu pogut verificar. El mètode de verificació OAuth2 no està suportat.
107
+ invalid_status: No us heu pogut verificar. La verificació OAuth2 ha estat incorrecta.
108
+ invalid_type: No s'ha pogut verificar. El tipus de document no és vàlid o no està en el cens.
109
+ no_identity: No s'ha pogut verificar. La verificació OAuth2 no ha retornat cap identificació.
110
+ via_oberta:
111
+ verifications:
112
+ document_type:
113
+ nie: NIE
114
+ nif: NIF
115
+ others: Permís de residència o altres
116
+ passport: Passaport
117
+ form:
118
+ code: 'Codi d''error: %{code}'
119
+ data: 'Dades que s''enviaran:'
120
+ description_html: <p>Aquesta autorització comprova si sou a la base de dades del cens <b>%{organization_name}</b>.</p> <p>Per dur a terme aquesta comprovació, s'enviarà la informació següent al <a href="https://www.aoc.cat/serveis-aoc/via-oberta/" target="_blank">Servei Via Oberta</a>, ofert per l'<a href="https://www.aoc.cat" target="_blank">Administració Oberta de Catalunya</a></p> <p>Aquesta informació s'utilitzarà amb l'únic propòsit de verificar la vostra identitat, però els registres d'aquesta transacció poden ser conservats pel proveïdor de serveis.</p>
121
+ document_id: Número de document
122
+ document_type: Tipus de document
123
+ error: 'Missatge d''error del servei:'
124
+ tos:
125
+ agreement: Accepto els termes d'ús i condicions del servei
126
+ content_html: |
127
+ <p>Per a poder verificar que consta com a persona empadronada al municipi, s'ha de fer una consulta automatitzada mitjançant Via Oberta a les dades locals del padró municipal d'habitants.</p>
128
+ <ol>
129
+ <li>Pots consultar la política concreta de tractament/protecció de dades en el <a href="https://www.aoc.cat/proteccio-dades/">següent enllaç</a></li>
130
+ <li>Presteu el vostre consentiment?</li>
131
+ </ol>
132
+ title: Termes d'ús i servei Via Oberta