예제 #1
0
 def updateGatewayWithResourcesOptions():
     default_gateways().extend([
         {
             'Pattern': server_pattern_resources(),
             'Methods': [HTTP_OPTIONS],
         },
     ])
 def updateGatewayWithResourcesErrors():
     if server_provide_errors():
         default_gateways().extend(
             [
                 # If path is not found then we try to dispatch a unauthorized access if the path is not
                 # found in REST the default error will have priority over the unauthorized access
                 {
                     "Pattern": server_pattern_resources(),
                     "Errors": [PATH_NOT_FOUND.status],
                     "Navigate": "error/{1}?status=%s" % UNAUTHORIZED_ACCESS.status,
                 },
                 {
                     "Pattern": server_pattern_resources(),
                     "Errors": [INVALID_AUTHORIZATION.status, FORBIDDEN_ACCESS.status, METHOD_NOT_AVAILABLE.status],
                     "Navigate": "error/{1}",
                 },
             ]
         )
예제 #3
0
 def updateGatewayWithResourcesErrors():
     if server_provide_errors():
         default_gateways().extend([
             # If path is not found then we try to dispatch a unauthorized access if the path is not
             # found in REST the default error will have priority over the unauthorized access
             {
                 'Pattern': server_pattern_resources(),
                 'Errors': [PATH_NOT_FOUND.status],
                 'Navigate':
                 'error/{1}?status=%s' % UNAUTHORIZED_ACCESS.status,
             },
             {
                 'Pattern':
                 server_pattern_resources(),
                 'Errors': [
                     INVALID_AUTHORIZATION.status, FORBIDDEN_ACCESS.status,
                     METHOD_NOT_AVAILABLE.status
                 ],
                 'Navigate':
                 'error/{1}',
             },
         ])
 def updateGatewayWithResourcesOptions():
     default_gateways().extend([{"Pattern": server_pattern_resources(), "Methods": [HTTP_OPTIONS]}])