token_auth 0.3.3 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Rakefile +1 -0
- data/app/controllers/token_auth/api/base_controller.rb +1 -0
- data/app/controllers/token_auth/api/payloads_controller.rb +1 -0
- data/app/controllers/token_auth/authentication_tokens_controller.rb +1 -0
- data/app/controllers/token_auth/base_controller.rb +1 -0
- data/app/controllers/token_auth/concerns/api_resources.rb +1 -0
- data/app/controllers/token_auth/concerns/cors_settings.rb +1 -0
- data/app/controllers/token_auth/configuration_tokens_controller.rb +1 -0
- data/app/controllers/token_auth/tokens_controller.rb +1 -0
- data/app/models/token_auth/application_record.rb +8 -0
- data/app/models/token_auth/authentication_token.rb +2 -1
- data/app/models/token_auth/configuration_token.rb +4 -4
- data/app/models/token_auth/payload.rb +1 -2
- data/app/models/token_auth/synchronizable_resource.rb +2 -1
- data/app/models/token_auth/uuid_enabled.rb +1 -0
- data/app/serializers/token_auth/synchronizable_resource_serializer.rb +5 -1
- data/config/brakeman.ignore +3 -20
- data/lib/token_auth.rb +1 -0
- data/lib/token_auth/engine.rb +1 -0
- data/lib/token_auth/version.rb +2 -1
- metadata +23 -22
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 429cf19fb37c7fa13df5d0975afff2f495f44c48
|
4
|
+
data.tar.gz: 619d2fde74615297470a98788e85ca4ebb712ed8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 341590e01512f1c3b1b04711003ad5c7619bd81f7bdd2979002dd028bc544472a8634888b1fecf6cf50e3563b2adb3555137cf5a4a1abe545ba1ab653bce8261
|
7
|
+
data.tar.gz: 2ac88f338d46e5379922d7c3f0dcdd524a5e8366a13677bf151ca94445aec163c5add2dd49a8a8891584b1302d908494649d51ede9ec8b984c79ba32ef825e91
|
data/Rakefile
CHANGED
@@ -2,12 +2,12 @@
|
|
2
2
|
|
3
3
|
module TokenAuth
|
4
4
|
# A single use human readable token for use with client configuration.
|
5
|
-
class ConfigurationToken <
|
5
|
+
class ConfigurationToken < ApplicationRecord
|
6
6
|
mattr_accessor :valid_period
|
7
7
|
self.valid_period = 4.hours
|
8
|
-
SAMPLE_SET = %w
|
8
|
+
SAMPLE_SET = %w[ A B C D E F H J K L M N P Q R S T U V W X Y Z
|
9
9
|
2 3 4 5 7 8 9
|
10
|
-
# $
|
10
|
+
# $ ].freeze
|
11
11
|
TOKEN_LENGTH = 6
|
12
12
|
|
13
13
|
validates :expires_at, :entity_id, :value, presence: true
|
@@ -41,7 +41,7 @@ module TokenAuth
|
|
41
41
|
end
|
42
42
|
|
43
43
|
authentication_token
|
44
|
-
rescue
|
44
|
+
rescue StandardError
|
45
45
|
nil
|
46
46
|
end
|
47
47
|
|
@@ -1,4 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
+
|
2
3
|
module TokenAuth
|
3
4
|
# An inbound resource. Inbound resource requests are validated and an
|
4
5
|
# attempt is made to upsert them.
|
@@ -10,7 +11,6 @@ module TokenAuth
|
|
10
11
|
|
11
12
|
def self.resource_type(params)
|
12
13
|
params.extract!(:type)[:type]
|
13
|
-
|
14
14
|
rescue NoMethodError
|
15
15
|
nil
|
16
16
|
end
|
@@ -60,7 +60,6 @@ module TokenAuth
|
|
60
60
|
else
|
61
61
|
@errors << resource.errors.full_messages.join(", ")
|
62
62
|
end
|
63
|
-
|
64
63
|
rescue ActiveRecord::UnknownAttributeError => error
|
65
64
|
@errors << error.message
|
66
65
|
end
|
@@ -1,7 +1,8 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
+
|
2
3
|
module TokenAuth
|
3
4
|
# A resource that may be pushed and/or pulled by an entity.
|
4
|
-
class SynchronizableResource <
|
5
|
+
class SynchronizableResource < ApplicationRecord
|
5
6
|
include UuidEnabled
|
6
7
|
|
7
8
|
validates :uuid, :entity_id, :entity_id_attribute_name, :name, :class_name,
|
data/config/brakeman.ignore
CHANGED
@@ -1,27 +1,10 @@
|
|
1
1
|
{
|
2
2
|
"ignored_warnings": [
|
3
|
-
{
|
4
|
-
"warning_type": "Cross-Site Request Forgery",
|
5
|
-
"warning_code": 7,
|
6
|
-
"fingerprint": "c674d468288bd469bd3118d61dc6a38738f84047fe7a8ee381cdc7786a51c8cd",
|
7
|
-
"message": "'protect_from_forgery' should be called in TokenAuth::Api::PayloadsController",
|
8
|
-
"file": "app/controllers/token_auth/api/payloads_controller.rb",
|
9
|
-
"line": 7,
|
10
|
-
"link": "http://brakemanscanner.org/docs/warning_types/cross-site_request_forgery/",
|
11
|
-
"code": null,
|
12
|
-
"render_path": null,
|
13
|
-
"location": {
|
14
|
-
"type": "controller",
|
15
|
-
"controller": "TokenAuth::Api::PayloadsController"
|
16
|
-
},
|
17
|
-
"user_input": null,
|
18
|
-
"confidence": "High",
|
19
|
-
"note": ""
|
20
|
-
},
|
21
3
|
{
|
22
4
|
"warning_type": "Cross-Site Request Forgery",
|
23
5
|
"warning_code": 7,
|
24
6
|
"fingerprint": "f4b575f7a0660e776b6f6a29f548beb56b6b506e386fe386430ba52e25c3f350",
|
7
|
+
"check_name": "ForgerySetting",
|
25
8
|
"message": "'protect_from_forgery' should be called in TokenAuth::Api::BaseController",
|
26
9
|
"file": "app/controllers/token_auth/api/base_controller.rb",
|
27
10
|
"line": 4,
|
@@ -37,6 +20,6 @@
|
|
37
20
|
"note": ""
|
38
21
|
}
|
39
22
|
],
|
40
|
-
"updated": "2017-
|
41
|
-
"brakeman_version": "
|
23
|
+
"updated": "2017-11-21 13:52:05 -0600",
|
24
|
+
"brakeman_version": "4.0.1"
|
42
25
|
}
|
data/lib/token_auth.rb
CHANGED
data/lib/token_auth/engine.rb
CHANGED
data/lib/token_auth/version.rb
CHANGED
metadata
CHANGED
@@ -1,71 +1,71 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: token_auth
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eric Carty-Fickes
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-11-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: active_model_serializers
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.10.
|
19
|
+
version: 0.10.7
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 0.10.
|
26
|
+
version: 0.10.7
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: actionpack
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 5.
|
33
|
+
version: '5.1'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 5.
|
40
|
+
version: '5.1'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: activerecord
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- -
|
45
|
+
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: 5.
|
47
|
+
version: '5.1'
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- -
|
52
|
+
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: 5.
|
54
|
+
version: '5.1'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: railties
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- -
|
59
|
+
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: 5.
|
61
|
+
version: '5.1'
|
62
62
|
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- -
|
66
|
+
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: 5.
|
68
|
+
version: '5.1'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: sprockets-rails
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -100,14 +100,14 @@ dependencies:
|
|
100
100
|
requirements:
|
101
101
|
- - "~>"
|
102
102
|
- !ruby/object:Gem::Version
|
103
|
-
version: 3.
|
103
|
+
version: '3.7'
|
104
104
|
type: :development
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
108
|
- - "~>"
|
109
109
|
- !ruby/object:Gem::Version
|
110
|
-
version: 3.
|
110
|
+
version: '3.7'
|
111
111
|
- !ruby/object:Gem::Dependency
|
112
112
|
name: capybara
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|
@@ -142,14 +142,14 @@ dependencies:
|
|
142
142
|
requirements:
|
143
143
|
- - '='
|
144
144
|
- !ruby/object:Gem::Version
|
145
|
-
version: 0.
|
145
|
+
version: '0.51'
|
146
146
|
type: :development
|
147
147
|
prerelease: false
|
148
148
|
version_requirements: !ruby/object:Gem::Requirement
|
149
149
|
requirements:
|
150
150
|
- - '='
|
151
151
|
- !ruby/object:Gem::Version
|
152
|
-
version: 0.
|
152
|
+
version: '0.51'
|
153
153
|
- !ruby/object:Gem::Dependency
|
154
154
|
name: mdl
|
155
155
|
requirement: !ruby/object:Gem::Requirement
|
@@ -198,6 +198,7 @@ files:
|
|
198
198
|
- app/controllers/token_auth/concerns/cors_settings.rb
|
199
199
|
- app/controllers/token_auth/configuration_tokens_controller.rb
|
200
200
|
- app/controllers/token_auth/tokens_controller.rb
|
201
|
+
- app/models/token_auth/application_record.rb
|
201
202
|
- app/models/token_auth/authentication_token.rb
|
202
203
|
- app/models/token_auth/configuration_token.rb
|
203
204
|
- app/models/token_auth/payload.rb
|