HS.BulkFHIR.API.ClientAuthAdapter
class HS.BulkFHIR.API.ClientAuthAdapter extends HS.BulkFHIR.API.AdapterBase
Base class for all client auth adapters. Subclasses must extend this class uniquely identify themselves, and implement the abstract methods. This base adapter accompanies the base config class HS.BulkFHIR.ClientAuth.ConfigBaseMethod Inventory
- GetAuthEnabledRestClient()
- GetFetchTokenInfo()
- GetUnAuthenticatedRestClient()
- Initialize()
- InitializeAdapterSpecific()
- PrelimValidateSession()
Parameters
parameter IsOAuth;
Whether the adapter uses OAuth.
Methods
abstract classmethod GetAuthEnabledRestClient(pSession As HS.BulkFHIR.Session = "", pBFCconfig As HS.BulkFHIR.API.Data.Config = "", pClientAuthConfig As HS.BulkFHIR.ClientAuth.ConfigBase, pMaxRequestsPerSec As %Integer = 10, ByRef pHeaders, pAccessTokenConfig As HS.BulkFHIR.Fetch.Util.AccessToken = "", pAdditionalAudienceUrl As %String = "") as HS.BulkFHIR.Fetch.Util.RestClient
Called at discretion of any fetch adapter method to obtain a rest client
ready-configured to make authenticated requests.
One of either @Input pSession or @Input pBFCConfig must be specified.
@Input pHeaders are custom http headers
@Input pAccessTokenConfig is optional & only for OAuth
@Input pAdditionalAudienceUrl a comma-separated string for any additional audiences
abstract classmethod GetFetchTokenInfo(pBFCconfig As HS.BulkFHIR.API.Data.Config = "", pClientAuthConfig As HS.BulkFHIR.ClientAuth.ConfigBase, pSession As HS.BulkFHIR.Session) as %DynamicObject
MUST be defined if IsOAuth = 1
Returns an access token utility object
@Input pClientAuthConfig will be used to obtain list of scopes needed for the fetch (among other data)
@Input pSession - pSession.tokenInfo needs to be defined
@Output is an instance of HS.BulkFHIR.Session property fetchTokenInfo, with "scope" and "credential_id"
classmethod GetUnAuthenticatedRestClient(pBFCconfig As HS.BulkFHIR.API.Data.Config = "", pClientAuthConfig As HS.BulkFHIR.ClientAuth.ConfigBase) as HS.BulkFHIR.Fetch.Util.RestClient
(Optional overrideable)
Called at discretion of any fetch adapter method to obtain a simple unauthenticated rest client
used for targeting unsecured endpoints or discovery calls, etc.
final classmethod Initialize(pBFCconfig As HS.BulkFHIR.API.Data.Config, pClientAuthConfig As HS.BulkFHIR.ClientAuth.ConfigBase)
Called when the BFC endpoint configuration is configured/re-configured
classmethod InitializeAdapterSpecific(pBFCconfig As HS.BulkFHIR.API.Data.Config, pClientAuthConfig As HS.BulkFHIR.ClientAuth.ConfigBase, ByRef pServiceRegistryEntry As HS.Registry.Service.HTTP)
(Optional overrideable)
Called by Initialize(), and should be used to implement any adapter-specific workflows.
Initialize() will call %Save() on pServiceRegistryEntry - this class may simply make any changes needed.
abstract classmethod PrelimValidateSession(pSession As HS.BulkFHIR.Session, pClientAuthConfig As HS.BulkFHIR.ClientAuth.ConfigBase, pRequestedResourceTypes)
(Optional overrideable)
Called at discretion of any fetch adapter method to conduct a preliminary check for any obvious
issues BEFORE we start dispatching requests to inevitable failure.
e.g. for oauth checking that scopes requested are within the scopes configured in the session
If check passes, should simply return. Else $$$ThrowFHIR($$$HttpOnlyResponse(403))
@Input pRequestedResourceTypes is a local global where subscript is name of the resource requested (value can be empty string)
Inherited Members
Inherited Methods
- %AddToSaveSet()
- %ClassIsLatestVersion()
- %ClassName()
- %ConstructClone()
- %DispatchClassMethod()
- %DispatchGetModified()
- %DispatchGetProperty()
- %DispatchMethod()
- %DispatchSetModified()
- %DispatchSetMultidimProperty()
- %DispatchSetProperty()
- %Extends()
- %GetParameter()
- %IsA()
- %IsModified()
- %New()
- %NormalizeObject()
- %ObjectModified()
- %OriginalNamespace()
- %PackageName()
- %RemoveFromSaveSet()
- %SerializeObject()
- %SetModified()
- %ValidateObject()