-
Notifications
You must be signed in to change notification settings - Fork 107
Description
Describe the Bug
According to sshkeys_core, ed25519-sk is a valid alias for [email protected], but using it will result in
Error: Evaluation Error: Error while evaluating a Resource Statement, Evaluation Error: Error while evaluating a Function Call, Wrong Keyline format! Got nil after applying regex to'ed25519-sk AAAA ....
Expected Behavior
I expect to be able to use the short form ed25519-sk as a valid key type
Steps to Reproduce
Having this in Hiera
accounts::user_list:
joe:
sshkeys:
- 'ed25519-sk ... [email protected]'
Environment
- Version: 8.4.0
- Platform: Ubuntu 24.04
- sshkeys_core Version: 2.4.0
Additional Context
Suggested patch
--- a/lib/puppet/functions/accounts_ssh_authorized_keys_line_parser.rb
+++ b/lib/puppet/functions/accounts_ssh_authorized_keys_line_parser.rb
@@ -16,7 +16,7 @@ Puppet::Functions.create_function(:accounts_ssh_authorized_keys_line_parser) do
end
def accounts_ssh_authorized_keys_line_parser_string(str)
- matched = str.match(%r{((sk-ssh-ed25519|sk-ecdsa-|ssh-|ecdsa-)[^\s]+)\s+([^\s]+)\s+(.*)$})
-
matched = str.match(%r{((sk-ssh-ed25519|sk-ecdsa-|ssh-|ecdsa-|ed25519-)[^\s]+)\s+([^\s]+)\s+(.*)$})
raise ArgumentError, "Wrong Keyline format! Got nil after applying regex to'#{str}'" unless matched
unless matched.length == 5