Documentation
¶
Overview ¶
Package gitprofile implements tenant-backed Git routing and credentials.
Index ¶
- Constants
- func BindTask(tc jobworkflow.TaskContext, s *Scope) func()
- func CacheNamespace(ctx context.Context) string
- 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 ProtocolValue(s string) bool
- func TaskContext(tc jobworkflow.TaskContext) context.Context
- 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) 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
Constants ¶
View Source
const ( ProfilePrefix = "_c2j_git_profile_" SecretPrefix = "_c2j_git_secret_" ReadOnlyKey = "git-profile-ro" ReadWriteKey = "git-profile-rw" )
View Source
const SocketEnv = "C2J_EXECUTION_SOCKET"
Variables ¶
This section is empty.
Functions ¶
func BindTask ¶
func BindTask(tc jobworkflow.TaskContext, s *Scope) func()
func CacheNamespace ¶
CacheNamespace prevents source sharing across tenants and routing profiles.
func CredentialNames ¶
func CredentialNames(selection Selection, snapshot jobdb.ConfigurationSnapshot) ([]string, error)
func ProtocolValue ¶
func TaskContext ¶
func TaskContext(tc jobworkflow.TaskContext) context.Context
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) RetainRedaction ¶
func (s *Scope) RetainRedaction() func()
RetainRedaction keeps masks until a running task finishes unwinding, even when cancellation has already closed its resolver socket.
Click to show internal directories.
Click to hide internal directories.