standard_id-provider 0.1.0 → 0.3.0
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 +4 -4
- data/{MIT-LICENSE → LICENSE} +3 -1
- data/app/controllers/standard_id/provider/application_controller.rb +5 -0
- data/app/controllers/standard_id/provider/introspection_controller.rb +9 -0
- data/app/controllers/standard_id/provider/revocation_controller.rb +9 -0
- data/lib/standard_id/provider/config/schema.rb +1 -1
- data/lib/standard_id/provider/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: b9592cd119ffb18ff4e2cf19a9feaca0058aee05edfe5ab24a01f18fbd3c4b1b
|
|
4
|
+
data.tar.gz: dc8fce05e463d51f56bfe482e7589ab274a183b58fa914ceca08fa53ebdbce42
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f6c57e6ee827fb92f2a48266c01579a272fb5b8c6605da5ed6c078d3aeb796ad4e6dfb2ebb501c75eb99239426628019f26f80aed085dc536794829e3854e86e
|
|
7
|
+
data.tar.gz: 1d3eb26ad72aa0b2c4958771f2f008355329213eb4863ab9a03cbecf5807f3e230eef1382813da5d68c6a39e287ac90f8c358a63e22978db1a008e341ed96f94
|
data/{MIT-LICENSE → LICENSE}
RENAMED
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
module StandardId
|
|
2
2
|
module Provider
|
|
3
3
|
class ApplicationController < ActionController::API
|
|
4
|
+
# Provides the shared rate-limit store + the TooManyRequests -> JSON 429
|
|
5
|
+
# handler (Retry-After header included), matching the standard_id engine's
|
|
6
|
+
# rate-limit response shape. Individual controllers declare their limits.
|
|
7
|
+
include StandardId::RateLimitHandling
|
|
8
|
+
|
|
4
9
|
rescue_from StandardId::OAuthError do |e|
|
|
5
10
|
render json: { error: e.oauth_error_code, error_description: e.message }, status: e.http_status
|
|
6
11
|
end
|
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
module StandardId
|
|
2
2
|
module Provider
|
|
3
3
|
class IntrospectionController < ApplicationController
|
|
4
|
+
# Throttle by IP (30 per 15 min) BEFORE client authentication so this
|
|
5
|
+
# credential-guessable RFC 7662 endpoint can't be brute-forced. Override
|
|
6
|
+
# with RATE_LIMIT_INTROSPECT_PER_IP.
|
|
7
|
+
rate_limit to: (ENV["RATE_LIMIT_INTROSPECT_PER_IP"] || 30).to_i,
|
|
8
|
+
within: 15.minutes,
|
|
9
|
+
by: -> { request.remote_ip },
|
|
10
|
+
name: "provider-introspect-ip",
|
|
11
|
+
store: StandardId::RateLimitHandling::RATE_LIMIT_STORE
|
|
12
|
+
|
|
4
13
|
before_action :authenticate_client!
|
|
5
14
|
|
|
6
15
|
def create
|
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
module StandardId
|
|
2
2
|
module Provider
|
|
3
3
|
class RevocationController < ApplicationController
|
|
4
|
+
# Throttle by IP (30 per 15 min) BEFORE client authentication so this
|
|
5
|
+
# credential-guessable RFC 7009 endpoint can't be brute-forced. Override
|
|
6
|
+
# with RATE_LIMIT_REVOKE_PER_IP.
|
|
7
|
+
rate_limit to: (ENV["RATE_LIMIT_REVOKE_PER_IP"] || 30).to_i,
|
|
8
|
+
within: 15.minutes,
|
|
9
|
+
by: -> { request.remote_ip },
|
|
10
|
+
name: "provider-revoke-ip",
|
|
11
|
+
store: StandardId::RateLimitHandling::RATE_LIMIT_STORE
|
|
12
|
+
|
|
4
13
|
before_action :authenticate_client!
|
|
5
14
|
|
|
6
15
|
def create
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: standard_id-provider
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.3.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Jaryl Sim
|
|
@@ -45,7 +45,7 @@ executables: []
|
|
|
45
45
|
extensions: []
|
|
46
46
|
extra_rdoc_files: []
|
|
47
47
|
files:
|
|
48
|
-
-
|
|
48
|
+
- LICENSE
|
|
49
49
|
- README.md
|
|
50
50
|
- Rakefile
|
|
51
51
|
- app/assets/stylesheets/standard_id/provider/application.css
|
|
@@ -89,7 +89,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
89
89
|
requirements:
|
|
90
90
|
- - ">="
|
|
91
91
|
- !ruby/object:Gem::Version
|
|
92
|
-
version: '
|
|
92
|
+
version: '4.0'
|
|
93
93
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
94
94
|
requirements:
|
|
95
95
|
- - ">="
|