Exemplo n.º 1
0
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)
}
Exemplo n.º 2
0
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
}