MCPcopy Create free account
hub / github.com/github/gh-aw / getMissingRequiredSecrets

Function getMissingRequiredSecrets

pkg/cli/engine_secrets.go:161–178  ·  view source on GitHub ↗

getMissingRequiredSecrets filters requirements to return only missing required secrets. It skips optional secrets and checks both primary and alternative secret names.

(requirements []SecretRequirement, existingSecrets map[string]struct {
})

Source from the content-addressed store, hash-verified

159// getMissingRequiredSecrets filters requirements to return only missing required secrets.
160// It skips optional secrets and checks both primary and alternative secret names.
161func getMissingRequiredSecrets(requirements []SecretRequirement, existingSecrets map[string]struct {
162}) []SecretRequirement {
163 var missing []SecretRequirement
164 for _, req := range requirements {
165 // Skip optional secrets - we only care about required ones
166 if req.Optional {
167 continue
168 }
169
170 exists := setutil.Contains(existingSecrets, req.Name) || sliceutil.Any(req.AlternativeEnvVars, func(alt string) bool {
171 return setutil.Contains(existingSecrets, alt)
172 })
173 if !exists {
174 missing = append(missing, req)
175 }
176 }
177 return missing
178}
179
180// ctx returns the context from the config, defaulting to background if nil
181func (c EngineSecretConfig) ctx() context.Context {

Callers 2

runTokensBootstrapFunction · 0.85

Calls 2

ContainsFunction · 0.92
AnyFunction · 0.92

Tested by 1