parameters.py 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. from fate_flow.entity import RetCode
  2. class ParametersBase:
  3. def to_dict(self):
  4. d = {}
  5. for k, v in self.__dict__.items():
  6. d[k] = v
  7. return d
  8. class ClientAuthenticationParameters(ParametersBase):
  9. def __init__(self, full_path, headers, form, data, json):
  10. self.full_path = full_path
  11. self.headers = headers
  12. self.form = form
  13. self.data = data
  14. self.json = json
  15. class ClientAuthenticationReturn(ParametersBase):
  16. def __init__(self, code=RetCode.SUCCESS, message="success"):
  17. self.code = code
  18. self.message = message
  19. class SignatureParameters(ParametersBase):
  20. def __init__(self, party_id, body):
  21. self.party_id = party_id
  22. self.body = body
  23. class SignatureReturn(ParametersBase):
  24. def __init__(self, code=RetCode.SUCCESS, site_signature=None):
  25. self.code = code
  26. self.site_signature = site_signature
  27. class AuthenticationParameters(ParametersBase):
  28. def __init__(self, src_party_id, site_signature, body):
  29. self.src_party_id = src_party_id
  30. self.site_signature = site_signature
  31. self.body = body
  32. class AuthenticationReturn(ParametersBase):
  33. def __init__(self, code=RetCode.SUCCESS, message="success"):
  34. self.code = code
  35. self.message = message
  36. class PermissionCheckParameters(ParametersBase):
  37. def __init__(self, src_role, src_party_id, role, party_id, initiator, roles, component_list, dataset_list, runtime_conf, dsl, component_parameters):
  38. self.src_role = src_role
  39. self.src_party_id = src_party_id
  40. self.role = role
  41. self.party_id = party_id
  42. self.initiator = initiator
  43. self.roles = roles
  44. self.component_list = component_list
  45. self.dataset_list = dataset_list
  46. self.run_time_conf = runtime_conf
  47. self.dsl = dsl
  48. self.component_parameters = component_parameters
  49. class PermissionReturn(ParametersBase):
  50. def __init__(self, code=RetCode.SUCCESS, message="success"):
  51. self.code = code
  52. self.message = message