ghsecret

package
v0.5.3 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2026 License: MIT Imports: 7 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package ghsecret turns credential Secrets referenced by Forge and Integration resources into GitHub clients. One Secret shape serves both kinds: a PAT under "token" (dev), or a GitHub App under "appID" + "privateKey" (production), with "webhookSecret" carrying the receiver HMAC secret where relevant. Apps are memoized per Secret resourceVersion so rotation transparently rebuilds while steady state costs nothing.

Index

Constants

View Source
const (
	// KeyToken is a PAT — the dev fallback; production uses App auth.
	KeyToken = "token"
	// KeyAppID is the GitHub App ID (decimal string).
	KeyAppID = "appID"
	// KeyPrivateKey is the App's PEM-encoded RSA private key.
	KeyPrivateKey = "privateKey"
	// KeyWebhookSecret is the receiver HMAC secret.
	KeyWebhookSecret = "webhookSecret"
)

Secret keys.

Variables

This section is empty.

Functions

func Token

func Token(secret *corev1.Secret) (string, bool)

Token returns the PAT held in the secret, if any.

Types

type Apps

type Apps struct {
	// contains filtered or unexported fields
}

Apps memoizes ghclient.App instances per credential Secret.

func NewApps

func NewApps() *Apps

NewApps builds an empty memo.

func (*Apps) FromSecret

func (a *Apps) FromSecret(secret *corev1.Secret, baseURL string) (*ghclient.App, error)

FromSecret builds (or returns the memoized) App from the secret's appID/privateKey keys. baseURL points at GHES; empty means github.com.

func (*Apps) Validate

func (a *Apps) Validate(secret *corev1.Secret, baseURL string) error

Validate checks the secret is usable: a non-empty PAT or a parseable App credential.

Jump to

Keyboard shortcuts

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