Class: Basecamp::Services::AuthorizationService
- Inherits:
-
BaseService
- Object
- BaseService
- Basecamp::Services::AuthorizationService
- Defined in:
- lib/basecamp/services/authorization_service.rb
Overview
Service for authorization operations. This is the only service that doesn't require an account context.
Instance Method Summary collapse
-
#get ⇒ Hash
Gets authorization information for the current user.
Constructor Details
This class inherits a constructor from Basecamp::Services::BaseService
Instance Method Details
#get ⇒ Hash
Gets authorization information for the current user.
Delegates to Http#get_authorization_document, which resolves
the issuer via resource-first OAuth discovery (SPEC.md §16) on the client's
own configured base URL and fetches the fixed authorization.json path.
Only the two soft fallback outcomes (+resource_discovery_failed+,
no_as_advertised) fall back to Launchpad; every hard selection failure
propagates as a Oauth::DiscoverySelectionError — a hard failure is never
silently converted into a Launchpad request. This service passes NO issuer,
config, or origin to the credentialed fetch, so there is no caller-supplied
path through which the bearer token could be sent to a foreign host.
Returns the authenticated user's identity and list of accounts they have access to.
35 36 37 38 39 40 41 42 |
# File 'lib/basecamp/services/authorization_service.rb', line 35 def get # Wrap in with_operation like every other service call so observability # hooks (logging, metrics, tracing) see this credentialed request and its # failures too. with_operation(service: "authorization", operation: "get", is_mutation: false) do http..json end end |