decidim-file_authorization_handler 0.31.6.1 → 0.31.6.3

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 94f5b784d3c2b3056f62b7675f565cf9c697eb6cee0e48a5ddb67de43a44317b
4
- data.tar.gz: c622e0561eabfe6267258c4cf31131c35cc8171274fbcf2f28cb4105ada2ff5a
3
+ metadata.gz: 2fde3cf7231be2ff3ac85ab43795028461a08c2bcde9697fb1ba924df92f252e
4
+ data.tar.gz: e6000774d125dddd928869d21c2f038510fe450c966274d7f7285caa379a4620
5
5
  SHA512:
6
- metadata.gz: 12b90762a42d545049b9bb34d53a04f6d3849e7896da9fd45e09578b2e3b30b18d140855a0bf1fe48f4e221f7a46480aacbcbc10bbef92fc6a5ff0ecef829a4f
7
- data.tar.gz: 3455c7254cb35b833cd8c92373decd9563ac7713fe806927cbf1932fe06d44e9940e1ea81161012c2fae425fcb9fc1ae8bc09b90c20de3be2238df3a12cd71b1
6
+ metadata.gz: 4f0a1aaf9e9066104e7d11960c19896e3dbee1a7c908bc50343c52930c2fa524c6e90149126d952b486e309d50a0191bdb1cff17ab7065c1e7f0b091d7d17653
7
+ data.tar.gz: ef1a7e004a53d7464aef6e0d82f27db2406bcfceffaa6170190ba4526fa2381943f19e5ccbea1d6bff43b313fd90a7fb493cd747bcf3befe6786619fad561793
data/README.md CHANGED
@@ -17,10 +17,20 @@ It has an admin controller to upload CSV files with the information. When
17
17
  importing files all records are inserted and the duplicates are removed in a
18
18
  background job for performance reasons.
19
19
 
20
- To keep the plugin simple the uploaded file is processed when the file is
21
- uploaded.
22
- Uploading the file to a temporary storage system and processing it in
23
- background is kept out of the scope for the first release.
20
+ To keep the plugin simple the uploaded file is processed when the file is uploaded.
21
+ Uploading the file to a temporary storage system and processing it in background is kept out of the scope for the first release.
22
+
23
+ ### Ephemeral authorization handler
24
+
25
+ The optional ephemeral authorization workflow can be enabled by setting the
26
+ `ENABLE_EPHEMERAL_FILE_AUTHORIZATION_HANDLER` environment variable to `true`:
27
+
28
+ ```bash
29
+ ENABLE_EPHEMERAL_FILE_AUTHORIZATION_HANDLER=true
30
+ ```
31
+
32
+ The regular `file_authorization_handler` workflow is always available.
33
+ When `ENABLE_EPHEMERAL_FILE_AUTHORIZATION_HANDLER=true`, the `ephemeral_file_authorization_handler` workflow is also registered. Ephemeral authorizations expire after one hour and can be renewed every five minutes. The option is disabled by default.
24
34
 
25
35
  ### CSV file format
26
36
 
@@ -96,12 +106,6 @@ bin/rails decidim_file_authorization_handler:install:migrations
96
106
  bin/rails db:migrate
97
107
  ```
98
108
 
99
- Finally, add the following line to your `config/routes.rb` file:
100
-
101
- ```ruby
102
- mount Decidim::FileAuthorizationHandler::AdminEngine => '/admin'
103
- ```
104
-
105
109
  ## Create development_app
106
110
  Run:
107
111
  ```bash
@@ -112,8 +116,6 @@ bin/rails db:migrate
112
116
 
113
117
  ## Run tests
114
118
 
115
- Node 16.9.1 is required!
116
-
117
119
  Create a dummy app in your application (if not present):
118
120
 
119
121
  ```bash
@@ -138,7 +140,7 @@ undefined method 'decidim_file_authorization_handler_admin_path'
138
140
  for module#<Module:0x00007fa2aa4e2a10>
139
141
  ```
140
142
 
141
- review if you have mounted the Engine routes into your application routes.
143
+ review if you have mounted the Engine routes into your application routes, cause is not longer necessary.
142
144
 
