Skip to content

httpd: make sshaut use multiple files#40

Merged
mvo5 merged 2 commits into
systemd:mainfrom
mvo5:check-multi-authorized-keys
Apr 27, 2026
Merged

httpd: make sshaut use multiple files#40
mvo5 merged 2 commits into
systemd:mainfrom
mvo5:check-multi-authorized-keys

Conversation

@mvo5
Copy link
Copy Markdown
Contributor

@mvo5 mvo5 commented Apr 22, 2026

This commit ensures that sshauth checks all files that may contain ssh keys like /etc/varlink-httpd/authorized_keys and the credentials for matching keys. It will also no longer die when no keys are found but instead keep waiting for other authentication sources to appear.

This is fine because we are socket activated anyway and it avoid a failure on a fresh VM that has no authentication but a running varlink-httpd which currently just fails in this setup.

Comment thread src/bin/varlink-httpd/auth_ssh.rs
Copy link
Copy Markdown
Contributor

@pothos pothos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good but using one hashmap would be nice to prevent the introduction of bugs that cause things to get out of sync.

@mvo5 mvo5 requested a review from keszybz April 23, 2026 14:01
mvo5 added 2 commits April 24, 2026 17:11
This commit ensures that sshauth checks all files that may contain
ssh keys like /etc/varlink-httpd/authorized_keys and the credentials
for matching keys. It will also no longer die when no keys are found
but instead keep waiting for other authentication sources to appear.

This is fine because we are socket activated anyway and it avoid
a failure on a fresh VM that has no authentication but a running
varlink-httpd which currently just fails in this setup.
The exiting ssh key caching was a bit ad-hoc, just using hashmap
etc. With the extension to multiple files this became a bit loose.
So this commit refactors the code to have a proper type for a
ssh KeyFile and the KeyCache with the associated methods to manage
them.

Thanks to Kai for suggesting this.
@mvo5 mvo5 force-pushed the check-multi-authorized-keys branch from 05c8c40 to 1d7f0b8 Compare April 24, 2026 15:12
@mvo5 mvo5 merged commit a75c70f into systemd:main Apr 27, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants