identity-gateway 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/.ruby-version +1 -0
- data/README.md +4 -5
- data/circle.yml +11 -0
- data/identity-gateway.gemspec +2 -2
- data/lib/identity/gateway/provider.rb +12 -0
- data/lib/identity/gateway/version.rb +1 -1
- metadata +7 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 64a6769951845fbdc09fe46d675da1b47358d1d3
|
4
|
+
data.tar.gz: d4c5b0257b8834b39f0f16e59c5c89f370162898
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0dca2931cca5a5b275a72fd3a6b999930ee254a2f50720f2d84c8645e8a1d76271756ce53715c7fce3becb03a960cbea5f8c97f943312d8c918532168928ad9e
|
7
|
+
data.tar.gz: e1712e03ed5c51ed3e4762458f1546bc0b324181028b6bb93a1fa08da716ccc55da205efaf2a5e2e5e7bfddca0fd1537c0d247ad28b601b6a011423b9d313771
|
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
2.2.4
|
data/README.md
CHANGED
@@ -1,8 +1,7 @@
|
|
1
1
|
# Identity::Gateway
|
2
2
|
|
3
|
-
[![Gem Version]
|
4
|
-
[
|
5
|
-
[GV img]: https://img.shields.io/gem/v/identity-gateway.svg
|
3
|
+
[![Gem Version](https://img.shields.io/gem/v/identity-gateway.svg)](https://rubygems.org/gems/identity-gateway)
|
4
|
+
[![CircleCI](https://circleci.com/gh/wamland-team/identity-gateway.svg?style=shield&circle-token=b03fdcc75674d173f58a296cb1a3b2162b6828dc)](https://circleci.com/gh/wamland-team/identity-gateway)
|
6
5
|
|
7
6
|
Identity's gateway provider for Ruby and Rails applications. Act as a man in the middle between backend services and Identity.
|
8
7
|
|
@@ -88,10 +87,10 @@ class ApplicationController < ActionController::Base
|
|
88
87
|
end
|
89
88
|
```
|
90
89
|
|
91
|
-
Alternatively, you can globally handle Identity::Gateway::Unauthorized's by having rails handle them as a
|
90
|
+
Alternatively, you can globally handle Identity::Gateway::Unauthorized's by having rails handle them as a 401 error and serving a 401 error page. Add the following to application.rb:
|
92
91
|
|
93
92
|
```ruby
|
94
|
-
config.action_dispatch.rescue_responses['Identity::Gateway::Unauthorized'] = :
|
93
|
+
config.action_dispatch.rescue_responses['Identity::Gateway::Unauthorized'] = :unauthorized
|
95
94
|
```
|
96
95
|
|
97
96
|
## Configuration
|
data/circle.yml
ADDED
data/identity-gateway.gemspec
CHANGED
@@ -21,10 +21,10 @@ Gem::Specification.new do |spec|
|
|
21
21
|
f.match(%r{^(test|spec|features)/})
|
22
22
|
end
|
23
23
|
|
24
|
-
spec.required_ruby_version = '>=
|
24
|
+
spec.required_ruby_version = '>= 2.2.2'
|
25
25
|
|
26
26
|
spec.add_dependency 'httparty', '~> 0.13'
|
27
|
-
spec.add_development_dependency 'bundler'
|
27
|
+
spec.add_development_dependency 'bundler'
|
28
28
|
spec.add_development_dependency 'rake', '~> 11.3'
|
29
29
|
spec.add_development_dependency 'rspec', '~> 3.5'
|
30
30
|
spec.add_development_dependency 'rubocop', '~> 0.47.1'
|
@@ -41,6 +41,18 @@ module Identity
|
|
41
41
|
@subject
|
42
42
|
end
|
43
43
|
|
44
|
+
# Revoke access token.
|
45
|
+
#
|
46
|
+
# ==== Returns
|
47
|
+
# * <tt>HTTParty::Response</tt>.
|
48
|
+
def revoke_access!
|
49
|
+
self.class.post(
|
50
|
+
"#{@settings.provider_url}/oauth/revoke",
|
51
|
+
body: { token: request_token }.to_json,
|
52
|
+
headers: api_headers
|
53
|
+
)
|
54
|
+
end
|
55
|
+
|
44
56
|
protected
|
45
57
|
|
46
58
|
# Try to authorize token against provider.
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: identity-gateway
|
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
|
- Loic Kartono
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-06-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|
@@ -28,22 +28,16 @@ dependencies:
|
|
28
28
|
name: bundler
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - "~>"
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: 1.14.6
|
34
31
|
- - ">="
|
35
32
|
- !ruby/object:Gem::Version
|
36
|
-
version:
|
33
|
+
version: '0'
|
37
34
|
type: :development
|
38
35
|
prerelease: false
|
39
36
|
version_requirements: !ruby/object:Gem::Requirement
|
40
37
|
requirements:
|
41
|
-
- - "~>"
|
42
|
-
- !ruby/object:Gem::Version
|
43
|
-
version: 1.14.6
|
44
38
|
- - ">="
|
45
39
|
- !ruby/object:Gem::Version
|
46
|
-
version:
|
40
|
+
version: '0'
|
47
41
|
- !ruby/object:Gem::Dependency
|
48
42
|
name: rake
|
49
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -96,6 +90,7 @@ files:
|
|
96
90
|
- ".gitignore"
|
97
91
|
- ".rspec"
|
98
92
|
- ".rubocop.yml"
|
93
|
+
- ".ruby-version"
|
99
94
|
- ".travis.yml"
|
100
95
|
- Gemfile
|
101
96
|
- LICENSE.txt
|
@@ -103,6 +98,7 @@ files:
|
|
103
98
|
- Rakefile
|
104
99
|
- bin/console
|
105
100
|
- bin/setup
|
101
|
+
- circle.yml
|
106
102
|
- identity-gateway.gemspec
|
107
103
|
- lib/identity/gateway.rb
|
108
104
|
- lib/identity/gateway/configuration.rb
|
@@ -120,7 +116,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
120
116
|
requirements:
|
121
117
|
- - ">="
|
122
118
|
- !ruby/object:Gem::Version
|
123
|
-
version:
|
119
|
+
version: 2.2.2
|
124
120
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
125
121
|
requirements:
|
126
122
|
- - ">="
|