143
145
  ## License
144
146
 
@@ -8,7 +8,7 @@ module Decidim
8
8
  def perform(organization)
9
9
  duplicated_census(organization).pluck(:id_document).each do |id_document|
10
10
  CensusDatum.inside(organization)
11
- .where(id_document: id_document)
11
+ .where(id_document:)
12
12
  .order(id: :desc)
13
13
  .all[1..]
14
14
  .each(&:delete)
@@ -27,7 +27,7 @@ module Decidim
27
27
  return "" if id_document.blank?
28
28
 
29
29
  Digest::SHA256.hexdigest(
30
- "#{id_document}-#{ENV.fetch("SECRET_KEY_BASE", nil)}"
30
+ "#{id_document}-#{Rails.application.secret_key_base}"
31
31
  )
32
32
  end
33
33
 
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ # A subclass of FileAuthorizationHandler for ephemeral verification workflows.
4
+ # It excludes tos_agreement from form_attributes because the verifications view
5
+ # already renders it as a proper checkbox via the _tos_acceptance_field partial.
6
+ #
7
+ # The class name matches the workflow registration name (:ephemeral_file_authorization_handler)
8
+ # so that handler_name is consistent across the hidden field, the authorization record,
9
+ # and the permission check.
10
+ class EphemeralFileAuthorizationHandler < FileAuthorizationHandler
11
+ def form_attributes
12
+ attributes.except(*%w(id user tos_agreement)).keys
13
+ end
14
+
15
+ def handler_name
16
+ +"ephemeral_file_authorization_handler"
17
+ end
18
+ end
@@ -49,7 +49,7 @@ class FileAuthorizationHandler < Decidim::AuthorizationHandler
49
49
  def unique_id
50
50
  return nil unless organization
51
51
 
52
- Digest::SHA256.hexdigest("#{census_for_user&.id_document}-#{organization.id}-#{ENV.fetch("SECRET_KEY_BASE", nil)}")
52
+ Digest::SHA256.hexdigest("#{census_for_user&.id_document}-#{organization.id}-#{Rails.application.secret_key_base}")
53
53
  end
54
54
 
55
55
  def census_for_user
@@ -0,0 +1,184 @@
1
+ # i18n-tasks finds and manages missing and unused translations: https://github.com/glebm/i18n-tasks
2
+
3
+ # The "main" locale.
4
+ base_locale: en
5
+ ## All available locales are inferred from the data by default. Alternatively, specify them explicitly:
6
+ locales: [ca, en, es, eu]
7
+ ## Reporting locale, default: en. Available: en, ru.
8
+ # internal_locale: en
9
+
10
+ # Read and write translations.
11
+ data:
12
+ ## Translations are read from the file system. Supported format: YAML, JSON.
13
+ ## Provide a custom adapter:
14
+ # adapter: I18n::Tasks::Data::FileSystem
15
+
16
+ # Locale files or `Dir.glob` patterns where translations are read from:
17
+ read:
18
+ ## Default:
19
+ # - config/locales/%{locale}.yml
20
+ ## More files:
21
+ # - config/locales/**/*.%{locale}.yml
22
+
23
+ # Locale files to write new keys to, based on a list of key pattern => file rules. Matched from top to bottom:
24
+ # `i18n-tasks normalize -p` will force move the keys according to these rules
25
+ write:
26
+ ## For example, write devise and simple form keys to their respective files:
27
+ # - ['{devise, simple_form}.*', 'config/locales/\1.%{locale}.yml']
28
+ ## Catch-all default:
29
+ - locales/%{locale}.yml
30
+
31
+ # External locale data (e.g. gems).
32
+ # This data is not considered unused and is never written to.
33
+ external:
34
+ ## Example (replace %#= with %=):
35
+ # - "<%#= %x[bundle info vagrant --path].chomp %>/templates/locales/%{locale}.yml"
36
+
37
+ ## Specify the router (see Readme for details). Valid values: conservative_router, pattern_router, isolating_router, or a custom class.
38
+ # router: conservative_router
39
+
40
+ yaml:
41
+ write:
42
+ # do not wrap lines at 80 characters
43
+ line_width: -1
44
+
45
+ ## Pretty-print JSON:
46
+ # json:
47
+ # write:
48
+ # indent: ' '
49
+ # space: ' '
50
+ # object_nl: "\n"
51
+ # array_nl: "\n"
52
+
53
+ # Find translate calls
54
+ search:
55
+ ## Paths or `Find.find` patterns to search in:
56
+ paths:
57
+ # - app/
58
+
59
+ ## Root directories for relative keys resolution.
60
+ # relative_roots:
61
+ # - app/controllers
62
+ # - app/helpers
63
+ # - app/mailers
64
+ # - app/presenters
65
+ # - app/views
66
+
67
+ ## Directories where method names which should not be part of a relative key resolution.
68
+ # By default, if a relative translation is used inside a method, the name of the method will be considered part of the resolved key.
69
+ # Directories listed here will not consider the name of the method part of the resolved key
70
+ #
71
+ # relative_exclude_method_name_paths:
72
+ # -
73
+
74
+ ## Files or `File.fnmatch` patterns to exclude from search. Some files are always excluded regardless of this setting:
75
+ ## *.jpg *.jpeg *.png *.gif *.svg *.ico *.eot *.otf *.ttf *.woff *.woff2 *.pdf *.css *.sass *.scss *.less
76
+ ## *.yml *.json *.zip *.tar.gz *.swf *.flv *.mp3 *.wav *.flac *.webm *.mp4 *.ogg *.opus *.webp *.map *.xlsx
77
+ # exclude:
78
+ # - source/images
79
+ # - source/static
80
+ # - source/stylesheets
81
+
82
+ ## Alternatively, the only files or `File.fnmatch patterns` to search in `paths`:
83
+ ## If specified, this settings takes priority over `exclude`, but `exclude` still applies.
84
+ # only: ["*.rb", "*.html.slim"]
85
+
86
+ ## If `strict` is `false`, guess usages such as t("categories.#{category}.title"). The default is `true`.
87
+ # strict: true
88
+
89
+ ## Allows adding ast_matchers for finding translations using the AST-scanners
90
+ ## The available matchers are:
91
+ ## - RailsModelMatcher
92
+ ## Matches ActiveRecord translations like
93
+ ## User.human_attribute_name(:email) and User.model_name.human
94
+ ## - DefaultI18nSubjectMatcher
95
+ ## Matches ActionMailer's default_i18n_subject method
96
+ ##
97
+ ## To implement your own, please see `I18n::Tasks::Scanners::AstMatchers::BaseMatcher`.
98
+ # ast_matchers:
99
+ # - 'I18n::Tasks::Scanners::AstMatchers::RailsModelMatcher'
100
+ # - 'I18n::Tasks::Scanners::AstMatchers::DefaultI18nSubjectMatcher'
101
+
102
+ ## Multiple scanners can be used. Their results are merged.
103
+ ## The options specified above are passed down to each scanner. Per-scanner options can be specified as well.
104
+ ## See this example of a custom scanner: https://github.com/glebm/i18n-tasks/wiki/A-custom-scanner-example
105
+
106
+ ## Translation Services
107
+ # translation:
108
+ # # Google Translate
109
+ # # Get an API key and set billing info at https://code.google.com/apis/console to use Google Translate
110
+ # google_translate_api_key: "AbC-dEf5"
111
+ # # DeepL Pro Translate
112
+ # # Get an API key and subscription at https://www.deepl.com/pro to use DeepL Pro
113
+ # deepl_api_key: "48E92789-57A3-466A-9959-1A1A1A1A1A1A"
114
+ # # deepl_host: "https://api.deepl.com"
115
+ # # deepl_version: "v2"
116
+ # # deepl_glossary_ids:
117
+ # # - f28106eb-0e06-489e-82c6-8215d6f95089
118
+ # # - 2c6415be-1852-4f54-9e1b-d800463496b4
119
+ # # add additional options to the DeepL.translate call: https://www.deepl.com/docs-api/translate-text/translate-text/
120
+ # deepl_options:
121
+ # formality: prefer_less
122
+ # # OpenAI
123
+ # openai_api_key: "sk-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
124
+ # # openai_model: "gpt-4o-mini" # see https://platform.openai.com/docs/models
125
+ # # may contain `%{from}` and `%{to}`, which will be replaced by source and target locale codes, respectively (using `Kernel.format`)
126
+ # # openai_system_prompt: >-
127
+ # # You are a professional translator that translates content from the %{from} locale
128
+ # # to the %{to} locale in an i18n locale array.
129
+ # #
130
+ # # The array has a structured format and contains multiple strings. Your task is to translate
131
+ # # each of these strings and create a new array with the translated strings.
132
+ # #
133
+ # # HTML markups (enclosed in < and > characters) must not be changed under any circumstance.
134
+ # # Variables (starting with %%{ and ending with }) must not be changed under any circumstance.
135
+ # #
136
+ # # Keep in mind the context of all the strings for a more accurate translation.
137
+
138
+ ## Do not consider these keys missing:
139
+ ignore_missing:
140
+ # - 'errors.messages.{accepted,blank,invalid,too_short,too_long}'
141
+ # - '{devise,simple_form}.*'
142
+ - '{activemodel,census_authorization}.*'
143
+ - 'decidim.authorization_handlers.*'
144
+
145
+ ## Consider these keys used:
146
+ ignore_unused:
147
+ # - 'activerecord.attributes.*'
148
+ # - '{devise,kaminari,will_paginate}.*'
149
+ # - 'simple_form.{yes,no}'
150
+ # - 'simple_form.{placeholders,hints,labels}.*'
151
+ # - 'simple_form.{error_notification,required}.:'
152
+ - '{activemodel,census_authorization}.*'
153
+ - 'decidim.authorization_handlers.file_authorization_handler.*'
154
+ - 'decidim.authorization_handlers.ephemeral_file_authorization_handler.*'
155
+ - 'decidim.file_authorization_handler.*'
156
+ - 'decidim.verifications.authorizations.first_login.actions.file_authorization_handler'
157
+
158
+ ## Exclude these keys from the `i18n-tasks eq-base' report:
159
+ # ignore_eq_base:
160
+ # all:
161
+ # - common.ok
162
+ # fr,es:
163
+ # - common.brand
164
+
165
+ ## Exclude these keys from the `i18n-tasks check-consistent-interpolations` report:
166
+ # ignore_inconsistent_interpolations:
167
+ # - 'activerecord.attributes.*'
168
+
169
+ ## Ignore these keys completely:
170
+ # ignore:
171
+ # - kaminari.*
172
+
173
+ ## Sometimes, it isn't possible for i18n-tasks to match the key correctly,
174
+ ## e.g. in case of a relative key defined in a helper method.
175
+ ## In these cases you can use the built-in PatternMapper to map patterns to keys, e.g.:
176
+ #
177
+ # <%# I18n::Tasks.add_scanner 'I18n::Tasks::Scanners::PatternMapper',
178
+ # only: %w(*.html.haml *.html.slim),
179
+ # patterns: [['= title\b', '.page_title']] %>
180
+ #
181
+ # The PatternMapper can also match key literals via a special %{key} interpolation, e.g.:
182
+ #
183
+ # <%# I18n::Tasks.add_scanner 'I18n::Tasks::Scanners::PatternMapper',
184
+ # patterns: [['\bSpree\.t[( ]\s*%{key}', 'spree.%{key}']] %>
@@ -1,9 +1,10 @@
1
+ ---
1
2
  ca:
