-
Notifications
You must be signed in to change notification settings - Fork 53
Add VaultSigner and tests #800
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
Conversation
143 is what docker does when killed I think... My guess is the initial |
AFAIU not only on docker, but generally on linux. If a command receives SIGTERM it should exit with 143.
I think so too. But I cannot reproduce. I don't currently have a linux box at hand, and on my Mac the vault command does not exit with 143 when killed. (Interestingly, a different test command ( I tried two independent workarounds to no avail: securesystemslib/tests/scripts/init-vault.sh Lines 3 to 5 in 85c8d0c
securesystemslib/tests/scripts/stop-vault.sh Lines 6 to 11 in 85c8d0c
Any ideas, @jku? |
I tried to debug this inside the GHA runner (with |
Now that I think about it, I was probably wrong and this actually kills tox instead of "vault server":
EDIT: yes, I tested this with a slightly modified branch: this does indeed kill tox. maybe |
🤦 or the stop-vault.sh |
Adds fully functional VaultSigner and basic "import_ -> from_priv_key_uri -> sign -> verify" test loop using a local vault server. Tests run on CI and can be run locally with tox, if vault is installed. Note also that vault supports all key types and signing schemes supported by SSlibKey. The here added VaultSigner, however, only supports `ed25519` keys. Other key types and schemes may be added in follow-up PRs. Signed-off-by: Lukas Puehringer <[email protected]>
@jku, this is ready for review. But we don't need to include it in 1.0. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
|
||
# Test sign and verify | ||
signature = signer.sign(b"DATA") | ||
self.assertIsNone(public_key.verify_signature(signature, b"DATA")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: assert seems unnecessary
self.assertIsNone(public_key.verify_signature(signature, b"DATA")) | |
public_key.verify_signature(signature, b"DATA") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤷 I wanted to make it clear that this is a test scenario, and not some random function call that could return e.g. True or False and pass the test either way.
Up to you, no strong feelings here. |
In that case, let's ship it. |
Adds fully functional VaultSigner and basic "import_ -> from_priv_key_uri
-> sign -> verify" test loop using a local vault server.
Tests run on CI and can be run locally with tox, if vault is installed.
Note also that vault supports all key types and signing schemes supported by
SSlibKey. The here added VaultSigner, however, only supports
ed25519
keys.
Other key types and schemes may be added in follow-up PRs
Fixes #307