Documentation
¶
Overview ¶
Package github provides a client for GitHub API interactions.
Package github implements a provider for GitHub secrets, allowing External Secrets to write secrets to GitHub Actions.
Index ¶
- func MaintenanceStatus() esv1.MaintenanceStatus
- func NewProvider() esv1.Provider
- func ProviderSpec() *esv1.SecretStoreProvider
- type ActionsServiceClient
- type Client
- func (g *Client) AuthWithPrivateKey(ctx context.Context) (*github.Client, error)
- func (g *Client) Close(_ context.Context) error
- func (g *Client) DeleteSecret(ctx context.Context, remoteRef esv1.PushSecretRemoteRef) error
- func (g *Client) GetAllSecrets(_ context.Context, _ esv1.ExternalSecretFind) (map[string][]byte, error)
- func (g *Client) GetSecret(_ context.Context, _ esv1.ExternalSecretDataRemoteRef) ([]byte, error)
- func (g *Client) GetSecretMap(_ context.Context, _ esv1.ExternalSecretDataRemoteRef) (map[string][]byte, error)
- func (g *Client) PushSecret(ctx context.Context, secret *corev1.Secret, remoteRef esv1.PushSecretData) error
- func (g *Client) SecretExists(ctx context.Context, ref esv1.PushSecretRemoteRef) (bool, error)
- func (g *Client) Validate() (esv1.ValidationResult, error)
- type Provider
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MaintenanceStatus ¶
func MaintenanceStatus() esv1.MaintenanceStatus
MaintenanceStatus returns the maintenance status of the provider.
func ProviderSpec ¶
func ProviderSpec() *esv1.SecretStoreProvider
ProviderSpec returns the provider specification for registration.
Types ¶
type ActionsServiceClient ¶
type ActionsServiceClient interface {
// CreateOrUpdateOrgSecret creates or updates an organization secret.
CreateOrUpdateOrgSecret(ctx context.Context, org string, eSecret *github.EncryptedSecret) (response *github.Response, err error)
// GetOrgSecret retrieves an organization secret.
GetOrgSecret(ctx context.Context, org string, name string) (*github.Secret, *github.Response, error)
// ListOrgSecrets lists all organization secrets.
ListOrgSecrets(ctx context.Context, org string, opts *github.ListOptions) (*github.Secrets, *github.Response, error)
}
ActionsServiceClient defines the interface for interacting with GitHub Actions secrets.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client implements the External Secrets Kubernetes provider for GitHub Actions secrets.
func (*Client) AuthWithPrivateKey ¶
AuthWithPrivateKey creates a new GitHub client authenticated using a private key. It retrieves the private key from the secret referenced in the provider configuration and sets up GitHub App authentication.
func (*Client) DeleteSecret ¶
DeleteSecret deletes a secret from GitHub Actions.
func (*Client) GetAllSecrets ¶
func (g *Client) GetAllSecrets(_ context.Context, _ esv1.ExternalSecretFind) (map[string][]byte, error)
GetAllSecrets is not implemented as this provider is write-only.
func (*Client) GetSecretMap ¶
func (g *Client) GetSecretMap(_ context.Context, _ esv1.ExternalSecretDataRemoteRef) (map[string][]byte, error)
GetSecretMap is not implemented as this provider is write-only.
func (*Client) PushSecret ¶
func (g *Client) PushSecret(ctx context.Context, secret *corev1.Secret, remoteRef esv1.PushSecretData) error
PushSecret pushes a new secret to GitHub Actions.
func (*Client) SecretExists ¶
SecretExists checks if a secret exists in GitHub Actions.
type Provider ¶
type Provider struct {
}
Provider implements the GitHub provider for managing secrets through GitHub Actions.
func (*Provider) Capabilities ¶
func (p *Provider) Capabilities() esv1.SecretStoreCapabilities
Capabilities return the provider supported capabilities (ReadOnly, WriteOnly, ReadWrite).
func (*Provider) NewClient ¶
func (p *Provider) NewClient(ctx context.Context, store esv1.GenericStore, kube client.Client, namespace string) (esv1.SecretsClient, error)
NewClient constructs a new secrets client based on the provided store.
func (*Provider) ValidateStore ¶
ValidateStore validates the configuration of a GitHub secret store.