add send_api in credential and fix
This commit is contained in:
parent
8f15544fe5
commit
1b90d6966b
|
@ -465,7 +465,7 @@ class DID(models.Model):
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def get_key_material(self):
|
def get_key_material(self):
|
||||||
self.decrypt_data(self.key_material)
|
return self.decrypt_data(self.key_material)
|
||||||
|
|
||||||
def set_key_material(self, value):
|
def set_key_material(self, value):
|
||||||
self.key_material = self.encrypt_data(value)
|
self.key_material = self.encrypt_data(value)
|
||||||
|
@ -531,7 +531,7 @@ class DID(models.Model):
|
||||||
|
|
||||||
headers = {"Authenticate": "Bearer {}".format(token)}
|
headers = {"Authenticate": "Bearer {}".format(token)}
|
||||||
|
|
||||||
response = requests.post(url=url, data=value, headers=headers)
|
response = requests.post(url=url, data=data, headers=headers)
|
||||||
if response.status_code >= 300:
|
if response.status_code >= 300:
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@ -582,6 +582,7 @@ class DID(models.Model):
|
||||||
return
|
return
|
||||||
|
|
||||||
self.api_token = self.encrypt_data(response)
|
self.api_token = self.encrypt_data(response)
|
||||||
|
return response
|
||||||
|
|
||||||
|
|
||||||
class Schemas(models.Model):
|
class Schemas(models.Model):
|
||||||
|
@ -876,6 +877,13 @@ class VerificableCredential(models.Model):
|
||||||
new_dict[key] = value
|
new_dict[key] = value
|
||||||
return new_dict
|
return new_dict
|
||||||
|
|
||||||
|
def send_api(self):
|
||||||
|
token = self.issuer_did.get_api_token()
|
||||||
|
data = self.user.decrypt_data(self.data)
|
||||||
|
response = self.issuer_did.did.send_api(data, token=token)
|
||||||
|
if response:
|
||||||
|
self.subject_did.did.get_api_token()
|
||||||
|
|
||||||
|
|
||||||
class VCTemplate(models.Model):
|
class VCTemplate(models.Model):
|
||||||
wkit_template_id = models.CharField(max_length=250)
|
wkit_template_id = models.CharField(max_length=250)
|
||||||
|
|
Loading…
Reference in New Issue