referencing secretInput directly rather than looking up in State by key
Signed-off-by: Richard Jones <richard@dagger.io>
This commit is contained in:
parent
e86985da16
commit
defaea5a87
@ -197,10 +197,10 @@ func SecretInput(data string) Input {
|
||||
|
||||
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.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)
|
||||
return compiler.Compile("", secretValue)
|
||||
}
|
||||
|
Reference in New Issue
Block a user