Metriche repository
- Star
- (17 star)
- Metriche merge PR
- (Metriche PR in attesa)
Descrizione
Feature Request
Summary
We should suffix tokens with a UUID (UTC timestamp) identifier to prevent clashes on multiple machines.
Motivation
If a user uses two instances of the same tool on two different machines, or split between operating systems or reinstalls their OS, the tool will strictly malfunction. This is because using the same app name will generate the same token multiple times on GitHub, which will return a 4xx range response and fail.

By appending a token with a UUID (UTC timestamp) we can prevent such clashes, and guarantee the tools built on top of github_auth always work as intended.
Expected Behavior
We should append a UTC timestamp to the token, making it unique, and also documenting when it was created.
Current
A token for crossgen.
Expected
crossgen (2017-02-22T00:31:59.602Z)
Drawbacks
Adding a UUID might make the name a bit less clear. It also might not be desirable for cases where you want to have an error if a key already exists. But the latter case is probably rare for github_auth, since we're trying to generate 1 key per application, per machine already.
It might also be unexpected for people writing their own labels, as I don't think we should include it there by default (see unresolved questions for more).
Rationale and alternatives
This does two things:
- it only documents the name of the application by default
- it adds a uuid, which prevents conflicts, but also informs creation date which can provide useful context as to why the key might have been created.
Alternatively we could use a spec-compliant UUID, but that would remove the useful context that a timestamp provides.
Unresolved Questions
In the builder pattern we have a .label() method to set the label. I'm unsure if we should always append a timestamp to the label. Maybe appending a timestamp could be a flag that can be turned off, but is enabled by default in the builder?