simpleapikeyengine 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 77a89d0e7f1170ed59fc0397aaacf0d5e4036384
|
4
|
+
data.tar.gz: 761677a6bcd15363d6fcbb2959c383d3f9f35610
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8652dbae145f1dca77021ae4936edf96a01d3340e492cadec95c2f4f8931ade4631874ca7b02fdcbe5dba26ed6d1a9e0ccdace3073fb74ea24fa794e56771017
|
7
|
+
data.tar.gz: 0620d5658db22d5f69e7989c7107bf0ab33e93d821ebf5acef394cddb123d495ae9ab159563bddfdb4a0f68d2b6b38dcc0d59ee69678957542272d52e666f26f
|
@@ -1,5 +1,6 @@
|
|
1
1
|
module SimpleApiKeyEngine
|
2
2
|
class Authentication < ActiveRecord::Base
|
3
|
+
has_many :api_keys, class_name: 'SimpleApiKeyEngine::ApiKey', dependent: :destroy
|
3
4
|
store :auth_hash
|
4
5
|
|
5
6
|
class << self
|
@@ -10,9 +11,9 @@ module SimpleApiKeyEngine
|
|
10
11
|
def activate(request, &block)
|
11
12
|
authentication = auth(request, &block)
|
12
13
|
return nil unless authentication
|
13
|
-
|
14
|
-
|
15
|
-
|
14
|
+
api_keys.create!(provider: authentication.provider,
|
15
|
+
user_type: authentication.user_type,
|
16
|
+
user_ident: authentication.user_ident)
|
16
17
|
end
|
17
18
|
|
18
19
|
private
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: simpleapikeyengine
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yuichi Takeuchi
|
@@ -69,6 +69,7 @@ files:
|
|
69
69
|
- db/migrate/20141110041340_create_simple_api_key_engine_authentications.rb
|
70
70
|
- db/migrate/20141117060900_add_expires_at_to_simple_api_key_engine_authentications.rb
|
71
71
|
- db/migrate/20150530161500_add_provider_to_simple_api_key_engine_api_keys.rb
|
72
|
+
- db/migrate/20150530175800_add_authentication_id_to_simple_api_key_engine_api_keys.rb
|
72
73
|
- lib/simpleapikeyengine.rb
|
73
74
|
- lib/simpleapikeyengine/engine.rb
|
74
75
|
- lib/simpleapikeyengine/provider_configuration.rb
|