Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Graph passwords with some special characters are not escaped #104

Closed
1 task done
alyssadai opened this issue Jan 29, 2025 · 1 comment · Fixed by #109
Closed
1 task done

Graph passwords with some special characters are not escaped #104

alyssadai opened this issue Jan 29, 2025 · 1 comment · Fixed by #109
Assignees
Labels
released This issue/pull request has been released.

Comments

@alyssadai
Copy link
Contributor

alyssadai commented Jan 29, 2025

Is there an existing issue for this?

Expected Behavior

My NB_GRAPH_ADMIN_PASSWORD.txt contains:

pXLUj\$rb_rLcH

I would expect this password to be set successfully, exactly as defined, during GraphDB server setup, and for queries from the node API to succeed (using this password behind the hood) without authorization errors.

Current Behavior

  • There is an error from GraphDB regarding escape characters during setup, during the step where the admin password should be changed:
{"message":"JSON parse error: Unrecognized character escape '$' (code 36); nested exception is Unrecognized character escape '$'
...
  • this is because even though the password string is passed as-written, it results in the payload being invalid JSON, due to the presence of an invalid escape \$, e.g.:

    { "password": "pXLUj\$rb_rLcH" }

    similarly, to be safe, quotes, slashes, and unexpected control characters (tab, newline, etc.) should be explicitly escaped in the value to ensure proper JSON parsing

  • The node API returns a 401 Unauthorized error when a query is submitted

  • NOTE: this appears to only be an issue for JSON payloads in curl requests - credentials provided using the -u flag are parsed as expected, e.g.

    curl -X PUT -u "admin:${ADMIN_PASS}" http://localhost:${NB_GRAPH_PORT}/${NB_GRAPH_DB} --data-binary "@data-config.ttl" -H "Content-Type: application/x-turtle"

Error message

No response

Environment

  • OS:
  • Python/Node version:

How to reproduce

No response

Anything else?

No response

@alyssadai alyssadai added the flag:schedule Flag issue that should go on the roadmap or backlog. label Jan 29, 2025
@rmanaem rmanaem moved this to Backlog in Neurobagel Jan 29, 2025
@rmanaem rmanaem removed the flag:schedule Flag issue that should go on the roadmap or backlog. label Jan 29, 2025
@alyssadai alyssadai moved this from Backlog to Specify - Active in Neurobagel Feb 3, 2025
@alyssadai alyssadai moved this from Specify - Active to Specify - Done in Neurobagel Feb 3, 2025
@alyssadai alyssadai moved this from Specify - Done to Implement - Active in Neurobagel Feb 7, 2025
@alyssadai alyssadai self-assigned this Feb 7, 2025
@alyssadai alyssadai moved this from Implement - Active to Implement - Done in Neurobagel Feb 11, 2025
@surchs surchs moved this from Implement - Done to Review - Active in Neurobagel Feb 11, 2025
@github-project-automation github-project-automation bot moved this from Review - Active to Review - Done in Neurobagel Feb 11, 2025
Copy link
Contributor

🚀 Issue was released in v0.4.2 🚀

@neurobagel-bot neurobagel-bot bot added the released This issue/pull request has been released. label Feb 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
released This issue/pull request has been released.
Projects
Status: Review - Done
Development

Successfully merging a pull request may close this issue.

2 participants