vault-rails 0.0.11 → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +362 -0
  3. data/README.md +106 -0
  4. data/Rakefile +18 -2
  5. data/lib/vault/encrypted_model.rb +112 -0
  6. data/lib/vault/rails.rb +30 -0
  7. data/lib/vault/rails/version.rb +1 -1
  8. data/spec/dummy/Rakefile +6 -0
  9. data/spec/dummy/app/models/person.rb +8 -0
  10. data/spec/dummy/bin/bundle +3 -0
  11. data/spec/dummy/bin/rails +4 -0
  12. data/spec/dummy/bin/rake +4 -0
  13. data/spec/dummy/config.ru +4 -0
  14. data/spec/dummy/config/application.rb +29 -0
  15. data/spec/dummy/config/boot.rb +5 -0
  16. data/spec/dummy/config/database.yml +12 -0
  17. data/spec/dummy/config/environment.rb +5 -0
  18. data/spec/dummy/config/environments/development.rb +37 -0
  19. data/spec/dummy/config/environments/test.rb +39 -0
  20. data/spec/dummy/config/initializers/assets.rb +8 -0
  21. data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
  22. data/spec/dummy/config/initializers/cookies_serializer.rb +3 -0
  23. data/spec/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  24. data/spec/dummy/config/initializers/inflections.rb +16 -0
  25. data/spec/dummy/config/initializers/mime_types.rb +4 -0
  26. data/spec/dummy/config/initializers/session_store.rb +3 -0
  27. data/spec/dummy/config/initializers/vault.rb +9 -0
  28. data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
  29. data/spec/dummy/config/locales/en.yml +23 -0
  30. data/spec/dummy/config/routes.rb +3 -0
  31. data/spec/dummy/config/secrets.yml +22 -0
  32. data/spec/dummy/db/development.sqlite3 +0 -0
  33. data/spec/dummy/db/migrate/20150428220101_create_people.rb +11 -0
  34. data/spec/dummy/db/schema.rb +24 -0
  35. data/spec/dummy/log/development.log +124 -0
  36. data/spec/dummy/public/404.html +67 -0
  37. data/spec/dummy/public/422.html +67 -0
  38. data/spec/dummy/public/500.html +66 -0
  39. data/spec/dummy/public/favicon.ico +0 -0
  40. data/spec/integration/rails_spec.rb +27 -0
  41. data/spec/spec_helper.rb +24 -0
  42. data/spec/support/vault_server.rb +68 -0
  43. data/spec/unit/rails_spec.rb +28 -0
  44. metadata +178 -23
  45. data/lib/vault-rails.rb +0 -5
  46. data/lib/vault/rails/engine.rb +0 -8
  47. data/vendor/assets/javascripts/vault.js.coffee +0 -629
  48. data/vendor/assets/javascripts/vault/vault.js.coffee +0 -629
