mirror of
https://github.com/sbrow/envr.git
synced 2025-12-29 15:47:38 -05:00
refactor: Removed TODOs.
This commit is contained in:
@@ -207,8 +207,7 @@ func (c Config) searchPaths() (paths []string, err error) {
|
||||
return paths, nil
|
||||
}
|
||||
|
||||
// TODO: Should this be private?
|
||||
func (s SshKeyPair) Identity() (age.Identity, error) {
|
||||
func (s SshKeyPair) identity() (age.Identity, error) {
|
||||
sshKey, err := os.ReadFile(s.Private)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to read SSH key: %w", err)
|
||||
@@ -222,8 +221,7 @@ func (s SshKeyPair) Identity() (age.Identity, error) {
|
||||
return id, nil
|
||||
}
|
||||
|
||||
// TODO: Should this be private?
|
||||
func (s SshKeyPair) Recipient() (age.Recipient, error) {
|
||||
func (s SshKeyPair) recipient() (age.Recipient, error) {
|
||||
sshKey, err := os.ReadFile(s.Public)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to read SSH key: %w", err)
|
||||
|
||||
@@ -107,7 +107,7 @@ func decryptDb(tmpFilePath string, keys []SshKeyPair) error {
|
||||
identities := make([]age.Identity, 0, len(keys))
|
||||
|
||||
for _, key := range keys {
|
||||
id, err := key.Identity()
|
||||
id, err := key.identity()
|
||||
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -245,7 +245,7 @@ func encryptDb(tmpFilePath string, keys []SshKeyPair) error {
|
||||
|
||||
recipients := make([]age.Recipient, 0, len(keys))
|
||||
for _, key := range keys {
|
||||
recipient, err := key.Recipient()
|
||||
recipient, err := key.recipient()
|
||||
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
Reference in New Issue
Block a user