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

Error with results of hashFieldAlias #268

Closed
farant opened this issue Aug 13, 2018 · 1 comment
Closed

Error with results of hashFieldAlias #268

farant opened this issue Aug 13, 2018 · 1 comment
Milestone

Comments

@farant
Copy link
Contributor

farant commented Aug 13, 2018

Getting the error:

Disallowed alias '@@3308e66eced24f113896497e3a487e8f6cf810ba'

when accessing a very long field name.

Error seems to be on line 189...190 of QueryBuilder.js

I see the regex is /^@*[_A-Za-z][_0-9A-Za-z]*$/ which disallows numerals as the initial character after optional @ characters. I would suggest one of:

  • Changing this to allow numerals in the initial position (not sure if there is a security/other concern)
  • updating makeNewBuild.js line 90 to something like this:
 return `@@_${hashFieldAlias(alias)}`;

(added an underscore after the two @ symbols)

  • Update hashFieldAlias in makeNewBuild.js to prepend a letter or underscore or letter to the generated hash it stores.

I know I was one of the test cases for this. Sorry I didn't catch it sooner!

@benjie
Copy link
Member

benjie commented Aug 14, 2018

Huh! Good catch!

benjie added a commit that referenced this issue Aug 16, 2018
Fixes #268; previously only long aliases whose sha1sum began with a letter passed 😳
@benjie benjie added this to the 4.0 milestone Aug 16, 2018
madtibo pushed a commit to spacefill/graphile-engine that referenced this issue Dec 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants