MCPcopy Create free account
hub / github.com/compozy/agh / rejectTaskSecretJSON

Function rejectTaskSecretJSON

internal/task/block_service.go:505–520  ·  view source on GitHub ↗
(path string, value []byte)

Source from the content-addressed store, hash-verified

503}
504
505func rejectTaskSecretJSON(path string, value []byte) error {
506 if len(value) == 0 {
507 return nil
508 }
509 decoded, ok := decodeTaskSecretJSON(value)
510 if !ok {
511 if redactTaskSecretText(string(value)) != string(value) {
512 return fmt.Errorf("%w: %s must not embed raw secret material", ErrValidation, path)
513 }
514 return nil
515 }
516 if taskSecretValueContainsSecret(decoded) {
517 return fmt.Errorf("%w: %s must not embed raw secret material", ErrValidation, path)
518 }
519 return nil
520}
521
522func redactTaskSecretText(value string) string {
523 return diagnostics.Redact(RedactClaimTokens(value))

Callers 1

taskBlockFromRequestMethod · 0.85

Calls 3

decodeTaskSecretJSONFunction · 0.85
redactTaskSecretTextFunction · 0.85

Tested by

no test coverage detected