crux-bphc / chronofactorem-rewrite

A rewrite of our ChronoFactorem project
https://www.chrono.crux-bphc.com/
MIT License
12 stars 3 forks source link

Encode timetable IDs so timetables can actually be private #135

Closed soumitradev closed 8 months ago

soumitradev commented 8 months ago

Here I'm using the package sqids for generating these IDs, since it seems like a good alternative to plain base62 with a salt, and it's reasonably convenient. It is on the endpoint side instead of the database side, so when writing new endpoints we need to keep in mind the encoding and decoding of these IDs.

However, once the current endpoints are moved to use sqids instead of the previous numeric IDs, whoever creates a new endpoint will probably realize that the id is a number instead of a string if they forgot to encode/decode, giving them a hint as to what the issue is.