Documentation
¶
Overview ¶
Package gitprofile implements tenant-backed Git routing and credentials.
Index ¶
- Constants
- func CacheNamespace(ctx context.Context) string
- func CombinedOutput(ctx context.Context, cmd *exec.Cmd) ([]byte, error)
- func Command(ctx context.Context, args ...string) *exec.Cmd
- func CredentialNames(selection Selection, snapshot jobdb.ConfigurationSnapshot) ([]string, error)
- func Env(ctx context.Context, base []string) []string
- func Key(name string) (string, error)
- func Output(ctx context.Context, cmd *exec.Cmd) ([]byte, error)
- func ProtocolValue(s string) bool
- func Run(ctx context.Context, cmd *exec.Cmd) error
- func WithScope(ctx context.Context, s *Scope) context.Context
- func WithSecretLimit(ctx context.Context, names []string) context.Context
- type Entry
- type Profile
- type Request
- type Resolver
- type Response
- type Scope
- func (s *Scope) AllowSecrets(names []string)
- func (s *Scope) CheckOutput(v any) error
- func (s *Scope) Close()
- func (s *Scope) Context() context.Context
- func (s *Scope) Error(err error) error
- func (s *Scope) Fork(ctx context.Context, selection Selection) (*Scope, error)
- func (s *Scope) Redact(text string) string
- func (s *Scope) RetainRedaction() func()
- type Selection
- type StderrLog
Constants ¶
const ( ProfilePrefix = "_c2j_git_profile_" SecretPrefix = "_c2j_git_secret_" ReadOnlyKey = "git-profile-ro" ReadWriteKey = "git-profile-rw" )
const SocketEnv = "C2J_EXECUTION_SOCKET"
const StderrArtifactName = "_c2j/git-stderr.txt"
Variables ¶
This section is empty.
Functions ¶
func CacheNamespace ¶
CacheNamespace prevents source sharing across tenants and routing profiles.
func CombinedOutput ¶ added in v0.0.106
CombinedOutput preserves callers' combined output while logging only stderr.
func CredentialNames ¶
func CredentialNames(selection Selection, snapshot jobdb.ConfigurationSnapshot) ([]string, error)
func Output ¶ added in v0.0.106
Output keeps stdout separate from stderr, including for machine-readable Git output.
func ProtocolValue ¶
Types ¶
type Entry ¶
type Entry struct {
URL string `json:"url" yaml:"url"`
RewriteFrom []string `json:"rewrite_from,omitempty" yaml:"rewrite_from,omitempty"`
Username string `json:"username,omitempty" yaml:"username,omitempty"`
SecretRef string `json:"secret_ref,omitempty" yaml:"secret_ref,omitempty"`
SecretFile string `json:"secret_file,omitempty" yaml:"secret_file,omitempty"`
}
type Profile ¶
type Profile struct {
Version int `json:"version" yaml:"version"`
Entries []Entry `json:"entries" yaml:"entries"`
}
type Response ¶
type Response struct {
Value json.RawMessage `json:"value,omitempty"`
Secret *jobdb.SecretValue `json:"secret,omitempty"`
Username string `json:"username,omitempty"`
Error string `json:"error,omitempty"`
}
type Scope ¶
type Scope struct {
// contains filtered or unexported fields
}
func FromContext ¶
func (*Scope) AllowSecrets ¶
AllowSecrets adds references already validated against the operation schema.
func (*Scope) CheckOutput ¶
func (*Scope) Context ¶ added in v0.0.99
Context carries this invocation's dependencies and cancellation directly.
func (*Scope) RetainRedaction ¶
func (s *Scope) RetainRedaction() func()
RetainRedaction keeps masks until a running task finishes unwinding, even when cancellation has already closed its resolver socket.
type Selection ¶
type Selection struct {
Explicit bool `json:"explicit,omitempty"`
Value any `json:"value,omitempty"`
Publish bool `json:"publish,omitempty"`
}
Selection distinguishes inherited defaults from an explicit name or null.
func InheritedSelection ¶
type StderrLog ¶ added in v0.0.106
type StderrLog struct {
// contains filtered or unexported fields
}
StderrLog belongs to one task, including its workspace and source preparation. Whole command records are retained so truncation cannot expose partial secrets.