rack-jive-signed_request 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +4 -0
- data/lib/rack/jive/signed_request.rb +7 -7
- data/lib/rack/jive/signed_request/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d6a80ac7ca19c95f6e85dab57d66aa5f1a0ec21b
|
4
|
+
data.tar.gz: 5382742cfd32c1f7b02a8b5235303ebc88d65c16
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bd07d4df5a28398191f83926584e2e17eb70be330f08fed50aa384885e262408e04a664c9b0f24603acda85463a3b3e66f4f14a6c0e2f3666080e6af816439e4
|
7
|
+
data.tar.gz: ef3f46cc664f615a79f4017c3ef86200d59fcbf3ac2b3c1c060701e576703f9e4117ddca21df5ab88326df71b220c2850d9952de034014369fd357bf71987d6f
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -58,6 +58,10 @@ end
|
|
58
58
|
|
59
59
|
`request.env['jive.user_id']` will be populated with the authenticated users Jive ID
|
60
60
|
|
61
|
+
`request.env['jive.email']` will be populated with the authenticated users Jive Email
|
62
|
+
|
63
|
+
`request.env['jive.errors.signed_request']` will be populated if there was an error authenticating the signed request
|
64
|
+
|
61
65
|
## Development
|
62
66
|
|
63
67
|
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
@@ -27,18 +27,18 @@ module Rack
|
|
27
27
|
auth_header_params = ::CGI.parse env["HTTP_AUTHORIZATION"].gsub(/^JiveEXTN\s/,'')
|
28
28
|
|
29
29
|
begin
|
30
|
-
|
31
|
-
|
30
|
+
if ::Jive::SignedRequest.authenticate(env["HTTP_AUTHORIZATION"], @secret.call(auth_header_params))
|
31
|
+
env["jive.user_id"] = env["HTTP_X_JIVE_USER_ID"]
|
32
|
+
env["jive.email"] = env["HTTP_X_JIVE_USER_EMAIL"]
|
33
|
+
env["jive.external"] = (env["HTTP_X_JIVE_USER_EXTERNAL"] === "true")
|
34
|
+
else
|
35
|
+
env["jive.errors.signed_request"] = "Could not authenticate"
|
32
36
|
end
|
33
37
|
rescue ArgumentError => $e
|
34
|
-
|
38
|
+
env["jive.errors.signed_request"] = $e.message
|
35
39
|
end
|
36
40
|
end
|
37
41
|
|
38
|
-
env["jive.user_id"] = env["HTTP_X_JIVE_USER_ID"]
|
39
|
-
env["jive.email"] = env["HTTP_X_JIVE_USER_EMAIL"]
|
40
|
-
env["jive.external"] = (env["HTTP_X_JIVE_USER_EXTERNAL"] === "true")
|
41
|
-
|
42
42
|
@app.call(env)
|
43
43
|
end
|
44
44
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rack-jive-signed_request
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Butch Marshall
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-12-
|
11
|
+
date: 2015-12-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|