@@ -0,0 +1,3 @@
1
+ Rails.application.routes.draw do
2
+
3
+ end
@@ -0,0 +1,22 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Your secret key is used for verifying the integrity of signed cookies.
4
+ # If you change this key, all old signed cookies will become invalid!
5
+
6
+ # Make sure the secret is at least 30 characters and all random,
7
+ # no regular words or you'll be exposed to dictionary attacks.
8
+ # You can use `rake secret` to generate a secure secret key.
9
+
10
+ # Make sure the secrets in this file are kept private
11
+ # if you're sharing your code publicly.
12
+
13
+ development:
14
+ secret_key_base: 75a06306a41385efadc01ac44274e1197a95863fcad5509b7613d87d600016292a0f17ffa0d39e63d8929c902a60dbd7cc287808788fa50d4dfeda9af13c92e5
15
+
16
+ test:
17
+ secret_key_base: 96ea431c4b0c7e86c0672ed6927cb93a92f5c7204f632a4ae9bcc33bd7509b5ee5c91ea54cdcdc2582d04fe7333736792c2e8c64c939026d3b69160cb0928874
18
+
19
+ # Do not keep production secrets in the repository,
20
+ # instead read values from the environment.
21
+ production:
22
+ secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>
Binary file
@@ -0,0 +1,11 @@
1
+ class CreatePeople < ActiveRecord::Migration
2
+ def change
3
+ create_table :people do |t|
4
+ t.string :name
5
+ t.string :ssn_encrypted
6
+ t.string :cc_encrypted
7
+
8
+ t.timestamps null: false
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,24 @@
1
+ # encoding: UTF-8
2
+ # This file is auto-generated from the current state of the database. Instead
3
+ # of editing this file, please use the migrations feature of Active Record to
4
+ # incrementally modify your database, and then regenerate this schema definition.
5
+ #
6
+ # Note that this schema.rb definition is the authoritative source for your
7
+ # database schema. If you need to create the application database on another
8
+ # system, you should be using db:schema:load, not running all the migrations
9
+ # from scratch. The latter is a flawed and unsustainable approach (the more migrations
10
+ # you'll amass, the slower it'll run and the greater likelihood for issues).
11
+ #
12
+ # It's strongly recommended that you check this file into your version control system.
13
+
14
+ ActiveRecord::Schema.define(version: 20150428220101) do
15
+
16
+ create_table "people", force: :cascade do |t|
17
+ t.string "name"
18
+ t.string "ssn_encrypted"
19
+ t.string "cc_encrypted"
20
+ t.datetime "created_at", null: false
21
+ t.datetime "updated_at", null: false
22
+ end
23
+
24
+ end
@@ -0,0 +1,124 @@
1
+  (1.1ms) CREATE TABLE "schema_migrations" ("version" varchar NOT NULL) 
2
+  (0.1ms) select sqlite_version(*)
3
+  (0.9ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
4
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
5
+ Migrating to CreatePeople (20150428220101)
6
+  (0.0ms) begin transaction
7
+  (0.3ms) CREATE TABLE "people" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "ssn_encrypted" varchar, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
8
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20150428220101"]]
9
+  (0.9ms) commit transaction
10
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
11
+  (0.1ms) begin transaction
12
+ SQL (1.1ms) INSERT INTO "people" ("ssn_encrypted", "created_at", "updated_at") VALUES (?, ?, ?) [["ssn_encrypted", "vault:v0:ChJFVVQozIQL4Ei0lqTraCToOnXpCcFYGqO5eO63iLRx0ys="], ["created_at", "2015-04-28 22:15:18.385978"], ["updated_at", "2015-04-28 22:15:18.385978"]]
13
+  (0.8ms) commit transaction
14
+ Person Load (0.2ms) SELECT "people".* FROM "people" ORDER BY "people"."id" ASC LIMIT 1
15
+ Person Load (0.1ms) SELECT "people".* FROM "people" ORDER BY "people"."id" ASC LIMIT 1
16
+ Person Load (0.2ms) SELECT "people".* FROM "people" ORDER BY "people"."id" ASC LIMIT 1
17
+ Person Load (0.1ms) SELECT "people".* FROM "people" ORDER BY "people"."id" ASC LIMIT 1
18
+  (0.1ms) begin transaction
19
+ SQL (0.4ms) UPDATE "people" SET "ssn_encrypted" = ?, "updated_at" = ? WHERE "people"."id" = ? [["ssn_encrypted", "vault:v0:6hdPkhvyL6cQszzuUicK/fFwjEFfI0yI7c+Ky7hE0YXogVKfnvUP"], ["updated_at", "2015-04-28 22:17:40.753649"], ["id", 1]]
20
+  (0.8ms) commit transaction
21
+  (0.1ms) begin transaction
22
+ SQL (0.4ms) INSERT INTO "people" ("ssn_encrypted", "created_at", "updated_at") VALUES (?, ?, ?) [["ssn_encrypted", "vault:v0:PyUilsAeJXcs0n48lstavY00bDe+L044ohK+0oHkzq3pKOHsnLVz"], ["created_at", "2015-04-28 22:54:06.392867"], ["updated_at", "2015-04-28 22:54:06.392867"]]
23
+  (0.7ms) commit transaction
24
+ Person Load (0.1ms) SELECT "people".* FROM "people" WHERE "people"."id" = ? LIMIT 1 [["id", nil]]
25
+  (0.1ms) begin transaction
26
+ SQL (0.2ms) INSERT INTO "people" ("ssn_encrypted", "created_at", "updated_at") VALUES (?, ?, ?) [["ssn_encrypted", "vault:v0:4OZF4htnZFxBm+n5hSW1S41dkNekHkka+mupSavZKC/6p4v31XDq"], ["created_at", "2015-04-28 22:54:06.402538"], ["updated_at", "2015-04-28 22:54:06.402538"]]
27
+  (0.8ms) commit transaction
28
+  (0.1ms) begin transaction
29
+ SQL (0.4ms) INSERT INTO "people" ("ssn_encrypted", "created_at", "updated_at") VALUES (?, ?, ?) [["ssn_encrypted", "vault:v0:4e+d6YE2ARcfoEPA32PCaU21WOVEXhkMJ1XNuSGj++wUpsI1gGzK"], ["created_at", "2015-04-28 22:54:15.370941"], ["updated_at", "2015-04-28 22:54:15.370941"]]
30
+  (0.7ms) commit transaction
31
+ Person Load (0.1ms) SELECT "people".* FROM "people" WHERE "people"."id" = ? LIMIT 1 [["id", nil]]
32
+  (0.1ms) begin transaction
33
+ SQL (0.2ms) INSERT INTO "people" ("ssn_encrypted", "created_at", "updated_at") VALUES (?, ?, ?) [["ssn_encrypted", "vault:v0:Em8yLcueou4lz2md2G024qrnqPcWy9Y8jt3thFNc3dYOssjgwNZT"], ["created_at", "2015-04-28 22:54:15.380377"], ["updated_at", "2015-04-28 22:54:15.380377"]]
34
+  (0.7ms) commit transaction
35
+  (0.1ms) begin transaction
36
+ SQL (0.4ms) INSERT INTO "people" ("ssn_encrypted", "created_at", "updated_at") VALUES (?, ?, ?) [["ssn_encrypted", "vault:v0:/iNACGD48/XtQtG8rKau+jLpbCgzRYd8uFpDNoibDVbia832rsu7"], ["created_at", "2015-04-28 22:54:22.074986"], ["updated_at", "2015-04-28 22:54:22.074986"]]
37
+  (0.8ms) commit transaction
38
+  (0.1ms) begin transaction
39
+ SQL (0.2ms) INSERT INTO "people" ("ssn_encrypted", "created_at", "updated_at") VALUES (?, ?, ?) [["ssn_encrypted", "vault:v0:VyWSmZ2NLlzwTuIX34ipIRY7stww5J6XxaJ3ksmJH/ubiM0MXOy5"], ["created_at", "2015-04-28 22:54:22.081952"], ["updated_at", "2015-04-28 22:54:22.081952"]]
40
+  (0.9ms) commit transaction
41
+ Person Load (0.2ms) SELECT "people".* FROM "people" WHERE "people"."id" = ? LIMIT 1 [["id", 7]]
42
+  (0.1ms) begin transaction
43
+ SQL (0.5ms) INSERT INTO "people" ("ssn_encrypted", "created_at", "updated_at") VALUES (?, ?, ?) [["ssn_encrypted", "vault:v0:AguGwPfOzd/U5qKlhPQahGIcDoC3ZRZ8e1glDv80Nu+DacFch4Pw"], ["created_at", "2015-04-28 23:32:08.648232"], ["updated_at", "2015-04-28 23:32:08.648232"]]
44
+  (0.8ms) commit transaction
45
+  (0.1ms) begin transaction
46
+ SQL (0.3ms) INSERT INTO "people" ("ssn_encrypted", "created_at", "updated_at") VALUES (?, ?, ?) [["ssn_encrypted", "vault:v0:lvqxMHbQcCjPJXuKuFZY//S9mG1gzGl1sUYFUmsAQSh04/jiv1fM"], ["created_at", "2015-04-28 23:32:08.655862"], ["updated_at", "2015-04-28 23:32:08.655862"]]
47
+  (0.8ms) commit transaction
48
+ Person Load (0.2ms) SELECT "people".* FROM "people" WHERE "people"."id" = ? LIMIT 1 [["id", 9]]
49
+  (0.1ms) begin transaction
50
+ SQL (0.4ms) INSERT INTO "people" ("ssn_encrypted", "created_at", "updated_at") VALUES (?, ?, ?) [["ssn_encrypted", "vault:v0:JSY0u6LbUbF+E7D11qGbChOftPTMP2NAHlpoNREGBm0Tz66SmcjB"], ["created_at", "2015-04-28 23:39:20.798361"], ["updated_at", "2015-04-28 23:39:20.798361"]]
51
+  (0.8ms) commit transaction
52
+  (0.1ms) begin transaction
53
+ SQL (0.2ms) INSERT INTO "people" ("ssn_encrypted", "created_at", "updated_at") VALUES (?, ?, ?) [["ssn_encrypted", "vault:v0:wmtAJciM13T1WEaRoOM5oQqDX8ZIk0AxSEieGjRiE0oBNYwsaxHC"], ["created_at", "2015-04-28 23:39:20.805761"], ["updated_at", "2015-04-28 23:39:20.805761"]]
54
+  (0.8ms) commit transaction
55
+ Person Load (0.2ms) SELECT "people".* FROM "people" WHERE "people"."id" = ? LIMIT 1 [["id", 11]]
56
+  (0.1ms) begin transaction
57
+ SQL (0.4ms) INSERT INTO "people" ("ssn_encrypted", "created_at", "updated_at") VALUES (?, ?, ?) [["ssn_encrypted", "vault:v0:QgPNlFX33ruxniWafaDZNRq93n51JkpMwmYrrgbhfIbh+EKzb6iM"], ["created_at", "2015-04-28 23:41:10.282604"], ["updated_at", "2015-04-28 23:41:10.282604"]]
58
+  (0.8ms) commit transaction
59
+ Person Load (0.2ms) SELECT "people".* FROM "people" WHERE "people"."id" = ? LIMIT 1 [["id", 12]]
60
+  (0.1ms) begin transaction
61
+ SQL (0.3ms) INSERT INTO "people" ("ssn_encrypted", "created_at", "updated_at") VALUES (?, ?, ?) [["ssn_encrypted", "vault:v0:gkBm6xAPNCNAaA1xsBxMpDeIh7YzbTwBiZJHdaSFK+T5OnNPngtD"], ["created_at", "2015-04-28 23:41:10.292849"], ["updated_at", "2015-04-28 23:41:10.292849"]]
62
+  (0.8ms) commit transaction
63
+  (0.1ms) begin transaction
64
+ SQL (0.4ms) INSERT INTO "people" ("ssn_encrypted", "created_at", "updated_at") VALUES (?, ?, ?) [["ssn_encrypted", "vault:v0:3MkmGz/mZxMQQOlZET5XNe1X54zfnnlhDG0fYGimAe37QSIAeVz+"], ["created_at", "2015-04-28 23:42:19.896940"], ["updated_at", "2015-04-28 23:42:19.896940"]]
65
+  (1.2ms) commit transaction
66
+  (0.1ms) begin transaction
67
+ SQL (0.3ms) INSERT INTO "people" ("ssn_encrypted", "created_at", "updated_at") VALUES (?, ?, ?) [["ssn_encrypted", "vault:v0:bTyUfRRp6Q0zpKTVt3sObFyOsGit3rWEJOpR1v73dflBF3Fa5Mcu"], ["created_at", "2015-04-28 23:42:19.905932"], ["updated_at", "2015-04-28 23:42:19.905932"]]
68
+  (0.8ms) commit transaction
69
+ Person Load (0.2ms) SELECT "people".* FROM "people" WHERE "people"."id" = ? LIMIT 1 [["id", 15]]
70
+  (0.1ms) begin transaction
71
+ SQL (0.4ms) INSERT INTO "people" ("ssn_encrypted", "created_at", "updated_at") VALUES (?, ?, ?) [["ssn_encrypted", "vault:v0:50HHLUsC9AnMM7jKI7tVA3eoAHfrtsB/T5vSE0kaWsxY+1JRIx1+"], ["created_at", "2015-04-28 23:42:23.392389"], ["updated_at", "2015-04-28 23:42:23.392389"]]
72
+  (2.2ms) commit transaction
73
+ Person Load (0.2ms) SELECT "people".* FROM "people" WHERE "people"."id" = ? LIMIT 1 [["id", 16]]
74
+  (0.1ms) begin transaction
75
+ SQL (0.3ms) INSERT INTO "people" ("ssn_encrypted", "created_at", "updated_at") VALUES (?, ?, ?) [["ssn_encrypted", "vault:v0:J/o/NxxLp9GqS2lHYxi7rCifoQgNVBxgUHAYlxP8h6qVINOagkGH"], ["created_at", "2015-04-28 23:42:23.405220"], ["updated_at", "2015-04-28 23:42:23.405220"]]
76
+  (0.7ms) commit transaction
77
+  (0.9ms) CREATE TABLE "schema_migrations" ("version" varchar NOT NULL) 
78
+  (0.1ms) select sqlite_version(*)
79
+  (0.8ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
80
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
81
+ Migrating to CreatePeople (20150428220101)
82
+  (0.1ms) begin transaction
83
+  (0.4ms) CREATE TABLE "people" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "ssn_encrypted" varchar, "cc_encrypted" varchar, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
84
+ SQL (0.3ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20150428220101"]]
85
+  (1.2ms) commit transaction
86
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
87
+  (0.1ms) begin transaction
88
+ SQL (0.4ms) INSERT INTO "people" ("ssn_encrypted", "created_at", "updated_at") VALUES (?, ?, ?) [["ssn_encrypted", "vault:v0:4pz/FaGFkU+p9VHszxMXDyH/YXkdFYO6qlA3iaBdVvXzB3n6iF7Y"], ["created_at", "2015-04-28 23:43:45.402176"], ["updated_at", "2015-04-28 23:43:45.402176"]]
89
+  (2.2ms) commit transaction
90
+ Person Load (0.2ms) SELECT "people".* FROM "people" WHERE "people"."id" = ? LIMIT 1 [["id", 1]]
91
+  (0.1ms) begin transaction
92
+ SQL (0.3ms) INSERT INTO "people" ("ssn_encrypted", "created_at", "updated_at") VALUES (?, ?, ?) [["ssn_encrypted", "vault:v0:mEeWpbBIJFlp2VtvLyl1PSFr2uz61oYbX/4Co96S5HkzGuUl295h"], ["created_at", "2015-04-28 23:43:45.415341"], ["updated_at", "2015-04-28 23:43:45.415341"]]
93
+  (0.8ms) commit transaction
94
+  (0.1ms) begin transaction
95
+ SQL (0.3ms) INSERT INTO "people" ("cc_encrypted", "created_at", "updated_at") VALUES (?, ?, ?) [["cc_encrypted", "vault:v0:A0Hq7zKoUKE9J56wN1H9NSaFkQ7bt5O27MU1mCmPxSFM7zr+BHDHD9Cmo5I="], ["created_at", "2015-04-28 23:43:45.420474"], ["updated_at", "2015-04-28 23:43:45.420474"]]
96
+  (0.8ms) commit transaction
97
+  (0.1ms) begin transaction
98
+ SQL (0.4ms) INSERT INTO "people" ("ssn_encrypted", "created_at", "updated_at") VALUES (?, ?, ?) [["ssn_encrypted", "vault:v0:Bmtn/OZ9jCRMwzfv1pCkcPbg91jfrMnDI5EYecHI0CDcpRnWph2P"], ["created_at", "2015-04-28 23:44:22.519005"], ["updated_at", "2015-04-28 23:44:22.519005"]]
99
+  (0.7ms) commit transaction
100
+  (0.1ms) begin transaction
101
+ SQL (0.3ms) INSERT INTO "people" ("cc_encrypted", "created_at", "updated_at") VALUES (?, ?, ?) [["cc_encrypted", "vault:v0:/1wLlIzPNcQxVfqObvhHCUSdJJI9dLXCOQYGjbQedsAmT31TUtAQmDPKYts="], ["created_at", "2015-04-28 23:44:22.525831"], ["updated_at", "2015-04-28 23:44:22.525831"]]
102
+  (0.7ms) commit transaction
103
+  (0.0ms) begin transaction
104
+ SQL (0.2ms) INSERT INTO "people" ("cc_encrypted", "created_at", "updated_at") VALUES (?, ?, ?) [["cc_encrypted", "vault:v0:wRD8X3AsC3mKwLDw63TgXB5S4QfW5+ZeOLDlKqpT40oS8HrkROhDb5OnZDc="], ["created_at", "2015-04-28 23:44:22.529001"], ["updated_at", "2015-04-28 23:44:22.529001"]]
105
+  (0.8ms) commit transaction
106
+ Person Load (0.2ms) SELECT "people".* FROM "people" WHERE "people"."id" = ? LIMIT 1 [["id", 6]]
107
+  (0.1ms) begin transaction
108
+ SQL (0.3ms) INSERT INTO "people" ("ssn_encrypted", "created_at", "updated_at") VALUES (?, ?, ?) [["ssn_encrypted", "vault:v0:n6wRfQUbNYH/HVtRMJdyTjOUg4B9ZhsDWoaHSlM26BLkDF0YFPBw"], ["created_at", "2015-04-28 23:44:22.537869"], ["updated_at", "2015-04-28 23:44:22.537869"]]
109
+  (0.8ms) commit transaction
110
+ Person Load (0.1ms) SELECT "people".* FROM "people" WHERE "people"."id" = ? LIMIT 1 [["id", 7]]
111
+  (0.1ms) begin transaction
112
+ SQL (0.6ms) INSERT INTO "people" ("ssn_encrypted", "created_at", "updated_at") VALUES (?, ?, ?) [["ssn_encrypted", "vault:v0:bHJytjW2GdN0F6++PC5vsW293RxzJiJpAJpbd0Se9N+nxGKMAmY5"], ["created_at", "2015-04-28 23:44:27.200877"], ["updated_at", "2015-04-28 23:44:27.200877"]]
113
+  (2.2ms) commit transaction
114
+ Person Load (0.2ms) SELECT "people".* FROM "people" WHERE "people"."id" = ? LIMIT 1 [["id", 8]]
115
+  (0.1ms) begin transaction
116
+ SQL (0.3ms) INSERT INTO "people" ("cc_encrypted", "created_at", "updated_at") VALUES (?, ?, ?) [["cc_encrypted", "vault:v0:Gjv/Semy8EGrxWeqYAY4HWmed6aDMDfSDISHzMls0SMK1lh9r8g5VWScnTM="], ["created_at", "2015-04-28 23:44:27.213798"], ["updated_at", "2015-04-28 23:44:27.213798"]]
117
+  (0.8ms) commit transaction
118
+  (0.1ms) begin transaction
119
+ SQL (0.2ms) INSERT INTO "people" ("cc_encrypted", "created_at", "updated_at") VALUES (?, ?, ?) [["cc_encrypted", "vault:v0:oMoXrN3ydHu71qxi5YLJz5ch2bx7AzX1FmWpRozeiEZlcY6dGeD8YjMNps0="], ["created_at", "2015-04-28 23:44:27.218940"], ["updated_at", "2015-04-28 23:44:27.218940"]]
120
+  (0.9ms) commit transaction
121
+ Person Load (0.1ms) SELECT "people".* FROM "people" WHERE "people"."id" = ? LIMIT 1 [["id", 10]]
122
+  (0.1ms) begin transaction
123
+ SQL (0.2ms) INSERT INTO "people" ("ssn_encrypted", "created_at", "updated_at") VALUES (?, ?, ?) [["ssn_encrypted", "vault:v0:m6f94GbtEQb1WIc3H67n4vQwC0p+vnOYAT8COCZ/fYQLXePJMNCu"], ["created_at", "2015-04-28 23:44:27.223470"], ["updated_at", "2015-04-28 23:44:27.223470"]]
124
+  (0.9ms) commit transaction
@@ -0,0 +1,67 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>The page you were looking for doesn't exist (404)</title>
5
+ <meta name="viewport" content="width=device-width,initial-scale=1">
6
+ <style>
7
+ body {
8
+ background-color: #EFEFEF;
9
+ color: #2E2F30;
10
+ text-align: center;
11
+ font-family: arial, sans-serif;
12
+ margin: 0;
13
+ }
14
+
15
+ div.dialog {
16
+ width: 95%;
17
+ max-width: 33em;
18
+ margin: 4em auto 0;
19
+ }
20
+
21
+ div.dialog > div {
22
+ border: 1px solid #CCC;
23
+ border-right-color: #999;
24
+ border-left-color: #999;
25
+ border-bottom-color: #BBB;
26
+ border-top: #B00100 solid 4px;
27
+ border-top-left-radius: 9px;
28
+ border-top-right-radius: 9px;
29
+ background-color: white;
30
+ padding: 7px 12% 0;
31
+ box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
32
+ }
33
+
34
+ h1 {
35
+ font-size: 100%;
36
+ color: #730E15;
37
+ line-height: 1.5em;
38
+ }
39
+
40
+ div.dialog > p {
41
+ margin: 0 0 1em;
42
+ padding: 1em;
43
+ background-color: #F7F7F7;
44
+ border: 1px solid #CCC;
45
+ border-right-color: #999;
46
+ border-left-color: #999;
47
+ border-bottom-color: #999;
48
+ border-bottom-left-radius: 4px;
49
+ border-bottom-right-radius: 4px;
50
+ border-top-color: #DADADA;
51
+ color: #666;
52
+ box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
53
+ }
54
+ </style>
55
+ </head>
56
+
57
+ <body>
58
+ <!-- This file lives in public/404.html -->
59
+ <div class="dialog">
60
+ <div>
61
+ <h1>The page you were looking for doesn't exist.</h1>
62
+ <p>You may have mistyped the address or the page may have moved.</p>
63
+ </div>
64
+ <p>If you are the application owner check the logs for more information.</p>
65
+ </div>
66
+ </body>
67
+ </html>
@@ -0,0 +1,67 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>The change you wanted was rejected (422)</title>
5
+ <meta name="viewport" content="width=device-width,initial-scale=1">
6
+ <style>
7
+ body {
8
+ background-color: #EFEFEF;
9
+ color: #2E2F30;
10
+ text-align: center;
11
+ font-family: arial, sans-serif;
12
+ margin: 0;
13
+ }
14
+
15
+ div.dialog {
16
+ width: 95%;
17
+ max-width: 33em;
18
+ margin: 4em auto 0;
19
+ }
20
+
21
+ div.dialog > div {
22
+ border: 1px solid #CCC;
23
+ border-right-color: #999;
24
+ border-left-color: #999;
25
+ border-bottom-color: #BBB;
26
+ border-top: #B00100 solid 4px;
27
+ border-top-left-radius: 9px;
28
+ border-top-right-radius: 9px;
29
+ background-color: white;
30
+ padding: 7px 12% 0;
31
+ box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
32
+ }
33
+
34
+ h1 {
35
+ font-size: 100%;
36
+ color: #730E15;
37
+ line-height: 1.5em;
38
+ }
39
+
40
+ div.dialog > p {
41
+ margin: 0 0 1em;
42
+ padding: 1em;
43
+ background-color: #F7F7F7;
44
+ border: 1px solid #CCC;
45
+ border-right-color: #999;
46
+ border-left-color: #999;
47
+ border-bottom-color: #999;
48
+ border-bottom-left-radius: 4px;
49
+ border-bottom-right-radius: 4px;
50
+ border-top-color: #DADADA;
51
+ color: #666;
52
+ box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
53
+ }
54
+ </style>
55
+ </head>
56
+
57
+ <body>
58
+ <!-- This file lives in public/422.html -->
59
+ <div class="dialog">
60
+ <div>
61
+ <h1>The change you wanted was rejected.</h1>
62
+ <p>Maybe you tried to change something you didn't have access to.</p>
63
+ </div>
64
+ <p>If you are the application owner check the logs for more information.</p>
65
+ </div>
66
+ </body>
67
+ </html>
@@ -0,0 +1,66 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>We're sorry, but something went wrong (500)</title>
5
+ <meta name="viewport" content="width=device-width,initial-scale=1">
6
+ <style>
7
+ body {
8
+ background-color: #EFEFEF;
9
+ color: #2E2F30;
10
+ text-align: center;
11
+ font-family: arial, sans-serif;
12
+ margin: 0;
13
+ }
14
+
15
+ div.dialog {
16
+ width: 95%;
17
+ max-width: 33em;
18
+ margin: 4em auto 0;
19
+ }
20
+
21
+ div.dialog > div {
22
+ border: 1px solid #CCC;
23
+ border-right-color: #999;
24
+ border-left-color: #999;
25
+ border-bottom-color: #BBB;
26
+ border-top: #B00100 solid 4px;
27
+ border-top-left-radius: 9px;
28
+ border-top-right-radius: 9px;
29
+ background-color: white;
30
+ padding: 7px 12% 0;
31
+ box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
32
+ }
33
+
34
+ h1 {
35
+ font-size: 100%;
36
+ color: #730E15;
37
+ line-height: 1.5em;
38
+ }
39
+
40
+ div.dialog > p {
41
+ margin: 0 0 1em;
42
+ padding: 1em;
43
+ background-color: #F7F7F7;
44
+ border: 1px solid #CCC;
45
+ border-right-color: #999;
46
+ border-left-color: #999;
47
+ border-bottom-color: #999;
48
+ border-bottom-left-radius: 4px;
49
+ border-bottom-right-radius: 4px;
50
+ border-top-color: #DADADA;
51
+ color: #666;
52
+ box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
53
+ }
54
+ </style>
55
+ </head>
56
+
57
+ <body>
58
+ <!-- This file lives in public/500.html -->
59
+ <div class="dialog">
60
+ <div>
61
+ <h1>We're sorry, but something went wrong.</h1>
62
+ </div>
63
+ <p>If you are the application owner check the logs for more information.</p>
64
+ </div>
65
+ </body>
66
+ </html>
File without changes
@@ -0,0 +1,27 @@
1
+ require "spec_helper"
2
+
3
+ describe Vault::Rails do
4
+ it "encrypts attributes" do
5
+ person = Person.create!(ssn: "123-45-6789")
6
+ expect(person.ssn_encrypted).to be
7
+ end
8
+
9
+ it "encrypts attributes with custom configuration" do
10
+ person = Person.create!(credit_card: "1234567890111213")
11
+ expect(person.cc_encrypted).to be
12
+ end
13
+
14
+ it "decrypts attributes" do
15
+ person = Person.create!(ssn: "123-45-6789")
16
+ person = Person.find(person.id)
17
+
18
+ expect(person.ssn).to eq("123-45-6789")
19
+ end
20
+
21
+ it "decrypts attributes with custom configuration" do
22
+ person = Person.create!(credit_card: "1234567890111213")
23
+ person = Person.find(person.id)
24
+
25
+ expect(person.credit_card).to eq("1234567890111213")
26
+ end
27
+ end
@@ -0,0 +1,24 @@
1
+ $LOAD_PATH.unshift File.expand_path("../../lib", __FILE__)
2
+ require "vault/rails"
3
+
4
+ require "rspec"
5
+
6
+ RSpec.configure do |config|
7
+ # Prohibit using the should syntax
8
+ config.expect_with :rspec do |spec|
9
+ spec.syntax = :expect
10
+ end
11
+
12
+ # Allow tests to isolate a specific test using +focus: true+. If nothing
13
+ # is focused, then all tests are executed.
14
+ config.filter_run(focus: true)
15
+ config.run_all_when_everything_filtered = true
16
+
17
+ # Run specs in random order to surface order dependencies. If you find an
18
+ # order dependency and want to debug it, you can fix the order by providing
19
+ # the seed, which is printed after each run.
20
+ # --seed 1234
21
+ config.order = 'random'
22
+ end
23
+
24
+ require File.expand_path("../dummy/config/environment.rb", __FILE__)