File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,8 @@ import (
17
17
)
18
18
19
19
func TestApiKey_IsCorrect (t * testing.T ) {
20
+ const hashedSecret = "$2y$10$Y.FlUK8q//DfybgFzNG2lONaJwvEFxHnCRo/r60BZbITDT6rOUhGa"
21
+
20
22
tests := []struct {
21
23
name string
22
24
HashedSecret string
@@ -26,21 +28,21 @@ func TestApiKey_IsCorrect(t *testing.T) {
26
28
}{
27
29
{
28
30
name : "valid secret" ,
29
- HashedSecret : "$2y$10$Y.FlUK8q//DfybgFzNG2lONaJwvEFxHnCRo/r60BZbITDT6rOUhGa" ,
31
+ HashedSecret : hashedSecret ,
30
32
ActivatedAt : 1744896576000 ,
31
33
Given : "abc123" ,
32
34
wantErr : false ,
33
35
},
34
36
{
35
37
name : "invalid secret" ,
36
- HashedSecret : "$2y$10$Y.FlUK8q//DfybgFzNG2lONaJwvEFxHnCRo/r60BZbITDT6rOUhGa" ,
38
+ HashedSecret : hashedSecret ,
37
39
ActivatedAt : 1744896576000 ,
38
40
Given : "123abc" ,
39
41
wantErr : true ,
40
42
},
41
43
{
42
44
name : "inactive" ,
43
- HashedSecret : "$2y$10$Y.FlUK8q//DfybgFzNG2lONaJwvEFxHnCRo/r60BZbITDT6rOUhGa" ,
45
+ HashedSecret : hashedSecret ,
44
46
ActivatedAt : 0 ,
45
47
Given : "abc123" ,
46
48
wantErr : true ,
You can’t perform that action at this time.
0 commit comments