Open marcoonroad opened 6 years ago
The command line tool will be removed for the initial release. Future releases could track this question. By now, this Issue will remain open until that.
See commit 2613aae.
This command-line utility tool (as a wrapper around this library) must be properly implemented for the next 1.0 release.
If a lockfile for CUID's counter is used, it will need a new user/group permission (such as ocaml-cuid-process
), otherwise, external potentially malicious actors could predict and/or tamper part of ID generation. Unhappily, this user/group idea could only work on Unix-like environments (Linux, BSD and MacOS), making the Windows implementation infeasible.
If I make the counter random or a fixed number, it would break the linear ordering of generated CUIDs. The only option I have is to make the counter the milliseconds piece of timestamp. In this sense, the library should support a ?(stateless=false)
for both CUIDs and slugs generation, so the ~stateless:true
parameter would be useful on concurrent/asynchronous environments as well.
No matter how much time we call
ocuidml
, it will always return the same counter field (in the case,0000
). It doesn't seem right, honestly. We should figure out a way to persist the counter state among shell invocations for such command. Either through a sort of daemon server or local/user configuration might be reasonable. :v: