The class GetPublicKeys offer several small methods to write a line like
command="getcredentials",from="server.domain.tld",no-port-forwarding,no-x11-forwarding,no-agent-forwarding ssh-rsa ... Zemke-Rhyne
This line is divided in four parts:
- the SSH options
- the key algo (e.g. ssh-rsa)
- the SSH public key itself (here truncated to ...)
- a comment
Instead of functions with a focus to write text, it could be more flexible to create an AuthorizedKeysLine class, with:
- booleans to enable or disable options like no-x11-forwarding, matching man 5 authorized_keys
- arrays of string to fill from
- a __toString() method to get the string representation of the line
This will allow to reuse this class in more deployment scripts.
good-first-issue This task has been identified as suitable for newcomers volunteers to familiarize themselves with our code base and infrastructure.