referencing secretInput directly rather than looking up in State by key

Signed-off-by: Richard Jones <richard@dagger.io>
This commit is contained in:
Richard Jones 2021-09-16 09:30:15 -06:00
parent e86985da16
commit defaea5a87
No known key found for this signature in database
GPG Key ID: CFB3A382EB166F4C

View File

@ -197,10 +197,10 @@ func SecretInput(data string) Input {
type secretInput string type secretInput string
func (i secretInput) Compile(key string, s *State) (*compiler.Value, error) { func (i secretInput) Compile(key string, _ *State) (*compiler.Value, error) {
hash := sha256.New() hash := sha256.New()
hash.Write([]byte(key)) hash.Write([]byte(key))
checksum := hash.Sum([]byte(s.Inputs[key].Secret.PlainText())) checksum := hash.Sum([]byte(i.PlainText()))
secretValue := fmt.Sprintf(`{id:"secret=%s;hash=%x"}`, key, checksum) secretValue := fmt.Sprintf(`{id:"secret=%s;hash=%x"}`, key, checksum)
return compiler.Compile("", secretValue) return compiler.Compile("", secretValue)
} }