package vaultutil

import (
	vaultapi "github.com/hashicorp/vault/api"
)

func GetGroups(c *vaultapi.Client) (*vaultapi.Secret, error) {
	resp, err := c.Logical().List("auth/ldap/groups")
	if err != nil {
		return resp, err
	}
	return resp, err
}

func DeleteGroups(c *vaultapi.Client, groupname string) (*vaultapi.Secret, error) {
	resp, err := c.Logical().Delete("auth/ldap/groups" + groupname)
	if err != nil {
		return resp, err
	}
	return resp, err
}

func GetGroupPolicy(c *vaultapi.Client, group_name string) (*vaultapi.Secret, error) {
	resp, err := c.Logical().Read("auth/ldap/groups/" + group_name)
	if err != nil {
		return resp, err
	}
	return resp, err
}

package vaultutil

import (
	vaultapi "github.com/hashicorp/vault/api"
)

func GetGroups(c *vaultapi.Client) (*vaultapi.Secret, error) {
	resp, err := c.Logical().List("auth/ldap/groups")
	if err != nil {
		return resp, err
	}
	return resp, err
}

func DeleteGroup(c *vaultapi.Client, groupname string) (*vaultapi.Secret, error) {
	resp, err := c.Logical().Delete("auth/ldap/groups/" + groupname)
	if err != nil {
		return resp, err
	}
	return resp, err
}

func GetGroupPolicy(c *vaultapi.Client, group_name string) (*vaultapi.Secret, error) {
	resp, err := c.Logical().Read("auth/ldap/groups/" + group_name)
	if err != nil {
		return resp, err
	}
	return resp, err
}

Fix logical path for DeleteGroup call
Fix logical path for DeleteGroup call
