active_storage_encryption 0.2.0 → 0.2.2
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 +4 -4
- data/.github/dependabot.yml +12 -0
- data/.github/workflows/ci.yml +75 -0
- data/.gitignore +14 -0
- data/.ruby-version +1 -0
- data/.standard.yml +1 -0
- data/Appraisals +2 -0
- data/Gemfile +9 -0
- data/README.md +2 -0
- data/active_storage_encryption.gemspec +45 -0
- data/gemfiles/rails_7.gemfile +1 -0
- data/gemfiles/rails_7.gemfile.lock +2 -1
- data/gemfiles/rails_8.gemfile +1 -0
- data/gemfiles/rails_8.gemfile.lock +2 -1
- data/lib/active_storage_encryption/engine.rb +4 -0
- data/lib/active_storage_encryption/version.rb +1 -1
- data/lib/generators/add_encryption_key_to_active_storage_blobs.rb.erb +9 -0
- data/lib/generators/install_generator.rb +25 -0
- data/test/dummy/app/assets/images/.keep +0 -0
- data/test/dummy/app/controllers/concerns/.keep +0 -0
- data/test/dummy/app/models/concerns/.keep +0 -0
- data/test/dummy/lib/assets/.keep +0 -0
- data/test/dummy/log/.keep +0 -0
- data/test/fixtures/files/.keep +0 -0
- data/test/integration/.keep +0 -0
- metadata +19 -127
- data/test/dummy/log/development.log +0 -304
- data/test/dummy/log/test.log +0 -66969
- data/test/dummy/storage/0a/mt/0amtaps713liftrtbxt9h998epz4 +0 -0
- data/test/dummy/storage/0b/93/0b93pygovuunam1a3ovzwmrbuw2x +0 -0
- data/test/dummy/storage/0m/3s/0m3s7r3nboblijr1jxlnvm3p3l4b +0 -0
- data/test/dummy/storage/0o/9s/0o9s4ctbpu757qh7ucyony0itek4 +0 -0
- data/test/dummy/storage/1e/q6/1eq646og0wazgfw7bwjqz2uem0g4 +0 -0
- data/test/dummy/storage/1n/o3/1no30cpwrm727bm6arvb7zxagdg1 +0 -0
- data/test/dummy/storage/1x/6w/1x6wsoq3pew17reztwax78lrr3hc +0 -0
- data/test/dummy/storage/28/de/28deswrv89c9f2tk7dz1l5uovd4r +0 -0
- data/test/dummy/storage/2h/sd/2hsd1mh20c6os2nzyoicfyymhwev +0 -0
- data/test/dummy/storage/2t/ni/2tnidhdk4c6cj0tnw3jiw88dgs4g +0 -0
- data/test/dummy/storage/2v/e0/2ve0555nluisy2el5cf4txzgae3j +0 -0
- data/test/dummy/storage/2z/c5/2zc5mj8g0o9l7mfnim0vs4v48xd6 +0 -0
- data/test/dummy/storage/34/xc/34xc9hk74dm9227d6mhgfcfxl4ue +0 -0
- data/test/dummy/storage/3z/0t/3z0tnve7ivrq0qyrvfhfzztjhjqs +0 -0
- data/test/dummy/storage/49/14/4914188q1dptpw4po91cp54f32bg +0 -0
- data/test/dummy/storage/4c/74/4c7412lfz0pm2ocg6u01h67bnsch +0 -0
- data/test/dummy/storage/52/qf/52qfbgjlf3gor3agsyrt09t19o55 +0 -0
- data/test/dummy/storage/57/go/57gok1uc4ebc3ugrjrje4lpe1ram +0 -0
- data/test/dummy/storage/5f/dv/5fdvt6tu1mkyajbz4hbxbw6fpt9w +0 -0
- data/test/dummy/storage/5x/b7/5xb7zzi66fi5f6yrn09pq4ogb9wo +0 -0
- data/test/dummy/storage/6m/vr/6mvr1fr5it125tm4vahjw6bv9wkz +0 -0
- data/test/dummy/storage/7b/hb/7bhbdxqn67lape1f49jqfktcei4n +0 -0
- data/test/dummy/storage/7n/4v/7n4vpm1q14y4qffc4jj78m036gtw +0 -0
- data/test/dummy/storage/7q/ku/7qkufbjwbbqwnf89uciosleixnew +0 -0
- data/test/dummy/storage/8l/5v/8l5vb4o02hx46s5qohfn5to945p3 +0 -0
- data/test/dummy/storage/8q/pu/8qpun3f8vzl7auxajvqyq8f48ngw +0 -0
- data/test/dummy/storage/8w/ag/8wag4ptmox207h7mobamk0tcebwx +0 -0
- data/test/dummy/storage/8w/v8/8wv8lrhsw4s2r6guh1csd3jd89ii +0 -0
- data/test/dummy/storage/9b/c6/9bc6wlpfnqdywpnxgeoin3w9b5ch +0 -0
- data/test/dummy/storage/9l/wk/9lwkt21k5iburdaitbwliw7krtwt +0 -0
- data/test/dummy/storage/9p/0v/9p0vgfw3l2854k7so3rp33rmyh7p +0 -0
- data/test/dummy/storage/9r/sy/9rsya3r6syft34qz24g1h4u4qq44 +0 -0
- data/test/dummy/storage/9s/es/9seslusr46xjf3mfzq10hkp13kc1 +0 -0
- data/test/dummy/storage/9t/nv/9tnvn5v52fkvurpgszf4gco78t5h +0 -0
- data/test/dummy/storage/9u/to/9utokgxyu6xyovandu7pjhogoaqp +0 -0
- data/test/dummy/storage/9w/a4/9wa4c20p4dvm1cd5thnv9f7ei13w +0 -0
- data/test/dummy/storage/at/kg/atkgs5gwz2xdv9lvqftsg6p7gcpu +0 -0
- data/test/dummy/storage/at/qo/atqomgf3rpb2f6e1tq1yn2xqzojv +0 -0
- data/test/dummy/storage/ba/lq/balqtije6kf82ht4lr70ajaae9kc +0 -0
- data/test/dummy/storage/bf/i1/bfi1ij9rygr6lkx1r0lhgi8o5smx +0 -0
- data/test/dummy/storage/bg/ye/bgyenotrv3aj6lk88edwv0c41pfj +0 -0
- data/test/dummy/storage/bu/xe/buxed4b1l78kcax53fa37awm9ywk +0 -0
- data/test/dummy/storage/d2/c1/d2c11nhikb474oq3q7so0xbhukvj +0 -0
- data/test/dummy/storage/development.sqlite3 +0 -0
- data/test/dummy/storage/dk/hy/dkhybxn2o27a8xgvfhsxpgqxa1zf +0 -0
- data/test/dummy/storage/e7/2n/e72nz5cz3wf6qvh4dw4qfnw6ucog +0 -0
- data/test/dummy/storage/eo/4q/eo4qn68m7al0ehhe0s23ycuzkjto +0 -0
- data/test/dummy/storage/ew/8s/ew8sejdsx8ddmrzkvfa37ebz1ts1 +0 -0
- data/test/dummy/storage/f8/q1/f8q1kpg2tou8ru0afj8d2gy6ym5p +0 -0
- data/test/dummy/storage/fr/55/fr558uhp1k93jzhb4butyi2ry51t +0 -0
- data/test/dummy/storage/g4/nh/g4nhx1zxbeiegqpgn8ppsl1yhm0t +0 -0
- data/test/dummy/storage/gg/r5/ggr51egxhqfh4w5eluzs47qceb76 +0 -0
- data/test/dummy/storage/gh/ua/ghuaagralqmjy8rkbwmuv3010lvs +0 -0
- data/test/dummy/storage/gx/uh/gxuhmf52ufli3m7ng8irp8ghxa1v +0 -0
- data/test/dummy/storage/h0/m1/h0m1emy251xus1d9qh6u25dzy18o +0 -0
- data/test/dummy/storage/hh/kc/hhkc2q8paptyvhw2m5hlwylhtfo5 +0 -0
- data/test/dummy/storage/hq/0q/hq0q04kr6qzrp0qaee8rehcp2tzx +0 -0
- data/test/dummy/storage/ii/g1/iig1ge3fsjitai4g2fkq4qt369wh +0 -0
- data/test/dummy/storage/io/f0/iof0mv7w8qjd6m826g52pzyxedet +0 -0
- data/test/dummy/storage/jk/2i/jk2ifmx6ac35ubk3esufnm6bn1m1 +0 -0
- data/test/dummy/storage/jw/4t/jw4trdeyfkw3j8z70xcnr9a7gqe5 +0 -0
- data/test/dummy/storage/ke/k2/kek24leksglm1rs2a78mfmot0p3s +0 -0
- data/test/dummy/storage/kh/6d/kh6doaxxwxiyes0yqz2dmmpajkzv +0 -0
- data/test/dummy/storage/kj/7n/kj7nookjhisagd80z8hlv3wn50am +0 -0
- data/test/dummy/storage/kq/lf/kqlf5udtrgrk4v55qodxyt6i68p8 +0 -0
- data/test/dummy/storage/ky/33/ky334jbo8eb08pj9qbe919iz91mh +0 -0
- data/test/dummy/storage/lt/zw/ltzw4lur2bheit1273ogpfzhv7j1 +0 -0
- data/test/dummy/storage/m2/ve/m2vejmyttn1ium81dopppom6vum6 +0 -0
- data/test/dummy/storage/m8/d4/m8d4r9iauedq8wlpvnx1f3ou0jwg +0 -0
- data/test/dummy/storage/m9/ee/m9eetioklzatyff94gq0vn1cga1n +0 -0
- data/test/dummy/storage/ma/v0/mav084zvmyoh1a8i7dcwqy2aaoi9 +0 -0
- data/test/dummy/storage/mg/pa/mgpauiu02i28j3poef65k3q0gfpw +0 -0
- data/test/dummy/storage/mm/8g/mm8gp5evncb1ol1lj2jlmra2ixij +0 -0
- data/test/dummy/storage/mm/d2/mmd21x8c1amgnidzw0wowiwug4g3 +0 -0
- data/test/dummy/storage/n2/qr/n2qro0y9heko9cwxlf10wiqiipsw +0 -0
- data/test/dummy/storage/n8/b7/n8b7b7qgu6jtw577dnn10jrrmszs +0 -0
- data/test/dummy/storage/n8/p2/n8p2ine0qqhphn09kqtxco4y7g0a +0 -0
- data/test/dummy/storage/nk/vh/nkvhgk7snpdy2ak6k02htxx9swp7 +0 -0
- data/test/dummy/storage/nn/s0/nns0nggo0x645ytco52adnsi4myp +0 -0
- data/test/dummy/storage/nu/kz/nukzl7cckkzh68i7kyjkm9mzw7c0 +0 -0
- data/test/dummy/storage/nv/8v/nv8vyoghcde1yr1bjpsw4327qt7s +0 -0
- data/test/dummy/storage/of/on/ofonhf1gs26k3dpj6o7b0ktzfowh +0 -0
- data/test/dummy/storage/pl/pf/plpfs59hvdoogj9gdweqta36csqn +0 -0
- data/test/dummy/storage/q5/g5/q5g55ekmscu10pzfw6q4syigt81g +0 -0
- data/test/dummy/storage/q5/kc/q5kcr9twyb9v4mh31pay0t7nkuwu +0 -0
- data/test/dummy/storage/qa/xd/qaxdngi74r52ahqg1pz8hjddeajc +0 -0
- data/test/dummy/storage/r7/5v/r75vadn34ak53vinylgnfdl1s8rt +0 -0
- data/test/dummy/storage/rj/rg/rjrghnyzyvxpkjw1a57mrloz72x1 +0 -0
- data/test/dummy/storage/se/h7/seh7eorfoanpp6de62pubv7kyu1a +0 -0
- data/test/dummy/storage/sj/i1/sji1oj12soz2fcjcoz0gejvzo8to +0 -0
- data/test/dummy/storage/sn/2r/sn2rku9thay4hbcbt926an69maku +0 -0
- data/test/dummy/storage/sw/jm/swjmbmxou3tnarcirxc6gdycxh91 +0 -0
- data/test/dummy/storage/sz/mq/szmqlydvpgqaw7p3v0wh444wtcif +0 -0
- data/test/dummy/storage/test.sqlite3 +0 -0
- data/test/dummy/storage/tg/by/tgbyrdvg94ivhhy2z59e8l9fod10 +0 -0
- data/test/dummy/storage/u5/vm/u5vmz08tuayqggd436et8fiaeml1 +0 -0
- data/test/dummy/storage/u6/pf/u6pf4yky0vbmvid3fa3lm4lre68g +0 -0
- data/test/dummy/storage/ub/ql/ubqlmlilt8ujgdpngcm1zae41kgy +0 -0
- data/test/dummy/storage/un/29/un29e9khqism72ag27ojccmn5sds +0 -0
- data/test/dummy/storage/ux/ns/uxnsvuk4rr1p67n1oq6tmraz0gaw +0 -0
- data/test/dummy/storage/v1/qo/v1qor0zxg3lctk9mbwyos3oag9gj +0 -0
- data/test/dummy/storage/v8/ok/v8okmd7374w1obna13a7anllx2vu +0 -0
- data/test/dummy/storage/vd/tf/vdtfmz2ctis3dr1r35do9bow2xj5 +0 -0
- data/test/dummy/storage/vo/dg/vodgq1inccnujjt3auber7tt8w8o +0 -0
- data/test/dummy/storage/vp/oe/vpoeiq00tf9pk0jcjlccomkju1zc +0 -0
- data/test/dummy/storage/vu/kg/vukgoj6qf96bhealui2yaeyn4n72 +0 -0
- data/test/dummy/storage/w7/2z/w72zoqu7v6v6jp0tpy671dcbvpow +0 -0
- data/test/dummy/storage/wa/3f/wa3fncsnozc6n4xfu32gw34geqcd +0 -0
- data/test/dummy/storage/wy/ix/wyixbqx3f6a4agb8bjhrtpblpaua +0 -0
- data/test/dummy/storage/xd/st/xdsttma3tqt7mex0vhp1vsm3dq16 +0 -0
- data/test/dummy/storage/xv/ej/xvejm2e064bnpunx3nmktaqs0x90 +0 -0
- data/test/dummy/storage/xx/py/xxpyyodssq2xmp57qrtvuw0wchwk +0 -0
- data/test/dummy/storage/xz/ik/xzikejc5sohi3zexa93s9xmg4jst +0 -0
- data/test/dummy/storage/y4/g8/y4g8teo86blcv0zysa2d2jawvk6i +0 -0
- data/test/dummy/storage/y9/58/y958xli6aoktx1ehuyjc1k8dcbzv +0 -0
- data/test/dummy/storage/yj/lw/yjlw8bf70iujb16deja8ae43rqbc +0 -0
- data/test/dummy/storage/z3/qy/z3qyb9avbucwhxa8909rpfued0y5 +0 -0
- data/test/dummy/storage/zr/wu/zrwudcg4kgo7r0jemszuzok8grqp +0 -0
- data/test/dummy/tmp/local_secret.txt +0 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 850bd7cbc71749f88f1a8e7c4305de38bfbb7c3641ee75864a34ce9f712af65a
|
4
|
+
data.tar.gz: 2ffa5b8c6abc2038395366138eb6f1d43dd4246f3d728e923a440805b7f53838
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 489bf8dbd01ee254354cf3dbcbedab9743f9f16f5b93c352cb234c8eef4f909c31916eef7187002eac8b0f66d476fd55d44cf31bd8320ea6fa275b36d62cb3b6
|
7
|
+
data.tar.gz: 746b6efed5b2e4819f280f511a1eb66882a257b173c6699b85a10606d1eac0210da92f6020c480e08de5e509a34f4eb7ff50f46c703609e5ed284ecd5cb0f23c
|
@@ -0,0 +1,75 @@
|
|
1
|
+
name: CI
|
2
|
+
|
3
|
+
on:
|
4
|
+
pull_request:
|
5
|
+
push:
|
6
|
+
branches: [ main ]
|
7
|
+
|
8
|
+
jobs:
|
9
|
+
lint:
|
10
|
+
name: "Lint"
|
11
|
+
runs-on: ubuntu-latest
|
12
|
+
steps:
|
13
|
+
- name: Checkout code
|
14
|
+
uses: actions/checkout@v4
|
15
|
+
|
16
|
+
# Note: Appraisals for Rails 7 and Rails 8 differ in minimum Ruby version: 3.1.0+ vs 3.2.2+
|
17
|
+
# So the version of Ruby to use here is the version that is able to run all Appraisals
|
18
|
+
- name: Set up Ruby
|
19
|
+
uses: ruby/setup-ruby@v1
|
20
|
+
with:
|
21
|
+
ruby-version: 3.2.2
|
22
|
+
bundler-cache: true
|
23
|
+
|
24
|
+
- name: Lint code for consistent style
|
25
|
+
run: bundle exec standardrb
|
26
|
+
|
27
|
+
test_rails7:
|
28
|
+
name: "Tests (Rails 7)"
|
29
|
+
runs-on: ubuntu-latest
|
30
|
+
env:
|
31
|
+
BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/rails_7.gemfile
|
32
|
+
steps:
|
33
|
+
- name: Install packages
|
34
|
+
run: sudo apt-get update && sudo apt-get install --no-install-recommends -y curl libjemalloc2 sqlite3
|
35
|
+
|
36
|
+
- name: Checkout code
|
37
|
+
uses: actions/checkout@v4
|
38
|
+
|
39
|
+
- name: Set up Ruby
|
40
|
+
uses: ruby/setup-ruby@v1
|
41
|
+
with:
|
42
|
+
ruby-version: 3.2.2
|
43
|
+
bundler-cache: true
|
44
|
+
|
45
|
+
- name: Run tests
|
46
|
+
env:
|
47
|
+
RAILS_ENV: test
|
48
|
+
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
49
|
+
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
50
|
+
run: bin/rails app:test
|
51
|
+
|
52
|
+
test_rails_8:
|
53
|
+
name: "Tests (Rails 8)"
|
54
|
+
runs-on: ubuntu-latest
|
55
|
+
env:
|
56
|
+
BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/rails_8.gemfile
|
57
|
+
steps:
|
58
|
+
- name: Install packages
|
59
|
+
run: sudo apt-get update && sudo apt-get install --no-install-recommends -y curl libjemalloc2 sqlite3
|
60
|
+
|
61
|
+
- name: Checkout code
|
62
|
+
uses: actions/checkout@v4
|
63
|
+
|
64
|
+
- name: Set up Ruby
|
65
|
+
uses: ruby/setup-ruby@v1
|
66
|
+
with:
|
67
|
+
ruby-version: 3.2.2
|
68
|
+
bundler-cache: true
|
69
|
+
|
70
|
+
- name: Run tests
|
71
|
+
env:
|
72
|
+
RAILS_ENV: test
|
73
|
+
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
74
|
+
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
75
|
+
run: bin/rails app:test
|
data/.gitignore
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
/.bundle/
|
2
|
+
/doc/
|
3
|
+
/log/*.log
|
4
|
+
/pkg/
|
5
|
+
/tmp/
|
6
|
+
/test/dummy/db/*.sqlite3
|
7
|
+
/test/dummy/db/*.sqlite3-*
|
8
|
+
/test/dummy/log/*.log
|
9
|
+
/test/dummy/storage/
|
10
|
+
/test/dummy/tmp/
|
11
|
+
|
12
|
+
# The Bundler lockfile should not be cached because its contents is arch-dependent
|
13
|
+
Gemfile.lock
|
14
|
+
.DS_Store
|
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
3.2.2
|
data/.standard.yml
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
ruby_version: 3.1
|
data/Appraisals
CHANGED
data/Gemfile
ADDED
data/README.md
CHANGED
@@ -113,6 +113,8 @@ Implementation details:
|
|
113
113
|
* `x-amz-server-side-encryption-customer-key`
|
114
114
|
* `x-amz-server-side-encryption-customer-key-MD5`
|
115
115
|
|
116
|
+
While S3 allows the `x-amz-server-side-encryption-customer-key-MD5` to be added to the signed URL for PUT, the value of that header gets removed from the signature due to the process called "hoisting" - which occurs during the signing of the URL. So your client _may_ override the encryption key you give it forcibly, by replacing the `x-amz-server-side-encryption-customer-key` and `x-amz-server-side-encryption-customer-key-MD5`. This can produce Blobs encrypted with a key you do not have. If you want to exclude the possibility of this, you need to perform an integrity check on your uploads. The integrity check will fail if the encryption key has been overridden in this manner, and you can then destroy the Blob. This problem has been reported to AWS.
|
117
|
+
|
116
118
|
### EncryptedDiskSevice - Filesystem
|
117
119
|
|
118
120
|
Can be used instead of the cloud services in development, or on the server if desired. The service will use AES-256-GCM encryption, with a way to switch to a different/more modern encryption scheme in the future.
|
@@ -0,0 +1,45 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "lib/active_storage_encryption/version"
|
4
|
+
|
5
|
+
Gem::Specification.new do |spec|
|
6
|
+
spec.name = "active_storage_encryption"
|
7
|
+
spec.version = ActiveStorageEncryption::VERSION
|
8
|
+
spec.authors = ["Julik Tarkhanov", "Sebastian van Hesteren"]
|
9
|
+
spec.email = ["me@julik.nl"]
|
10
|
+
spec.homepage = "https://github.com/cheddar-me/active_storage_encryption"
|
11
|
+
spec.summary = "Customer-supplied encryption key support for ActiveStorage blobs."
|
12
|
+
spec.description = "Adds customer-supplied encryption keys to storage services."
|
13
|
+
spec.license = "MIT"
|
14
|
+
spec.required_ruby_version = ">= 3.1.0"
|
15
|
+
|
16
|
+
# Prevent pushing this gem to RubyGems.org. To allow pushes either set the "allowed_push_host"
|
17
|
+
# to allow pushing to a single host or delete this section to allow pushing to any host.
|
18
|
+
spec.metadata["allowed_push_host"] = "https://rubygems.org"
|
19
|
+
|
20
|
+
# The homepage link on rubygems.org only appears if you add homepage_uri. Just spec.homepage is not enough.
|
21
|
+
spec.metadata["homepage_uri"] = spec.homepage
|
22
|
+
spec.metadata["source_code_uri"] = spec.homepage
|
23
|
+
spec.metadata["changelog_uri"] = "#{spec.homepage}/blob/main/CHANGELOG.md"
|
24
|
+
|
25
|
+
# Do not remove any files from the gemspec - tests are useful because people can read them
|
26
|
+
spec.files = Dir.chdir(File.expand_path(__dir__)) do
|
27
|
+
`git ls-files -z`.split("\x0")
|
28
|
+
end
|
29
|
+
|
30
|
+
spec.add_dependency "rails", ">= 7.2.2.1"
|
31
|
+
spec.add_dependency "block_cipher_kit", ">= 0.0.4"
|
32
|
+
spec.add_dependency "serve_byte_range", "~> 1.0"
|
33
|
+
spec.add_dependency "activestorage"
|
34
|
+
|
35
|
+
# Testing with cloud services
|
36
|
+
spec.add_development_dependency "aws-sdk-s3"
|
37
|
+
spec.add_development_dependency "net-http"
|
38
|
+
|
39
|
+
# Code formatting, linting and testing
|
40
|
+
spec.add_development_dependency "sqlite3"
|
41
|
+
spec.add_development_dependency "standard", ">= 1.35.1"
|
42
|
+
spec.add_development_dependency "appraisal"
|
43
|
+
spec.add_development_dependency "magic_frozen_string_literal"
|
44
|
+
spec.add_development_dependency "rake"
|
45
|
+
end
|
data/gemfiles/rails_7.gemfile
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: ..
|
3
3
|
specs:
|
4
|
-
active_storage_encryption (0.2.
|
4
|
+
active_storage_encryption (0.2.2)
|
5
5
|
activestorage
|
6
6
|
block_cipher_kit (>= 0.0.4)
|
7
7
|
rails (>= 7.2.2.1)
|
@@ -279,6 +279,7 @@ DEPENDENCIES
|
|
279
279
|
rake
|
280
280
|
sqlite3
|
281
281
|
standard (>= 1.35.1)
|
282
|
+
stringio
|
282
283
|
|
283
284
|
BUNDLED WITH
|
284
285
|
2.5.11
|
data/gemfiles/rails_8.gemfile
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: ..
|
3
3
|
specs:
|
4
|
-
active_storage_encryption (0.2.
|
4
|
+
active_storage_encryption (0.2.2)
|
5
5
|
activestorage
|
6
6
|
block_cipher_kit (>= 0.0.4)
|
7
7
|
rails (>= 7.2.2.1)
|
@@ -279,6 +279,7 @@ DEPENDENCIES
|
|
279
279
|
rake
|
280
280
|
sqlite3
|
281
281
|
standard (>= 1.35.1)
|
282
|
+
stringio
|
282
283
|
|
283
284
|
BUNDLED WITH
|
284
285
|
2.5.11
|
@@ -0,0 +1,9 @@
|
|
1
|
+
class AddEncryptionKeyToActiveStorageBlobs < ActiveRecord::Migration[7.2]
|
2
|
+
def change
|
3
|
+
# You _must_ use attribute encryption for this column. Rails uses base64 and JSON encoding
|
4
|
+
# for encrypted attributes, so they can be stored as a string. The "raw" encryption key
|
5
|
+
# that active_storage_encryption will generate and assign to the Blob is going to be
|
6
|
+
# binary, however.
|
7
|
+
add_column :active_storage_blobs, :encryption_key, :string, if_not_exists: true
|
8
|
+
end
|
9
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "rails/generators"
|
4
|
+
require "rails/generators/active_record"
|
5
|
+
|
6
|
+
module ActiveStorageEncryption
|
7
|
+
# The generator is used to install ActiveStorageEncryption. It adds the `encryption_key`
|
8
|
+
# column to ActiveStorage::Blob.
|
9
|
+
# Run it with `bin/rails g active_storage_encryption:install` in your console.
|
10
|
+
class InstallGenerator < Rails::Generators::Base
|
11
|
+
include ActiveRecord::Generators::Migration
|
12
|
+
|
13
|
+
source_paths << File.join(File.dirname(__FILE__, 2))
|
14
|
+
|
15
|
+
# Generates monolithic migration file that contains all database changes.
|
16
|
+
def create_migration_file
|
17
|
+
# Adding a new migration to the gem is then just adding a file.
|
18
|
+
migration_file_paths_in_order = Dir.glob(__dir__ + "/*.rb.erb").sort
|
19
|
+
migration_file_paths_in_order.each do |migration_template_path|
|
20
|
+
untemplated_migration_filename = File.basename(migration_template_path).gsub(/\.erb$/, "")
|
21
|
+
migration_template(migration_template_path, File.join(db_migrate_path, untemplated_migration_filename))
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
metadata
CHANGED
@@ -1,15 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: active_storage_encryption
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Julik Tarkhanov
|
8
8
|
- Sebastian van Hesteren
|
9
|
-
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date: 2025-03
|
11
|
+
date: 2025-04-03 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: rails
|
@@ -172,10 +171,17 @@ executables: []
|
|
172
171
|
extensions: []
|
173
172
|
extra_rdoc_files: []
|
174
173
|
files:
|
174
|
+
- ".github/dependabot.yml"
|
175
|
+
- ".github/workflows/ci.yml"
|
176
|
+
- ".gitignore"
|
177
|
+
- ".ruby-version"
|
178
|
+
- ".standard.yml"
|
175
179
|
- Appraisals
|
180
|
+
- Gemfile
|
176
181
|
- MIT-LICENSE
|
177
182
|
- README.md
|
178
183
|
- Rakefile
|
184
|
+
- active_storage_encryption.gemspec
|
179
185
|
- bin/rails
|
180
186
|
- bin/rubocop
|
181
187
|
- config/initializers/active_storage_encryption.rb
|
@@ -200,13 +206,18 @@ files:
|
|
200
206
|
- lib/active_storage_encryption/private_url_policy.rb
|
201
207
|
- lib/active_storage_encryption/resumable_gcs_upload.rb
|
202
208
|
- lib/active_storage_encryption/version.rb
|
209
|
+
- lib/generators/add_encryption_key_to_active_storage_blobs.rb.erb
|
210
|
+
- lib/generators/install_generator.rb
|
203
211
|
- lib/tasks/active_storage_encryption_tasks.rake
|
204
212
|
- test/active_storage_encryption_test.rb
|
205
213
|
- test/dummy/Rakefile
|
214
|
+
- test/dummy/app/assets/images/.keep
|
206
215
|
- test/dummy/app/assets/stylesheets/application.css
|
207
216
|
- test/dummy/app/controllers/application_controller.rb
|
217
|
+
- test/dummy/app/controllers/concerns/.keep
|
208
218
|
- test/dummy/app/helpers/application_helper.rb
|
209
219
|
- test/dummy/app/models/application_record.rb
|
220
|
+
- test/dummy/app/models/concerns/.keep
|
210
221
|
- test/dummy/app/views/layouts/application.html.erb
|
211
222
|
- test/dummy/app/views/pwa/manifest.json.erb
|
212
223
|
- test/dummy/app/views/pwa/service-worker.js
|
@@ -234,133 +245,16 @@ files:
|
|
234
245
|
- test/dummy/db/migrate/20250304023851_create_active_storage_tables.active_storage.rb
|
235
246
|
- test/dummy/db/migrate/20250304023853_add_blob_encryption_key_column.rb
|
236
247
|
- test/dummy/db/schema.rb
|
237
|
-
- test/dummy/
|
238
|
-
- test/dummy/log
|
248
|
+
- test/dummy/lib/assets/.keep
|
249
|
+
- test/dummy/log/.keep
|
239
250
|
- test/dummy/public/404.html
|
240
251
|
- test/dummy/public/406-unsupported-browser.html
|
241
252
|
- test/dummy/public/422.html
|
242
253
|
- test/dummy/public/500.html
|
243
254
|
- test/dummy/public/icon.png
|
244
255
|
- test/dummy/public/icon.svg
|
245
|
-
- test/
|
246
|
-
- test/
|
247
|
-
- test/dummy/storage/0m/3s/0m3s7r3nboblijr1jxlnvm3p3l4b
|
248
|
-
- test/dummy/storage/0o/9s/0o9s4ctbpu757qh7ucyony0itek4
|
249
|
-
- test/dummy/storage/1e/q6/1eq646og0wazgfw7bwjqz2uem0g4
|
250
|
-
- test/dummy/storage/1n/o3/1no30cpwrm727bm6arvb7zxagdg1
|
251
|
-
- test/dummy/storage/1x/6w/1x6wsoq3pew17reztwax78lrr3hc
|
252
|
-
- test/dummy/storage/28/de/28deswrv89c9f2tk7dz1l5uovd4r
|
253
|
-
- test/dummy/storage/2h/sd/2hsd1mh20c6os2nzyoicfyymhwev
|
254
|
-
- test/dummy/storage/2t/ni/2tnidhdk4c6cj0tnw3jiw88dgs4g
|
255
|
-
- test/dummy/storage/2v/e0/2ve0555nluisy2el5cf4txzgae3j
|
256
|
-
- test/dummy/storage/2z/c5/2zc5mj8g0o9l7mfnim0vs4v48xd6
|
257
|
-
- test/dummy/storage/34/xc/34xc9hk74dm9227d6mhgfcfxl4ue
|
258
|
-
- test/dummy/storage/3z/0t/3z0tnve7ivrq0qyrvfhfzztjhjqs
|
259
|
-
- test/dummy/storage/49/14/4914188q1dptpw4po91cp54f32bg
|
260
|
-
- test/dummy/storage/4c/74/4c7412lfz0pm2ocg6u01h67bnsch
|
261
|
-
- test/dummy/storage/52/qf/52qfbgjlf3gor3agsyrt09t19o55
|
262
|
-
- test/dummy/storage/57/go/57gok1uc4ebc3ugrjrje4lpe1ram
|
263
|
-
- test/dummy/storage/5f/dv/5fdvt6tu1mkyajbz4hbxbw6fpt9w
|
264
|
-
- test/dummy/storage/5x/b7/5xb7zzi66fi5f6yrn09pq4ogb9wo
|
265
|
-
- test/dummy/storage/6m/vr/6mvr1fr5it125tm4vahjw6bv9wkz
|
266
|
-
- test/dummy/storage/7b/hb/7bhbdxqn67lape1f49jqfktcei4n
|
267
|
-
- test/dummy/storage/7n/4v/7n4vpm1q14y4qffc4jj78m036gtw
|
268
|
-
- test/dummy/storage/7q/ku/7qkufbjwbbqwnf89uciosleixnew
|
269
|
-
- test/dummy/storage/8l/5v/8l5vb4o02hx46s5qohfn5to945p3
|
270
|
-
- test/dummy/storage/8q/pu/8qpun3f8vzl7auxajvqyq8f48ngw
|
271
|
-
- test/dummy/storage/8w/ag/8wag4ptmox207h7mobamk0tcebwx
|
272
|
-
- test/dummy/storage/8w/v8/8wv8lrhsw4s2r6guh1csd3jd89ii
|
273
|
-
- test/dummy/storage/9b/c6/9bc6wlpfnqdywpnxgeoin3w9b5ch
|
274
|
-
- test/dummy/storage/9l/wk/9lwkt21k5iburdaitbwliw7krtwt
|
275
|
-
- test/dummy/storage/9p/0v/9p0vgfw3l2854k7so3rp33rmyh7p
|
276
|
-
- test/dummy/storage/9r/sy/9rsya3r6syft34qz24g1h4u4qq44
|
277
|
-
- test/dummy/storage/9s/es/9seslusr46xjf3mfzq10hkp13kc1
|
278
|
-
- test/dummy/storage/9t/nv/9tnvn5v52fkvurpgszf4gco78t5h
|
279
|
-
- test/dummy/storage/9u/to/9utokgxyu6xyovandu7pjhogoaqp
|
280
|
-
- test/dummy/storage/9w/a4/9wa4c20p4dvm1cd5thnv9f7ei13w
|
281
|
-
- test/dummy/storage/at/kg/atkgs5gwz2xdv9lvqftsg6p7gcpu
|
282
|
-
- test/dummy/storage/at/qo/atqomgf3rpb2f6e1tq1yn2xqzojv
|
283
|
-
- test/dummy/storage/ba/lq/balqtije6kf82ht4lr70ajaae9kc
|
284
|
-
- test/dummy/storage/bf/i1/bfi1ij9rygr6lkx1r0lhgi8o5smx
|
285
|
-
- test/dummy/storage/bg/ye/bgyenotrv3aj6lk88edwv0c41pfj
|
286
|
-
- test/dummy/storage/bu/xe/buxed4b1l78kcax53fa37awm9ywk
|
287
|
-
- test/dummy/storage/d2/c1/d2c11nhikb474oq3q7so0xbhukvj
|
288
|
-
- test/dummy/storage/development.sqlite3
|
289
|
-
- test/dummy/storage/dk/hy/dkhybxn2o27a8xgvfhsxpgqxa1zf
|
290
|
-
- test/dummy/storage/e7/2n/e72nz5cz3wf6qvh4dw4qfnw6ucog
|
291
|
-
- test/dummy/storage/eo/4q/eo4qn68m7al0ehhe0s23ycuzkjto
|
292
|
-
- test/dummy/storage/ew/8s/ew8sejdsx8ddmrzkvfa37ebz1ts1
|
293
|
-
- test/dummy/storage/f8/q1/f8q1kpg2tou8ru0afj8d2gy6ym5p
|
294
|
-
- test/dummy/storage/fr/55/fr558uhp1k93jzhb4butyi2ry51t
|
295
|
-
- test/dummy/storage/g4/nh/g4nhx1zxbeiegqpgn8ppsl1yhm0t
|
296
|
-
- test/dummy/storage/gg/r5/ggr51egxhqfh4w5eluzs47qceb76
|
297
|
-
- test/dummy/storage/gh/ua/ghuaagralqmjy8rkbwmuv3010lvs
|
298
|
-
- test/dummy/storage/gx/uh/gxuhmf52ufli3m7ng8irp8ghxa1v
|
299
|
-
- test/dummy/storage/h0/m1/h0m1emy251xus1d9qh6u25dzy18o
|
300
|
-
- test/dummy/storage/hh/kc/hhkc2q8paptyvhw2m5hlwylhtfo5
|
301
|
-
- test/dummy/storage/hq/0q/hq0q04kr6qzrp0qaee8rehcp2tzx
|
302
|
-
- test/dummy/storage/ii/g1/iig1ge3fsjitai4g2fkq4qt369wh
|
303
|
-
- test/dummy/storage/io/f0/iof0mv7w8qjd6m826g52pzyxedet
|
304
|
-
- test/dummy/storage/jk/2i/jk2ifmx6ac35ubk3esufnm6bn1m1
|
305
|
-
- test/dummy/storage/jw/4t/jw4trdeyfkw3j8z70xcnr9a7gqe5
|
306
|
-
- test/dummy/storage/ke/k2/kek24leksglm1rs2a78mfmot0p3s
|
307
|
-
- test/dummy/storage/kh/6d/kh6doaxxwxiyes0yqz2dmmpajkzv
|
308
|
-
- test/dummy/storage/kj/7n/kj7nookjhisagd80z8hlv3wn50am
|
309
|
-
- test/dummy/storage/kq/lf/kqlf5udtrgrk4v55qodxyt6i68p8
|
310
|
-
- test/dummy/storage/ky/33/ky334jbo8eb08pj9qbe919iz91mh
|
311
|
-
- test/dummy/storage/lt/zw/ltzw4lur2bheit1273ogpfzhv7j1
|
312
|
-
- test/dummy/storage/m2/ve/m2vejmyttn1ium81dopppom6vum6
|
313
|
-
- test/dummy/storage/m8/d4/m8d4r9iauedq8wlpvnx1f3ou0jwg
|
314
|
-
- test/dummy/storage/m9/ee/m9eetioklzatyff94gq0vn1cga1n
|
315
|
-
- test/dummy/storage/ma/v0/mav084zvmyoh1a8i7dcwqy2aaoi9
|
316
|
-
- test/dummy/storage/mg/pa/mgpauiu02i28j3poef65k3q0gfpw
|
317
|
-
- test/dummy/storage/mm/8g/mm8gp5evncb1ol1lj2jlmra2ixij
|
318
|
-
- test/dummy/storage/mm/d2/mmd21x8c1amgnidzw0wowiwug4g3
|
319
|
-
- test/dummy/storage/n2/qr/n2qro0y9heko9cwxlf10wiqiipsw
|
320
|
-
- test/dummy/storage/n8/b7/n8b7b7qgu6jtw577dnn10jrrmszs
|
321
|
-
- test/dummy/storage/n8/p2/n8p2ine0qqhphn09kqtxco4y7g0a
|
322
|
-
- test/dummy/storage/nk/vh/nkvhgk7snpdy2ak6k02htxx9swp7
|
323
|
-
- test/dummy/storage/nn/s0/nns0nggo0x645ytco52adnsi4myp
|
324
|
-
- test/dummy/storage/nu/kz/nukzl7cckkzh68i7kyjkm9mzw7c0
|
325
|
-
- test/dummy/storage/nv/8v/nv8vyoghcde1yr1bjpsw4327qt7s
|
326
|
-
- test/dummy/storage/of/on/ofonhf1gs26k3dpj6o7b0ktzfowh
|
327
|
-
- test/dummy/storage/pl/pf/plpfs59hvdoogj9gdweqta36csqn
|
328
|
-
- test/dummy/storage/q5/g5/q5g55ekmscu10pzfw6q4syigt81g
|
329
|
-
- test/dummy/storage/q5/kc/q5kcr9twyb9v4mh31pay0t7nkuwu
|
330
|
-
- test/dummy/storage/qa/xd/qaxdngi74r52ahqg1pz8hjddeajc
|
331
|
-
- test/dummy/storage/r7/5v/r75vadn34ak53vinylgnfdl1s8rt
|
332
|
-
- test/dummy/storage/rj/rg/rjrghnyzyvxpkjw1a57mrloz72x1
|
333
|
-
- test/dummy/storage/se/h7/seh7eorfoanpp6de62pubv7kyu1a
|
334
|
-
- test/dummy/storage/sj/i1/sji1oj12soz2fcjcoz0gejvzo8to
|
335
|
-
- test/dummy/storage/sn/2r/sn2rku9thay4hbcbt926an69maku
|
336
|
-
- test/dummy/storage/sw/jm/swjmbmxou3tnarcirxc6gdycxh91
|
337
|
-
- test/dummy/storage/sz/mq/szmqlydvpgqaw7p3v0wh444wtcif
|
338
|
-
- test/dummy/storage/test.sqlite3
|
339
|
-
- test/dummy/storage/tg/by/tgbyrdvg94ivhhy2z59e8l9fod10
|
340
|
-
- test/dummy/storage/u5/vm/u5vmz08tuayqggd436et8fiaeml1
|
341
|
-
- test/dummy/storage/u6/pf/u6pf4yky0vbmvid3fa3lm4lre68g
|
342
|
-
- test/dummy/storage/ub/ql/ubqlmlilt8ujgdpngcm1zae41kgy
|
343
|
-
- test/dummy/storage/un/29/un29e9khqism72ag27ojccmn5sds
|
344
|
-
- test/dummy/storage/ux/ns/uxnsvuk4rr1p67n1oq6tmraz0gaw
|
345
|
-
- test/dummy/storage/v1/qo/v1qor0zxg3lctk9mbwyos3oag9gj
|
346
|
-
- test/dummy/storage/v8/ok/v8okmd7374w1obna13a7anllx2vu
|
347
|
-
- test/dummy/storage/vd/tf/vdtfmz2ctis3dr1r35do9bow2xj5
|
348
|
-
- test/dummy/storage/vo/dg/vodgq1inccnujjt3auber7tt8w8o
|
349
|
-
- test/dummy/storage/vp/oe/vpoeiq00tf9pk0jcjlccomkju1zc
|
350
|
-
- test/dummy/storage/vu/kg/vukgoj6qf96bhealui2yaeyn4n72
|
351
|
-
- test/dummy/storage/w7/2z/w72zoqu7v6v6jp0tpy671dcbvpow
|
352
|
-
- test/dummy/storage/wa/3f/wa3fncsnozc6n4xfu32gw34geqcd
|
353
|
-
- test/dummy/storage/wy/ix/wyixbqx3f6a4agb8bjhrtpblpaua
|
354
|
-
- test/dummy/storage/xd/st/xdsttma3tqt7mex0vhp1vsm3dq16
|
355
|
-
- test/dummy/storage/xv/ej/xvejm2e064bnpunx3nmktaqs0x90
|
356
|
-
- test/dummy/storage/xx/py/xxpyyodssq2xmp57qrtvuw0wchwk
|
357
|
-
- test/dummy/storage/xz/ik/xzikejc5sohi3zexa93s9xmg4jst
|
358
|
-
- test/dummy/storage/y4/g8/y4g8teo86blcv0zysa2d2jawvk6i
|
359
|
-
- test/dummy/storage/y9/58/y958xli6aoktx1ehuyjc1k8dcbzv
|
360
|
-
- test/dummy/storage/yj/lw/yjlw8bf70iujb16deja8ae43rqbc
|
361
|
-
- test/dummy/storage/z3/qy/z3qyb9avbucwhxa8909rpfued0y5
|
362
|
-
- test/dummy/storage/zr/wu/zrwudcg4kgo7r0jemszuzok8grqp
|
363
|
-
- test/dummy/tmp/local_secret.txt
|
256
|
+
- test/fixtures/files/.keep
|
257
|
+
- test/integration/.keep
|
364
258
|
- test/integration/encrypted_blob_proxy_controller_test.rb
|
365
259
|
- test/integration/encrypted_blobs_controller_test.rb
|
366
260
|
- test/lib/encrypted_disk_service_test.rb
|
@@ -375,7 +269,6 @@ metadata:
|
|
375
269
|
homepage_uri: https://github.com/cheddar-me/active_storage_encryption
|
376
270
|
source_code_uri: https://github.com/cheddar-me/active_storage_encryption
|
377
271
|
changelog_uri: https://github.com/cheddar-me/active_storage_encryption/blob/main/CHANGELOG.md
|
378
|
-
post_install_message:
|
379
272
|
rdoc_options: []
|
380
273
|
require_paths:
|
381
274
|
- lib
|
@@ -390,8 +283,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
390
283
|
- !ruby/object:Gem::Version
|
391
284
|
version: '0'
|
392
285
|
requirements: []
|
393
|
-
rubygems_version: 3.
|
394
|
-
signing_key:
|
286
|
+
rubygems_version: 3.6.6
|
395
287
|
specification_version: 4
|
396
288
|
summary: Customer-supplied encryption key support for ActiveStorage blobs.
|
397
289
|
test_files: []
|