Skip to content

Commit

Permalink
Merge pull request #5 from cycloidio/gl_authorized_keys_reload
Browse files Browse the repository at this point in the history
authorized_keys.go: Provide Reload on authorized_keys
  • Loading branch information
muntac authored May 21, 2020
2 parents 03930fa + 10ffaa1 commit 2be0b22
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions authorized_keys.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
)

type AuthorizedKeys struct {
File string
Keys []ssh.PublicKey
}

Expand All @@ -31,7 +32,13 @@ func (f *AuthorizedKeys) UnmarshalFlag(value string) error {
authorizedKeysBytes = rest
}

f.File = value
f.Keys = authorizedKeys

return nil
}

// Reload reloads the value of the Keys
func (f *AuthorizedKeys) Reload() error {
return f.UnmarshalFlag(f.File)
}

0 comments on commit 2be0b22

Please sign in to comment.