2
3
  activemodel:
3
4
  attributes:
4
5
  file_authorization_handler:
5
- id_document: Document d'identitat (DNI, NIF, Passaport o Targeta de Residència)
6
6
  birthdate: Data de naixement
7
+ id_document: Document d'identitat (DNI, NIF, Passaport o Targeta de Residència)
7
8
  census_authorization:
8
9
  form:
9
10
  date_select:
@@ -12,40 +13,46 @@ ca:
12
13
  year: Any
13
14
  decidim:
14
15
  authorization_handlers:
15
- file_authorization_handler:
16
- name: Cens Organització
16
+ ephemeral_file_authorization_handler:
17
17
  explanation: Autoritza el teu compte d'usuari contra el cens de la Organització
18
+ fields:
19
+ birthdate: Data de naixement
20
+ name: Cens Organització
18
21
  type: CSV
22
+ file_authorization_handler:
23
+ explanation: Autoritza el teu compte d'usuari contra el cens de la Organització
19
24
  fields:
20
25
  birthdate: Data de naixement
26
+ name: Cens Organització
27
+ type: CSV
21
28
  file_authorization_handler:
22
- upload_info:
23
- format: "Ha de ser un fitxer generat en excel i exportat en CSV amb dues columnes:"
24
- errors:
25
- messages:
26
- not_censed: No hem pogut trobar el teu document d'identitat amb aquesta data de naixement al padró municipal. Si les dades són correctes i el problema persisteix, siusplau, posa't en contacte amb un administrador.
27
- younger_than_minimum_age: Hauries de ser major de %{age} anys
28
29
  admin:
