Beispiel #1
0
 def validate(self, apiobj, method, api, param, safe):
     """Validating all the input parameter as enforced by the WMCore.REST module"""
     authz_login_valid()
     if method in ['GET']:
         validate_str('subresource', param, safe, RX_SUBRES, optional=True)
         validate_str("hashkey", param, safe, RX_HASH, optional=True)
         validate_num("verbose", param, safe, optional=True)
         validate_str("username", param, safe, RX_USERNAME, optional=True)
         if safe.kwargs['username']:
             authz_operator(safe.kwargs['username'])
Beispiel #2
0
    def validate(self, apiobj, method, api, param, safe):
        """Validating all the input parameter as enforced by the WMCore.REST module"""
        authz_login_valid()

        if method in ['PUT']:
            validate_file("inputfile", param, safe, 'hashkey', optional=False)
            validate_str("name", param, safe, RX_LOGFILENAME, optional=False)
        if method in ['GET']:
            validate_str("name", param, safe, RX_LOGFILENAME, optional=False)
            validate_str("username", param, safe, RX_USERNAME, optional=True)
            if safe.kwargs['username']:
                authz_operator(safe.kwargs['username'])