Example #1
0
def post(metadata_field, infile):
    '''
      Process a POST request.  Return an HTTP status code.  Read all data from infile.
      
      metdata_field: a string containing a serialized ms_gateway_request_info structure
      infile: file-like object which can be read from
   '''

    # parse
    req_info = None
    try:
        req_info = rg_request.parse_request_info_from_pb(metadata_field)
    except Exception, e:
        # verification failure
        log.exception(e)
        return (403, "Authorization Required")
Example #2
0
def post( metadata_field, infile ):
   '''
      Process a POST request.  Return an HTTP status code.  Read all data from infile.
      
      metdata_field: a string containing a serialized ms_gateway_request_info structure
      infile: file-like object which can be read from
   '''
   
   # parse
   req_info = None
   try:
      req_info = rg_request.parse_request_info_from_pb( metadata_field )
   except Exception, e:
      # verification failure
      log.exception( e )
      return (403, "Authorization Required")
Example #3
0
def delete(metadata_field):
    '''
      Process a DELETE request.  Return an HTTP status code.
      Generate and write out a deletion receipt, if this is a manifest.
      Do this even if the data wasn't found (i.e. the HTTP status code 
      indicates the status of the operation, but we should always 
      give back a deletion receipt as proof of work).
      
      metadata_field: uploaded metadata value for the request
   '''

    # parse
    req_info = None
    try:
        req_info = rg_request.parse_request_info_from_pb(metadata_field)
    except Exception, e:
        # verification failure
        log.exception(e)
        return (403, "Authorization required")
Example #4
0
def delete( metadata_field ):
   '''
      Process a DELETE request.  Return an HTTP status code.
      Generate and write out a deletion receipt, if this is a manifest.
      Do this even if the data wasn't found (i.e. the HTTP status code 
      indicates the status of the operation, but we should always 
      give back a deletion receipt as proof of work).
      
      metadata_field: uploaded metadata value for the request
   '''
   
   # parse
   req_info = None
   try:
      req_info = rg_request.parse_request_info_from_pb( metadata_field )
   except Exception, e:
      # verification failure
      log.exception( e )
      return (403, "Authorization required")