You've already forked golang-saas-starter-kit
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:
@@ -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
|
||||||
|
Reference in New Issue
Block a user