diff options
author | Lars Wirzenius <liw@liw.fi> | 2023-09-21 04:49:08 +0000 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2023-09-21 04:49:08 +0000 |
commit | 977c5ba9351ba14fce6e04117d939b50b5deb73f (patch) | |
tree | a8c75f9fc4e0f5122b13d812abbf04ecc395a79f | |
parent | bb830960fedcc58a47141406ef7707f4892fb2db (diff) | |
parent | e3364a68f77a0af164be19b4b802033cc778911d (diff) | |
download | sshca-977c5ba9351ba14fce6e04117d939b50b5deb73f.tar.gz |
Merge branch 'liw/fix-add-principals' into 'main'
fix: add principals to host
See merge request larswirzenius/sshca!67
-rw-r--r-- | src/cmd/host.rs | 2 | ||||
-rw-r--r-- | sshca.md | 7 |
2 files changed, 7 insertions, 2 deletions
diff --git a/src/cmd/host.rs b/src/cmd/host.rs index d3a85b4..830a5f4 100644 --- a/src/cmd/host.rs +++ b/src/cmd/host.rs @@ -466,7 +466,7 @@ pub struct AddPrincipals { impl Runnable for AddPrincipals { fn run(&mut self, _config: &Config, store: &mut KeyStore) -> Result<(), CAError> { if let Some(host) = store.get_host_mut(&self.hostname) { - host.set_principals(&self.principals); + host.add_principals(&self.principals); assert!(store.is_dirty()); Ok(()) } else { @@ -468,7 +468,12 @@ when I run sshca host principals list myhost then stdout doesn't contain "alfred.lan" then stdout doesn't contain "alfred.example.com" -when I run sshca host principals add --host myhost alfred.lan alfred.example.com +when I run sshca host principals add --host myhost alfred.lan +when I run sshca host principals list myhost +then stdout contains "alfred.lan" +then stdout doesn't contain "alfred.example.com" + +when I run sshca host principals add --host myhost alfred.example.com when I run sshca host principals list myhost then stdout contains "alfred.lan" then stdout contains "alfred.example.com" |