Maintains support for loading old Driver config.json that use the singular `SecurityGroupName` field, but also adds a new plural `SecurityGroupNames` field. This change also bumps to latest stretchr/testify, in the course of adding a dep on stretchr/testify/mock to help test the modified `configureSecurityGroups` code. The unused `deleteSecurityGroup` is dropped as well. Signed-off-by: John Sirois <john.sirois@gmail.com> Signed-off-by: Bill Farner <terasurfer@gmail.com>
15 lines
273 B
Go
15 lines
273 B
Go
package objx
|
|
|
|
import (
|
|
"crypto/sha1"
|
|
"encoding/hex"
|
|
)
|
|
|
|
// HashWithKey hashes the specified string using the security
|
|
// key.
|
|
func HashWithKey(data, key string) string {
|
|
hash := sha1.New()
|
|
hash.Write([]byte(data + ":" + key))
|
|
return hex.EncodeToString(hash.Sum(nil))
|
|
}
|