gsm

module
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2025 License: MIT

README

Google Secret Manager Emulator

[!NOTE] Forked from charlesgreen/gsm until charlesgreen/gsm#1 is merged. Otherwise several bits of functionality don't actually work, especially for Go clients.

Usage in tests

package main

import (
    "testing"
    "github.com/coxley/gsm/gsmtest"
)

func TestTCP(t *testing.T) {
    gsm, err := gsmtest.New(t)
    if err != nil {
        t.Fatal(err)
    }

    ctx, cancel := context.WithCancel(context.Background())
    defer cancel()
    go gsm.Start(ctx)

    client, err := gsm.Client(ctx)
    if err != nil {
        t.Fatal(err)
    }
    defer client.Close()
    // Use normally
}

func TestMem(t *testing.T) {
    // Uses local buffer instead of network sockets. Enables use with new packages like
    // testing/synctest
    gsm, err := gsmtest.New(t, gsmtest.InMemory())
    if err != nil {
        t.Fatal(err)
    }
    // Same as other test
}

Directories

Path Synopsis
cmd
server command
Package main provides the HTTP server executable for the Google Secret Manager emulator.
Package main provides the HTTP server executable for the Google Secret Manager emulator.
internal
api/handlers
Package handlers provides HTTP request handlers for the GSM emulator API endpoints.
Package handlers provides HTTP request handlers for the GSM emulator API endpoints.
api/middleware
Package middleware provides HTTP middleware functions for authentication, CORS, and logging.
Package middleware provides HTTP middleware functions for authentication, CORS, and logging.
api/routes
Package routes handles HTTP routing and middleware configuration for the GSM emulator.
Package routes handles HTTP routing and middleware configuration for the GSM emulator.
models
Package models contains data structures and types used throughout the Google Secret Manager emulator.
Package models contains data structures and types used throughout the Google Secret Manager emulator.
storage
Package storage provides data storage interfaces and implementations for the GSM emulator.
Package storage provides data storage interfaces and implementations for the GSM emulator.
pkg
client
Package client provides example usage of the Google Secret Manager emulator with the official client library.
Package client provides example usage of the Google Secret Manager emulator with the official client library.

Jump to

Keyboard shortcuts

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