secrets

package
v1.0.10 Latest Latest
Warning

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

Go to latest
Published: May 22, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package secrets provides utilities for loading webhook secrets from the environment.

Use LoadFromEnv to collect all environment variables whose names begin with "WEBHOOK_SECRET" as webhook signing secrets.

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadFromEnv

func LoadFromEnv(ctx context.Context) [][]byte
Example
package main

import (
	"context"
	"fmt"

	"github.com/chainguard-dev/terraform-infra-common/modules/github-events/internal/secrets"
)

func main() {
	ctx := context.Background()
	// LoadFromEnv reads all WEBHOOK_SECRET* environment variables.
	// With no such variables set, it returns nil.
	s := secrets.LoadFromEnv(ctx)
	fmt.Println(len(s))
}
Output:
0

Types

This section is empty.

Jump to

Keyboard shortcuts

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