introduce setter and fix typo

This commit is contained in:
Sasha Klizhentas 2017-03-30 17:52:58 -07:00
parent 176e0f5475
commit daf04f1abe
2 changed files with 8 additions and 1 deletions

View file

@ -56,6 +56,8 @@ type CertAuthority interface {
GetSigningKeys() [][]byte
// GetRoles returns a list of roles assumed by users signed by this CA
GetRoles() []string
// SetRoles sets assigned roles for this certificate authority
SetRoles(roles []string)
// FirstSigningKey returns first signing key or returns error if it's not here
// The first key is returned because multiple keys can exist during key rotation.
FirstSigningKey() ([]byte, error)
@ -195,6 +197,11 @@ func (ca *CertAuthorityV2) GetRoles() []string {
return ca.Spec.Roles
}
// SetRoles sets assigned roles for this certificate authority
func (ca *CertAuthorityV2) SetRoles(roles []string) {
ca.Spec.Roles = roles
}
// GetRawObject returns raw object data, used for migrations
func (ca *CertAuthorityV2) GetRawObject() interface{} {
return ca.rawObject

View file

@ -647,7 +647,7 @@ func userCAFormat(ca services.CertAuthority, keyBytes []byte) (string, error) {
// authorized_hosts format, a space-separated list of: makrer, hosts, key, and comment.
// For example:
//
// @cert-authority *.cluster-a ssh-rsa AAA... type=user
// @cert-authority *.cluster-a ssh-rsa AAA... type=host
//
// URL encoding is used to pass the CA type and allowed logins into the comment field.
func hostCAFormat(ca services.CertAuthority, keyBytes []byte, client *auth.TunClient) (string, error) {