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

Command-line tool must remember internal state (i.e, counter) #1

Open
marcoonroad opened this issue Apr 5, 2018 · 3 comments
Open
Assignees
Labels
bug Something isn't working question Further information is requested
Milestone

Comments

@marcoonroad
Copy link
Owner

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. ✌️

@marcoonroad marcoonroad added bug Something isn't working question Further information is requested labels Apr 5, 2018
@marcoonroad marcoonroad self-assigned this Apr 5, 2018
@marcoonroad
Copy link
Owner Author

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.

@marcoonroad marcoonroad added this to the v1.0 release milestone Dec 13, 2020
@marcoonroad
Copy link
Owner Author

This command-line utility tool (as a wrapper around this library) must be properly implemented for the next 1.0 release.

@marcoonroad
Copy link
Owner Author

marcoonroad commented Dec 13, 2020

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant