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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7277bed83877f6bf4d594edaf754208a194edc113b166428005491855f5c4e94
4
- data.tar.gz: 6bb65c12882616a7b5116e56d82b6aae805ffcce9e021621f2572a00f4c4f4a3
3
+ metadata.gz: b9592cd119ffb18ff4e2cf19a9feaca0058aee05edfe5ab24a01f18fbd3c4b1b
4
+ data.tar.gz: dc8fce05e463d51f56bfe482e7589ab274a183b58fa914ceca08fa53ebdbce42
5
5
  SHA512:
6
- metadata.gz: f1648a8f251196809c60e44ab87dc8611e943f73c27e5430b70660c65af010eb523ac8dcce958ec992786e3784e571a67b49dc057ed1475079d8fd635d5410c1
7
- data.tar.gz: 5ee6aaf6993590ddbf1c2139c26d11c079d0b3aee394cf38c48fe05b5cebaf85e36bbbefed4b8e641e9cfc63d657b66349e0442904b08db3ab95519d9566ac89
6
+ metadata.gz: f6c57e6ee827fb92f2a48266c01579a272fb5b8c6605da5ed6c078d3aeb796ad4e6dfb2ebb501c75eb99239426628019f26f80aed085dc536794829e3854e86e
7
+ data.tar.gz: 1d3eb26ad72aa0b2c4958771f2f008355329213eb4863ab9a03cbecf5807f3e230eef1382813da5d68c6a39e287ac90f8c358a63e22978db1a008e341ed96f94
@@ -1,4 +1,6 @@
1
- Copyright (c) Jaryl Sim
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2026 Rarebit One
2
4
 
3
5
  Permission is hereby granted, free of charge, to any person obtaining
4
6
  a copy of this software and associated documentation files (the
@@ -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
@@ -1,4 +1,4 @@
1
- StandardConfig.schema.draw do
1
+ StandardId::ConfigSchema.define do
2
2
  scope :provider do
3
3
  field :id_token_lifetime, type: :integer, default: 3600
4
4
  field :scopes_supported, type: :array, default: -> { %w[openid profile email offline_access] }
@@ -1,5 +1,5 @@
1
1
  module StandardId
2
2
  module Provider
3
- VERSION = "0.1.0"
3
+ VERSION = "0.3.0"
4
4
  end
5
5
  end
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.1.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
- - MIT-LICENSE
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: '3.2'
92
+ version: '4.0'
93
93
  required_rubygems_version: !ruby/object:Gem::Requirement
94
94
  requirements:
95
95
  - - ">="