Page MenuHomeDevCentral

Create a AuthorizedKeysLine class to refactor GetPublicKeys
Closed, WontfixPublic

Description

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.

Event Timeline

dereckson raised the priority of this task from to Wishlist.
dereckson updated the task description. (Show Details)
dereckson changed the visibility from "All Users" to "Public (No Login Required)".
dereckson added a subscriber: dereckson.
dereckson claimed this task.

Zemke-Rhyne is now decommissioned, as all secrets have been migrated to Vault.