示例#1
0
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.
    ''')
示例#2
0
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)
示例#3
0
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)
示例#4
0
class Register(Context):
    '''
    The register context.
    '''
    # ---------------------------------------------------------------- Defined
    hintsCall = definesIf(dict)
    # ---------------------------------------------------------------- Required
    nodes = requires(list)
示例#5
0
class Register(Context):
    '''
    The register context.
    '''
    # ---------------------------------------------------------------- Defined
    hintsModel = definesIf(dict)
    # ---------------------------------------------------------------- Required
    invokers = requires(list)
示例#6
0
class Register(Context):
    '''
    The register context.
    '''
    # ---------------------------------------------------------------- Defined
    hintsCall = definesIf(dict)
    # ---------------------------------------------------------------- Required
    invokers = requires(list)
    doSuggest = requires(IDo)
示例#7
0
class RequestContentHTTP(Context):
    '''
    Context for HTTP request content data. 
    '''
    # ---------------------------------------------------------------- Defined
    source = definesIf(IInputStream,
                       doc='''
    @rtype: IInputStream
    The source for the request content.
    ''')
示例#8
0
class Request(Context):
    '''
    Context for request. 
    '''
    # ---------------------------------------------------------------- Defined
    rootURI = definesIf(str, doc='''
    @rtype: string
    The root URI of the request.
    ''')
    # ---------------------------------------------------------------- Required
    uri = requires(str)
示例#9
0
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)
示例#10
0
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. 
    ''')
示例#11
0
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)
示例#12
0
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)
示例#13
0
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)
示例#14
0
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)
示例#15
0
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)
示例#16
0
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)
示例#17
0
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.
    ''')
示例#18
0
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.
    ''')
示例#20
0
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)