Exception: StandardId::NoBoundProfileError
- Inherits:
-
InvalidGrantError
- Object
- StandardError
- OAuthError
- InvalidGrantError
- StandardId::NoBoundProfileError
- Defined in:
- lib/standard_id/errors.rb
Overview
Raised at mint time when an account has no profile of the type bound to the requested audience via ‘c.oauth.audience_profile_types`.
Subclass of ‘InvalidGrantError` so existing OAuth error handling (which renders OAuthError as RFC 6749 error responses) treats this as `invalid_grant`. The audience and expected profile types are surfaced via readers for audit logging only — operators MUST NOT interpolate them into client-facing error responses, since the configured profile-type taxonomy is internal-only information.
Instance Attribute Summary collapse
-
#audience ⇒ Object
readonly
Returns the value of attribute audience.
-
#expected_profile_types ⇒ Object
readonly
Returns the value of attribute expected_profile_types.
Instance Method Summary collapse
-
#initialize(audience:, expected_profile_types:) ⇒ NoBoundProfileError
constructor
A new instance of NoBoundProfileError.
Methods inherited from InvalidGrantError
Methods inherited from OAuthError
#http_status, #oauth_error_code
Constructor Details
#initialize(audience:, expected_profile_types:) ⇒ NoBoundProfileError
Returns a new instance of NoBoundProfileError.
73 74 75 76 77 78 |
# File 'lib/standard_id/errors.rb', line 73 def initialize(audience:, expected_profile_types:) @audience = audience @expected_profile_types = Array(expected_profile_types) super("No profile of type [#{@expected_profile_types.join(', ')}] " \ "for audience '#{audience}'") end |
Instance Attribute Details
#audience ⇒ Object (readonly)
Returns the value of attribute audience.
71 72 73 |
# File 'lib/standard_id/errors.rb', line 71 def audience @audience end |
#expected_profile_types ⇒ Object (readonly)
Returns the value of attribute expected_profile_types.
71 72 73 |
# File 'lib/standard_id/errors.rb', line 71 def expected_profile_types @expected_profile_types end |