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 and "proxyUsername" + "proxyPassword" carrying the forward proxy's basic-auth credentials when the resource sets spec.proxy. Apps are memoized per Secret resourceVersion so rotation transparently rebuilds while steady state costs nothing.
Index ¶
Constants ¶
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" // KeyProxyUsername is the forward proxy's basic-auth username. KeyProxyUsername = "proxyUsername" // KeyProxyPassword is the forward proxy's basic-auth password. KeyProxyPassword = "proxyPassword" )
Secret keys.
Variables ¶
This section is empty.
Functions ¶
func ProxyURL ¶ added in v0.11.2
ProxyURL composes the effective proxy URL: the resource's spec proxy URL with the secret's basic-auth credentials attached, when present. The CRD pattern rejects userinfo in the spec URL, so credentials never live anywhere but the Secret. rawURL "" means no proxy and returns "".
Types ¶
type Apps ¶
type Apps struct {
// contains filtered or unexported fields
}
Apps memoizes ghclient.App instances per credential Secret.
func (*Apps) FromSecret ¶
FromSecret builds (or returns the memoized) App from the secret's appID/privateKey keys. baseURL points at GHES; empty means github.com. proxy is the referencing resource's raw spec proxy URL ("" = none); its basic-auth credentials are read from the secret's proxy keys.