Skip to content

Commit

Permalink
Adding some resilience to how users sending token information have ac…
Browse files Browse the repository at this point in the history
…cess to.
  • Loading branch information
jmatsumura committed May 9, 2017
1 parent 351ade5 commit 7c41aff
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions query.py
Original file line number Diff line number Diff line change
Expand Up @@ -458,6 +458,12 @@ def get_manifest_token(id_list):
# using all the IDs noted within the particular token.
def token_to_manifest(token):

# Leave early if the token is obviously corrupt
if len(token) != 6:
return 'Error -- Invalid token length.'
if not re.match(r"^[a-zA-Z0-9]+$",token):
return 'Error -- Invalid characters detected.'

ids = process_cquery_http("MATCH (t:token{{id:'{0}'}}) RETURN t.id_list AS id_list".format(token))[0]['id_list']
urls = ['http','ftp','fasp','s3']
manifest = ""
Expand Down

0 comments on commit 7c41aff

Please sign in to comment.