keycard 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/Rakefile +2 -0
- data/keycard.gemspec +1 -1
- data/lib/keycard/db.rb +6 -3
- data/lib/keycard/institution_finder.rb +1 -5
- data/lib/keycard/railtie.rb +0 -7
- data/lib/keycard/version.rb +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 04e5999db1a74c237714b9c8afae5bca2ac11c0c33bc8d56c174967082331ee7
|
4
|
+
data.tar.gz: db2486afcc74b2777fb74f0ce02fd6f6c3499c69823d39af9db7bd4403d31bb7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 671cff5c7be3e97ff2b4325ff94786f3dbb3d82ffb03e5efd015bf95a8e73a1d9c92a34ca47aa8c2eaf124bea691d0560f765ee854db4fa2e5127b3e4484f160
|
7
|
+
data.tar.gz: 7ebe3ac9d5019acd351fc63f430e65c52e7d711db036713db96fc9be5b8c962013d7808bb4f3f5c1993b7f2526ad95719ab3733b628abf9c33b2d6ede48f8fdc
|
data/Rakefile
CHANGED
data/keycard.gemspec
CHANGED
@@ -31,7 +31,7 @@ Gem::Specification.new do |spec|
|
|
31
31
|
spec.add_development_dependency "bundler", "~> 1.16"
|
32
32
|
spec.add_development_dependency "coveralls", "~> 0.8"
|
33
33
|
spec.add_development_dependency "pry"
|
34
|
-
spec.add_development_dependency "rake", "~>
|
34
|
+
spec.add_development_dependency "rake", "~> 12.0"
|
35
35
|
spec.add_development_dependency "rspec", "~> 3.0"
|
36
36
|
spec.add_development_dependency "rubocop", "~> 0.52"
|
37
37
|
spec.add_development_dependency "rubocop-rails", "~> 1.1"
|
data/lib/keycard/db.rb
CHANGED
@@ -83,8 +83,10 @@ module Keycard
|
|
83
83
|
# This will connect with the current config if not already conencted.
|
84
84
|
def migrate!
|
85
85
|
connect! unless connected?
|
86
|
-
|
87
|
-
|
86
|
+
unless config.readonly
|
87
|
+
Sequel.extension :migration
|
88
|
+
Sequel::Migrator.run(db, File.join(__dir__, '../../db/migrations'), table: schema_table)
|
89
|
+
end
|
88
90
|
end
|
89
91
|
|
90
92
|
def schema_table
|
@@ -134,7 +136,8 @@ module Keycard
|
|
134
136
|
|
135
137
|
def config
|
136
138
|
@config ||= OpenStruct.new(
|
137
|
-
url: ENV['KEYCARD_DATABASE_URL'] || ENV['DATABASE_URL']
|
139
|
+
url: ENV['KEYCARD_DATABASE_URL'] || ENV['DATABASE_URL'],
|
140
|
+
readonly: false
|
138
141
|
)
|
139
142
|
end
|
140
143
|
|
@@ -26,7 +26,7 @@ module Keycard
|
|
26
26
|
end
|
27
27
|
|
28
28
|
def attributes_for(request)
|
29
|
-
return {} unless (numeric_ip = numeric_ip(
|
29
|
+
return {} unless (numeric_ip = numeric_ip(request.remote_ip))
|
30
30
|
|
31
31
|
insts = insts_for_ip(numeric_ip)
|
32
32
|
|
@@ -54,9 +54,5 @@ module Keycard
|
|
54
54
|
nil
|
55
55
|
end
|
56
56
|
end
|
57
|
-
|
58
|
-
def client_ip(request)
|
59
|
-
request.get_header('X-Forwarded-For')
|
60
|
-
end
|
61
57
|
end
|
62
58
|
end
|
data/lib/keycard/railtie.rb
CHANGED
@@ -82,14 +82,7 @@ module Keycard
|
|
82
82
|
Railtie.after_blocks.each do |block|
|
83
83
|
block.call(config.to_h)
|
84
84
|
end
|
85
|
-
end
|
86
85
|
|
87
|
-
# This runs before any block registered under a `config.to_prepare`, which
|
88
|
-
# could be in plugins or initializers that want to use a fully configured
|
89
|
-
# Keycard instance. The `to_prepare` hook is run once at the start of a
|
90
|
-
# production instance and for every request in development (unless caching
|
91
|
-
# is turned on so there is no reloading).
|
92
|
-
initializer "keycard.ready", after: :finisher_hook do
|
93
86
|
Keycard::DB.initialize! unless Railtie.under_rake?
|
94
87
|
|
95
88
|
Railtie.ready_blocks.each do |block|
|
data/lib/keycard/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: keycard
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Noah Botimer
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date: 2018-03-
|
12
|
+
date: 2018-03-23 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: mysql2
|
@@ -87,14 +87,14 @@ dependencies:
|
|
87
87
|
requirements:
|
88
88
|
- - "~>"
|
89
89
|
- !ruby/object:Gem::Version
|
90
|
-
version: '
|
90
|
+
version: '12.0'
|
91
91
|
type: :development
|
92
92
|
prerelease: false
|
93
93
|
version_requirements: !ruby/object:Gem::Requirement
|
94
94
|
requirements:
|
95
95
|
- - "~>"
|
96
96
|
- !ruby/object:Gem::Version
|
97
|
-
version: '
|
97
|
+
version: '12.0'
|
98
98
|
- !ruby/object:Gem::Dependency
|
99
99
|
name: rspec
|
100
100
|
requirement: !ruby/object:Gem::Requirement
|
@@ -227,7 +227,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
227
227
|
version: '0'
|
228
228
|
requirements: []
|
229
229
|
rubyforge_project:
|
230
|
-
rubygems_version: 2.
|
230
|
+
rubygems_version: 2.7.3
|
231
231
|
signing_key:
|
232
232
|
specification_version: 4
|
233
233
|
summary: Keycard provides authentication support and user/request information, especially
|