29
- destroy:
30
- title: Esborrar totes les dades del cens
31
- confirm: Aquesta acció no es pot desfer. Estàs segur/a que voleu continuar?
32
30
  censuses:
33
31
  create:
32
+ invalid_format: Format de fitxer no vàlid. Només s'admeten fitxers CSV.
34
33
  success: S'han importat amb èxit %{count} elements (%{errors} errors)
35
- invalid_format: "Format de fitxer no vàlid. Només s'admeten fitxers CSV."
36
34
  destroy:
37
35
  success: S'han esborrat totes les dades censals
36
+ destroy:
37
+ confirm: Aquesta acció no es pot desfer. Estàs segur/a que vols continuar?
38
+ title: Esborra totes les dades del cens
38
39
  menu:
39
40
  census: Pujar cens
40
- show:
41
- title: Dades del cens carregat
42
- import_csv: Importa un CSV
43
- data: Hi ha un total de %{count} registres carregats. La última càrrega va ser el dia %{due_date}
44
- empty: Encara no hi ha dades censals carregades. Utilitza el botó "Importa un CSV" de dalt per importar un fitxer CSV.
45
41
  new:
46
- title: Pujar un nou cens
47
42
  file: Arxiu excel .csv amb les dades del cens
48
43
  submit: Carrega
44
+ title: Puja un nou cens
45
+ show:
46
+ data: Hi ha un total de %{count} registres carregats. La última càrrega va ser el dia %{due_date}
47
+ empty: Encara no hi ha dades censals carregades. Utilitza el següent formulari per importar-lo utilitzant un fitxer CSV.
48
+ import_csv: Importa CSV
49
+ title: Dades del cens carregades
50
+ errors:
51
+ messages:
52
+ not_censed: No hem pogut trobar el teu document d'identitat amb aquesta data de naixement al padró municipal. Si les dades són correctes i el problema persisteix, siusplau, posa't en contacte amb un administrador.
53
+ younger_than_minimum_age: Hauries de ser major de %{age} anys
54
+ upload_info:
55
+ format: 'Ha de ser un fitxer generat en excel i exportat en CSV amb dues columnes:'
49
56
  verifications:
50
57
  authorizations:
51
58
  first_login:
@@ -1,9 +1,10 @@
1
+ ---
1
2
  en:
2
3
  activemodel:
3
4
  attributes:
4
5
  file_authorization_handler:
5
- id_document: Identification document (DNI, NIF, Password or Residence Card)
6
6
  birthdate: Date of birth
7
+ id_document: Identification document (DNI, NIF, Password or Residence Card)
7
8
  census_authorization:
8
9
  form:
9
10
  date_select:
@@ -12,40 +13,46 @@ en:
12
13
  year: Year
13
14
  decidim:
14
15
  authorization_handlers:
15
- file_authorization_handler:
16
- name: Organization's Census
16
+ ephemeral_file_authorization_handler:
17
17
  explanation: Authorize your user account against Organization's Census
18
+ fields:
19
+ birthdate: Birthdate
20
+ name: Organization's Census
18
21
  type: CSV
22
+ file_authorization_handler:
23
+ explanation: Authorize your user account against Organization's Census
19
24
  fields:
20
25
  birthdate: Birthdate
26
+ name: Organization's Census
27
+ type: CSV
21
28
  file_authorization_handler:
22
- upload_info:
23
- format: 'Must be a file generated by excel and exported with CSV format with two columns:'
24
- errors:
25
- messages:
26
- not_censed: We could not find your document ID matching with this birthdate in our Census. If the data entered is correct and the problem persists, please, contact an administrator.
27
- younger_than_minimum_age: You should be older than %{age} years
28
29
  admin:
29
- destroy:
30
- title: Delete all census data
31
- confirm: Delete all the census can not be undone. Are you sure you want to continue?
32
30
  censuses:
33
31
  create:
32
+ invalid_format: Invalid file format. Only CSV files are accepted.
34
33
  success: Successfully imported %{count} items (%{errors} errors)
35
- invalid_format: "Invalid file format. Only CSV files are accepted."
36
34
  destroy:
37
35
  success: All census data have been deleted
36
+ destroy:
37
+ confirm: Delete all the census can not be undone. Are you sure you want to continue?
38
+ title: Delete all census data
38
39
  menu:
39
40
  census: Upload census
40
- show:
41
- title: Current census data
42
- import_csv: Import CSV
43
- data: There are %{count} records loaded in total. Last upload date was on %{due_date}
44
- empty: There are no census data. Use the "Import CSV" button above to import it using a CSV file.
45
41
  new:
46
- title: Upload a new census
47
42
  file: Excel .csv file with census data
48
43
  submit: Upload file
44
+ title: Upload a new census
45
+ show:
46
+ data: There are %{count} records loaded in total. Last upload date was on %{due_date}
47
+ empty: There are no census data. Use the form below to import it using a CSV file.
48
+ import_csv: Import CSV
49
+ title: Current census data
50
+ errors:
51
+ messages:
52
+ not_censed: We could not find your document ID matching with this birthdate in our Census. If the data entered is correct and the problem persists, please, contact an administrator.
53
+ younger_than_minimum_age: You should be older than %{age} years
54
+ upload_info:
55
+ format: 'Must be a file generated by excel and exported with CSV format with two columns:'
49
56
  verifications:
50
57
  authorizations:
51
58
  first_login:
@@ -1,9 +1,10 @@
1
+ ---
1
2
  es:
2
3
  activemodel:
3
4
  attributes:
4
5
  file_authorization_handler:
5
- id_document: Documento de identidad (DNI, NIF, Pasaporte o Targeta de Residencia)
6
6
  birthdate: Fecha de nacimiento
7
+ id_document: Documento de identidad (DNI, NIF, Pasaporte o Targeta de Residencia)
7
8
  census_authorization:
8
9
  form:
9
10
  date_select:
@@ -12,40 +13,46 @@ es:
12
13
  year: Año
13
14
  decidim:
14
15
  authorization_handlers:
15
- file_authorization_handler:
16
- name: Censo de la Organización
16
+ ephemeral_file_authorization_handler:
17
17
  explanation: Autoriza tu cuenta de usuario contra el Censo de la Organización
18
+ fields:
19
+ birthdate: Fecha de nacimiento
20
+ name: Censo de la Organización
18
21
  type: CSV
22
+ file_authorization_handler:
23
+ explanation: Autoriza tu cuenta de usuario contra el Censo de la Organización
19
24
  fields:
20
25
  birthdate: Fecha de nacimiento
26
+ name: Censo de la Organización
27
+ type: CSV
21
28
  file_authorization_handler:
22
- upload_info:
23
- format: 'Debe ser un fichero generado por excel y exportado en formato CSV con dos columnas:'
24
- errors:
25
- messages:
26
- not_censed: No hemos podido encontrar tu documento de identidad con esta fecha de nacimiento en el padrón municipal. Si tus datos son correctos y el problema persiste, por favor, ponte en contacto con un administrador
27
- younger_than_minimum_age: Deberías ser mayor de %{age} años
28
29
  admin:
29
- destroy:
30
- title: Borrar todos los datos de censo
31
- confirm: Borrar el censo no se puede deshacer. ¿Estás seguro/a que deseas continuar?
32
30
  censuses:
33
31
  create:
