Key per Repository of a Shared List¶
adr~key-per-repository~1
Needs: dsn
Context and Problem Statement¶
A device without an SSH configuration has one key pair, whose public key the user registers as a deploy key of the repository of the tasks (decision 0007). A shared list lies in a repository of its own. GitHub accepts a deploy key for one repository only: the same key cannot be added to a second one, and a connection with it to the second repository is let in and then told that the repository is not found. With which key does a device reach the repository of a shared list?
Considered Options¶
- A key pair per repository of a shared list, offered before the key of the device
- The one key of the device, registered with the account of the user
- The one key of the device, registered with an account of its own for the devices
- HTTPS with an access token per repository
Decision Outcome¶
Chosen option: "A key pair per repository of a shared list, offered before the key of the device", because each key stays a deploy key that grants access to the one repository only, which is what decision 0007 chose the key of the application for.
The key of a repository is created when the user asks for it in the settings, in the form of the key of the device. A connection offers the key of its repository first: the server takes the first key that it knows, and the key of the device may be known to it from another repository. The key of the device is offered after it, so that a device whose one key is registered for all its repositories keeps working without a key per repository. The repository of the tasks keeps the key of the device.
Consequences¶
- Good, because a lost phone compromises the repositories of its lists and nothing else, each through a key that is revoked on its own.
- Good, because a setup with one key for all repositories, which some servers allow, works as before.
- Bad, because each shared list of each device needs a key registration of its own.
- Bad, because the device keeps one more unencrypted private key per shared list.
Pros and Cons of the Options¶
The one key of the device, registered with the account of the user¶
- Good, because one registration covers all repositories, and no change of the application is needed.
- Bad, because the key of a phone then writes to every repository of the user, not only to those of the lists.
The one key of the device, registered with an account of its own for the devices¶
- Good, because the account is invited to the repositories of the lists only.
- Bad, because a second account has to be created and kept, which a server may restrict to one per person.
HTTPS with an access token per repository¶
- Good, because it works where SSH is blocked.
- Bad, because a token expires and is typed or pasted into the device, and the application would keep two ways to log in.