SPIKE Go SDK
Go to file
Volkan Özçelik e7312f630a
update SPIFFE ID matchers.
Signed-off-by: Volkan Özçelik <me@volkan.io>
2025-05-28 22:26:59 -07:00
api Minor changes. 2025-03-29 20:50:38 -07:00
assets Initial Commit 2024-11-27 10:03:10 -08:00
crypto Added new packages to the SDK 2025-01-18 15:20:37 -08:00
hack update SPIFFE ID matchers. 2025-05-28 22:26:59 -07:00
kv add import secrets method. 2025-03-01 15:44:42 -08:00
net Enhance HTTP client configuration with timeout and connection settings 2025-04-14 18:11:18 +03:00
retry Minor changes. 2025-03-29 20:50:38 -07:00
security/mem Add memory locking. 2025-04-10 20:43:34 -07:00
spiffe minor changes 2024-12-02 12:55:48 -08:00
spiffeid update SPIFFE ID matchers. 2025-05-28 22:26:59 -07:00
system Added new packages to the SDK 2025-01-18 15:20:37 -08:00
validation Implement restore and recover APIs 2025-02-08 09:26:59 -08:00
.gitignore Initial Commit 2024-11-27 10:03:10 -08:00
CODEOWNERS add CoC and friend + minor code refactoring 2024-12-01 20:07:09 -08:00
CODE_OF_CONDUCT.md add CoC and friend + minor code refactoring 2024-12-01 20:07:09 -08:00
CONTRIBUTING.md add CoC and friend + minor code refactoring 2024-12-01 20:07:09 -08:00
CONTRIBUTING_DCO.md add CoC and friend + minor code refactoring 2024-12-01 20:07:09 -08:00
LICENSE Initial commit 2024-11-27 08:16:46 -08:00
MAINTAINERS.md add CoC and friend + minor code refactoring 2024-12-01 20:07:09 -08:00
README.md Update README 2024-12-02 23:36:31 -08:00
SECURITY.md add CoC and friend + minor code refactoring 2024-12-01 20:07:09 -08:00
go.mod Validators accept multiple trust roots. 2025-05-04 15:09:57 -07:00
go.sum Validators accept multiple trust roots. 2025-05-04 15:09:57 -07:00
qodana.yaml Minor changes. 2025-03-29 20:56:57 -07:00

README.md

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/api"
)

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 security@spike.ist.

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.