Skip to content

Commit

Permalink
cleanup TBD comments
Browse files Browse the repository at this point in the history
  • Loading branch information
jreadey committed Jan 16, 2024
1 parent f2365ce commit 7968ea7
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 22 deletions.
21 changes: 4 additions & 17 deletions hsds/attr_sn.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@ async def GET_Attributes(request):
log.debug(f"bucket: {bucket}")
kwargs["bucket"] = bucket

# TBD - verify that the obj_id belongs to the given domain
await validateAction(app, domain, obj_id, username, "read")

attributes = await getAttributes(app, obj_id, **kwargs)
Expand Down Expand Up @@ -166,7 +165,6 @@ async def GET_Attribute(request):
raise HTTPBadRequest(reason=msg)
bucket = getBucketForDomain(domain)

# TBD - verify that the obj_id belongs to the given domain
await validateAction(app, domain, obj_id, username, "read")

if "ignore_nan" in params and params["ignore_nan"]:
Expand Down Expand Up @@ -518,7 +516,6 @@ async def PUT_Attribute(request):
domain_json = await getDomainJson(app, domain)
verifyRoot(domain_json)

# TBD - verify that the obj_id belongs to the given domain
await validateAction(app, domain, req_obj_id, username, "create")

# get attribute from request body
Expand All @@ -539,8 +536,7 @@ async def PUT_Attribute(request):
status = await putAttributes(app, req_obj_id, attr_json, **kwargs)
log.info(f"PUT Attributes status: {status}")

hrefs = [] # TBD
req_rsp = {"hrefs": hrefs}
req_rsp = {}
# attribute creation successful
resp = await jsonResponse(request, req_rsp, status=status)
log.response(request, resp=resp)
Expand Down Expand Up @@ -656,7 +652,6 @@ async def PUT_Attributes(request):

log.debug(f"got {len(obj_ids)} obj_ids")

# TBD - verify that the obj_id belongs to the given domain
await validateAction(app, domain, req_obj_id, username, "create")

kwargs = {"bucket": bucket}
Expand Down Expand Up @@ -694,8 +689,7 @@ async def PUT_Attributes(request):

log.info("DomainCrawler done for put_attrs action")

hrefs = [] # TBD
req_rsp = {"hrefs": hrefs}
req_rsp = {}
# attribute creation successful
log.debug(f"PUT_Attributes returning status: {status}")
resp = await jsonResponse(request, req_rsp, status=status)
Expand Down Expand Up @@ -737,16 +731,14 @@ async def DELETE_Attribute(request):
domain_json = await getDomainJson(app, domain)
verifyRoot(domain_json)

# TBD - verify that the obj_id belongs to the given domain
await validateAction(app, domain, obj_id, username, "delete")

attr_names = [attr_name, ]
kwargs = {"attr_names": attr_names, "bucket": bucket}

await deleteAttributes(app, obj_id, **kwargs)

hrefs = [] # TBD
req_rsp = {"hrefs": hrefs}
req_rsp = {}
resp = await jsonResponse(request, req_rsp)
log.response(request, resp=resp)
return resp
Expand Down Expand Up @@ -789,7 +781,6 @@ async def GET_AttributeValue(request):
domain_json = await getDomainJson(app, domain)
verifyRoot(domain_json)

# TBD - verify that the obj_id belongs to the given domain
await validateAction(app, domain, obj_id, username, "read")

params = request.rel_url.query
Expand Down Expand Up @@ -967,7 +958,6 @@ async def PUT_AttributeValue(request):
domain_json = await getDomainJson(app, domain)
verifyRoot(domain_json)

# TBD - verify that the obj_id belongs to the given domain
await validateAction(app, domain, obj_id, username, "update")

attr_names = [attr_name, ]
Expand Down Expand Up @@ -1097,8 +1087,7 @@ async def PUT_AttributeValue(request):
else:
log.info("PUT AttributesValue status: 200")

hrefs = [] # TBD
req_rsp = {"hrefs": hrefs}
req_rsp = {}
# attribute creation successful
resp = await jsonResponse(request, req_rsp)
log.response(request, resp=resp)
Expand Down Expand Up @@ -1213,7 +1202,6 @@ async def POST_Attributes(request):
domain_json = await getDomainJson(app, domain)
verifyRoot(domain_json)

# TBD - verify that the obj_id belongs to the given domain
await validateAction(app, domain, obj_id, username, "read")

params = request.rel_url.query
Expand Down Expand Up @@ -1361,7 +1349,6 @@ async def DELETE_Attributes(request):
domain_json = await getDomainJson(app, domain)
verifyRoot(domain_json)

# TBD - verify that the obj_id belongs to the given domain
await validateAction(app, domain, obj_id, username, "delete")

kwargs = {"attr_names": attr_names, "bucket": bucket, "separator": separator}
Expand Down
1 change: 0 additions & 1 deletion hsds/ctype_sn.py
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,6 @@ async def DELETE_Datatype(request):
domain_json = await getDomainJson(app, domain)
verifyRoot(domain_json)

# TBD - verify that the obj_id belongs to the given domain
await validateAction(app, domain, ctype_id, username, "delete")

req = getDataNodeUrl(app, ctype_id) + "/datatypes/" + ctype_id
Expand Down
1 change: 0 additions & 1 deletion hsds/dset_sn.py
Original file line number Diff line number Diff line change
Expand Up @@ -1215,7 +1215,6 @@ async def DELETE_Dataset(request):
domain_json = await getDomainJson(app, domain)
verifyRoot(domain_json)

# TBD - verify that the obj_id belongs to the given domain
await validateAction(app, domain, dset_id, username, "delete")

req = getDataNodeUrl(app, dset_id) + "/datasets/" + dset_id
Expand Down
1 change: 0 additions & 1 deletion hsds/group_sn.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,6 @@ async def DELETE_Group(request):
# get domain JSON
domain_json = await getDomainJson(app, domain)

# TBD - verify that the obj_id belongs to the given domain
await validateAction(app, domain, group_id, username, "delete")

verifyRoot(domain_json)
Expand Down
2 changes: 0 additions & 2 deletions hsds/link_sn.py
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,6 @@ async def PUT_Links(request):

log.debug(f"got {len(grp_ids)} grp_ids")

# TBD - verify that the grp_id belongs to the given domain
await validateAction(app, domain, req_grp_id, username, "create")

kwargs = {"bucket": bucket}
Expand Down Expand Up @@ -609,7 +608,6 @@ async def POST_Links(request):
domain_json = await getDomainJson(app, domain)
verifyRoot(domain_json)

# TBD - verify that the obj_id belongs to the given domain
await validateAction(app, domain, req_id, username, "read")

resp_json = {}
Expand Down

0 comments on commit 7968ea7

Please sign in to comment.