ballerina.auth.authz package

public struct AuthzChecker

Representation of AuthzChecker

Field Name Data Type Description Default Value
permissionstore PermissionStore authzCache: authorization cache instance
authzCache Cache authorization cache instance
  • < AuthzChecker > check ( string username , string scopeName ) ( boolean )

    Performs a authorization check, by comparing the groups of the user and the groups of the scope

    Parameter Name Data Type Description
    username string user name
    scopeName string name of the scope

    Return Variable Data Type Description
    boolean boolean: true if authorization check is a success, else false

public struct HttpAuthzHandler

AuthorizationChecker instance

  • < HttpAuthzHandler > canHandle ( InRequest req ) ( boolean )

    Checks if the provided request can be authorized

    Parameter Name Data Type Description
    req InRequest InRequest object

    Return Variable Data Type Description
    boolean boolean: true if its possible authorize, else false
  • < HttpAuthzHandler > handle ( InRequest req , string scopeName , string resourceName ) ( boolean )

    Performs a authorization check, by comparing the groups of the user and the groups of the scope

    Parameter Name Data Type Description
    req InRequest InRequest instance
    scopeName string name of the scope
    resourceName string name of the resource which is being accessed

    Return Variable Data Type Description
    boolean boolean: true if authorization check is a success, else false

public function createChecker ( PermissionStore permissionstore , Cache cache ) ( AuthzChecker )

Creates a Basic Authenticator

Parameter Name Data Type Description
permissionstore PermissionStore PermissionStore instance
cache Cache Cache instance

Return Variable Data Type Description
AuthzChecker AuthzChecker: AuthzChecker instance