Debian Codegraph @

/

debian golang-github-spiffe-spike-sdk-go 0.16.4-2debian golang-github-spiffe-spike-sdk-go-dev gomod github.com/spiffe/spike-sdk-go debiangogohtmlinimakemakefilemarkdownshellyaml 178 files · 1303 symbols
View dependency graph

Depends on

README (full)

SPIKE

SPIKE Go SDK

This library is a convenient Go library for working with SPIKE.

It leverages the SPIFFE Workload API, providing high-level functionality that includes:

  • Establishing mutually authenticated TLS (mTLS) between workloads powered by SPIFFE.
  • Abstracting SPIKE REST API calls.

Documentation

See the Go Package documentation.

Quick Start

Prerequisites:

  1. Running SPIRE or another SPIFFE Workload API implementation.
  2. SPIFFE_ENDPOINT_SOCKET environment variable set to address of the Workload API (e.g. unix:///tmp/agent.sock).

Usage Example

package main

import (
	"fmt"

	spike "github.com/spiffe/spike-sdk-go/impl"
)

func main() {
	api := spike.New() // Use the default Workload API Socket
	defer api.Close()  // Close the connection when done

	path := "tenants/demo/db/creds"

	// Create a Secret
	err := api.PutSecret(path, map[string]string{
		"username": "SPIKE",
		"password": "SPIKE_Rocks",
	})
	if err != nil {
		fmt.Println("Error writing secret:", err.Error())
		return
	}

	// Read the Secret
	secret, err := api.GetSecret(path)
	if err != nil {
		fmt.Println("Error reading secret:", err.Error())
		return
	}

	if secret == nil {
		fmt.Println("Secret not found.")
		return
	}

	fmt.Println("Secret found:")

	data := secret.Data
	for k, v := range data {
		fmt.Printf("%s: %s\n", k, v)
	}
}

A Note on Security

We take SPIKE's security seriously. If you believe you have found a vulnerability, please responsibily disclose it to [email protected].

See SECURITY.md for additional details.

Community

Open Source is better together.

If you are a security enthusiast, join SPIFFE's Slack Workspace and let us change the world together 🤘.

Contributing

To contribute to SPIKE, follow the contributing guidelines to get started.

Use GitHub issues to request features or file bugs.

Communications

License

Mozilla Public License v2.0.

dir .github/
dir api/
dir assets/
dir config/
dir crypto/
dir debian/
dir errors/
dir hack/
dir kv/
dir log/
dir net/
dir predicate/
dir retry/
dir security/
dir spiffe/
dir spiffeid/
dir strings/
dir system/
dir validation/
file .gitignore
file .golangci.yml
file CODEOWNERS
file CODE_OF_CONDUCT.md
file CONTRIBUTING.md
file CONTRIBUTING_DCO.md
file LICENSE
file MAINTAINERS.md
file Makefile
file README.md
file SECURITY.md
file coverage.html
file go.mod
file go.sum
file qodana.yaml