cyberark

package
v1.13.1 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2026 License: Apache-2.0 Imports: 13 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

Index

Constants

View Source
const (
	// JWTSourceFile is the only currently-supported JWTSource value (besides
	// the empty string, which also means "file").
	JWTSourceFile = "file"

	// DefaultAccount is the Conjur account name used when ClientConfig.Account
	// is unset.
	DefaultAccount = "conjur"
)

Variables

View Source
var ErrMissingSubdomain = errors.New("no CyberArk subdomain configured: set config.cyberark.subdomain or the ARK_SUBDOMAIN environment variable")

ErrMissingSubdomain is returned when no subdomain is configured, either via config.cyberark.subdomain or the ARK_SUBDOMAIN environment variable.

View Source
var ErrNoAuthMethod = errors.New("no CyberArk authentication method configured: set config.cyberark.service_id (Conjur JWT) or ARK_USERNAME + ARK_SECRET (legacy username/password)")

ErrNoAuthMethod is returned when neither a Conjur service-id nor username/password credentials are configured.

Functions

func NewDatauploadClient

func NewDatauploadClient(ctx context.Context, httpClient *http.Client, serviceMap *servicediscovery.Services, tenantUUID string, cfg ClientConfig) (*dataupload.CyberArkClient, error)

NewDatauploadClient initializes and returns a new CyberArk Data Upload client. It performs service discovery to find the necessary API endpoints and authenticates using whichever method is configured (Conjur JWT exchange or legacy username/password — see selectAuthenticator).

func NewRequestAuthenticator added in v1.12.0

func NewRequestAuthenticator(ctx context.Context, httpClient *http.Client, serviceMap *servicediscovery.Services, cfg ClientConfig) (identity.RequestAuthenticator, error)

NewRequestAuthenticator selects and builds the configured request authenticator (Conjur JWT exchange or legacy username/password). Exposed for other consumers (e.g. envelope key fetching) that need the same auth seam without a dataupload client.

func ValidateJWTSource added in v1.12.0

func ValidateJWTSource(source string) error

ValidateJWTSource returns an error if source is set to something other than the empty string or JWTSourceFile — the only supported jwt_source values. Shared so the CLI/config-file validation path and the client construction path can't drift on what's accepted.

Types

type ClientConfig

type ClientConfig struct {
	Subdomain string

	// Conjur JWT exchange (preferred for new installs).
	ServiceID   string // authn-jwt service id (POC: per-cluster, e.g. "dev-cluster")
	Account     string // defaults to DefaultAccount
	JWTSource   string // "" or JWTSourceFile (POC) | "spiffe" (deferred)
	JWTFilePath string // default jwtsource.DefaultTokenPath

	// Legacy CyberArk Identity username/password (backward compatibility).
	// Sourced from ARK_USERNAME / ARK_SECRET. Used only when ServiceID is unset.
	Username string
	Secret   []byte
}

ClientConfig holds the configuration needed to initialize a CyberArk client.

Two authentication methods coexist (the product is GA; existing installs use username/password). The active method is selected by config presence, see selectAuthenticator: a Conjur authn-jwt ServiceID, when set, takes precedence over username/password.

func LoadClientConfig added in v1.12.0

func LoadClientConfig(log logr.Logger, subdomain string) (ClientConfig, error)

LoadClientConfig loads the CyberArk client config. subdomain (from config.cyberark.subdomain) takes precedence; falls back to ARK_SUBDOMAIN when empty. Also reads legacy ARK_USERNAME/ARK_SECRET, used only when no Conjur service-id is configured.

type ClientConfigLoader

type ClientConfigLoader func() (ClientConfig, error)

ClientConfigLoader is a function type that loads and returns a ClientConfig.

Directories

Path Synopsis
internal/cyberark/jwtsource/jwtsource.go
internal/cyberark/jwtsource/jwtsource.go

Jump to

Keyboard shortcuts

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