32
+ invalid_format: Formato de archivo no válido. Solo se admiten ficheros CSV.
34
33
  success: Se han importado con éxito %{count} elementos (%{errors} errores)
35
- invalid_format: "Formato de archivo no válido. Solo se admiten ficheros CSV."
36
34
  destroy:
37
35
  success: Se han borrado todos los datos censales
36
+ destroy:
37
+ confirm: Borrar el censo no se puede deshacer. ¿Estás seguro/a que deseas continuar?
38
+ title: Borrar todos los datos de censo
38
39
  menu:
39
40
  census: Subir censo
40
- show:
41
- title: Datos de censo actuales
42
- import_csv: Importar CSV
43
- data: Hay un total de %{count} registros cargados. La última carga fue el día %{due_date}
44
- empty: No hay datos censales. Usa el botón "Importar CSV" de arriba para importar un fichero CSV.
45
41
  new:
46
- title: Subir un nuevo censo
47
42
  file: Archivo excel .csv con los datos del censo
48
43
  submit: Subir archivo
44
+ title: Subir un nuevo censo
45
+ show:
46
+ data: Hay un total de %{count} registros cargados. La última carga fue el día %{due_date}
47
+ empty: No hay datos censales. Usa el formulario a continuación para importar usando un fichero CSV.
48
+ import_csv: Importa CSV
49
+ title: Datos de censo actuales
50
+ errors:
51
+ messages:
52
+ not_censed: No hemos podido encontrar tu documento de identidad con esta fecha de nacimiento en el padrón municipal. Si tus datos son correctos y el problema persiste, por favor, ponte en contacto con un administrador
53
+ younger_than_minimum_age: Deberías ser mayor de %{age} años
54
+ upload_info:
55
+ format: 'Debe ser un fichero generado por excel y exportado en formato CSV con dos columnas:'
49
56
  verifications:
50
57
  authorizations:
51
58
  first_login:
@@ -0,0 +1,54 @@
1
+ ---
2
+ eu:
3
+ activemodel:
4
+ attributes:
5
+ file_authorization_handler:
6
+ birthdate: Jaioteguna
7
+ id_document: Nortasun-agiria (NAN, IFZ, Pasaportea edo Egoitza Txartela)
8
+ census_authorization:
9
+ form:
10
+ date_select:
11
+ day: Eguna
12
+ month: Hilabetea
13
+ year: Urtea
14
+ decidim:
15
+ authorization_handlers:
16
+ file_authorization_handler:
17
+ explanation: Zure erabiltzaile-kontua Erakundearen Erroldaren bidez baimendu
18
+ fields:
19
+ birthdate: Jaioteguna
20
+ name: Erakundearen Errolda
21
+ type: CSV
22
+ file_authorization_handler:
23
+ admin:
24
+ censuses:
25
+ create:
26
+ invalid_format: Fitxategiaren formatua ez da baliagarria. CSV fitxategiak bakarrik onartzen dira.
27
+ success: "%{count} elementu arrakastaz inportatu dira (%{errors} errore)"
28
+ destroy:
29
+ success: Erroldako datu guztiak ezabatu dira
30
+ destroy:
31
+ confirm: Errolda ezabatzea ezin da desegin. Ziur zaude jarraitu nahi duzula?
32
+ title: Erroldako datu guztiak ezabatu
33
+ menu:
34
+ census: Errolda igo
35
+ new:
36
+ file: Erroldaren datuak dituen excel .csv fitxategia
37
+ submit: Fitxategia igo
38
+ title: Errolda berria igo
39
+ show:
40
+ data: Guztira %{count} erregistro kargatuta daude. Azken karga %{due_date} egunean izan zen.
41
+ empty: Ez dago errolda-daturik. Erabili beheko inprimakia CSV fitxategi bat erabiliz inportatzeko.
42
+ import_csv: Inportatu CSV
43
+ title: Uneko errolda-datuak
44
+ errors:
45
+ messages:
46
+ not_censed: Ezin izan dugu zure nortasun-agiria eta jaioteguna udal erroldan aurkitu. Zure datuak zuzenak badira eta arazoak jarraitzen badu, jar zaitez administratzailearekin harremanetan.
47
+ younger_than_minimum_age: "%{age} urte baino gehiago izan beharko zenuke"
48
+ upload_info:
49
+ format: 'Excel bidez sortutako eta CSV formatuan esportatutako fitxategia izan behar du, bi zutaberekin:'
50
+ verifications:
51
+ authorizations:
52
+ first_login:
53
+ actions:
54
+ file_authorization_handler: Egiaztatu zure burua erakundearen erroldaren bidez
@@ -5,10 +5,19 @@ module Decidim
5
5
  class AdminEngine < ::Rails::Engine
