vault-rails 0.0.11 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/LICENSE +362 -0
- data/README.md +106 -0
- data/Rakefile +18 -2
- data/lib/vault/encrypted_model.rb +112 -0
- data/lib/vault/rails.rb +30 -0
- data/lib/vault/rails/version.rb +1 -1
- data/spec/dummy/Rakefile +6 -0
- data/spec/dummy/app/models/person.rb +8 -0
- data/spec/dummy/bin/bundle +3 -0
- data/spec/dummy/bin/rails +4 -0
- data/spec/dummy/bin/rake +4 -0
- data/spec/dummy/config.ru +4 -0
- data/spec/dummy/config/application.rb +29 -0
- data/spec/dummy/config/boot.rb +5 -0
- data/spec/dummy/config/database.yml +12 -0
- data/spec/dummy/config/environment.rb +5 -0
- data/spec/dummy/config/environments/development.rb +37 -0
- data/spec/dummy/config/environments/test.rb +39 -0
- data/spec/dummy/config/initializers/assets.rb +8 -0
- data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/spec/dummy/config/initializers/cookies_serializer.rb +3 -0
- data/spec/dummy/config/initializers/filter_parameter_logging.rb +4 -0
- data/spec/dummy/config/initializers/inflections.rb +16 -0
- data/spec/dummy/config/initializers/mime_types.rb +4 -0
- data/spec/dummy/config/initializers/session_store.rb +3 -0
- data/spec/dummy/config/initializers/vault.rb +9 -0
- data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/spec/dummy/config/locales/en.yml +23 -0
- data/spec/dummy/config/routes.rb +3 -0
- data/spec/dummy/config/secrets.yml +22 -0
- data/spec/dummy/db/development.sqlite3 +0 -0
- data/spec/dummy/db/migrate/20150428220101_create_people.rb +11 -0
- data/spec/dummy/db/schema.rb +24 -0
- data/spec/dummy/log/development.log +124 -0
- data/spec/dummy/public/404.html +67 -0
- data/spec/dummy/public/422.html +67 -0
- data/spec/dummy/public/500.html +66 -0
- data/spec/dummy/public/favicon.ico +0 -0
- data/spec/integration/rails_spec.rb +27 -0
- data/spec/spec_helper.rb +24 -0
- data/spec/support/vault_server.rb +68 -0
- data/spec/unit/rails_spec.rb +28 -0
- metadata +178 -23
- data/lib/vault-rails.rb +0 -5
- data/lib/vault/rails/engine.rb +0 -8
- data/vendor/assets/javascripts/vault.js.coffee +0 -629
- data/vendor/assets/javascripts/vault/vault.js.coffee +0 -629
@@ -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,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
|
+
[1m[36m (1.1ms)[0m [1mCREATE TABLE "schema_migrations" ("version" varchar NOT NULL) [0m
|
2
|
+
[1m[35m (0.1ms)[0m select sqlite_version(*)
|
3
|
+
[1m[36m (0.9ms)[0m [1mCREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")[0m
|
4
|
+
[1m[35mActiveRecord::SchemaMigration Load (0.1ms)[0m SELECT "schema_migrations".* FROM "schema_migrations"
|
5
|
+
Migrating to CreatePeople (20150428220101)
|
6
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
7
|
+
[1m[35m (0.3ms)[0m 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
|
+
[1m[36mSQL (0.1ms)[0m [1mINSERT INTO "schema_migrations" ("version") VALUES (?)[0m [["version", "20150428220101"]]
|
9
|
+
[1m[35m (0.9ms)[0m commit transaction
|
10
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
11
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
12
|
+
[1m[35mSQL (1.1ms)[0m 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
|
+
[1m[36m (0.8ms)[0m [1mcommit transaction[0m
|
14
|
+
[1m[35mPerson Load (0.2ms)[0m SELECT "people".* FROM "people" ORDER BY "people"."id" ASC LIMIT 1
|
15
|
+
[1m[36mPerson Load (0.1ms)[0m [1mSELECT "people".* FROM "people" ORDER BY "people"."id" ASC LIMIT 1[0m
|
16
|
+
[1m[36mPerson Load (0.2ms)[0m [1mSELECT "people".* FROM "people" ORDER BY "people"."id" ASC LIMIT 1[0m
|
17
|
+
[1m[36mPerson Load (0.1ms)[0m [1mSELECT "people".* FROM "people" ORDER BY "people"."id" ASC LIMIT 1[0m
|
18
|
+
[1m[35m (0.1ms)[0m begin transaction
|
19
|
+
[1m[36mSQL (0.4ms)[0m [1mUPDATE "people" SET "ssn_encrypted" = ?, "updated_at" = ? WHERE "people"."id" = ?[0m [["ssn_encrypted", "vault:v0:6hdPkhvyL6cQszzuUicK/fFwjEFfI0yI7c+Ky7hE0YXogVKfnvUP"], ["updated_at", "2015-04-28 22:17:40.753649"], ["id", 1]]
|
20
|
+
[1m[35m (0.8ms)[0m commit transaction
|
21
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
22
|
+
[1m[35mSQL (0.4ms)[0m 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
|
+
[1m[36m (0.7ms)[0m [1mcommit transaction[0m
|
24
|
+
[1m[35mPerson Load (0.1ms)[0m SELECT "people".* FROM "people" WHERE "people"."id" = ? LIMIT 1 [["id", nil]]
|
25
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
26
|
+
[1m[35mSQL (0.2ms)[0m 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
|
+
[1m[36m (0.8ms)[0m [1mcommit transaction[0m
|
28
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
29
|
+
[1m[35mSQL (0.4ms)[0m 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
|
+
[1m[36m (0.7ms)[0m [1mcommit transaction[0m
|
31
|
+
[1m[35mPerson Load (0.1ms)[0m SELECT "people".* FROM "people" WHERE "people"."id" = ? LIMIT 1 [["id", nil]]
|
32
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
33
|
+
[1m[35mSQL (0.2ms)[0m 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
|
+
[1m[36m (0.7ms)[0m [1mcommit transaction[0m
|
35
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
36
|
+
[1m[35mSQL (0.4ms)[0m 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
|
+
[1m[36m (0.8ms)[0m [1mcommit transaction[0m
|
38
|
+
[1m[35m (0.1ms)[0m begin transaction
|
39
|
+
[1m[36mSQL (0.2ms)[0m [1mINSERT INTO "people" ("ssn_encrypted", "created_at", "updated_at") VALUES (?, ?, ?)[0m [["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
|
+
[1m[35m (0.9ms)[0m commit transaction
|
41
|
+
[1m[36mPerson Load (0.2ms)[0m [1mSELECT "people".* FROM "people" WHERE "people"."id" = ? LIMIT 1[0m [["id", 7]]
|
42
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
43
|
+
[1m[35mSQL (0.5ms)[0m 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
|
+
[1m[36m (0.8ms)[0m [1mcommit transaction[0m
|
45
|
+
[1m[35m (0.1ms)[0m begin transaction
|
46
|
+
[1m[36mSQL (0.3ms)[0m [1mINSERT INTO "people" ("ssn_encrypted", "created_at", "updated_at") VALUES (?, ?, ?)[0m [["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
|
+
[1m[35m (0.8ms)[0m commit transaction
|
48
|
+
[1m[36mPerson Load (0.2ms)[0m [1mSELECT "people".* FROM "people" WHERE "people"."id" = ? LIMIT 1[0m [["id", 9]]
|
49
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
50
|
+
[1m[35mSQL (0.4ms)[0m 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
|
+
[1m[36m (0.8ms)[0m [1mcommit transaction[0m
|
52
|
+
[1m[35m (0.1ms)[0m begin transaction
|
53
|
+
[1m[36mSQL (0.2ms)[0m [1mINSERT INTO "people" ("ssn_encrypted", "created_at", "updated_at") VALUES (?, ?, ?)[0m [["ssn_encrypted", "vault:v0:wmtAJciM13T1WEaRoOM5oQqDX8ZIk0AxSEieGjRiE0oBNYwsaxHC"], ["created_at", "2015-04-28 23:39:20.805761"], ["updated_at", "2015-04-28 23:39:20.805761"]]
|
54
|
+
[1m[35m (0.8ms)[0m commit transaction
|
55
|
+
[1m[36mPerson Load (0.2ms)[0m [1mSELECT "people".* FROM "people" WHERE "people"."id" = ? LIMIT 1[0m [["id", 11]]
|
56
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
57
|
+
[1m[35mSQL (0.4ms)[0m 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
|
+
[1m[36m (0.8ms)[0m [1mcommit transaction[0m
|
59
|
+
[1m[35mPerson Load (0.2ms)[0m SELECT "people".* FROM "people" WHERE "people"."id" = ? LIMIT 1 [["id", 12]]
|
60
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
61
|
+
[1m[35mSQL (0.3ms)[0m 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
|
+
[1m[36m (0.8ms)[0m [1mcommit transaction[0m
|
63
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
64
|
+
[1m[35mSQL (0.4ms)[0m 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
|
+
[1m[36m (1.2ms)[0m [1mcommit transaction[0m
|
66
|
+
[1m[35m (0.1ms)[0m begin transaction
|
67
|
+
[1m[36mSQL (0.3ms)[0m [1mINSERT INTO "people" ("ssn_encrypted", "created_at", "updated_at") VALUES (?, ?, ?)[0m [["ssn_encrypted", "vault:v0:bTyUfRRp6Q0zpKTVt3sObFyOsGit3rWEJOpR1v73dflBF3Fa5Mcu"], ["created_at", "2015-04-28 23:42:19.905932"], ["updated_at", "2015-04-28 23:42:19.905932"]]
|
68
|
+
[1m[35m (0.8ms)[0m commit transaction
|
69
|
+
[1m[36mPerson Load (0.2ms)[0m [1mSELECT "people".* FROM "people" WHERE "people"."id" = ? LIMIT 1[0m [["id", 15]]
|
70
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
71
|
+
[1m[35mSQL (0.4ms)[0m 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
|
+
[1m[36m (2.2ms)[0m [1mcommit transaction[0m
|
73
|
+
[1m[35mPerson Load (0.2ms)[0m SELECT "people".* FROM "people" WHERE "people"."id" = ? LIMIT 1 [["id", 16]]
|
74
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
75
|
+
[1m[35mSQL (0.3ms)[0m 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
|
+
[1m[36m (0.7ms)[0m [1mcommit transaction[0m
|
77
|
+
[1m[36m (0.9ms)[0m [1mCREATE TABLE "schema_migrations" ("version" varchar NOT NULL) [0m
|
78
|
+
[1m[35m (0.1ms)[0m select sqlite_version(*)
|
79
|
+
[1m[36m (0.8ms)[0m [1mCREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")[0m
|
80
|
+
[1m[35mActiveRecord::SchemaMigration Load (0.1ms)[0m SELECT "schema_migrations".* FROM "schema_migrations"
|
81
|
+
Migrating to CreatePeople (20150428220101)
|
82
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
83
|
+
[1m[35m (0.4ms)[0m 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
|
+
[1m[36mSQL (0.3ms)[0m [1mINSERT INTO "schema_migrations" ("version") VALUES (?)[0m [["version", "20150428220101"]]
|
85
|
+
[1m[35m (1.2ms)[0m commit transaction
|
86
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
87
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
88
|
+
[1m[35mSQL (0.4ms)[0m 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
|
+
[1m[36m (2.2ms)[0m [1mcommit transaction[0m
|
90
|
+
[1m[35mPerson Load (0.2ms)[0m SELECT "people".* FROM "people" WHERE "people"."id" = ? LIMIT 1 [["id", 1]]
|
91
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
92
|
+
[1m[35mSQL (0.3ms)[0m 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
|
+
[1m[36m (0.8ms)[0m [1mcommit transaction[0m
|
94
|
+
[1m[35m (0.1ms)[0m begin transaction
|
95
|
+
[1m[36mSQL (0.3ms)[0m [1mINSERT INTO "people" ("cc_encrypted", "created_at", "updated_at") VALUES (?, ?, ?)[0m [["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
|
+
[1m[35m (0.8ms)[0m commit transaction
|
97
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
98
|
+
[1m[35mSQL (0.4ms)[0m 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
|
+
[1m[36m (0.7ms)[0m [1mcommit transaction[0m
|
100
|
+
[1m[35m (0.1ms)[0m begin transaction
|
101
|
+
[1m[36mSQL (0.3ms)[0m [1mINSERT INTO "people" ("cc_encrypted", "created_at", "updated_at") VALUES (?, ?, ?)[0m [["cc_encrypted", "vault:v0:/1wLlIzPNcQxVfqObvhHCUSdJJI9dLXCOQYGjbQedsAmT31TUtAQmDPKYts="], ["created_at", "2015-04-28 23:44:22.525831"], ["updated_at", "2015-04-28 23:44:22.525831"]]
|
102
|
+
[1m[35m (0.7ms)[0m commit transaction
|
103
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
104
|
+
[1m[35mSQL (0.2ms)[0m 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
|
+
[1m[36m (0.8ms)[0m [1mcommit transaction[0m
|
106
|
+
[1m[35mPerson Load (0.2ms)[0m SELECT "people".* FROM "people" WHERE "people"."id" = ? LIMIT 1 [["id", 6]]
|
107
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
108
|
+
[1m[35mSQL (0.3ms)[0m 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
|
+
[1m[36m (0.8ms)[0m [1mcommit transaction[0m
|
110
|
+
[1m[35mPerson Load (0.1ms)[0m SELECT "people".* FROM "people" WHERE "people"."id" = ? LIMIT 1 [["id", 7]]
|
111
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
112
|
+
[1m[35mSQL (0.6ms)[0m 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
|
+
[1m[36m (2.2ms)[0m [1mcommit transaction[0m
|
114
|
+
[1m[35mPerson Load (0.2ms)[0m SELECT "people".* FROM "people" WHERE "people"."id" = ? LIMIT 1 [["id", 8]]
|
115
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
116
|
+
[1m[35mSQL (0.3ms)[0m 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
|
+
[1m[36m (0.8ms)[0m [1mcommit transaction[0m
|
118
|
+
[1m[35m (0.1ms)[0m begin transaction
|
119
|
+
[1m[36mSQL (0.2ms)[0m [1mINSERT INTO "people" ("cc_encrypted", "created_at", "updated_at") VALUES (?, ?, ?)[0m [["cc_encrypted", "vault:v0:oMoXrN3ydHu71qxi5YLJz5ch2bx7AzX1FmWpRozeiEZlcY6dGeD8YjMNps0="], ["created_at", "2015-04-28 23:44:27.218940"], ["updated_at", "2015-04-28 23:44:27.218940"]]
|
120
|
+
[1m[35m (0.9ms)[0m commit transaction
|
121
|
+
[1m[36mPerson Load (0.1ms)[0m [1mSELECT "people".* FROM "people" WHERE "people"."id" = ? LIMIT 1[0m [["id", 10]]
|
122
|
+
[1m[35m (0.1ms)[0m begin transaction
|
123
|
+
[1m[36mSQL (0.2ms)[0m [1mINSERT INTO "people" ("ssn_encrypted", "created_at", "updated_at") VALUES (?, ?, ?)[0m [["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
|
+
[1m[35m (0.9ms)[0m 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
|
data/spec/spec_helper.rb
ADDED
@@ -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__)
|