fix: deprecate AID and enforce Cuid2 #10216

Merged
thatonecalculator merged 2 commits from :deprecate-aid into develop 2023-05-29 04:12:30 +00:00
Collaborator

This PR deprecates AID and enforce Cuid2 for security and horizontal scalability.

IDs generated with the default settings result in the form of [8 chars timestamp] + [8 chars cuid2]. Thus, roughly 1427399 IDs are needed in the same millisecond to reach 50% chance of collision. The total length and fingerprint can be configured in default.yml.

As a result, this approach provides K-sortability and collision resistance, while preserving the backward compatibility with AID but giving up "complete"-sortability.

Locally tested.

This PR deprecates AID and enforce [Cuid2](https://github.com/paralleldrive/cuid2) for security and horizontal scalability. IDs generated with the default settings result in the form of `[8 chars timestamp] + [8 chars cuid2]`. Thus, roughly 1427399 IDs are needed in the same millisecond to reach 50% chance of collision. The total length and fingerprint can be configured in `default.yml`. As a result, this approach provides K-sortability and collision resistance, while preserving the backward compatibility with AID but giving up "complete"-sortability. Locally tested.
Poster
Collaborator

Codeberg is not working right now, I'll try to open later.

Codeberg is not working right now, I'll try to open later.
namekuji closed this pull request 2023-05-29 02:37:30 +00:00
namekuji added 1 commit 2023-05-29 02:41:43 +00:00
ci/woodpecker/pr/dockerHubRelease unknown status Details
ci/woodpecker/pr/dockerHubReleaseCandidate unknown status Details
ci/woodpecker/pr/dockerHubTag Pipeline was successful Details
ci/woodpecker/pr/commit Pipeline was successful Details
ci/woodpecker/pr/testDocker Pipeline was successful Details
98f9e3e5c4
use cuid2 with timestamp
Poster
Collaborator

Reopening now

Reopening now
namekuji reopened this pull request 2023-05-29 02:45:16 +00:00
thatonecalculator reviewed 2023-05-29 03:29:16 +00:00
@ -102,0 +88,4 @@
# No need to uncomment in most cases, but you may want to change
# these settings if you plan to run a large and/or distributed server.
# cuid: {

Should use the list format that the other items use

cuid:
  # Min 16, Max 24
  length: 16
  
  # Set this to a unique string across workers (e.g., machine's hostname)
  # if your workers are running in multiple hosts.
  fingerprint: my-fingerprint
Should use the list format that the other items use ```yaml cuid: # Min 16, Max 24 length: 16 # Set this to a unique string across workers (e.g., machine's hostname) # if your workers are running in multiple hosts. fingerprint: my-fingerprint ```
Poster
Collaborator

fixed

fixed
thatonecalculator marked this conversation as resolved
namekuji added 1 commit 2023-05-29 03:58:59 +00:00
ci/woodpecker/pr/dockerHubRelease unknown status Details
ci/woodpecker/pr/dockerHubReleaseCandidate unknown status Details
ci/woodpecker/pr/dockerHubTag Pipeline was successful Details
ci/woodpecker/pr/commit Pipeline was successful Details
ci/woodpecker/pr/testDocker Pipeline was successful Details
cf4427f4f0
fix example config format
thatonecalculator merged commit fca3c6f85e into develop 2023-05-29 04:12:30 +00:00
namekuji deleted branch deprecate-aid 2023-05-29 04:20:33 +00:00
Sign in to join this conversation.
No reviewers
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: firefish/firefish#10216
There is no content yet.