6
6
  isolate_namespace Decidim::FileAuthorizationHandler::Admin
7
7
 
8
+ paths["db/migrate"] = nil
9
+ paths["lib/tasks"] = nil
10
+
8
11
  routes do
9
12
  resource :censuses, only: [:show, :new, :create, :destroy]
10
13
  end
11
14
 
15
+ initializer "decidim_file_authorization_handler.admin_mount_routes" do
16
+ Decidim::Core::Engine.routes do
17
+ mount Decidim::FileAuthorizationHandler::AdminEngine, at: "/admin/file_authorization_handler", as: "decidim_file_authorization_handler_admin"
18
+ end
19
+ end
20
+
12
21
  initializer "decidim_file_authorization.add_admin_menu" do
13
22
  Decidim.menu :admin_menu do |menu|
14
23
  menu.add_item :file_authorization_handler,
@@ -10,6 +10,17 @@ module Decidim
10
10
  Decidim::Verifications.register_workflow(:file_authorization_handler) do |workflow|
11
11
  workflow.form = "FileAuthorizationHandler"
12
12
  end
13
+
14
+ next unless ENV.fetch("ENABLE_EPHEMERAL_FILE_AUTHORIZATION_HANDLER", "false") == "true"
15
+
16
+ # Enable Ephemeral Verification
17
+ Decidim::Verifications.register_workflow(:ephemeral_file_authorization_handler) do |workflow|
18
+ workflow.ephemeral = true
19
+ workflow.form = "EphemeralFileAuthorizationHandler"
20
+ workflow.expires_in = 1.hour
21
+ workflow.renewable = true
22
+ workflow.time_between_renewals = 5.minutes
23
+ end
13
24
  end
14
25
  end
15
26
  end
@@ -7,6 +7,6 @@ module Decidim
7
7
  # Uses the latest matching Decidim version for
8
8
  # - major, minor and patch
9
9
  # - the optional extra number is related to this module's patches
10
- VERSION = "#{DECIDIM_VERSION}.1".freeze
10
+ VERSION = "#{DECIDIM_VERSION}.3".freeze
11
11
  end
12
12
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: decidim-file_authorization_handler
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.31.6.1
4
+ version: 0.31.6.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Gómez
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2026-08-04 00:00:00.000000000 Z
13
+ date: 2026-08-27 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: decidim
@@ -72,14 +72,17 @@ files:
72
72
  - app/models/decidim/file_authorization_handler/csv_data.rb
73
73
  - app/models/decidim/file_authorization_handler/status.rb
74
74
  - app/permissions/decidim/file_authorization_handler/admin/permissions.rb
75
+ - app/services/ephemeral_file_authorization_handler.rb
75
76
  - app/services/file_authorization_handler.rb
76
77
  - app/views/decidim/file_authorization_handler/admin/censuses/_upload_info.html.erb
77
78
  - app/views/decidim/file_authorization_handler/admin/censuses/new.html.erb
78
79
  - app/views/decidim/file_authorization_handler/admin/censuses/show.html.erb
79
80
  - app/views/layouts/file_authorization_handler/application.html.erb
81
+ - config/i18n-tasks.yml
80
82
  - config/locales/ca.yml
81
83
  - config/locales/en.yml
82
84
  - config/locales/es.yml
85
+ - config/locales/eu.yml
83
86
  - db/migrate/20171110120821_create_decidim_file_authorization_handler_census_datum.rb
84
87
  - db/migrate/20221207143742_add_extras_to_census_datum.rb
85
88
  - lib/decidim/file_authorization_handler.rb