Skip to main content

HS.REST.Handler

abstract class HS.REST.Handler extends %pkg.isc.rest.handler

Base REST handler for all dispatch classes to extend. Acts as an intermediate layer between HS code and isc.rest to enforce best practices relevant to HS.

Method Inventory

Methods

classmethod AuthenticationStrategy() as %Dictionary.Classname
Inherited description: Subclasses must override this to define a custom authentication strategy class.
final classmethod CheckPermission(pEndpoint As %String, pUserContext As %RegisteredObject, ByRef URLParams) as %Boolean
Inherited description: Checks the user's permission for a documentation-related endpoint. pEndpoint may be one of:
  • /build-documentation
  • /openapi.json
pUserContext is supplied by GetUserContext().
classmethod GetUserResource(pFullUserInfo As %DynamicObject) as %pkg.isc.rest.model.iSerializable
Subclasses may override this method to provide information about the logged-in user.
  • pFullUserInfo: dynamic object with full user info provided by the authentication strategy
    classmethod IsPublic(pUrl As %String, pMethod As %String) as %Boolean
    Returns 1 if a given combination of URL + method should be considered public. That means that UnknownUser is not rejected with a 401. By default only /auth/status is permitted for unauthenticated users.
    @API.Overridable
    @Argument pUrl URL of incoming request. Same as in OnPreDispatch(). @Argument pMethod HTTP method of incoming request. Same as in OnPreDispatch().
    classmethod LogErrorStatus(pStatus As %Status)
    Any additional logging of errors during requests.
    @API.Overrideable
    classmethod ModifyOpenAPISpecification(ByRef specification As %pkg.isc.rest.openAPI.model.openAPI)
    Used to modify a generated OpenAPI specification before it is finalized, implement any custom-changes you want to make to the OpenAPI specification as a whole here. If you want to modify something class-specific (resource/action endpoints, schemas generated for classes), consider using the ModifyOpenAPISpecification() ClassMethod of the class in question instead.
    @API.Overrideable
    classmethod OnHandleCorsRequest(pUrl As %String) as %Status
    This is the CORS request handler. User should override this method in their subclass if they don't want the default behavior from super class.
    @API.Overrideable
    final classmethod OnPreDispatch(pUrl As %String, pMethod As %String, ByRef pContinue As %Boolean) as %Status
    Inherited description: This method Gets called prior to dispatch of the request. Put any common code here that you want to be executed for EVERY request. If pContinue is set to 0, the request will NOT be dispatched according to the UrlMap. If this case it's the responsibility of the user to return a response.

    Inherited Members

    Inherited Methods

    Subclasses

    FeedbackOpens in a new tab