consentful 0.1.0.pre1

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 (77) hide show
  1. checksums.yaml +7 -0
  2. data/MIT-LICENSE +20 -0
  3. data/README.md +28 -0
  4. data/Rakefile +6 -0
  5. data/app/assets/stylesheets/consentful/application.css +15 -0
  6. data/app/assets/stylesheets/consentful/consent.scss +518 -0
  7. data/app/components/consentful/banner.html.erb +53 -0
  8. data/app/components/consentful/banner.rb +27 -0
  9. data/app/components/consentful/modal.html.erb +19 -0
  10. data/app/components/consentful/modal.rb +21 -0
  11. data/app/components/consentful/preferences.html.erb +167 -0
  12. data/app/components/consentful/preferences.rb +48 -0
  13. data/app/components/consentful/service_detail.html.erb +99 -0
  14. data/app/components/consentful/service_detail.rb +18 -0
  15. data/app/components/consentful/toggle.html.erb +30 -0
  16. data/app/components/consentful/toggle.rb +30 -0
  17. data/app/controllers/concerns/consentful/visitor_cookie.rb +52 -0
  18. data/app/controllers/consentful/admin/base_controller.rb +27 -0
  19. data/app/controllers/consentful/admin/categories_controller.rb +46 -0
  20. data/app/controllers/consentful/admin/copy_versions_controller.rb +113 -0
  21. data/app/controllers/consentful/admin/dashboard_controller.rb +11 -0
  22. data/app/controllers/consentful/admin/records_controller.rb +11 -0
  23. data/app/controllers/consentful/admin/services_controller.rb +80 -0
  24. data/app/controllers/consentful/application_controller.rb +9 -0
  25. data/app/controllers/consentful/consent_controller.rb +132 -0
  26. data/app/helpers/consentful/application_helper.rb +4 -0
  27. data/app/helpers/consentful/consent_helper.rb +23 -0
  28. data/app/javascript/consentful/controllers/banner_controller.js +92 -0
  29. data/app/javascript/consentful/controllers/clipboard_copy_controller.js +30 -0
  30. data/app/javascript/consentful/controllers/modal_controller.js +50 -0
  31. data/app/javascript/consentful/controllers/modal_trigger_controller.js +9 -0
  32. data/app/javascript/consentful/controllers/preferences_controller.js +182 -0
  33. data/app/javascript/consentful/index.js +42 -0
  34. data/app/javascript/consentful/state.js +91 -0
  35. data/app/jobs/consentful/application_job.rb +4 -0
  36. data/app/mailers/consentful/application_mailer.rb +6 -0
  37. data/app/models/consentful/application_record.rb +8 -0
  38. data/app/models/consentful/consent_category.rb +21 -0
  39. data/app/models/consentful/consent_copy_version.rb +49 -0
  40. data/app/models/consentful/consent_record.rb +33 -0
  41. data/app/models/consentful/consent_service.rb +38 -0
  42. data/app/models/consentful/consent_state.rb +80 -0
  43. data/app/models/consentful/consent_visitor_link.rb +26 -0
  44. data/app/presenters/consentful/consent_record_presenter.rb +73 -0
  45. data/app/services/consentful/dashboard_report.rb +45 -0
  46. data/app/services/consentful/sar_lookup.rb +47 -0
  47. data/app/views/consentful/admin/categories/edit.html.erb +22 -0
  48. data/app/views/consentful/admin/categories/index.html.erb +17 -0
  49. data/app/views/consentful/admin/copy_versions/_form.html.erb +34 -0
  50. data/app/views/consentful/admin/copy_versions/edit.html.erb +2 -0
  51. data/app/views/consentful/admin/copy_versions/index.html.erb +34 -0
  52. data/app/views/consentful/admin/copy_versions/new.html.erb +2 -0
  53. data/app/views/consentful/admin/copy_versions/show.html.erb +24 -0
  54. data/app/views/consentful/admin/dashboard/show.html.erb +35 -0
  55. data/app/views/consentful/admin/records/index.html.erb +35 -0
  56. data/app/views/consentful/admin/services/_form.html.erb +42 -0
  57. data/app/views/consentful/admin/services/edit.html.erb +2 -0
  58. data/app/views/consentful/admin/services/index.html.erb +27 -0
  59. data/app/views/consentful/admin/services/new.html.erb +2 -0
  60. data/app/views/consentful/consent/preferences.html.erb +14 -0
  61. data/app/views/layouts/consentful/admin.html.erb +66 -0
  62. data/app/views/layouts/consentful/application.html.erb +17 -0
  63. data/config/routes.rb +25 -0
  64. data/db/migrate/20260522100000_create_consent_categories.rb +19 -0
  65. data/db/migrate/20260522100100_create_consent_services.rb +38 -0
  66. data/db/migrate/20260522100200_create_consent_copy_versions.rb +30 -0
  67. data/db/migrate/20260522100300_create_consent_records.rb +22 -0
  68. data/db/migrate/20260522100400_create_consent_visitor_links.rb +21 -0
  69. data/lib/consentful/configuration.rb +100 -0
  70. data/lib/consentful/engine.rb +5 -0
  71. data/lib/consentful/seed_starter.rb +57 -0
  72. data/lib/consentful/version.rb +3 -0
  73. data/lib/consentful.rb +27 -0
  74. data/lib/generators/consentful/install_generator.rb +29 -0
  75. data/lib/generators/consentful/templates/consentful.rb +35 -0
  76. data/lib/tasks/consentful_tasks.rake +9 -0
  77. metadata +149 -0
@@ -0,0 +1,35 @@
1
+ # frozen_string_literal: true
2
+
3
+ Consentful.configure do |config|
4
+ # --- Cookies -------------------------------------------------------------
5
+ # config.cookie_name = "consent"
6
+ # config.visitor_cookie_name = "visitor_id"
7
+ # config.cookie_expiry_months = 12
8
+
9
+ # --- Categories ----------------------------------------------------------
10
+ # config.category_keys = %w[necessary analytics marketing]
11
+ # config.required_category_key = "necessary"
12
+
13
+ # --- SAR identifier types (engine ships email only) ----------------------
14
+ # config.visitor_identifier_types = { email: 0, lead_id: 1, enquiry_id: 2 }
15
+
16
+ # --- Tracking enforcement (flip on once consent_allowed? is wired) -------
17
+ # config.enforce = false
18
+
19
+ # --- Admin panel auth (REQUIRED) -----------------------------------------
20
+ # Gate who can reach the mounted /consent-management admin panel.
21
+ config.authorize = ->(controller) { controller.try(:current_admin).present? }
22
+
23
+ # Who is acting — stamped onto published copy versions as `published_by`.
24
+ config.identify = ->(controller) { controller.try(:current_admin)&.email }
25
+
26
+ # --- Cookie options / error reporting (optional) -------------------------
27
+ # config.cookie_options = ->(request) do
28
+ # { secure: Rails.env.production?, same_site: :lax, httponly: false, domain: ".example.com" }
29
+ # end
30
+ # config.error_handler = ->(exception) { Rollbar.error(exception) }
31
+
32
+ # --- Preference centre ---------------------------------------------------
33
+ # config.sar_contact_email = "privacy@example.com"
34
+ # config.layout = "application" # render /cookie-preferences inside your own layout
35
+ end
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ namespace :consentful do
4
+ desc "Seed a starter set of consent categories, an example service, and a published copy version"
5
+ task seed: :environment do
6
+ Consentful::SeedStarter.call
7
+ puts "Consentful starter data seeded."
8
+ end
9
+ end
metadata ADDED
@@ -0,0 +1,149 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: consentful
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0.pre1
5
+ platform: ruby
6
+ authors:
7
+ - John Arnold
8
+ bindir: bin
9
+ cert_chain: []
10
+ date: 1980-01-02 00:00:00.000000000 Z
11
+ dependencies:
12
+ - !ruby/object:Gem::Dependency
13
+ name: rails
14
+ requirement: !ruby/object:Gem::Requirement
15
+ requirements:
16
+ - - ">="
17
+ - !ruby/object:Gem::Version
18
+ version: '7.1'
19
+ type: :runtime
20
+ prerelease: false
21
+ version_requirements: !ruby/object:Gem::Requirement
22
+ requirements:
23
+ - - ">="
24
+ - !ruby/object:Gem::Version
25
+ version: '7.1'
26
+ - !ruby/object:Gem::Dependency
27
+ name: view_component
28
+ requirement: !ruby/object:Gem::Requirement
29
+ requirements:
30
+ - - ">="
31
+ - !ruby/object:Gem::Version
32
+ version: '3.0'
33
+ type: :runtime
34
+ prerelease: false
35
+ version_requirements: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - ">="
38
+ - !ruby/object:Gem::Version
39
+ version: '3.0'
40
+ description: Consentful is a Rails engine providing cookie/consent state, consent
41
+ recording, a public preference centre, and a self-contained, mountable admin panel
42
+ for managing consent categories, services and copy.
43
+ email:
44
+ - 41114838+jaarnie@users.noreply.github.com
45
+ executables: []
46
+ extensions: []
47
+ extra_rdoc_files: []
48
+ files:
49
+ - MIT-LICENSE
50
+ - README.md
51
+ - Rakefile
52
+ - app/assets/stylesheets/consentful/application.css
53
+ - app/assets/stylesheets/consentful/consent.scss
54
+ - app/components/consentful/banner.html.erb
55
+ - app/components/consentful/banner.rb
56
+ - app/components/consentful/modal.html.erb
57
+ - app/components/consentful/modal.rb
58
+ - app/components/consentful/preferences.html.erb
59
+ - app/components/consentful/preferences.rb
60
+ - app/components/consentful/service_detail.html.erb
61
+ - app/components/consentful/service_detail.rb
62
+ - app/components/consentful/toggle.html.erb
63
+ - app/components/consentful/toggle.rb
64
+ - app/controllers/concerns/consentful/visitor_cookie.rb
65
+ - app/controllers/consentful/admin/base_controller.rb
66
+ - app/controllers/consentful/admin/categories_controller.rb
67
+ - app/controllers/consentful/admin/copy_versions_controller.rb
68
+ - app/controllers/consentful/admin/dashboard_controller.rb
69
+ - app/controllers/consentful/admin/records_controller.rb
70
+ - app/controllers/consentful/admin/services_controller.rb
71
+ - app/controllers/consentful/application_controller.rb
72
+ - app/controllers/consentful/consent_controller.rb
73
+ - app/helpers/consentful/application_helper.rb
74
+ - app/helpers/consentful/consent_helper.rb
75
+ - app/javascript/consentful/controllers/banner_controller.js
76
+ - app/javascript/consentful/controllers/clipboard_copy_controller.js
77
+ - app/javascript/consentful/controllers/modal_controller.js
78
+ - app/javascript/consentful/controllers/modal_trigger_controller.js
79
+ - app/javascript/consentful/controllers/preferences_controller.js
80
+ - app/javascript/consentful/index.js
81
+ - app/javascript/consentful/state.js
82
+ - app/jobs/consentful/application_job.rb
83
+ - app/mailers/consentful/application_mailer.rb
84
+ - app/models/consentful/application_record.rb
85
+ - app/models/consentful/consent_category.rb
86
+ - app/models/consentful/consent_copy_version.rb
87
+ - app/models/consentful/consent_record.rb
88
+ - app/models/consentful/consent_service.rb
89
+ - app/models/consentful/consent_state.rb
90
+ - app/models/consentful/consent_visitor_link.rb
91
+ - app/presenters/consentful/consent_record_presenter.rb
92
+ - app/services/consentful/dashboard_report.rb
93
+ - app/services/consentful/sar_lookup.rb
94
+ - app/views/consentful/admin/categories/edit.html.erb
95
+ - app/views/consentful/admin/categories/index.html.erb
96
+ - app/views/consentful/admin/copy_versions/_form.html.erb
97
+ - app/views/consentful/admin/copy_versions/edit.html.erb
98
+ - app/views/consentful/admin/copy_versions/index.html.erb
99
+ - app/views/consentful/admin/copy_versions/new.html.erb
100
+ - app/views/consentful/admin/copy_versions/show.html.erb
101
+ - app/views/consentful/admin/dashboard/show.html.erb
102
+ - app/views/consentful/admin/records/index.html.erb
103
+ - app/views/consentful/admin/services/_form.html.erb
104
+ - app/views/consentful/admin/services/edit.html.erb
105
+ - app/views/consentful/admin/services/index.html.erb
106
+ - app/views/consentful/admin/services/new.html.erb
107
+ - app/views/consentful/consent/preferences.html.erb
108
+ - app/views/layouts/consentful/admin.html.erb
109
+ - app/views/layouts/consentful/application.html.erb
110
+ - config/routes.rb
111
+ - db/migrate/20260522100000_create_consent_categories.rb
112
+ - db/migrate/20260522100100_create_consent_services.rb
113
+ - db/migrate/20260522100200_create_consent_copy_versions.rb
114
+ - db/migrate/20260522100300_create_consent_records.rb
115
+ - db/migrate/20260522100400_create_consent_visitor_links.rb
116
+ - lib/consentful.rb
117
+ - lib/consentful/configuration.rb
118
+ - lib/consentful/engine.rb
119
+ - lib/consentful/seed_starter.rb
120
+ - lib/consentful/version.rb
121
+ - lib/generators/consentful/install_generator.rb
122
+ - lib/generators/consentful/templates/consentful.rb
123
+ - lib/tasks/consentful_tasks.rake
124
+ homepage: https://github.com/jaarnie/consentful
125
+ licenses:
126
+ - MIT
127
+ metadata:
128
+ homepage_uri: https://github.com/jaarnie/consentful
129
+ source_code_uri: https://github.com/jaarnie/consentful
130
+ changelog_uri: https://github.com/jaarnie/consentful/blob/main/CHANGELOG.md
131
+ rubygems_mfa_required: 'true'
132
+ rdoc_options: []
133
+ require_paths:
134
+ - lib
135
+ required_ruby_version: !ruby/object:Gem::Requirement
136
+ requirements:
137
+ - - ">="
138
+ - !ruby/object:Gem::Version
139
+ version: '3.1'
140
+ required_rubygems_version: !ruby/object:Gem::Requirement
141
+ requirements:
142
+ - - ">="
143
+ - !ruby/object:Gem::Version
144
+ version: '0'
145
+ requirements: []
146
+ rubygems_version: 3.6.9
147
+ specification_version: 4
148
+ summary: A mountable GDPR consent management engine for Rails.
149
+ test_files: []