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

Make the maximum ID value explicit for ID parameters #971

Open
slifty opened this issue Apr 29, 2024 · 0 comments · May be fixed by #1033
Open

Make the maximum ID value explicit for ID parameters #971

slifty opened this issue Apr 29, 2024 · 0 comments · May be fixed by #1033
Assignees

Comments

@slifty
Copy link
Member

slifty commented Apr 29, 2024

          I tried `GET opportunities/555555555555555555555555555555` and got this response:
{
  "name": "DatabaseError",
  "message": "Unexpected database error.",
  "details": [
    {
      "length": 168,
      "name": "error",
      "severity": "ERROR",
      "code": "22003",
      "where": "unnamed portal parameter $1 = '...'",
      "file": "numutils.c",
      "line": "314",
      "routine": "pg_strtoint32"
    }
  ]
}

Which is fine and probably not a new error at all, but would be nice to make it a 400 since we don't support IDs greater than 2^32-1.

Originally posted by @bickelj in #967 (comment)

We can easily add this to the isId validator function which should harden all our endpoints at once.

@slifty slifty self-assigned this Apr 29, 2024
@slifty slifty assigned hminsky2002 and unassigned slifty Apr 30, 2024
hminsky2002 added a commit that referenced this issue May 24, 2024
This commit adds an explicit maximum value for IDs, as we do not support
IDs greater than 2^32-1.

Issue #971 Make maximum ID value explicit for ID parameters
@hminsky2002 hminsky2002 linked a pull request May 24, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants