roda-gen 1.0.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.
- checksums.yaml +7 -0
- data/CHANGELOG.md +9 -0
- data/LICENSE.txt +21 -0
- data/README.md +94 -0
- data/bin/roda +11 -0
- data/lib/roda-gen.rb +3 -0
- data/lib/roda_gen/app_name.rb +29 -0
- data/lib/roda_gen/cli.rb +122 -0
- data/lib/roda_gen/generators/daemon.rb +78 -0
- data/lib/roda_gen/generators/migration.rb +68 -0
- data/lib/roda_gen/generators/migration_numbering.rb +21 -0
- data/lib/roda_gen/generators/model.rb +75 -0
- data/lib/roda_gen/generators/project.rb +145 -0
- data/lib/roda_gen/generators/route.rb +71 -0
- data/lib/roda_gen/generators/templates/daemon/bin/%daemon_name%.tt +13 -0
- data/lib/roda_gen/generators/templates/daemon/lib/daemon/%daemon_name%.rb.tt +22 -0
- data/lib/roda_gen/generators/templates/daemon/spec/daemons/%daemon_name%_spec.rb.tt +18 -0
- data/lib/roda_gen/generators/templates/migration/db/migrate/%migration_filename%.rb.tt +6 -0
- data/lib/roda_gen/generators/templates/model/db/migrate/%migration_filename%.rb.tt +12 -0
- data/lib/roda_gen/generators/templates/model/models/%resource_name%.rb.tt +5 -0
- data/lib/roda_gen/generators/templates/model/spec/models/%resource_name%_spec.rb.tt +18 -0
- data/lib/roda_gen/generators/templates/project/%app_name%.rb.tt +43 -0
- data/lib/roda_gen/generators/templates/project/.bundle/config.tt +3 -0
- data/lib/roda_gen/generators/templates/project/.erb_lint.yml.tt +29 -0
- data/lib/roda_gen/generators/templates/project/.gitignore.tt +19 -0
- data/lib/roda_gen/generators/templates/project/.reek.yml.tt +45 -0
- data/lib/roda_gen/generators/templates/project/.rspec.tt +4 -0
- data/lib/roda_gen/generators/templates/project/.rubocop.yml.tt +119 -0
- data/lib/roda_gen/generators/templates/project/.ruby-version.tt +1 -0
- data/lib/roda_gen/generators/templates/project/.rubycritic.yml.tt +15 -0
- data/lib/roda_gen/generators/templates/project/Gemfile.tt +109 -0
- data/lib/roda_gen/generators/templates/project/Procfile.dev.tt +7 -0
- data/lib/roda_gen/generators/templates/project/README.md.tt +891 -0
- data/lib/roda_gen/generators/templates/project/Rakefile.tt +3 -0
- data/lib/roda_gen/generators/templates/project/assets/javascripts/admin.js.tt +84 -0
- data/lib/roda_gen/generators/templates/project/assets/javascripts/app.js.tt +29 -0
- data/lib/roda_gen/generators/templates/project/assets/javascripts/push.js.tt +53 -0
- data/lib/roda_gen/generators/templates/project/assets/javascripts/upload.js.tt +200 -0
- data/lib/roda_gen/generators/templates/project/assets/stylesheets/app.css.tt +52 -0
- data/lib/roda_gen/generators/templates/project/assets/stylesheets/typography.css.tt +85 -0
- data/lib/roda_gen/generators/templates/project/bin/console.tt +2 -0
- data/lib/roda_gen/generators/templates/project/bin/dev.tt +8 -0
- data/lib/roda_gen/generators/templates/project/bin/gdpr_worker.tt +13 -0
- data/lib/roda_gen/generators/templates/project/bin/push_sender.tt +13 -0
- data/lib/roda_gen/generators/templates/project/bin/setup.tt +224 -0
- data/lib/roda_gen/generators/templates/project/bin/shrine_clean_cache.tt +13 -0
- data/lib/roda_gen/generators/templates/project/config/boot.rb.tt +23 -0
- data/lib/roda_gen/generators/templates/project/config/console.rb.tt +20 -0
- data/lib/roda_gen/generators/templates/project/config/database.rb.tt +45 -0
- data/lib/roda_gen/generators/templates/project/config/initializers/00_environments.rb.tt +5 -0
- data/lib/roda_gen/generators/templates/project/config/initializers/01_logger.rb.tt +46 -0
- data/lib/roda_gen/generators/templates/project/config/initializers/02_app_config.rb.tt +19 -0
- data/lib/roda_gen/generators/templates/project/config/initializers/10_database.rb.tt +3 -0
- data/lib/roda_gen/generators/templates/project/config/initializers/15_mail.rb.tt +53 -0
- data/lib/roda_gen/generators/templates/project/config/initializers/20_redis.rb.tt +13 -0
- data/lib/roda_gen/generators/templates/project/config/initializers/25_rack_attack.rb.tt +96 -0
- data/lib/roda_gen/generators/templates/project/config/initializers/30_i18n.rb.tt +37 -0
- data/lib/roda_gen/generators/templates/project/config/initializers/35_listen_job.rb.tt +4 -0
- data/lib/roda_gen/generators/templates/project/config/initializers/37_shrine.rb.tt +20 -0
- data/lib/roda_gen/generators/templates/project/config/initializers/40_routing.rb.tt +20 -0
- data/lib/roda_gen/generators/templates/project/config/initializers/41_render.rb.tt +10 -0
- data/lib/roda_gen/generators/templates/project/config/initializers/43_static.rb.tt +30 -0
- data/lib/roda_gen/generators/templates/project/config/initializers/44_sessions.rb.tt +62 -0
- data/lib/roda_gen/generators/templates/project/config/initializers/45_security.rb.tt +49 -0
- data/lib/roda_gen/generators/templates/project/config/initializers/46_flash.rb.tt +5 -0
- data/lib/roda_gen/generators/templates/project/config/initializers/47_json.rb.tt +8 -0
- data/lib/roda_gen/generators/templates/project/config/initializers/48_errors.rb.tt +43 -0
- data/lib/roda_gen/generators/templates/project/config/initializers/49_misc.rb.tt +26 -0
- data/lib/roda_gen/generators/templates/project/config/initializers/50_mailer.rb.tt +52 -0
- data/lib/roda_gen/generators/templates/project/config/initializers/51_locale_kit.rb.tt +29 -0
- data/lib/roda_gen/generators/templates/project/config/initializers/52_consent_kit.rb.tt +28 -0
- data/lib/roda_gen/generators/templates/project/config/initializers/55_audit_log.rb.tt +16 -0
- data/lib/roda_gen/generators/templates/project/config/initializers/56_form_helper.rb.tt +7 -0
- data/lib/roda_gen/generators/templates/project/config/initializers/57_rodauth.rb.tt +304 -0
- data/lib/roda_gen/generators/templates/project/config/initializers/60_web_push.rb.tt +12 -0
- data/lib/roda_gen/generators/templates/project/config/initializers/61_flipper.rb.tt +15 -0
- data/lib/roda_gen/generators/templates/project/config/initializers/62_split.rb.tt +15 -0
- data/lib/roda_gen/generators/templates/project/config/puma.rb.tt +24 -0
- data/lib/roda_gen/generators/templates/project/config/settings/development.yml.tt +9 -0
- data/lib/roda_gen/generators/templates/project/config/settings/production.yml.tt +13 -0
- data/lib/roda_gen/generators/templates/project/config/settings/test.yml.tt +9 -0
- data/lib/roda_gen/generators/templates/project/config/settings.yml.tt +45 -0
- data/lib/roda_gen/generators/templates/project/config.ru.tt +36 -0
- data/lib/roda_gen/generators/templates/project/db/migrate/create_account_profiles.rb.tt +66 -0
- data/lib/roda_gen/generators/templates/project/db/migrate/create_accounts.rb.tt +70 -0
- data/lib/roda_gen/generators/templates/project/db/migrate/create_audit_log.rb.tt +185 -0
- data/lib/roda_gen/generators/templates/project/db/migrate/create_authorization.rb.tt +68 -0
- data/lib/roda_gen/generators/templates/project/db/migrate/create_countries.rb.tt +13 -0
- data/lib/roda_gen/generators/templates/project/db/migrate/create_country_calling_codes.rb.tt +15 -0
- data/lib/roda_gen/generators/templates/project/db/migrate/create_country_exit_codes.rb.tt +13 -0
- data/lib/roda_gen/generators/templates/project/db/migrate/create_country_languages.rb.tt +19 -0
- data/lib/roda_gen/generators/templates/project/db/migrate/create_country_time_zones.rb.tt +11 -0
- data/lib/roda_gen/generators/templates/project/db/migrate/create_currencies.rb.tt +12 -0
- data/lib/roda_gen/generators/templates/project/db/migrate/create_gdpr_requests.rb.tt +43 -0
- data/lib/roda_gen/generators/templates/project/db/migrate/create_languages.rb.tt +11 -0
- data/lib/roda_gen/generators/templates/project/db/migrate/create_push_subscriptions.rb.tt +16 -0
- data/lib/roda_gen/generators/templates/project/db/migrate/create_rodauth_features.rb.tt +105 -0
- data/lib/roda_gen/generators/templates/project/db/migrate/create_settings.rb.tt +60 -0
- data/lib/roda_gen/generators/templates/project/db/seeds/01_countries.csv.tt +250 -0
- data/lib/roda_gen/generators/templates/project/db/seeds/01_currencies.csv.tt +162 -0
- data/lib/roda_gen/generators/templates/project/db/seeds/01_languages.csv.tt +144 -0
- data/lib/roda_gen/generators/templates/project/db/seeds/02_country_calling_codes.csv.tt +237 -0
- data/lib/roda_gen/generators/templates/project/db/seeds/02_country_exit_codes.csv.tt +239 -0
- data/lib/roda_gen/generators/templates/project/db/seeds/02_country_languages.csv.tt +226 -0
- data/lib/roda_gen/generators/templates/project/db/seeds/02_country_time_zones.csv.tt +369 -0
- data/lib/roda_gen/generators/templates/project/db/seeds/03_setting_system_defaults.yml.tt +35 -0
- data/lib/roda_gen/generators/templates/project/db/seeds.rb.tt +69 -0
- data/lib/roda_gen/generators/templates/project/deploy/Caddyfile.tt +69 -0
- data/lib/roda_gen/generators/templates/project/deploy/logrotate/%app_name%-caddy.tt +11 -0
- data/lib/roda_gen/generators/templates/project/deploy/systemd/%app_name%-audit-partition.service.tt +21 -0
- data/lib/roda_gen/generators/templates/project/deploy/systemd/%app_name%-audit-partition.timer.tt +16 -0
- data/lib/roda_gen/generators/templates/project/deploy/systemd/%app_name%-gdpr-worker.service.tt +25 -0
- data/lib/roda_gen/generators/templates/project/deploy/systemd/%app_name%-push-sender.service.tt +25 -0
- data/lib/roda_gen/generators/templates/project/deploy/systemd/%app_name%-shrine-cleanup.service.tt +21 -0
- data/lib/roda_gen/generators/templates/project/deploy/systemd/%app_name%-shrine-cleanup.timer.tt +16 -0
- data/lib/roda_gen/generators/templates/project/deploy/systemd/%app_name%.service.tt +36 -0
- data/lib/roda_gen/generators/templates/project/helpers/audit_helper.rb.tt +59 -0
- data/lib/roda_gen/generators/templates/project/helpers/authorization_helper.rb.tt +25 -0
- data/lib/roda_gen/generators/templates/project/helpers/current_account_helper.rb.tt +33 -0
- data/lib/roda_gen/generators/templates/project/helpers/feature_flag_helper.rb.tt +34 -0
- data/lib/roda_gen/generators/templates/project/helpers/form_helper.rb.tt +50 -0
- data/lib/roda_gen/generators/templates/project/helpers/http_cache_helper.rb.tt +15 -0
- data/lib/roda_gen/generators/templates/project/helpers/logger_helper.rb.tt +7 -0
- data/lib/roda_gen/generators/templates/project/helpers/split_helper.rb.tt +22 -0
- data/lib/roda_gen/generators/templates/project/lib/audit_context.rb.tt +26 -0
- data/lib/roda_gen/generators/templates/project/lib/audit_lookup.rb.tt +21 -0
- data/lib/roda_gen/generators/templates/project/lib/daemon/base.rb.tt +104 -0
- data/lib/roda_gen/generators/templates/project/lib/daemon/gdpr_worker.rb.tt +53 -0
- data/lib/roda_gen/generators/templates/project/lib/daemon/push_sender.rb.tt +47 -0
- data/lib/roda_gen/generators/templates/project/lib/daemon/shrine_cache_cleaner.rb.tt +22 -0
- data/lib/roda_gen/generators/templates/project/lib/deploy_check.rb.tt +96 -0
- data/lib/roda_gen/generators/templates/project/lib/filtered_logger.rb.tt +54 -0
- data/lib/roda_gen/generators/templates/project/lib/gdpr.rb.tt +106 -0
- data/lib/roda_gen/generators/templates/project/lib/rbac_audit.rb.tt +47 -0
- data/lib/roda_gen/generators/templates/project/lib/tasks/.rubocop.yml.tt +4 -0
- data/lib/roda_gen/generators/templates/project/lib/tasks/audit.rake.tt +85 -0
- data/lib/roda_gen/generators/templates/project/lib/tasks/console.rake.tt +8 -0
- data/lib/roda_gen/generators/templates/project/lib/tasks/db.rake.tt +104 -0
- data/lib/roda_gen/generators/templates/project/lib/tasks/deploy.rake.tt +38 -0
- data/lib/roda_gen/generators/templates/project/lib/tasks/flags.rake.tt +47 -0
- data/lib/roda_gen/generators/templates/project/lib/tasks/gdpr.rake.tt +31 -0
- data/lib/roda_gen/generators/templates/project/lib/tasks/parser_current_shim.rb.tt +13 -0
- data/lib/roda_gen/generators/templates/project/lib/tasks/quality.rake.tt +84 -0
- data/lib/roda_gen/generators/templates/project/lib/tasks/secrets.rake.tt +154 -0
- data/lib/roda_gen/generators/templates/project/lib/tasks/spec.rake.tt +136 -0
- data/lib/roda_gen/generators/templates/project/lib/tasks/split.rake.tt +27 -0
- data/lib/roda_gen/generators/templates/project/lib/tasks/tailwind.rake.tt +35 -0
- data/lib/roda_gen/generators/templates/project/locales/de.yml.tt +325 -0
- data/lib/roda_gen/generators/templates/project/locales/en.yml.tt +321 -0
- data/lib/roda_gen/generators/templates/project/locales/es.yml.tt +326 -0
- data/lib/roda_gen/generators/templates/project/locales/fr.yml.tt +329 -0
- data/lib/roda_gen/generators/templates/project/locales/it.yml.tt +325 -0
- data/lib/roda_gen/generators/templates/project/locales/rodauth/de.yml.tt +5 -0
- data/lib/roda_gen/generators/templates/project/locales/rodauth/en.yml.tt +6 -0
- data/lib/roda_gen/generators/templates/project/locales/rodauth/es.yml.tt +5 -0
- data/lib/roda_gen/generators/templates/project/locales/rodauth/fr.yml.tt +5 -0
- data/lib/roda_gen/generators/templates/project/locales/rodauth/it.yml.tt +5 -0
- data/lib/roda_gen/generators/templates/project/locales/rodauth/sv.yml.tt +274 -0
- data/lib/roda_gen/generators/templates/project/locales/rodauth/tru.yml.tt +274 -0
- data/lib/roda_gen/generators/templates/project/locales/sv.yml.tt +319 -0
- data/lib/roda_gen/generators/templates/project/locales/tru.yml.tt +294 -0
- data/lib/roda_gen/generators/templates/project/log/.keep.tt +0 -0
- data/lib/roda_gen/generators/templates/project/models/account.rb.tt +50 -0
- data/lib/roda_gen/generators/templates/project/models/account_privilege.rb.tt +15 -0
- data/lib/roda_gen/generators/templates/project/models/account_profile.rb.tt +115 -0
- data/lib/roda_gen/generators/templates/project/models/account_role.rb.tt +14 -0
- data/lib/roda_gen/generators/templates/project/models/audit_action.rb.tt +23 -0
- data/lib/roda_gen/generators/templates/project/models/audit_actor_type.rb.tt +10 -0
- data/lib/roda_gen/generators/templates/project/models/audit_log.rb.tt +257 -0
- data/lib/roda_gen/generators/templates/project/models/audit_status.rb.tt +9 -0
- data/lib/roda_gen/generators/templates/project/models/country.rb.tt +17 -0
- data/lib/roda_gen/generators/templates/project/models/country_calling_code.rb.tt +7 -0
- data/lib/roda_gen/generators/templates/project/models/country_exit_code.rb.tt +7 -0
- data/lib/roda_gen/generators/templates/project/models/country_language.rb.tt +8 -0
- data/lib/roda_gen/generators/templates/project/models/country_time_zone.rb.tt +7 -0
- data/lib/roda_gen/generators/templates/project/models/currency.rb.tt +7 -0
- data/lib/roda_gen/generators/templates/project/models/gdpr_request.rb.tt +32 -0
- data/lib/roda_gen/generators/templates/project/models/gender.rb.tt +7 -0
- data/lib/roda_gen/generators/templates/project/models/language.rb.tt +13 -0
- data/lib/roda_gen/generators/templates/project/models/privilege.rb.tt +21 -0
- data/lib/roda_gen/generators/templates/project/models/push_subscription.rb.tt +10 -0
- data/lib/roda_gen/generators/templates/project/models/role.rb.tt +21 -0
- data/lib/roda_gen/generators/templates/project/models/role_privilege.rb.tt +14 -0
- data/lib/roda_gen/generators/templates/project/models/setting_system_default.rb.tt +11 -0
- data/lib/roda_gen/generators/templates/project/models/setting_user_value.rb.tt +12 -0
- data/lib/roda_gen/generators/templates/project/models/settings.rb.tt +22 -0
- data/lib/roda_gen/generators/templates/project/models/signup_form_data.rb.tt +61 -0
- data/lib/roda_gen/generators/templates/project/models.rb.tt +6 -0
- data/lib/roda_gen/generators/templates/project/package.json.tt +13 -0
- data/lib/roda_gen/generators/templates/project/public/apple-touch-icon.png +0 -0
- data/lib/roda_gen/generators/templates/project/public/favicon.ico +0 -0
- data/lib/roda_gen/generators/templates/project/public/favicon.svg.tt +5 -0
- data/lib/roda_gen/generators/templates/project/public/fonts/JetBrainsMono-Italic-Variable.woff2 +0 -0
- data/lib/roda_gen/generators/templates/project/public/fonts/JetBrainsMono-Variable.woff2 +0 -0
- data/lib/roda_gen/generators/templates/project/public/fonts/Lato-Bold.woff2 +0 -0
- data/lib/roda_gen/generators/templates/project/public/fonts/Lato-BoldItalic.woff2 +0 -0
- data/lib/roda_gen/generators/templates/project/public/fonts/Lato-Italic.woff2 +0 -0
- data/lib/roda_gen/generators/templates/project/public/fonts/Lato-Regular.woff2 +0 -0
- data/lib/roda_gen/generators/templates/project/public/fonts/NOTICE.md +17 -0
- data/lib/roda_gen/generators/templates/project/public/fonts/NotoSansSyriac-Bold.woff2 +0 -0
- data/lib/roda_gen/generators/templates/project/public/fonts/NotoSansSyriac-Regular.woff2 +0 -0
- data/lib/roda_gen/generators/templates/project/public/fonts/NotoSansSyriacWestern-Bold.woff2 +0 -0
- data/lib/roda_gen/generators/templates/project/public/fonts/NotoSansSyriacWestern-Regular.woff2 +0 -0
- data/lib/roda_gen/generators/templates/project/public/manifest.webmanifest.tt +12 -0
- data/lib/roda_gen/generators/templates/project/public/robots.txt.tt +4 -0
- data/lib/roda_gen/generators/templates/project/public/service-worker.js.tt +27 -0
- data/lib/roda_gen/generators/templates/project/routes/account.rb.tt +10 -0
- data/lib/roda_gen/generators/templates/project/routes/admin.rb.tt +118 -0
- data/lib/roda_gen/generators/templates/project/routes/gdpr.rb.tt +32 -0
- data/lib/roda_gen/generators/templates/project/routes/heartbeat.rb.tt +35 -0
- data/lib/roda_gen/generators/templates/project/routes/legal.rb.tt +20 -0
- data/lib/roda_gen/generators/templates/project/routes/profile.rb.tt +56 -0
- data/lib/roda_gen/generators/templates/project/routes/push.rb.tt +25 -0
- data/lib/roda_gen/generators/templates/project/spec/browser/role_boundary_spec.rb.tt +10 -0
- data/lib/roda_gen/generators/templates/project/spec/browser/spec_helper.rb.tt +146 -0
- data/lib/roda_gen/generators/templates/project/spec/browser/support/auth_helpers.rb.tt +71 -0
- data/lib/roda_gen/generators/templates/project/spec/browser/uat/auth_spec.rb.tt +25 -0
- data/lib/roda_gen/generators/templates/project/spec/browser/uat/consent_nojs_spec.rb.tt +60 -0
- data/lib/roda_gen/generators/templates/project/spec/browser/uat/create_account_form_spec.rb.tt +26 -0
- data/lib/roda_gen/generators/templates/project/spec/browser/uat/otp_lifecycle_spec.rb.tt +67 -0
- data/lib/roda_gen/generators/templates/project/spec/browser/uat/profile_form_spec.rb.tt +17 -0
- data/lib/roda_gen/generators/templates/project/spec/browser/uat/upload_spec.rb.tt +102 -0
- data/lib/roda_gen/generators/templates/project/spec/browser/wcag/auth_pages_spec.rb.tt +61 -0
- data/lib/roda_gen/generators/templates/project/spec/browser/wcag/legal_pages_spec.rb.tt +33 -0
- data/lib/roda_gen/generators/templates/project/spec/daemons/base_spec.rb.tt +106 -0
- data/lib/roda_gen/generators/templates/project/spec/daemons/gdpr_worker_spec.rb.tt +72 -0
- data/lib/roda_gen/generators/templates/project/spec/daemons/push_sender_spec.rb.tt +74 -0
- data/lib/roda_gen/generators/templates/project/spec/locale_parity_spec.rb.tt +58 -0
- data/lib/roda_gen/generators/templates/project/spec/models/account_profile_spec.rb.tt +180 -0
- data/lib/roda_gen/generators/templates/project/spec/models/account_spec.rb.tt +104 -0
- data/lib/roda_gen/generators/templates/project/spec/models/audit_actor_type_spec.rb.tt +7 -0
- data/lib/roda_gen/generators/templates/project/spec/models/audit_log_spec.rb.tt +398 -0
- data/lib/roda_gen/generators/templates/project/spec/models/audit_status_spec.rb.tt +7 -0
- data/lib/roda_gen/generators/templates/project/spec/models/authorization_spec.rb.tt +82 -0
- data/lib/roda_gen/generators/templates/project/spec/models/country_calling_code_spec.rb.tt +11 -0
- data/lib/roda_gen/generators/templates/project/spec/models/country_exit_code_spec.rb.tt +10 -0
- data/lib/roda_gen/generators/templates/project/spec/models/country_language_spec.rb.tt +21 -0
- data/lib/roda_gen/generators/templates/project/spec/models/country_spec.rb.tt +29 -0
- data/lib/roda_gen/generators/templates/project/spec/models/country_time_zone_spec.rb.tt +9 -0
- data/lib/roda_gen/generators/templates/project/spec/models/currency_spec.rb.tt +9 -0
- data/lib/roda_gen/generators/templates/project/spec/models/deploy_check_spec.rb.tt +143 -0
- data/lib/roda_gen/generators/templates/project/spec/models/gdpr_spec.rb.tt +110 -0
- data/lib/roda_gen/generators/templates/project/spec/models/language_spec.rb.tt +15 -0
- data/lib/roda_gen/generators/templates/project/spec/models/rbac_audit_spec.rb.tt +110 -0
- data/lib/roda_gen/generators/templates/project/spec/models/setting_system_default_spec.rb.tt +26 -0
- data/lib/roda_gen/generators/templates/project/spec/models/setting_user_value_spec.rb.tt +33 -0
- data/lib/roda_gen/generators/templates/project/spec/models/settings_spec.rb.tt +63 -0
- data/lib/roda_gen/generators/templates/project/spec/models/signup_form_data_spec.rb.tt +22 -0
- data/lib/roda_gen/generators/templates/project/spec/spec_helper.rb.tt +93 -0
- data/lib/roda_gen/generators/templates/project/spec/support/audit_log_helpers.rb.tt +21 -0
- data/lib/roda_gen/generators/templates/project/spec/support/audit_lookup_shared_examples.rb.tt +19 -0
- data/lib/roda_gen/generators/templates/project/spec/support/auth_helpers.rb.tt +62 -0
- data/lib/roda_gen/generators/templates/project/spec/support/faker.rb.tt +30 -0
- data/lib/roda_gen/generators/templates/project/spec/web/admin_spec.rb.tt +155 -0
- data/lib/roda_gen/generators/templates/project/spec/web/audit_log_spec.rb.tt +159 -0
- data/lib/roda_gen/generators/templates/project/spec/web/auth_spec.rb.tt +492 -0
- data/lib/roda_gen/generators/templates/project/spec/web/authorization_spec.rb.tt +110 -0
- data/lib/roda_gen/generators/templates/project/spec/web/boot_spec.rb.tt +27 -0
- data/lib/roda_gen/generators/templates/project/spec/web/consent_banner_spec.rb.tt +46 -0
- data/lib/roda_gen/generators/templates/project/spec/web/feature_flag_helper_spec.rb.tt +33 -0
- data/lib/roda_gen/generators/templates/project/spec/web/flags_spec.rb.tt +67 -0
- data/lib/roda_gen/generators/templates/project/spec/web/gdpr_spec.rb.tt +55 -0
- data/lib/roda_gen/generators/templates/project/spec/web/heartbeat_spec.rb.tt +65 -0
- data/lib/roda_gen/generators/templates/project/spec/web/host_allowlist_spec.rb.tt +27 -0
- data/lib/roda_gen/generators/templates/project/spec/web/legal_spec.rb.tt +61 -0
- data/lib/roda_gen/generators/templates/project/spec/web/locale_resolver_spec.rb.tt +34 -0
- data/lib/roda_gen/generators/templates/project/spec/web/logger_helper_spec.rb.tt +23 -0
- data/lib/roda_gen/generators/templates/project/spec/web/logger_spec.rb.tt +82 -0
- data/lib/roda_gen/generators/templates/project/spec/web/otp_audit_spec.rb.tt +147 -0
- data/lib/roda_gen/generators/templates/project/spec/web/profile_spec.rb.tt +97 -0
- data/lib/roda_gen/generators/templates/project/spec/web/push_spec.rb.tt +55 -0
- data/lib/roda_gen/generators/templates/project/spec/web/rack_attack_runtime_spec.rb.tt +52 -0
- data/lib/roda_gen/generators/templates/project/spec/web/rack_attack_spec.rb.tt +81 -0
- data/lib/roda_gen/generators/templates/project/spec/web/rbac_audit_spec.rb.tt +62 -0
- data/lib/roda_gen/generators/templates/project/spec/web/request_id_spec.rb.tt +62 -0
- data/lib/roda_gen/generators/templates/project/spec/web/role_boundary_spec.rb.tt +21 -0
- data/lib/roda_gen/generators/templates/project/spec/web/session_skip_spec.rb.tt +74 -0
- data/lib/roda_gen/generators/templates/project/spec/web/split_helper_spec.rb.tt +38 -0
- data/lib/roda_gen/generators/templates/project/spec/web/type_routing_spec.rb.tt +55 -0
- data/lib/roda_gen/generators/templates/project/spec/web/upload_zone_spec.rb.tt +91 -0
- data/lib/roda_gen/generators/templates/project/tmp/.keep.tt +0 -0
- data/lib/roda_gen/generators/templates/project/vendor/.keep.tt +0 -0
- data/lib/roda_gen/generators/templates/project/views/403.erb.tt +10 -0
- data/lib/roda_gen/generators/templates/project/views/404.erb.tt +10 -0
- data/lib/roda_gen/generators/templates/project/views/500.erb.tt +12 -0
- data/lib/roda_gen/generators/templates/project/views/_head_meta.erb.tt +29 -0
- data/lib/roda_gen/generators/templates/project/views/_impersonate_picker.erb.tt +21 -0
- data/lib/roda_gen/generators/templates/project/views/_language_switcher.erb.tt +22 -0
- data/lib/roda_gen/generators/templates/project/views/_locked_accounts.erb.tt +18 -0
- data/lib/roda_gen/generators/templates/project/views/_upload_zone.erb.tt +35 -0
- data/lib/roda_gen/generators/templates/project/views/account/profile.erb.tt +149 -0
- data/lib/roda_gen/generators/templates/project/views/admin/flags.erb.tt +51 -0
- data/lib/roda_gen/generators/templates/project/views/consent_kit/_banner.erb.tt +59 -0
- data/lib/roda_gen/generators/templates/project/views/consent_kit/_preferences.erb.tt +87 -0
- data/lib/roda_gen/generators/templates/project/views/gdpr/erased.erb.tt +6 -0
- data/lib/roda_gen/generators/templates/project/views/gdpr/index.erb.tt +28 -0
- data/lib/roda_gen/generators/templates/project/views/layout.erb.tt +112 -0
- data/lib/roda_gen/generators/templates/project/views/legal/contact.erb.tt +44 -0
- data/lib/roda_gen/generators/templates/project/views/legal/cookies.erb.tt +47 -0
- data/lib/roda_gen/generators/templates/project/views/legal/disclaimer.erb.tt +19 -0
- data/lib/roda_gen/generators/templates/project/views/legal/privacy.erb.tt +26 -0
- data/lib/roda_gen/generators/templates/project/views/mailers/account_unlocked.erb.tt +5 -0
- data/lib/roda_gen/generators/templates/project/views/mailers/data_erased.erb.tt +5 -0
- data/lib/roda_gen/generators/templates/project/views/mailers/data_export.erb.tt +5 -0
- data/lib/roda_gen/generators/templates/project/views/rodauth/add-recovery-codes.erb.tt +30 -0
- data/lib/roda_gen/generators/templates/project/views/rodauth/change-login.erb.tt +44 -0
- data/lib/roda_gen/generators/templates/project/views/rodauth/change-password.erb.tt +41 -0
- data/lib/roda_gen/generators/templates/project/views/rodauth/close-account.erb.tt +27 -0
- data/lib/roda_gen/generators/templates/project/views/rodauth/confirm-password.erb.tt +23 -0
- data/lib/roda_gen/generators/templates/project/views/rodauth/create-account.erb.tt +183 -0
- data/lib/roda_gen/generators/templates/project/views/rodauth/login.erb.tt +51 -0
- data/lib/roda_gen/generators/templates/project/views/rodauth/logout.erb.tt +10 -0
- data/lib/roda_gen/generators/templates/project/views/rodauth/otp-auth.erb.tt +26 -0
- data/lib/roda_gen/generators/templates/project/views/rodauth/otp-disable.erb.tt +27 -0
- data/lib/roda_gen/generators/templates/project/views/rodauth/otp-setup.erb.tt +48 -0
- data/lib/roda_gen/generators/templates/project/views/rodauth/otp-unlock-not-available.erb.tt +18 -0
- data/lib/roda_gen/generators/templates/project/views/rodauth/otp-unlock.erb.tt +28 -0
- data/lib/roda_gen/generators/templates/project/views/rodauth/recovery-auth.erb.tt +23 -0
- data/lib/roda_gen/generators/templates/project/views/rodauth/recovery-codes.erb.tt +26 -0
- data/lib/roda_gen/generators/templates/project/views/rodauth/remember.erb.tt +35 -0
- data/lib/roda_gen/generators/templates/project/views/rodauth/reset-password-request.erb.tt +27 -0
- data/lib/roda_gen/generators/templates/project/views/rodauth/reset-password.erb.tt +30 -0
- data/lib/roda_gen/generators/templates/project/views/rodauth/two-factor-auth.erb.tt +8 -0
- data/lib/roda_gen/generators/templates/project/views/rodauth/two-factor-disable.erb.tt +20 -0
- data/lib/roda_gen/generators/templates/project/views/rodauth/two-factor-manage.erb.tt +36 -0
- data/lib/roda_gen/generators/templates/project/views/rodauth/unlock-account-request.erb.tt +13 -0
- data/lib/roda_gen/generators/templates/project/views/rodauth/unlock-account.erb.tt +23 -0
- data/lib/roda_gen/generators/templates/project/views/rodauth/verify-account-resend.erb.tt +26 -0
- data/lib/roda_gen/generators/templates/project/views/rodauth/verify-account.erb.tt +32 -0
- data/lib/roda_gen/generators/templates/project/views/rodauth/verify-login-change.erb.tt +8 -0
- data/lib/roda_gen/generators/templates/route/routes/%plural%.rb.tt +19 -0
- data/lib/roda_gen/generators/templates/route/spec/web/%plural%_spec.rb.tt +36 -0
- data/lib/roda_gen/generators/templates/route/views/%plural%/index.erb.tt +11 -0
- data/lib/roda_gen/generators/templates/route/views/%plural%/show.erb.tt +7 -0
- data/lib/roda_gen/generators/templates/upload/db/migrate/%migration_filename%.rb.tt +13 -0
- data/lib/roda_gen/generators/templates/upload/helpers/upload_serving.rb.tt +43 -0
- data/lib/roda_gen/generators/templates/upload/models/%resource_name%.rb.tt +11 -0
- data/lib/roda_gen/generators/templates/upload/models/%resource_name%_uploader.rb.tt +19 -0
- data/lib/roda_gen/generators/templates/upload/routes/%plural%.rb.tt +44 -0
- data/lib/roda_gen/generators/templates/upload/spec/web/%plural%_spec.rb.tt +56 -0
- data/lib/roda_gen/generators/templates/upload/views/%plural%/index.erb.tt +18 -0
- data/lib/roda_gen/generators/upload.rb +83 -0
- data/lib/roda_gen/project_context.rb +30 -0
- data/lib/roda_gen/version.rb +5 -0
- data/lib/roda_gen.rb +16 -0
- metadata +497 -0
|
@@ -0,0 +1,294 @@
|
|
|
1
|
+
# Turoyo (ISO 639-3 'tru'), Central Neo-Aramaic written in the West Syriac Sertō script.
|
|
2
|
+
# Translations are best-effort, a native speaker should review before any user-facing deployment
|
|
3
|
+
tru:
|
|
4
|
+
# Read by views/layout.erb for <html dir>, an RTL locale declares dir: rtl here.
|
|
5
|
+
# Keyed under html. since the I18n gem reserves the i18n. namespace for plural rules
|
|
6
|
+
html:
|
|
7
|
+
dir: rtl
|
|
8
|
+
|
|
9
|
+
forms:
|
|
10
|
+
required_legend: ܚܩ̈ܠܐ ܕܡܘܫܡ̈ܫܐ ܒ * ܠܙܡ̈ܢ.
|
|
11
|
+
errors:
|
|
12
|
+
summary_heading: ܡܘܕܓܠ ܐܠ ܡܛܠܘ̈ܒܐ ܕܠܬܚܬ ܩܡ ܕܫܘܟ ܡܡܛܝܬ
|
|
13
|
+
profile:
|
|
14
|
+
heading: ܕܡܘܬܟ ܫܟܼܨܝܬܐ
|
|
15
|
+
save: ܢܛܘܪ ܕܡܘܬܐ
|
|
16
|
+
updated_flash: ܕܡܘܬܟ ܫܟܼܨܝܬܐ ܐܬܚܕܬܬ.
|
|
17
|
+
fieldset:
|
|
18
|
+
identity: ܫܘܡܗܐ
|
|
19
|
+
name: ܫܡܐ
|
|
20
|
+
address: ܥܘܢܘܐܢ
|
|
21
|
+
preferences: ܚܘܫܒ̈ܐ
|
|
22
|
+
contact: ܡܫܬܘܕܥܢܘܬܐ
|
|
23
|
+
recovery_codes:
|
|
24
|
+
intro: ܪ̈ܡܙܐ ܕܚܕܬܘܬܐ ܐܢܘܢ ܪ̈ܡܙܐ ܕܚܕܐ ܙܒܢ ܕܣܝܡܝܢ ܠܡܥܠܘ ܐܢ ܛܥܝܬ ܡܫܘܪܪܢܐ. ܒܪܐ ܐܢܘܢ ܡܚܕܐ ܘܢܛܘܪ ܒܐܬܪܐ ܫܪܝܪܐ — ܠܐ ܡܬܚܙܝܢ ܐܠܐ ܚܕܐ ܙܒܢ.
|
|
25
|
+
heading: ܪ̈ܡܙܟ ܕܚܕܬܘܬܐ
|
|
26
|
+
save_warning: ܢܛܘܪ ܪ̈ܡܙܐ ܡܚܕܐ. ܟܠ ܚܕ ܚܫܚ ܚܕܐ ܙܒܢ ܒܠܚܘܕ ܘܠܙܡ ܚܕ ܠܡܥܠܘ ܐܢ ܛܥܝܬ ܡܫܘܪܪܢܟ. ܡܬܚܙܝܢ ܒܠܚܘܕ ܒܦܐܬܐ ܗܕܐ ܘܠܐ ܡܨܝܢ ܠܡܬܚܘܝܘ ܬܘܒ.
|
|
27
|
+
print_hint: ܫܘܡܫ ܠܣܕܪܐ ܕܛܒܥܐ ܕܡܒܚܒܫܢܐ (Cmd/Ctrl+P) ܠܡܫܡܠܘ ܐܝܟ PDF ܐܘ ܠܡܛܒܥܘ ܥܠ ܘܪܩܐ.
|
|
28
|
+
login:
|
|
29
|
+
remember_me: ܕܟܪܢܝ ܒܗܢܐ ܡܐܢܐ
|
|
30
|
+
logout:
|
|
31
|
+
intro: ܦܘܩ ܡܢ ܡܐܢܐ ܗܢܐ. ܡܬܗܦܟ ܐܢܬ ܠܦܐܬܐ ܕܡܥܠܘ.
|
|
32
|
+
two_factor_manage:
|
|
33
|
+
intro: ܕܒܪ ܠܥܠܬܐ ܬܪܝܢܝܬܐ ܕܡܫܡܫܐ ܠܡܫܪܪܘ ܕܐܢܬ ܗܘ ܒܙܒܢܐ ܕܡܥܠܘ.
|
|
34
|
+
empty: ܠܝܬ ܥܠܬܐ ܬܪܝܢܝܬܐ ܕܡܨܝܐ ܠܡܘܣܦܘ ܐܘ ܠܡܫܩܠܘ ܒܗܕܐ ܫܥܬܐ.
|
|
35
|
+
confirm_password:
|
|
36
|
+
intro: ܫܪܪ ܫܘܕܥܟ ܕܗܫܐ ܠܡܙܠܘ ܩܕܡ. ܥܒ̈ܕܐ ܡܕܡ ܒܥܝܢ ܒܘܚܢܐ ܚܕܬܐ ܕܫܘܕܥܐ ܠܢܛܪܘܬ ܚܫܒܢܟ.
|
|
37
|
+
recovery_auth:
|
|
38
|
+
intro: ܠܐ ܡܨܝܬ ܠܡܡܛܝܘ ܠܡܫܘܪܪܢܟ؟ ܥܘܠ ܚܕ ܡܢ ܪ̈ܡܙܐ ܕܚܕܐ ܙܒܢ ܕܢܛܪܬ ܟܕ ܣܕܪܬ ܠܗ.
|
|
39
|
+
close_account:
|
|
40
|
+
intro: ܡܐ ܕܚܫܒܢܟ ܡܬܣܟܪ ܠܐ ܡܨܐ ܐܢܬ ܠܡܥܠܘ ܬܘܒ. ܫܛܪܐ ܕܚܫܒܢܐ ܦܐܫ ܒܣܕܪܐ ܠܢܛܪܘܬ ܫܘܠܫܠܬܐ ܕܕܘܪܫܐ܆ ܐܠܐ ܠܐ ܡܨܐ ܐܢܫ — ܐܦܠܐ ܐܢܬ — ܠܡܫܚܠܦܘ ܒܗ ܬܘܒ.
|
|
41
|
+
otp_disable:
|
|
42
|
+
intro: ܡܐ ܕܡܫܩܠ ܐܢܬ ܫܘܪܪܐ ܕܬܪܝܢ ܥܠ̈ܠܢ ܚܫܒܢܟ ܢܛܝܪ ܒܫܘܕܥܟ ܒܠܚܘܕ. ܐܚܕ ܠܗ ܬܘܒ ܒܒܝ ܕܡܨܝܬ.
|
|
43
|
+
create_account:
|
|
44
|
+
fieldset:
|
|
45
|
+
account: ܚܘܫܒܢܐ
|
|
46
|
+
profile: ܕܡܘܬܐ ܫܟܼܨܝܬܐ
|
|
47
|
+
label:
|
|
48
|
+
email: ܐܓܪܬܐ ܐܠܩܛܪܘܢܝܬܐ
|
|
49
|
+
password: ܡܠܬܐ ܕܛܘܫܝܬܐ
|
|
50
|
+
password_confirm: ܫܪܪ ܡܠܬܐ ܕܛܘܫܝܬܐ
|
|
51
|
+
first_name: ܫܡܐ ܩܕܡܝܐ
|
|
52
|
+
last_name: ܫܡܐ ܕܟܘܢܝܐ
|
|
53
|
+
address: ܥܘܢܘܐܢ
|
|
54
|
+
postal_code: ܪܡܙܐ ܕܒܪܝܕ
|
|
55
|
+
city: ܡܕܝܢܬܐ
|
|
56
|
+
country: ܐܬܪܐ
|
|
57
|
+
language: ܠܫܢܐ
|
|
58
|
+
time_zone: ܡܢܛܩܬܐ ܕܙܒܢܐ
|
|
59
|
+
mobile_number: ܛܠܦܘܢ ܡܙܝܥܐ
|
|
60
|
+
personal_identity_number: "ܡܢܝܢܐ ܫܟܼܨܝܐ (Personnummer, 12 ܡܢܝܢ̈ܐ)"
|
|
61
|
+
gender: ܓܢܣܐ
|
|
62
|
+
gender:
|
|
63
|
+
prefer_not_to_say: ܠܐ ܒܥܐ ܠܡܐܡܪ
|
|
64
|
+
male: ܕܟܪܐ
|
|
65
|
+
female: ܢܩܒܬܐ
|
|
66
|
+
non_binary: ܠܐ ܒܝܢܪܝܐ
|
|
67
|
+
|
|
68
|
+
legal:
|
|
69
|
+
footer:
|
|
70
|
+
aria_label: ܫܘܠܐ ܬܚܬܝܐ
|
|
71
|
+
contact: ܡܚܒܪܢܘܬܐ
|
|
72
|
+
privacy: ܫܬܝܩܘܬܐ
|
|
73
|
+
cookies: ܟܘܼܟܝܼܣ
|
|
74
|
+
disclaimer: ܫܠܡܘܢܘܬܐ ܕܚܘܒܐ
|
|
75
|
+
contact:
|
|
76
|
+
title: ܡܚܒܪܢܘܬܐ ܘܡܘܕܥܢܘܬܐ ܕܫܘܬܦܘܬܐ
|
|
77
|
+
intro: |
|
|
78
|
+
ܡܘܕܥܢܘܬܐ ܕܠܙܡܐ ܒܚܩܘܼܬܐ ܕܣܚܪܐ ܐܠܩܛܪܘܢܝܐ ܕܫܘܝܕ (2 § 7) ܘܒܕܝܪܩܛܝܒ
|
|
79
|
+
ܕܣܚܪܐ ܐܠܩܛܪܘܢܝܐ ܕܐܘܪܘܦܐ (2000/31/EC, ܐܪܛܝܩ̈ܠ 5).
|
|
80
|
+
company_heading: ܫܘܬܦܘܬܐ
|
|
81
|
+
company_name: ܫܡܐ ܕܫܘܬܦܘܬܐ
|
|
82
|
+
org_nr: ܡܢܝܢܐ ܕܫܘܬܦܘܬܐ
|
|
83
|
+
vat_id: ܡܢܝܢܐ ܕܘܫܘܚܕ
|
|
84
|
+
representative: ܡܫܠܛܢܐ ܡܫܠܚܢܐ
|
|
85
|
+
address_heading: ܥܘܢܘܐܢ
|
|
86
|
+
contact_heading: ܡܚܒܪܢܘܬܐ
|
|
87
|
+
email: ܒܪܝܕܐ ܐܠܩܛܪܘܢܝܐ
|
|
88
|
+
phone: ܛܠܦܘܢ
|
|
89
|
+
supervisory_heading: ܫܘܠܛܢܐ ܡܫܠܛܢܐ
|
|
90
|
+
privacy:
|
|
91
|
+
title: ܛܟܣܐ ܕܫܬܝܩܘܬܐ
|
|
92
|
+
intro: |
|
|
93
|
+
ܐܝܟܢ ܚܫܚܝܢܢ ܠܡܕܥܘ ܘܠܡܫܡܫܘ ܘܠܡܛܫܝܘ ܘܠܡܢܛܪܘ ܡܘܕܥܢܘܬܟ ܘܐܝܠܝܢ
|
|
94
|
+
ܙܕܩ̈ܐ ܐܝܬ ܠܟ ܒܛܟܣܐ ܕܫܘܡܠܝܐ ܕܡܘܕܥܢܘܬܐ ܕܐܘܪܘܦܐ (GDPR ܐܪܛܝܩ̈ܠ 13–22).
|
|
95
|
+
controller_heading: ܡܫܠܛܢܐ ܕܡܘܕܥܢܘܬܐ
|
|
96
|
+
controller_body: |
|
|
97
|
+
ܡܫܠܛܢܐ ܕܡܘܕܥܢܘܬܐ ܗܘ ܫܘܬܦܘܬܐ ܫܪܝܪܐ ܕܡܘܫܡܫܐ ܒܦܐܬܐ ܕܡܚܒܪܢܘܬܐ.
|
|
98
|
+
ܚܒܪ ܠܡܚܒܪܢܐ ܕܫܬܝܩܘܬܐ ܒܥܘܢܘܐܢ ܫܦܝܠ ܠܫܘܐ̈ܠܐ.
|
|
99
|
+
collect_heading: ܡܢܐ ܡܕܥܝܢܢ
|
|
100
|
+
collect_body: |
|
|
101
|
+
ܡܐ ܕܒܪܐ ܐܢܬ ܚܫܒܢܐ ܢܛܪܝܢܢ ܒܪܝܕܟ ܘܫܘܕܥܐ ܛܫܝܐ ܘܡܘܕܥܢܘܬܐ ܕܕܡܘܬܐ
|
|
102
|
+
ܫܟܼܨܝܬܐ. ܟܠ ܥܒܕܐ ܕܫܠܡܘܬܐ ܢܛܝܪ ܒܫܘܠܫܠܬܐ ܕܕܘܪܫܐ ܥܡ ܙܒܢܐ ܘܥܢܘܐܢ
|
|
103
|
+
IP ܘܡܢܝܢܐ ܕܫܒܬܐ.
|
|
104
|
+
legal_basis_heading: ܫܬܐܣܬܐ ܕܚܩܘܼܬܐ
|
|
105
|
+
legal_basis_body: |
|
|
106
|
+
ܡܫܡܫܝܢ ܠܡܘܕܥܢܘܬܐ ܥܠ ܫܬܐܣܬܐ ܕ(ܐ) ܫܘܡܠܝܐ ܕܩܝܡܐ ܘ(ܒ) ܚܘܒܐ
|
|
107
|
+
ܕܝܠܢ ܕܫܡܫܢܐ ܫܪܝܪܐ ܘ(ܓ) ܫܠܡܘܬܟ ܠܟܠ ܫܪܒܬܐ ܕܟܘܼܟܝܼܣ.
|
|
108
|
+
retention_heading: ܢܛܘܪܘܬܐ
|
|
109
|
+
retention_body: |
|
|
110
|
+
ܡܘܕܥܢܘܬܐ ܕܚܫܒܢܐ ܢܛܝܪܐ ܟܡܐ ܕܚܫܒܢܐ ܫܘܫܛܢܐ ܘܬܪܥܣܪ ܝܪ̈ܚܐ ܒܬܪ ܣܘܟܪܗ.
|
|
111
|
+
rights_heading: ܙܕܩܝܟ
|
|
112
|
+
rights_body: |
|
|
113
|
+
ܠܦܘܼܬ GDPR ܐܪܛܝܩ̈ܠ 15–22 ܐܝܬ ܠܟ ܙܕܩܐ ܕܬܚܙܐ ܘܬܫܚܠܦ ܘܬܡܚܐ ܡܘܕܥܢܘܬܟ
|
|
114
|
+
ܘܬܥܒܪ ܠܫܘܡܠܝܐ ܕܫܡܘܫܐ ܘܬܩܒܠ ܡܘܕܥܢܘܬܟ ܒܕܝܘܩܢܐ ܫܩܠܢܐ.
|
|
115
|
+
contact_heading: ܐܝܟܢ ܚܒܪ ܠܢ
|
|
116
|
+
contact_body: |
|
|
117
|
+
ܫܕܪ ܫܘܐ̈ܠܐ ܕܫܬܝܩܘܬܐ ܠܥܘܢܘܐܢ ܕܡܘܫܡܫ ܫܦܝܠ. ܡܦܢܝܢܢ ܒܓܘ ܚܕ ܝܪܚܐ.
|
|
118
|
+
cookies:
|
|
119
|
+
title: ܛܟܣܐ ܕܟܘܼܟܝܼܣ
|
|
120
|
+
intro: |
|
|
121
|
+
ܚܫܚܝܢ ܒܟܘܼܟܝܼܣ ܘܒܕܝܠ ܕܣܠܡܐ ܠܡܫܡܫܘ ܠܐܬܪܐ ܘܠܡܕܟܪܘ ܠܕܝܠܝܢ ܕܝܠܟ ܘ
|
|
122
|
+
(ܐܝܟܐ ܕܫܠܡܬ) ܠܡܘܕܥܘ ܫܘܡܠܝܐ ܕܐܬܪܐ. ܟܘܼܟܝܼܣ ܚܫܘܚ̈ܐ ܡܬܬܣܝܡܝܢ
|
|
123
|
+
ܒܠܚܘܕ܆ ܘܟܠ ܫܪܒܬܐ ܐܚܪܬܐ ܡܬܬܣܝܡܐ ܒܠܚܘܕ ܒܬܪ ܫܠܡܘܬܟ.
|
|
124
|
+
categories_heading: ܫܪܒ̈ܬܐ ܕܟܘܼܟܝܼܣ
|
|
125
|
+
services_heading: ܫܡܘܫ̈ܐ ܕܬܠܝܬܐ
|
|
126
|
+
services_empty: ܠܝܬ ܫܡܘܫܐ ܕܬܠܝܬܐ ܒܫܪܒܬܐ ܗܕܐ.
|
|
127
|
+
manage_heading: ܕܒܪ ܕܝܠܝܢ ܕܝܠܟ
|
|
128
|
+
manage_body: |
|
|
129
|
+
ܡܨܝܬ ܠܡܫܚܠܦܘ ܠܒܚܝܪܟ ܕܟܘܼܟܝܼܣ ܒܟܠ ܙܒܢ ܒܦܐܬܐ ܕܕܝܠܝܢ.
|
|
130
|
+
manage_link: ܦܬܚ ܕܝܠܝܢ ܕܟܘܼܟܝܼܣ
|
|
131
|
+
disclaimer:
|
|
132
|
+
title: ܫܠܡܘܢܘܬܐ ܕܚܘܒܐ
|
|
133
|
+
intro: |
|
|
134
|
+
ܐܬܪܐ ܡܫܡܫ ܒܚܘܒܐ ܫܪܝܪܐ ܘܫܘܬܦܘܬܐ ܡܫܬܕܠܐ ܠܡܢܛܪܘ ܠܚܘܫܒܐ
|
|
135
|
+
ܫܪܝܪܐ܆ ܐܠܐ ܠܐ ܫܘܕܥܝܢ ܕܚܘܫܒܐ ܡܫܡܠܝܐ ܐܘ ܚܕܬܐ.
|
|
136
|
+
accuracy_heading: ܫܪܝܪܘܬܐ ܕܡܘܕܥܢܘܬܐ
|
|
137
|
+
accuracy_body: |
|
|
138
|
+
ܦܐ̈ܬܐ ܡܨ̈ܝܢ ܠܡܚܒܫܘ ܛܥܝܘܬܐ ܐܘ ܡܘܕܥܢܘܬܐ ܕܠܐ ܚܕܬܐ. ܠܐ
|
|
139
|
+
ܫܘܕܥܝܢܢ ܠܡܫܡܠܝܘܬܐ ܘܫܪܝܪܘܬܐ.
|
|
140
|
+
liability_heading: ܚܕܕܐ ܕܚܘܒܐ
|
|
141
|
+
liability_body: |
|
|
142
|
+
ܫܘܡܠܝܐ ܕܐܬܪܐ ܒܚܘܒܐ ܕܝܠܟ. ܒܫܒܝܠܐ ܕܡܨܝܢ ܕܚܩܘܼܬܐ܆ ܡܫܡܫܢܐ
|
|
143
|
+
ܠܝܬ ܠܗ ܚܘܒܐ ܥܠ ܚܘܣܪܢܐ ܕܡܢ ܫܘܡܠܝܟ ܕܐܬܪܐ.
|
|
144
|
+
external_heading: ܪ̈ܒܘܛܐ ܒܪ̈ܝܐ
|
|
145
|
+
external_body: |
|
|
146
|
+
ܪ̈ܒܘܛܐ ܠܐܬܪ̈ܐ ܒܪ̈ܝܐ ܝܗܝܒܝܢ ܒܫܘܡܠܝܐ. ܠܝܬ ܠܢ ܫܘܠܛܢܐ ܥܠ ܚܘܫܒܗܘܢ.
|
|
147
|
+
ip_heading: ܙܕܩ̈ܐ ܕܚܘܫܒܐ
|
|
148
|
+
ip_body: |
|
|
149
|
+
ܚܘܫܒܐ ܕܐܬܪܐ ܗܢܐ ܗܘ ܕܡܫܡܫܢܐ ܘܠܐ ܡܬܚܕܬ ܒܠܐ ܫܠܡܘܬܗ.
|
|
150
|
+
governing_law_heading: ܚܩܘܼܬܐ ܕܫܘܠܛܢܐ
|
|
151
|
+
governing_law_body: |
|
|
152
|
+
ܫܠܡܘܢܘܬܐ ܗܕܐ ܡܫܡܫܐ ܒܚܩܘܼܬܐ ܕܫܘܝܕ. ܕܝܢ̈ܐ ܒܒܝܬ ܕܝܢܐ ܕܫܘܝܕ.
|
|
153
|
+
|
|
154
|
+
nav:
|
|
155
|
+
primary: ܪܫܝܐ
|
|
156
|
+
language: ܠܫܢܐ
|
|
157
|
+
user:
|
|
158
|
+
sign_in: ܥܠܘܠ
|
|
159
|
+
sign_out: ܦܘܩܕ
|
|
160
|
+
profile: ܕܡܘܬܐ ܫܟܼܨܝܬܐ
|
|
161
|
+
change_password: ܫܚܠܦ ܡܠܬܐ ܕܛܘܫܝܬܐ
|
|
162
|
+
change_email: ܫܚܠܦ ܐܓܪܬܐ ܐܠܩܛܪܘܢܝܬܐ
|
|
163
|
+
two_factor: ܫܘܪܪܐ ܒܥܠܠ̈ܐ ܕܬܪ̈ܝܢ
|
|
164
|
+
recovery_codes: ܪ̈ܡܙܐ ܕܚܕܬܘܬܐ
|
|
165
|
+
close_account: ܐܚܘܕ ܚܘܫܒܢܐ
|
|
166
|
+
section:
|
|
167
|
+
profile: ܕܡܘܬܐ ܫܟܼܨܝܬܐ
|
|
168
|
+
security: ܛܘܫܝܬܐ
|
|
169
|
+
account: ܚܘܫܒܢܐ
|
|
170
|
+
|
|
171
|
+
admin:
|
|
172
|
+
close: ܣܟܘܪ
|
|
173
|
+
impersonating: "ܡܫܡܫ ܐܢܬ ܐܝܟ %{email}."
|
|
174
|
+
stop_impersonating: ܟܠܝ ܫܘܡܫܐ ܐܝܟ ܐܚܪܢܐ
|
|
175
|
+
impersonate:
|
|
176
|
+
open: ܡܫܡܫ ܐܝܟ ܡܫܡܫܢܐ
|
|
177
|
+
title: ܡܫܡܫ ܐܝܟ ܡܫܡܫܢܐ
|
|
178
|
+
search_placeholder: ܒܨܝ ܒܐܓܪܬܐ ܐܠܩܛܪܘܢܝܬܐ ܐܘ ܒܫܡܐ…
|
|
179
|
+
no_results: ܠܝܬ ܡܫܡ̈ܫܢܐ ܕܡܫܟܚܝܢ.
|
|
180
|
+
locked_accounts:
|
|
181
|
+
open: ܚܘܫܒ̈ܢܐ ܣܟܝܪ̈ܐ
|
|
182
|
+
title: ܚܘܫܒ̈ܢܐ ܣܟܝܪ̈ܐ
|
|
183
|
+
none: ܠܝܬ ܚܘܫܒ̈ܢܐ ܣܟܝܪ̈ܐ.
|
|
184
|
+
unlocked: "%{email} ܐܬܦܬܚ."
|
|
185
|
+
flags:
|
|
186
|
+
nav: ܢܝ̈ܫܐ
|
|
187
|
+
title: ܢܝ̈ܫܐ ܕܚܝ̈ܠܐ
|
|
188
|
+
none: ܠܝܬ ܢܝ̈ܫܐ ܕܚܝ̈ܠܐ ܗܫܐ.
|
|
189
|
+
col:
|
|
190
|
+
flag: ܢܝܫܐ
|
|
191
|
+
state: ܐܝܟܢܝܘܬܐ
|
|
192
|
+
actions: ܥܒ̈ܕܐ
|
|
193
|
+
enable: ܐܚܘܕ
|
|
194
|
+
disable: ܒܛܠ
|
|
195
|
+
set_percentage: "ܣܝܡ %"
|
|
196
|
+
new_key: ܩܠܝܕܐ ܚܕܬܐ ܕܢܝܫܐ
|
|
197
|
+
create: ܒܪܝ ܢܝܫܐ
|
|
198
|
+
created: "ܢܝܫܐ %{key} ܐܬܒܪܝ."
|
|
199
|
+
updated: "ܢܝܫܐ %{key} ܐܬܚܕܬ."
|
|
200
|
+
state:
|
|
201
|
+
enabled: ܦܬܝܚܐ
|
|
202
|
+
disabled: ܣܟܝܪܐ
|
|
203
|
+
partial: "%{percentage}% ܕܡܫܡ̈ܫܢܐ"
|
|
204
|
+
|
|
205
|
+
push:
|
|
206
|
+
fieldset: ܡܘܕܥ̈ܢܘܬܐ
|
|
207
|
+
description: ܩܒܠ ܡܘܕܥ̈ܢܘܬܐ ܕܕܘܚܝܐ ܒܗܢܐ ܡܒܚܒܫܢܐ܆ ܐܦ ܟܕ ܐܬܪܐ ܣܟܝܪ.
|
|
208
|
+
enable: ܐܚܘܕ ܡܘܕܥ̈ܢܘܬܐ
|
|
209
|
+
enabled: ܐܚܝܕ̈ܢ ܡܘܕܥ̈ܢܘܬܐ
|
|
210
|
+
unsupported: ܠܐ ܡܣܬܡܟ ܒܗܢܐ ܡܒܚܒܫܢܐ
|
|
211
|
+
notification:
|
|
212
|
+
title: "%{app}"
|
|
213
|
+
body: ܐܝܬ ܠܟ ܡܘܕܥܢܘܬܐ ܚܕܬܐ.
|
|
214
|
+
|
|
215
|
+
upload:
|
|
216
|
+
drop_here: ܣܝܡ ܦܝ̈ܠܐ ܐܘ ܟܝ̈ܣܐ ܗܪܟܐ
|
|
217
|
+
hint: ܗܠ %{max} MB ܠܟܠ ܦܝܠܐ. ܟܝ̈ܣܐ ܢܛܪܝܢ ܪܘܟܒܗܘܢ.
|
|
218
|
+
choose_files: ܓܒܝ ܦܝ̈ܠܐ
|
|
219
|
+
choose_folder: ܓܒܝ ܟܝܣܐ
|
|
220
|
+
too_large: ܪܒܐ ܣܓܝ (ܡܟܣܐ %{max} MB)
|
|
221
|
+
too_many: ܦܝ̈ܠܐ ܣܓܝ̈ܐܐ ܒܚܕܐ ܙܒܢܐ (ܡܟܣܐ %{max})
|
|
222
|
+
failed: ܡܣܩܬܐ ܠܐ ܐܙܠܐ
|
|
223
|
+
done: ܡܣܩ
|
|
224
|
+
|
|
225
|
+
consent_kit:
|
|
226
|
+
preferences:
|
|
227
|
+
close: ܣܟܘܪ
|
|
228
|
+
|
|
229
|
+
gdpr:
|
|
230
|
+
nav: ܡܘܕܥܢܘܬܟ
|
|
231
|
+
title: ܡܘܕܥܢܘܬܟ
|
|
232
|
+
export:
|
|
233
|
+
heading: ܐܦܩ ܡܘܕܥܢܘܬܟ
|
|
234
|
+
description: ܫܕܪܝܢܢ ܠܟ ܒܐܓܪܬܐ ܐܠܩܛܪܘܢܝܬܐ ܢܘܣܟܐ ܫܩܠܢܐ ܕܡܘܕܥܢܘܬܐ ܫܟܼܨܝܬܐ ܕܐܝܬ ܠܢ ܥܠܝܟ.
|
|
235
|
+
button: ܛܠܘܒ ܐܦܩܬܐ
|
|
236
|
+
queued: ܫܕܪܝܢܢ ܠܟ ܐܦܩܬܐ ܕܡܘܕܥܢܘܬܟ ܒܥܓܠ.
|
|
237
|
+
erase:
|
|
238
|
+
heading: ܡܚܝ ܚܘܫܒܢܟ
|
|
239
|
+
description: ܣܟܘܪ ܚܘܫܒܢܟ ܠܥܠܡ ܘܡܚܝ ܡܘܕܥܢܘܬܟ ܫܟܼܨܝܬܐ.
|
|
240
|
+
warning: ܗܕܐ ܠܐ ܡܨܝܐ ܠܡܬܗܦܟܘ. ܚܘܫܒܢܟ ܡܬܣܟܪ ܡܚܕܐ؛ ܡܘܕܥ̈ܢܘܬܐ ܡܕܡ ܦܝܫܝ ܒܕܝܘܩܢܐ ܡܛܫܝܐ ܒܠܚܘܕ ܟܡܐ ܕܠܙܡ ܚܩܘܼܬܐ.
|
|
241
|
+
confirm_label: ܝܕܥ ܐܢܐ ܕܗܕܐ ܗܝ ܠܥܠܡ.
|
|
242
|
+
button: ܡܚܝ ܚܘܫܒܢܝ
|
|
243
|
+
erased_page:
|
|
244
|
+
heading: ܚܘܫܒܢܟ ܐܬܡܚܝ
|
|
245
|
+
body: ܚܘܫܒܢܟ ܣܟܝܪ ܘܡܘܕܥܢܘܬܟ ܫܟܼܨܝܬܐ ܡܬܡܚܝܐ. ܫܕܪܢ ܠܟ ܫܪܪܐ ܒܐܓܪܬܐ ܐܠܩܛܪܘܢܝܬܐ.
|
|
246
|
+
retention_note: ܫܛܪܐ ܙܥܘܪܐ ܡܛܫܝܐ ܦܐܫ ܒܠܚܘܕ ܟܡܐ ܕܠܙܡ ܚܩܘܼܬܐ܆ ܘܗܝܕܝܢ ܡܬܡܚܐ ܡܢ ܢܦܫܗ.
|
|
247
|
+
home_link: ܚܙܘܪ ܠܦܐܬܐ ܕܫܘܪܝܐ
|
|
248
|
+
|
|
249
|
+
locales:
|
|
250
|
+
de: Deutsch
|
|
251
|
+
en: English
|
|
252
|
+
es: Español
|
|
253
|
+
fr: Français
|
|
254
|
+
it: Italiano
|
|
255
|
+
sv: Svenska
|
|
256
|
+
tru: ܣܘܪܝܘܝܐ
|
|
257
|
+
|
|
258
|
+
errors:
|
|
259
|
+
not_found:
|
|
260
|
+
title: ܠܐ ܐܫܬܟܚܬ ܦܐܬܐ
|
|
261
|
+
body: ܦܐܬܐ ܕܒܥܝܬ ܠܗ̇ ܠܐ ܐܝܬ ܐܘ ܫܘܢܝܬ ܠܗ̇
|
|
262
|
+
forbidden:
|
|
263
|
+
title: ܡܥܠܢܘܬܐ ܟܠܝܬܐ
|
|
264
|
+
body: ܠܝܬ ܠܟ ܡܫܠܛܢܘܬܐ ܠܡܚܙܐ ܗܕܐ ܦܐܬܐ.
|
|
265
|
+
server_error:
|
|
266
|
+
title: ܡܕܡ ܠܐ ܛܒܼ
|
|
267
|
+
body: ܒܚܫܒܐ ܕܠܐ ܒܚܘܫܒܢܐ ܐܬܚܘܝ. ܦܠܛܐ ܡܬܝܕܥ ܠܗ̇.
|
|
268
|
+
back_home: ܚܙܘܪ ܠܦܐܬܐ ܕܫܘܪܝܐ
|
|
269
|
+
|
|
270
|
+
validation:
|
|
271
|
+
must_not_be_blank: ܠܐ ܡܨܐ ܕܢܗܘܐ ܣܪܝܩܐ
|
|
272
|
+
|
|
273
|
+
# Pluralization demo, I18n::Backend::Pluralization picks the form per locale via twitter_cldr (30_i18n.rb)
|
|
274
|
+
cart:
|
|
275
|
+
items:
|
|
276
|
+
one: "1 ܐܕܫܐ"
|
|
277
|
+
other: "%{count} ܐܕ̈ܫܐ"
|
|
278
|
+
|
|
279
|
+
mailers:
|
|
280
|
+
account_unlocked:
|
|
281
|
+
subject: "ܚܘܫܒܢܟ ܕ%{app} ܐܬܦܬܚ"
|
|
282
|
+
greeting: "ܫܠܡܐ %{recipient},"
|
|
283
|
+
body: "ܡܕܒܪܢܐ ܦܬܚ ܚܘܫܒܢܟ ܕ%{app}. ܡܨܝܬ ܠܡܥܠܘ ܬܘܒ."
|
|
284
|
+
sign_off: "— ܟܢܫܐ ܕ%{app}"
|
|
285
|
+
data_export:
|
|
286
|
+
subject: "ܐܦܩܬܐ ܕܡܘܕܥܢܘܬܟ ܕ%{app}"
|
|
287
|
+
greeting: "ܫܠܡܐ %{recipient},"
|
|
288
|
+
body: "ܐܦܩܬܐ ܕܡܘܕܥܢܘܬܟ ܫܟܼܨܝܬܐ ܡܠܘܝܐ ܐܝܟ ܦܝܢܟܐ JSON."
|
|
289
|
+
sign_off: "— ܟܢܫܐ ܕ%{app}"
|
|
290
|
+
data_erased:
|
|
291
|
+
subject: "ܚܘܫܒܢܟ ܕ%{app} ܐܬܡܚܝ"
|
|
292
|
+
greeting: "ܫܠܡܐ %{recipient},"
|
|
293
|
+
body: "ܚܘܫܒܢܟ ܐܬܣܟܪ ܘܡܘܕܥܢܘܬܟ ܫܟܼܨܝܬܐ ܐܬܡܚܝܬ. ܫܛܪܐ ܙܥܘܪܐ ܡܛܫܝܐ ܦܐܫ ܒܠܚܘܕ ܟܡܐ ܕܠܙܡ ܚܩܘܼܬܐ."
|
|
294
|
+
sign_off: "— ܟܢܫܐ ܕ%{app}"
|
|
File without changes
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require 'rodauth/model'
|
|
4
|
+
|
|
5
|
+
# Rodauth::Model adds an association per enabled Rodauth feature
|
|
6
|
+
class Account < Sequel::Model
|
|
7
|
+
include Rodauth::Model(<%= @app.camel %>.rodauth)
|
|
8
|
+
|
|
9
|
+
one_to_one :profile,
|
|
10
|
+
class: :AccountProfile,
|
|
11
|
+
key: :account_id
|
|
12
|
+
|
|
13
|
+
many_to_many :roles,
|
|
14
|
+
left_key: :account_id,
|
|
15
|
+
right_key: :role_id,
|
|
16
|
+
join_table: :account_roles
|
|
17
|
+
many_to_many :direct_privileges,
|
|
18
|
+
class: :Privilege,
|
|
19
|
+
left_key: :account_id,
|
|
20
|
+
right_key: :privilege_id,
|
|
21
|
+
join_table: :account_privileges
|
|
22
|
+
|
|
23
|
+
def all_privileges
|
|
24
|
+
@all_privileges ||= begin
|
|
25
|
+
direct = direct_privileges_dataset.select(:privilege)
|
|
26
|
+
via_roles = RolePrivilege
|
|
27
|
+
.where(role_id: AccountRole.where(account_id: id).select(:role_id))
|
|
28
|
+
.select(:privilege_id)
|
|
29
|
+
direct.union(via_roles).select_map(:privilege)
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
def privilege?(*privileges)
|
|
34
|
+
# Fail closed on an empty list, [] - all_privileges == [] would answer yes
|
|
35
|
+
raise ArgumentError, '#privilege? requires at least one privilege code' if privileges.empty?
|
|
36
|
+
|
|
37
|
+
(privileges - all_privileges).empty?
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
# Namespaced so Flipper ids never collide with another actor type
|
|
41
|
+
def flipper_id = "Account;#{id}"
|
|
42
|
+
|
|
43
|
+
private
|
|
44
|
+
|
|
45
|
+
# Sequel's own refresh hook, so account.reload sees a grant made since load
|
|
46
|
+
def _refresh_set_values(hash)
|
|
47
|
+
@all_privileges = nil
|
|
48
|
+
super
|
|
49
|
+
end
|
|
50
|
+
end
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require_relative '../lib/rbac_audit'
|
|
4
|
+
|
|
5
|
+
# Direct grant, the escape hatch when one account needs a privilege without a role
|
|
6
|
+
class AccountPrivilege < Sequel::Model
|
|
7
|
+
include RbacAudit
|
|
8
|
+
|
|
9
|
+
audit_rbac 'rbac.account_privilege', created: 'grant', deleted: 'revoke'
|
|
10
|
+
|
|
11
|
+
unrestrict_primary_key
|
|
12
|
+
|
|
13
|
+
many_to_one :account
|
|
14
|
+
many_to_one :privilege
|
|
15
|
+
end
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# Created by 57_rodauth.rb's after_create_account hook, same transaction as the account
|
|
4
|
+
class AccountProfile < Sequel::Model
|
|
5
|
+
# PK is the FK to accounts.id, set from Rodauth's account_id, never from params
|
|
6
|
+
unrestrict_primary_key
|
|
7
|
+
|
|
8
|
+
many_to_one :account, key: :account_id
|
|
9
|
+
|
|
10
|
+
def full_name
|
|
11
|
+
"#{first_name} #{last_name}".strip
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
# nil on a malformed column, CHECK stops new writes but imported rows may differ
|
|
15
|
+
def birthdate
|
|
16
|
+
Date.parse(personal_identity_number[0, 8]) if personal_identity_number&.match?(/\A\d{12}\z/)
|
|
17
|
+
rescue Date::Error
|
|
18
|
+
nil
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
# auto_validations only gives validates_not_null, which lets "" through
|
|
22
|
+
# Same field set as before_create_account in 57_rodauth.rb, keep in sync
|
|
23
|
+
REQUIRED_PRESENCE = %i[
|
|
24
|
+
first_name last_name address postal_code city
|
|
25
|
+
country language time_zone mobile_number
|
|
26
|
+
personal_identity_number
|
|
27
|
+
].freeze
|
|
28
|
+
|
|
29
|
+
def validate
|
|
30
|
+
super
|
|
31
|
+
# message: resolved per call so the current I18n.locale applies
|
|
32
|
+
validates_presence REQUIRED_PRESENCE, message: I18n.t('validation.must_not_be_blank')
|
|
33
|
+
|
|
34
|
+
pin = personal_identity_number
|
|
35
|
+
# errors[:field] is nil, not [], when the field is clean
|
|
36
|
+
return if errors[:personal_identity_number]&.any?
|
|
37
|
+
return errors.add(:personal_identity_number, 'must be 12 digits') unless pin.match?(/\A\d{12}\z/)
|
|
38
|
+
return errors.add(:personal_identity_number, 'starts with an invalid date') unless birthdate
|
|
39
|
+
|
|
40
|
+
errors.add(:personal_identity_number, 'check digit is invalid') unless personal_identity_number_luhn_valid?
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
# Swedish personnummer check digit, Luhn over the last 10 digits
|
|
44
|
+
def personal_identity_number_luhn_valid?
|
|
45
|
+
digits = personal_identity_number[2, 10].chars.map(&:to_i)
|
|
46
|
+
total = digits.each_with_index.sum do |digit, i|
|
|
47
|
+
doubled = i.even? ? digit * 2 : digit
|
|
48
|
+
doubled > 9 ? doubled - 9 : doubled
|
|
49
|
+
end
|
|
50
|
+
(total % 10).zero?
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
# Before validation so presence sees the canonical value, a bare "()" would pass otherwise
|
|
54
|
+
def before_validation
|
|
55
|
+
self.mobile_number = canon_phone_number(mobile_number)
|
|
56
|
+
super
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
# "070-123 45 67" with country "SE" becomes "+46701234567", an unseeded
|
|
60
|
+
# country_calling_codes logs and returns the digits as-is
|
|
61
|
+
def canon_phone_number(raw)
|
|
62
|
+
return nil unless raw
|
|
63
|
+
|
|
64
|
+
# Keep digits and "+", drop any "+" that is not leading
|
|
65
|
+
number = raw.gsub(/[^0-9+]/, '').gsub(/(.)\+/, '\1')
|
|
66
|
+
return '' if number.empty?
|
|
67
|
+
|
|
68
|
+
number.start_with?('+') ? canonicalize_international(number) : canonicalize_local(number)
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
private
|
|
72
|
+
|
|
73
|
+
def canonicalize_local(number)
|
|
74
|
+
calling_code, trunc_code = CountryCallingCode
|
|
75
|
+
.where(country: country)
|
|
76
|
+
.get(%i[calling_code trunc_code])
|
|
77
|
+
|
|
78
|
+
unless calling_code
|
|
79
|
+
DB.loggers.first&.warn("country_calling_codes has no row for #{country.inspect}")
|
|
80
|
+
return number
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
strip_exit_code(number) || prepend_calling_code(number, calling_code, trunc_code)
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
# User typed the international dial prefix ("00", "011") instead of "+"
|
|
87
|
+
def strip_exit_code(number)
|
|
88
|
+
CountryExitCode.where(country: country).select_map(:exit_code).each do |code|
|
|
89
|
+
return "+#{number[code.size..]}" if number.start_with?(code)
|
|
90
|
+
end
|
|
91
|
+
nil
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
def prepend_calling_code(number, calling_code, trunc_code)
|
|
95
|
+
number = number[trunc_code.size..] if trunc_code && number.start_with?(trunc_code)
|
|
96
|
+
"+#{calling_code}#{number}"
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
# Longest known 1-3 digit calling code wins, then a stray trunk digit after it
|
|
100
|
+
# is stripped ("+460701234567" becomes "+46701234567" when SE's trunc is "0")
|
|
101
|
+
def canonicalize_international(number)
|
|
102
|
+
digits = number[1..]
|
|
103
|
+
row = DB.fetch(<<~SQL, digits).first
|
|
104
|
+
SELECT calling_code, trunc_code
|
|
105
|
+
FROM country_calling_codes
|
|
106
|
+
JOIN (SELECT substring(? FROM 1 FOR generate_series) AS calling_code, generate_series
|
|
107
|
+
FROM generate_series(1, 3)) AS prefixes USING (calling_code)
|
|
108
|
+
ORDER BY generate_series DESC, country
|
|
109
|
+
LIMIT 1
|
|
110
|
+
SQL
|
|
111
|
+
return number unless row
|
|
112
|
+
|
|
113
|
+
number.sub(/\A(\+#{Regexp.escape(row[:calling_code])})#{Regexp.escape(row[:trunc_code] || '')}/, '\1')
|
|
114
|
+
end
|
|
115
|
+
end
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require_relative '../lib/rbac_audit'
|
|
4
|
+
|
|
5
|
+
class AccountRole < Sequel::Model
|
|
6
|
+
include RbacAudit
|
|
7
|
+
|
|
8
|
+
audit_rbac 'rbac.account_role', created: 'grant', deleted: 'revoke'
|
|
9
|
+
|
|
10
|
+
unrestrict_primary_key
|
|
11
|
+
|
|
12
|
+
many_to_one :account
|
|
13
|
+
many_to_one :role
|
|
14
|
+
end
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require_relative '../lib/audit_lookup'
|
|
4
|
+
|
|
5
|
+
# Audit action codes, for instance 'user.login'
|
|
6
|
+
class AuditAction < Sequel::Model(Sequel[:audit_log][:actions])
|
|
7
|
+
extend AuditLookup
|
|
8
|
+
|
|
9
|
+
unrestrict_primary_key
|
|
10
|
+
|
|
11
|
+
def self.unknown_code_message(code) # :nodoc:
|
|
12
|
+
<<~MSG.chomp
|
|
13
|
+
Unknown audit action: #{code.inspect}. Register it first, e.g.:
|
|
14
|
+
|
|
15
|
+
AuditAction.create(
|
|
16
|
+
code: '#{code}',
|
|
17
|
+
category: 'auth',
|
|
18
|
+
description: '...'
|
|
19
|
+
)
|
|
20
|
+
AuditAction.refresh_cache!
|
|
21
|
+
MSG
|
|
22
|
+
end
|
|
23
|
+
end
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require_relative '../lib/audit_lookup'
|
|
4
|
+
|
|
5
|
+
# Impersonation is metadata.impersonator_id, not an actor type
|
|
6
|
+
class AuditActorType < Sequel::Model(Sequel[:audit_log][:actor_types])
|
|
7
|
+
extend AuditLookup
|
|
8
|
+
|
|
9
|
+
unrestrict_primary_key
|
|
10
|
+
end
|