func (k *KeyPermission) Create(locator ssh.KeyLocator) error { handler, ok := ssh.PermissionHandlerFor(k.Type) if !ok { return errors.New(fmt.Sprintf("The permission type '%s' is not recognized.", k.Type)) } return handler.CreatePermission(locator, k.With) }
func (p *KeyPermission) Check() error { _, ok := ssh.PermissionHandlerFor(p.Type) if !ok { return errors.New(fmt.Sprintf("The permission type '%s' is not recognized.", p.Type)) } return nil }