class RequestHTTP(Context): ''' Context for HTTP request data. ''' # ---------------------------------------------------------------- Defined clientIP = definesIf(str, doc=''' @rtype: string The client IP that made the request. ''') scheme = defines(str, doc=''' @rtype: string The scheme URI protocol name to be used for the response. ''') method = defines(str, doc=''' @rtype: string The method name of the request. ''') uri = defines(str, doc=''' @rtype: string The relative request URI. ''') headers = definesIf(dict, doc=''' @rtype: dictionary{string, string} The raw headers. ''') parameters = definesIf(list, doc=''' @rtype: list[tuple(string, string)] The parameters of the request. ''')
class Register(Context): ''' The register context. ''' # ---------------------------------------------------------------- Defined invokers = defines(list, doc=''' @rtype: list[Context] The invokers created based on the services. ''') validations = definesIf(dict, doc=''' @rtype: dictionary{TypeService: list[object, object]} The validations indexed by the service type. As a value a list that provides on the first position the binded validation target and on the second the binded target ''') doCopyInvoker = defines(IDo, doc=''' @rtype: callable(destination:Context, source:Context, exclude:set=None) -> Context On the first position the destination invoker to copy to and on the second position the source to copy from, returns the destination invoker. Accepts also a named argument containing a set of attributes names to exclude. ''') # ---------------------------------------------------------------- Optional exclude = optional(set) # ---------------------------------------------------------------- Required services = requires(Iterable)
class Element(Context): ''' The element context. ''' # ---------------------------------------------------------------- Defined shadowing = definesIf(Context, doc=''' @rtype: Context The element that this shadow element is based on. ''') shadowed = definesIf(Context, doc=''' @rtype: Context The element that this element shadows. ''') # ---------------------------------------------------------------- Required property = requires(TypeProperty)
class Register(Context): ''' The register context. ''' # ---------------------------------------------------------------- Defined hintsCall = definesIf(dict) # ---------------------------------------------------------------- Required nodes = requires(list)
class Register(Context): ''' The register context. ''' # ---------------------------------------------------------------- Defined hintsModel = definesIf(dict) # ---------------------------------------------------------------- Required invokers = requires(list)
class Register(Context): ''' The register context. ''' # ---------------------------------------------------------------- Defined hintsCall = definesIf(dict) # ---------------------------------------------------------------- Required invokers = requires(list) doSuggest = requires(IDo)
class RequestContentHTTP(Context): ''' Context for HTTP request content data. ''' # ---------------------------------------------------------------- Defined source = definesIf(IInputStream, doc=''' @rtype: IInputStream The source for the request content. ''')
class Request(Context): ''' Context for request. ''' # ---------------------------------------------------------------- Defined rootURI = definesIf(str, doc=''' @rtype: string The root URI of the request. ''') # ---------------------------------------------------------------- Required uri = requires(str)
class RequestEncoder(Context): ''' The create encoder context. ''' # ---------------------------------------------------------------- Defined objType = definesIf(Type, doc=''' @rtype: Type The type that is the target of the encoder create. ''') # ---------------------------------------------------------------- Required encoder = requires(ITransfrom)
class Response(Context): ''' The response context. ''' # ---------------------------------------------------------------- Defined renderFactory = definesIf(Callable, doc=''' @rtype: callable(Content, markers=None) -> IRender The renderer factory to be used for the response content, it receives as the first argument the content to render in and as the second argument is an optional one and provides the markers to be used in the rendering indexing, if not provided then no indexing will occur. ''')
class Request(Context): ''' The request context. ''' # ---------------------------------------------------------------- Defined node = definesIf(Context, doc=''' @rtype: Context The node corresponding to the request. ''') nodesValues = definesIf(dict, doc=''' @rtype: dictionary{Context: string} A dictionary containing the path values indexed by the node. ''') extension = definesIf(str, doc=''' @rtype: string The extension of the requested URI. ''') # ---------------------------------------------------------------- Required uri = requires(str)
class Decoding(Context): ''' The model decoding context. ''' # ---------------------------------------------------------------- Defined relation = definesIf(Context, doc=''' @rtype: Invoker The invoker that the decoding is in relation with. ''') # ---------------------------------------------------------------- Required validations = requires(list) property = requires(TypeProperty) doSet = requires(IDo)
class Content(Context): ''' The content context. ''' # ---------------------------------------------------------------- Defined source = defines(IInputStream) length = defines(int) indexes = definesIf(list, doc=''' @rtype: list[Index] The indexes list. ''') # ---------------------------------------------------------------- Required charSet = requires(str)
class RequestContent(Context): ''' The request content context. ''' # ---------------------------------------------------------------- Defined source = defines(IInputStream) doContentReader = definesIf(IDo, doc=''' @rtype: callable(bytes) -> bytes|None The content reader callable used for pushing data from the asyncore read, returns True in order to get more data. Once the reader is finalized it will return either None or remaining bytes. ''') # ---------------------------------------------------------------- Required length = requires(int)
class Decoding(Context): ''' The model decoding context. ''' # ---------------------------------------------------------------- Defined maximumLength = definesIf(int, doc=''' @rtype: integer Flag indicating if the decoding is mandatory. ''') # ---------------------------------------------------------------- Required validations = requires(list) property = requires(TypeProperty) doSet = requires(IDo)
class PermissionResource(Context): ''' The permission context. ''' # ---------------------------------------------------------------- Defined navigate = definesIf(str, doc=''' @rtype: string The permission navigation. ''') # ---------------------------------------------------------------- Required method = requires(int) path = requires(Path) invoker = requires(Invoker) filters = requires(list) values = requires(dict)
class CodedHTTP(Context): ''' Context for coded. ''' # ---------------------------------------------------------------- Defines code = defines(str, doc=''' @rtype: string The unique code associated with the context. ''') status = defines(int, doc=''' @rtype: integer The HTTP status code. ''') isSuccess = definesIf(bool, doc=''' @rtype: boolean True if the context is in success mode, False otherwise. ''')
class Invoker(Context): ''' The invoker context. ''' # ---------------------------------------------------------------- Defined path = defines(list, doc=''' @rtype: list[Context] The starting path elements for filter. ''') filterName = definesIf(str, doc=''' @rtype: string If present it means the invoker is a filter type invoker and is known with the provided name. ''') # ---------------------------------------------------------------- Required call = requires(TypeCall) method = requires(int) output = requires(Type) location = requires(str)
class Solicitation(Context): ''' The solicitation context. ''' # ---------------------------------------------------------------- Required userId = requires(int, doc=''' @rtype: integer The user id to create gateways for. ''') # ---------------------------------------------------------------- Defined rbacId = defines(int, doc=''' @rtype: integer The id of the rbac to create gateways for. ''') provider = definesIf(Callable, doc=''' @rtype: callable(TypeProperty) -> string|None Callable used for getting the authenticated value. ''')
class Invoker(Context): ''' The invoker context. ''' # ---------------------------------------------------------------- Defined shadowing = defines(Context, doc=''' @rtype: Context The invoker that this shadow is made for. ''') shadowed = definesIf(Context, doc=''' @rtype: Context The invoker that is shadowed. ''') # ---------------------------------------------------------------- Required id = requires(str) path = requires(list) methodHTTP = requires(str) isModel = requires(bool) isCollection = requires(bool)