Skip to content

Commit

Permalink
Changes on stakeholder status info returnal
Browse files Browse the repository at this point in the history
  • Loading branch information
BRUNO MIGUEL GOMES DOS SANTOS committed Jun 4, 2021
1 parent 34355ec commit 0d3d1a0
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Repository of 5G ZORRO Identity and Permissions Manager components source code.
* Mongo (optional)
* Python

## Pre-Requesites
## Pre-Requisites
### Install Git
```python
sudo apt-get update
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.1.0
1.2.0
24 changes: 12 additions & 12 deletions src/app/holder/holder.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,19 +270,19 @@ async def read_stakeholder_status(response: Response): # key: str, stakeholder_d
#body_dict = body.dict()
#subscriber = mongo_setup_provider.stakeholder_col.find_one({"stakeholderClaim.stakeholderDID": body_dict["stakeholderDID"]}, {"_id": 0, "handler_url": 0})

result_list = []
#result_list = []

subscriber = mongo_setup_provider.stakeholder_col.find({"revoked" : { "$exists" : False} }, {"_id": 0, "handler_url": 0})
#if subscriber == None:
# response.status_code = status.HTTP_404_NOT_FOUND
# return "Stakeholder Credential non existent"
#else:
# return subscriber
subscriber = mongo_setup_provider.stakeholder_col.find_one({"revoked" : { "$exists" : False} }, {"_id": 0, "handler_url": 0})
if subscriber == None:
response.status_code = status.HTTP_404_NOT_FOUND
return "Active Stakeholder Credential non existent or not found"
else:
return subscriber

for result_object in subscriber:
result_list.append(result_object)
#for result_object in subscriber:
# result_list.append(result_object)

return result_list
#return result_list

except:
return "Unable to fetch requested Stakeholder Credential"
Expand Down Expand Up @@ -510,7 +510,7 @@ async def read_all_credentials(response: Response): #, token: str, handler_url:
result_list = []

for result_object in subscriber:
print(result_object)
#print(result_object)
result_list.append(result_object)

return result_list
Expand All @@ -519,7 +519,7 @@ async def read_all_credentials(response: Response): #, token: str, handler_url:
return "Unable to fetch Marketplace Credentials"


@router.get("/read_did/revoked")
@router.get("/read_did/revoked", include_in_schema=False)
async def read_revoked_credential():
try:
subscriber = mongo_setup_provider.collection.find({"revoked" : { "$exists" : True}}, {"_id": 0, "state": 0, "handler_url": 0, "credential_exchange_id": 0, "revoked": 0})
Expand Down
4 changes: 2 additions & 2 deletions src/app/issuer/issuer.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ async def read_all_credentials(response: Response): #, token: str
except:
return "Unable to fetch Marketplace Credentials"

@router.put("/revoke_did")
@router.put("/revoke_did", include_in_schema=False)
async def revoke_credential(response: Response, body: RevokeCred):
# CHECK FOR REQUEST RECORD
try:
Expand Down Expand Up @@ -278,7 +278,7 @@ async def revoke_credential(response: Response, body: RevokeCred):

return resp_revoke

@router.get("/read_did/revoked")
@router.get("/read_did/revoked", include_in_schema=False)
async def read_revoked_credential():
try:
subscriber = mongo_setup_admin.collection.find({"revoked" : { "$exists" : True}}, {"_id": 0, "state": 0, "handler_url": 0, "service_endpoint": 0, "credential_exchange_id": 0, "revoked": 0})
Expand Down

0 comments on commit 0d3d1a0

Please sign in to comment.