Skip to content

Commit 1880b2a

Browse files
committed
refactor(test): replace real looking token to avoid false-positive secret scanner findings
1 parent 264997f commit 1880b2a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

middleware/token_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ import (
1010
"github.com/stretchr/testify/assert"
1111
)
1212

13-
func TestStoreWebToken_WithValidBearerToken(t *testing.T) {
14-
token := "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c"
13+
func TestStoreWebToken_WithFakeBearerToken(t *testing.T) {
14+
token := "fake.invalid.token"
1515
authHeader := "Bearer " + token
1616

1717
nextHandler := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
@@ -103,8 +103,8 @@ func TestStoreWebToken_WithEmptyBearerToken(t *testing.T) {
103103
assert.Equal(t, http.StatusOK, recorder.Code)
104104
}
105105

106-
func TestStoreWebToken_WithBearerTokenLowercase(t *testing.T) {
107-
token := "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c"
106+
func TestStoreWebToken_WithFakeBearerTokenLowercase(t *testing.T) {
107+
token := "fake.invalid.token"
108108
authHeader := "bearer " + token // lowercase
109109

110110
nextHandler := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {

0 commit comments

Comments
 (0)