1
0
mirror of https://github.com/raseels-repos/golang-saas-starter-kit.git synced 2025-08-10 22:41:25 +02:00

remove secret after test complete

This commit is contained in:
Lee Brown
2019-05-17 14:50:36 -04:00
parent b4535820d4
commit 2651aea991

View File

@@ -1,6 +1,8 @@
package auth_test package auth_test
import ( import (
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/service/secretsmanager"
"os" "os"
"testing" "testing"
"time" "time"
@@ -28,6 +30,17 @@ func TestAuthenticator(t *testing.T) {
awsSecretID := "jwt-key" + uuid.NewRandom().String() awsSecretID := "jwt-key" + uuid.NewRandom().String()
defer func() {
// cleanup the secret after test is complete
sm := secretsmanager.New(test.AwsSession)
_, err := sm.DeleteSecret(&secretsmanager.DeleteSecretInput{
SecretId: aws.String(awsSecretID),
})
if err != nil {
t.Fatal(err)
}
}()
var authTests = []struct { var authTests = []struct {
name string name string
awsSecretID string awsSecretID string