cerner-oauth1a 2.5.1 → 2.5.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/cerner/oauth1a/protocol.rb +16 -4
- data/lib/cerner/oauth1a/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ca8300adcad968664fcc86fc549aea148270447a03b551a3a4ab3205768bc39b
|
4
|
+
data.tar.gz: 83979ce58e001e22b1c1f88f5f7f32f7c743955d1f6f01772e4ff59073b2ba54
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f80154214e20e2bad8ecea32520af361b51e700740bb51cff3688bec67363cd1187bf08a089a4fbccb32be241d0677f924d87471076c67e40fb3cace036e22e3
|
7
|
+
data.tar.gz: 492f0ba94453e2c13e276a7074467df0764153d45c0424286835191d2fb2c214c802569ac35436b17bc8dcdcca9dc9588008e33866e28e217cb0689971a23b0b
|
data/CHANGELOG.md
CHANGED
@@ -49,6 +49,10 @@ module Cerner
|
|
49
49
|
# Cerner::OAuth1a::Protocol.parse_www_authenticate_header(header)
|
50
50
|
# # => {:realm=>"https://test.host", :oauth_problem=>"token_expired"}
|
51
51
|
#
|
52
|
+
# header = 'OAuth realm="https://test.host", oauth_problem=token_expired'
|
53
|
+
# Cerner::OAuth1a::Protocol.parse_www_authenticate_header(header)
|
54
|
+
# # => {:realm=>"https://test.host", :oauth_problem=>"token_expired"}
|
55
|
+
#
|
52
56
|
# Returns a Hash with symbolized keys of all of the parameters.
|
53
57
|
def self.parse_authorization_header(value)
|
54
58
|
params = {}
|
@@ -57,10 +61,18 @@ module Cerner
|
|
57
61
|
value = value.strip
|
58
62
|
return params unless value.size > 6 && value[0..5].casecmp?('OAuth ')
|
59
63
|
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
+
# trim off 'OAuth ' prefix
|
65
|
+
value = value[6..-1]
|
66
|
+
|
67
|
+
# split value on comma separators
|
68
|
+
value.split(/,\s*/).each do |kv_part|
|
69
|
+
# split each part on '=' separator
|
70
|
+
key, value = kv_part.split('=')
|
71
|
+
key = URI.decode_www_form_component(key)
|
72
|
+
# trim off surrounding double quotes, if they exist
|
73
|
+
value = value[1..-2] if value.start_with?('"') && value.end_with?('"')
|
74
|
+
value = URI.decode_www_form_component(value)
|
75
|
+
params[key.to_sym] = value
|
64
76
|
end
|
65
77
|
|
66
78
|
params
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cerner-oauth1a
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.5.
|
4
|
+
version: 2.5.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nathan Beyer
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-05-12 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: |
|
14
14
|
A minimal dependency library for interacting with a Cerner OAuth 1.0a Access
|