func GetCredentialValue(cRef C.struct_CredentialSpec) *C.char {
	return C.CString(GetCredentialValueByteString(cRef))
}
GetCredentialValue returns a C *char with the given credential's value
export GetCredentialValue
package main
import "C"
import (
	"fmt"
	"reflect"
	"unsafe"
	"github.com/cyberark/secretless-broker/internal/plugin"
	"github.com/cyberark/secretless-broker/internal/plugin/connectors/tcp/mysql/protocol"
	pluginv1 "github.com/cyberark/secretless-broker/internal/plugin/v1"
	"github.com/cyberark/secretless-broker/internal/providers"
	configv2 "github.com/cyberark/secretless-broker/pkg/secretless/config/v2"
)
func ZeroizeByteSlice(bs []byte) {
	for byteIndex := range bs {
		bs[byteIndex] = 0
	}
}
func ByteBoundString(b []byte) string {
	header := (*reflect.SliceHeader)(unsafe.Pointer(&b))
	bytesHeader := &reflect.StringHeader{
		Data: header.Data,
		Len:  header.Len,
	}
	return *(*string)(unsafe.Pointer(bytesHeader))
}
func NewCredential(ref C.struct_CredentialSpec) *configv2.Credential {
	return &configv2.Credential{
		Name: C.GoString(ref.Name),
		Get:  C.GoString(ref.ID),
		From: C.GoString(ref.Provider),
	}
}
func GetCredentialValues(credentialSpecs []*configv2.Credential) (map[string][]byte, error) {
	providerFactories := make(map[string]func(pluginv1.ProviderOptions) (pluginv1.Provider, error))
	for providerID, providerFactory := range providers.ProviderFactories {
		providerFactories[providerID] = providerFactory
	}
	resolver := plugin.NewResolver(providerFactories, nil, nil)
	return resolver.Resolve(credentialSpecs)
}