Help us shape the future of Go! Take the 2026 Go Developer Survey

secretfacade

module
v0.2.14 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 9, 2026 License: Apache-2.0

README

Facade for reading and writing to secret stores for Go

Introduction

In order to work with an ever increasing number of secret stores and providers this library provides a basic interface to allow client applications to read and write secrets. It optionally provides idiomatic authentication mechanisms for each of the various secret stores.

Installation and usage

To install, run:

$ go get github.com/jenkins-x-plugins/secretfacade

And import using:

import "github.com/jenkins-x-plugins/secretfacade"

Usage:

package main

import (
	"fmt"

	"github.com/jenkins-x-plugins/secretfacade/pkg/secretstore"
	"github.com/jenkins-x-plugins/secretfacade/pkg/secretstore/factory"
)

func main() {
	factory := factory.SecretManagerFactory{}
	mgr, err := factory.NewSecretManager(secretstore.SecretStoreTypeGoogle)
	if err != nil {
		panic("error creating google secret manager from factory")
	}

	err = mgr.SetSecret("projectId", "myDatabaseConnectionString", &secretstore.SecretValue{Value: "superSecret"})
	if err != nil {
		panic("error setting myDatabaseConnectionString secret")
	}

	connectionStringSecret, err := mgr.GetSecret("projectId", "myDatabaseConnectionString", "")
	if err != nil {
		panic("error getting myDatabaseConnectionString secret")
	}

	fmt.Printf("Please don't print out secrets like %s", connectionStringSecret)
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL