oo_auth 1.0.1 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/README.md +1 -1
- data/lib/oo_auth.rb +11 -3
- data/lib/oo_auth/request_proxy.rb +1 -1
- data/lib/oo_auth/version.rb +1 -1
- metadata +2 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 178f38351c6f267d456819463e4ca2c93926117870d861ec72e3ed29683b3a37
|
4
|
+
data.tar.gz: f1ac00838a7e75882e43b66e3375c1fa98dc53a2fcbbfe1b56318b3f1d6a67fe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b6ce16bde9a6ab1cd8d7efec77c37384bf638dd1b0a7fdb860fdbba53da60a52352beaeb2211f7a44df6507e3e18cfacfae9d82ee0e4c75eeae859613d5ba893
|
7
|
+
data.tar.gz: 327e56fb32b8bf427aa91729f03edb33809eba68282c4acd0c80c9405b88d9bf217a98e89ef41b9c4f189b17c0b4223bebcce7bc0f5269dcb5fc6c8696607103
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
[](http://badge.fury.io/rb/oo_auth) [](https://codeclimate.com/github/mtgrosser/oo_auth)
|
1
|
+
[](http://badge.fury.io/rb/oo_auth) [](https://travis-ci.org/mtgrosser/girocode) [](https://codeclimate.com/github/mtgrosser/oo_auth)
|
2
2
|
|
3
3
|
# oo_auth
|
4
4
|
|
data/lib/oo_auth.rb
CHANGED
@@ -78,13 +78,13 @@ module OoAuth
|
|
78
78
|
#
|
79
79
|
# See Also: {OAuth core spec version 1.0, section 5.1}[http://oauth.net/core/1.0#rfc.section.5.1]
|
80
80
|
def escape(value)
|
81
|
-
|
81
|
+
uri_escape(value.to_s)
|
82
82
|
rescue ArgumentError
|
83
|
-
|
83
|
+
uri_escape(value.to_s.force_encoding(Encoding::UTF_8))
|
84
84
|
end
|
85
85
|
|
86
86
|
def unescape(value)
|
87
|
-
URI.
|
87
|
+
URI.decode_www_form_component(value.gsub('+', '%2B'))
|
88
88
|
end
|
89
89
|
|
90
90
|
# cf. http://tools.ietf.org/html/rfc5849#section-3.4.1.1
|
@@ -124,6 +124,14 @@ module OoAuth
|
|
124
124
|
authorization
|
125
125
|
end
|
126
126
|
|
127
|
+
private
|
128
|
+
|
129
|
+
def uri_escape(string)
|
130
|
+
encoding = string.encoding
|
131
|
+
string.b.gsub(RESERVED_CHARACTERS) { |m|
|
132
|
+
'%' + m.unpack('H2' * m.bytesize).join('%').upcase }.force_encoding(encoding)
|
133
|
+
end
|
134
|
+
|
127
135
|
end
|
128
136
|
|
129
137
|
end
|
@@ -18,7 +18,7 @@ module OoAuth
|
|
18
18
|
header = header.to_s
|
19
19
|
return unless header.start_with?('OAuth ')
|
20
20
|
# decompose
|
21
|
-
|
21
|
+
header[6, header.length].split(',').inject({}) do |hsh, str|
|
22
22
|
key, value = str.split('=').map { |s| OoAuth.unescape(s.strip) }
|
23
23
|
if PARAMETERS.include?(key)
|
24
24
|
hsh[key] = value.sub(/^\"(.*)\"$/, '\1')
|
data/lib/oo_auth/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
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.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matthias Grosser
|
@@ -118,8 +118,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
118
118
|
- !ruby/object:Gem::Version
|
119
119
|
version: '0'
|
120
120
|
requirements: []
|
121
|
-
|
122
|
-
rubygems_version: 2.4.5.1
|
121
|
+
rubygems_version: 3.0.3
|
123
122
|
signing_key:
|
124
123
|
specification_version: 4
|
125
124
|
summary: OAuth without the callbacks
|