Skip to content

Commit

Permalink
Merge pull request juju#15731 from jameinel/2.9-allowed-signers
Browse files Browse the repository at this point in the history
juju#15731

This lets you set up a verified SSH signing public key, to allow git to verify those commits. Each contributor who wants to use an SSH key instead of a gpg key for verification should add a line that maps their email address to their signing key.

Then when checking out juju, you can run:
```
git config gpg.ssh.allowedSignersFile "$(pwd)/allowed_signers"
```

Which will configure the local working directory to trust signatures from allowed_signers.

See the guide here: https://docs.gitlab.com/ee/user/project/repository/ssh_signed_commits/

For more details on how to add the content of your public key to the file, and how to configure and check that your signatures are valid.

It is also recommended to run:
```
git config --global commit.gpgsign true
```

So that you don't have to pass `-S` to every `git commit` request.

You may also want to run:
```
git config log.showSignature true
```

So that every time you run `git log` it will check signed commits and see whether a given commit has been signed or not.

Some of the commits in the Juju repository will be generated by Github's bot, which has their signing key at:
 https://github.com/web-flow.gpg
With key signature: 5DE3E0509C47EA3CF04A42D34AEE18F83AFDEB23

By default, it is not a trusted key, so you may want to download and `gpg --import` that key into your keyring, and then `gpg --edit-key 4AEE18F83AFDEB23` to trust that key. You don't have to, but since it is the key that is making those commits, by trusting it you don't get warnings for every mainline commit that it isn't sure about who create the commit.

## Checklist

*If an item is not applicable, use `~strikethrough~`.*

- [ ] ~Code style: imports ordered, good names, simple structure, etc~
- [ ] Comments saying why design decisions were made
- [ ] ~Go unit tests, with comments saying what you're testing~
- [ ] ~[Integration tests](https://github.com/juju/juju/tree/main/tests), with comments saying what you're testing~
- [ ] ~[doc.go](https://discourse.charmhub.io/t/readme-in-packages/451) added or updated in changed packages~

## QA steps

You should be able to add this allowed_signers file to your git configuration as described above, and have it show you that the signed commits are valid.

To trust this file for only this working directory
```sh
$ git config gpg.ssh.allowedSignersFile "$(pwd)/allowed_signers"
```

Then:
```sh
$ git log --show-signature
```

Should show that *this commit* was correctly signed for `john@arbash-meinel.com`.

## Documentation changes

Maybe this description should end up as a signed-commits.md or some other documentation.
  • Loading branch information
jujubot committed Jun 13, 2023
2 parents 5f4c5e2 + 4786048 commit dde3183
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions allowed_signers
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
ian.booth@canonical.com namespaces="git" ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPKjQDDaO24INaGFnUdVebD1wYcDXmm/cLKH+27S2SnC wallyworld-git-signing-key
jack.shaw@canonical.com namespaces="git" ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINP0LQkkiiHuMdVz4aF7ypsxNLQscgGd1UrmHrjyEd9F jack-w-shaw-git-signing-key
joe.phillips@canonical.com namespaces="git" ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKdk2GDbpmHUP/FQVunGu6Bl9TD1Hh5Z8oYAD17CzPP6 joe-signing-key
john.meinel@canonical.com namespaces="git" ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHu5ROyG1P7OQnNE5uNw0JVjKzZdbqGg3cHqywTt/Ynb jameinel-git-signing-key
john@arbash-meinel.com namespaces="git" ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHu5ROyG1P7OQnNE5uNw0JVjKzZdbqGg3cHqywTt/Ynb jameinel-git-signing-key
stickupkid@gmail.com namespaces="git" ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPqO5HpXaSh6MJ9FVt8nyoxhWN+AqlFxIXE68JGrRysb stickupkid@gmail.com
stickupkid@gmail.com namespaces="git" ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDwmnwQng7gaXz47aRDnNTo7i2iTKq7BMnl+UwuXA/Mubrvtrc/XrcixNNm7iS7khVValIc1bIf1m7oTBp72rFWyuZ5FLDgVsjYn8nFfv3g9HlGlGOyN76xX6gOyGfcGCWWKvUPpuX3DjKDm2z8a95lbYZVjXL7ViqVTXnu2G6c7PnbHTTL+n0IO+5hzdXyq7UxAc+T+sfIdCTC7ru8mY+31CP6ovbEMBf37Qowjp9SIUxqj4nMeRjKUFB0XnkFLBuFWqZq1kIcSTSNMWjEK6b6W/dRWfQ6gsQ4Ybe/8HEKoB9IuOy9HcdZT9H97LCSkQHUgma/kB89NO/YV59STksD stickupkid@gmail.com
vitaly.antonenko@canonical.com namespaces="git" ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMA/Wg23FBdk2ui9BQPcjzqlN5OjHZgXJ3471LssH4ko anvial-git-signing-key

0 comments on commit dde3183

Please sign in to comment.