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

Potential switching from stringified IDs to using uuid for sanity checking. #47

Open
AbstractUmbra opened this issue Dec 4, 2024 · 0 comments
Assignees
Labels
question Further information is requested unconfirmed bug Potential issue - to be investigated

Comments

@AbstractUmbra
Copy link
Owner

Whilst I'm personally a fan of not restricting types further than needed, I've hit a rare issue where a user provided bad input and it got me wondering.

In essence, we have let's say the Get Manga endpoint under GET /manga/:id. Path traversal in URLs is a common pitfall and this is what happened. We got input of . for :id. This means instead we hit GET /manga which is a collection endpoint versus the expected entity endpoint.

My proposed solution to this would be using uuid.UUID() at the library level and accepting both types as arguments, e.g. input_: str | UUID and then transforming all string input to UUID transparently, which would resolve this issue.

Currently I'm wondering if this is a non-issue and shouldn't be handled by the library, rather than by the consumers. More investigation is needed.

@AbstractUmbra AbstractUmbra added question Further information is requested unconfirmed bug Potential issue - to be investigated labels Dec 4, 2024
@AbstractUmbra AbstractUmbra self-assigned this Dec 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested unconfirmed bug Potential issue - to be investigated
Projects
None yet
Development

No branches or pull requests

1 participant