oo_auth 1.0.2 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/oo_auth/nonce/redis_store.rb +5 -6
- data/lib/oo_auth/version.rb +1 -1
- data/lib/oo_auth.rb +4 -4
- metadata +8 -79
- data/CHANGELOG +0 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0e3c25ecc07c0f5e8a9bb658923875e6752758f47e1bd8853a96600f7f0f5037
|
4
|
+
data.tar.gz: b9ef1572c7a6debae566c0ecdb890a7a45c9c7014ea0f2b38e3778d87d9fa90c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cd0feb225e94f8f7fc260f10ffc628b5d8d5f5482a7158670cd7e1dd0a0a9e51fa24227b71ff94eaa0bf62732f4ab80ad2d138c7b12d3f53615f38fbb474721e
|
7
|
+
data.tar.gz: 47aca33e5594764cf1759b392930fd0ab6e0c7507c7a2e6b6c68659309713e43b094eb016f50b896ffc3617a070ceabf2e460b35607111489e6441ea38174921
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
[![Gem Version](https://badge.fury.io/rb/oo_auth.png)](http://badge.fury.io/rb/oo_auth) [![
|
1
|
+
[![Gem Version](https://badge.fury.io/rb/oo_auth.png)](http://badge.fury.io/rb/oo_auth) [![build](https://github.com/mtgrosser/oo_auth/actions/workflows/build.yml/badge.svg)](https://github.com/mtgrosser/oo_auth/actions/workflows/build.yml) [![Code Climate](https://codeclimate.com/github/mtgrosser/oo_auth.png)](https://codeclimate.com/github/mtgrosser/oo_auth)
|
2
2
|
|
3
3
|
# oo_auth
|
4
4
|
|
@@ -3,15 +3,14 @@ module OoAuth
|
|
3
3
|
class RedisStore < AbstractStore
|
4
4
|
attr_reader :redis, :namespace, :ttl
|
5
5
|
|
6
|
-
def initialize(options
|
7
|
-
options.symbolize_keys!
|
6
|
+
def initialize(**options)
|
8
7
|
@namespace = options.delete(:namespace)
|
9
8
|
@ttl = options.delete(:ttl) || 15.minutes
|
10
|
-
@redis = Redis.new(options)
|
9
|
+
@redis = Redis.new(**options)
|
11
10
|
end
|
12
11
|
|
13
12
|
def remember(nonce)
|
14
|
-
return nonce if @redis.set(key(nonce), '1',
|
13
|
+
return nonce if @redis.set(key(nonce), '1', nx: true, ex: ttl)
|
15
14
|
false
|
16
15
|
rescue Errno::ECONNREFUSED
|
17
16
|
false
|
@@ -21,8 +20,8 @@ module OoAuth
|
|
21
20
|
|
22
21
|
def key(nonce)
|
23
22
|
"#{@namespace}:oo_auth_nonce:#{nonce.timestamp}:#{nonce.value}"
|
24
|
-
end
|
23
|
+
end
|
25
24
|
|
26
25
|
end
|
27
26
|
end
|
28
|
-
end
|
27
|
+
end
|
data/lib/oo_auth/version.rb
CHANGED
data/lib/oo_auth.rb
CHANGED
@@ -109,16 +109,16 @@ module OoAuth
|
|
109
109
|
end
|
110
110
|
|
111
111
|
# Use this to sign Net::HTTP or ActionDispatch requests
|
112
|
-
def sign!(*args)
|
112
|
+
def sign!(*args, **kwargs)
|
113
113
|
credentials = args.pop
|
114
|
-
proxy = RequestProxy.new(*args)
|
114
|
+
proxy = RequestProxy.new(*args, **kwargs)
|
115
115
|
Signature.sign!(proxy, credentials)
|
116
116
|
end
|
117
117
|
|
118
118
|
# Use this in your controllers to verify the OAuth signature
|
119
119
|
# of a request.
|
120
|
-
def authorize!(
|
121
|
-
proxy = RequestProxy.new(
|
120
|
+
def authorize!(...)
|
121
|
+
proxy = RequestProxy.new(...)
|
122
122
|
return unless authorization = self.authorization(proxy.consumer_key, proxy.token)
|
123
123
|
return unless Signature.verify!(proxy, authorization.credentials)
|
124
124
|
authorization
|
metadata
CHANGED
@@ -1,92 +1,21 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: oo_auth
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matthias Grosser
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
12
|
-
dependencies:
|
13
|
-
- !ruby/object:Gem::Dependency
|
14
|
-
name: byebug
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
16
|
-
requirements:
|
17
|
-
- - ">="
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: '0'
|
20
|
-
type: :development
|
21
|
-
prerelease: false
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
23
|
-
requirements:
|
24
|
-
- - ">="
|
25
|
-
- !ruby/object:Gem::Version
|
26
|
-
version: '0'
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: simplecov
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - ">="
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: '0'
|
34
|
-
type: :development
|
35
|
-
prerelease: false
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
37
|
-
requirements:
|
38
|
-
- - ">="
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version: '0'
|
41
|
-
- !ruby/object:Gem::Dependency
|
42
|
-
name: rake
|
43
|
-
requirement: !ruby/object:Gem::Requirement
|
44
|
-
requirements:
|
45
|
-
- - ">="
|
46
|
-
- !ruby/object:Gem::Version
|
47
|
-
version: 0.8.7
|
48
|
-
type: :development
|
49
|
-
prerelease: false
|
50
|
-
version_requirements: !ruby/object:Gem::Requirement
|
51
|
-
requirements:
|
52
|
-
- - ">="
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
version: 0.8.7
|
55
|
-
- !ruby/object:Gem::Dependency
|
56
|
-
name: minitest
|
57
|
-
requirement: !ruby/object:Gem::Requirement
|
58
|
-
requirements:
|
59
|
-
- - "~>"
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
version: '4.7'
|
62
|
-
type: :development
|
63
|
-
prerelease: false
|
64
|
-
version_requirements: !ruby/object:Gem::Requirement
|
65
|
-
requirements:
|
66
|
-
- - "~>"
|
67
|
-
- !ruby/object:Gem::Version
|
68
|
-
version: '4.7'
|
69
|
-
- !ruby/object:Gem::Dependency
|
70
|
-
name: timecop
|
71
|
-
requirement: !ruby/object:Gem::Requirement
|
72
|
-
requirements:
|
73
|
-
- - "~>"
|
74
|
-
- !ruby/object:Gem::Version
|
75
|
-
version: 0.6.3
|
76
|
-
type: :development
|
77
|
-
prerelease: false
|
78
|
-
version_requirements: !ruby/object:Gem::Requirement
|
79
|
-
requirements:
|
80
|
-
- - "~>"
|
81
|
-
- !ruby/object:Gem::Version
|
82
|
-
version: 0.6.3
|
11
|
+
date: 2023-05-25 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
83
13
|
description: Out Of Band OAuth
|
84
14
|
email: mtgrosser@gmx.net
|
85
15
|
executables: []
|
86
16
|
extensions: []
|
87
17
|
extra_rdoc_files: []
|
88
18
|
files:
|
89
|
-
- CHANGELOG
|
90
19
|
- LICENSE
|
91
20
|
- README.md
|
92
21
|
- lib/oo_auth.rb
|
@@ -103,7 +32,7 @@ homepage: http://github.com/mtgrosser/oo_auth
|
|
103
32
|
licenses:
|
104
33
|
- MIT
|
105
34
|
metadata: {}
|
106
|
-
post_install_message:
|
35
|
+
post_install_message:
|
107
36
|
rdoc_options: []
|
108
37
|
require_paths:
|
109
38
|
- lib
|
@@ -111,15 +40,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
111
40
|
requirements:
|
112
41
|
- - ">="
|
113
42
|
- !ruby/object:Gem::Version
|
114
|
-
version: '
|
43
|
+
version: '3.0'
|
115
44
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
116
45
|
requirements:
|
117
46
|
- - ">="
|
118
47
|
- !ruby/object:Gem::Version
|
119
48
|
version: '0'
|
120
49
|
requirements: []
|
121
|
-
rubygems_version: 3.
|
122
|
-
signing_key:
|
50
|
+
rubygems_version: 3.3.26
|
51
|
+
signing_key:
|
123
52
|
specification_version: 4
|
124
53
|
summary: OAuth without the callbacks
|
125
54
|
test_files: []
|