Skip to content

Commit c621c55

Browse files
committed
chore: upgraded dependencies
1 parent 02509cb commit c621c55

File tree

7 files changed

+40
-25
lines changed

7 files changed

+40
-25
lines changed

cache/constants.go

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
package cache
2+
3+
import (
4+
gostringsseparator "github.com/ralvarezdev/go-strings/separator"
5+
)
6+
7+
var (
8+
// JwtIdentifierSeparator is the separator of the JWT identifier prefixes
9+
JwtIdentifierSeparator = gostringsseparator.Dots
10+
)

cache/redis/constants.go

+7
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
package redis
22

3+
import (
4+
gostringsseparator "github.com/ralvarezdev/go-strings/separator"
5+
)
6+
37
var (
48
// JwtIdentifierPrefix is the prefix of the JWT Identifier key
59
JwtIdentifierPrefix = "jti"
10+
11+
// JwtIdentifierSeparator is the separator of the JWT identifier prefixes
12+
JwtIdentifierSeparator = gostringsseparator.Dots
613
)

cache/redis/validator.go

+4-5
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,10 @@ package redis
33
import (
44
"context"
55
"github.com/go-redis/redis/v8"
6-
godatabasesredis "github.com/ralvarezdev/go-databases/redis"
6+
godatabases "github.com/ralvarezdev/go-databases"
77
gojwtcache "github.com/ralvarezdev/go-jwt/cache"
88
gojwttoken "github.com/ralvarezdev/go-jwt/token"
99
gostringsadd "github.com/ralvarezdev/go-strings/add"
10-
gostringsseparator "github.com/ralvarezdev/go-strings/separator"
1110
"strconv"
1211
"time"
1312
)
@@ -30,10 +29,10 @@ func NewTokenValidatorService(
3029
) {
3130
// Check if the Redis client is nil
3231
if redisClient == nil {
33-
return nil, godatabasesredis.ErrNilClient
32+
return nil, godatabases.ErrNilConnection
3433
}
3534

36-
return &TokenValidatorService{redisClient: redisClient, logger: logger}, nil
35+
return &TokenValidatorService{redisClient, logger}, nil
3736
}
3837

3938
// GetKey gets the JWT Identifier key
@@ -49,7 +48,7 @@ func (d *TokenValidatorService) GetKey(
4948

5049
return gostringsadd.Prefixes(
5150
id,
52-
gostringsseparator.Dots,
51+
JwtIdentifierSeparator,
5352
JwtIdentifierPrefix,
5453
tokenPrefix,
5554
), nil

cache/validator.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import (
55
gocachetimed "github.com/ralvarezdev/go-cache/timed"
66
gojwttoken "github.com/ralvarezdev/go-jwt/token"
77
gostringsadd "github.com/ralvarezdev/go-strings/add"
8-
gostringsseparator "github.com/ralvarezdev/go-strings/separator"
98
"time"
109
)
1110

@@ -48,7 +47,7 @@ func (t *TokenValidatorService) GetKey(
4847
return "", err
4948
}
5049

51-
return gostringsadd.Prefixes(id, gostringsseparator.Dots, tokenPrefix), nil
50+
return gostringsadd.Prefixes(id, JwtIdentifierSeparator, tokenPrefix), nil
5251
}
5352

5453
// Set sets a token in the cache

go.mod

+5-5
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ require (
66
github.com/gin-gonic/gin v1.10.0
77
github.com/go-redis/redis/v8 v8.11.5
88
github.com/golang-jwt/jwt/v5 v5.2.1
9-
github.com/ralvarezdev/go-cache v0.1.1
10-
github.com/ralvarezdev/go-databases v0.4.13
11-
github.com/ralvarezdev/go-flags v0.3.1
12-
github.com/ralvarezdev/go-logger v0.4.5
13-
github.com/ralvarezdev/go-strings v0.1.6
9+
github.com/ralvarezdev/go-cache v0.1.2
10+
github.com/ralvarezdev/go-databases v0.5.0
11+
github.com/ralvarezdev/go-flags v0.3.2
12+
github.com/ralvarezdev/go-logger v0.4.6
13+
github.com/ralvarezdev/go-strings v0.1.7
1414
golang.org/x/crypto v0.32.0
1515
)
1616

go.sum

+10-10
Original file line numberDiff line numberDiff line change
@@ -63,16 +63,16 @@ github.com/pelletier/go-toml/v2 v2.2.2 h1:aYUidT7k73Pcl9nb2gScu7NSrKCSHIDE89b3+6
6363
github.com/pelletier/go-toml/v2 v2.2.2/go.mod h1:1t835xjRzz80PqgE6HHgN2JOsmgYu/h4qDAS4n929Rs=
6464
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
6565
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
66-
github.com/ralvarezdev/go-cache v0.1.1 h1:Gd+F6ghWEDNUG/EYtVOiYPnw6rV3aXenpnkEXBvZTUA=
67-
github.com/ralvarezdev/go-cache v0.1.1/go.mod h1:uxdoDOgKOj0tQReWRA7rc1RtiFPhg8tfzVK6nJJ7QKo=
68-
github.com/ralvarezdev/go-databases v0.4.13 h1:thB7s0XwOTfAumUFDbelABH77NesyMOJI1VX3If1dw4=
69-
github.com/ralvarezdev/go-databases v0.4.13/go.mod h1:JOUqccAyW1lAriqYEkUmvAtMeraAsAeT71gw0xj0vhc=
70-
github.com/ralvarezdev/go-flags v0.3.1 h1:YxGYUonmr0dwJL+9oDY/4GqCl1CYwYDJExpGXXMc9rU=
71-
github.com/ralvarezdev/go-flags v0.3.1/go.mod h1:R3yVBYvzwqfOp26LidaiJ/zftVAnPC3pKunVpV/vosE=
72-
github.com/ralvarezdev/go-logger v0.4.5 h1:Lw7DdZUb4YSQDA7J9nv79soojw1eFHVVzO8wdE9d+Qg=
73-
github.com/ralvarezdev/go-logger v0.4.5/go.mod h1:vq47onxpED19/o3dh5/YbBKK0eZhqJENPgACYkqNNi8=
74-
github.com/ralvarezdev/go-strings v0.1.6 h1:NWI+XCipWaOo0vhSNpZz+7Eb4igk/GXD5RaFsk4ZPqY=
75-
github.com/ralvarezdev/go-strings v0.1.6/go.mod h1:8sFOqmPJpqzS7bTjf91EzUCITnwpmkfifwY80GxV5r8=
66+
github.com/ralvarezdev/go-cache v0.1.2 h1:OkFimEChOm3YXlBe4tOjeDnbqvPumJMNf8Xo4WAQp2c=
67+
github.com/ralvarezdev/go-cache v0.1.2/go.mod h1:uxdoDOgKOj0tQReWRA7rc1RtiFPhg8tfzVK6nJJ7QKo=
68+
github.com/ralvarezdev/go-databases v0.5.0 h1:F9z3mQ7k6H2toKYQ2bFXhPlW4rvtSWWuemB2U7JI57U=
69+
github.com/ralvarezdev/go-databases v0.5.0/go.mod h1:wNnYvx5JG6ajKLWW1r1s2Qarh5cwx5aiJ7FZqBx85Uk=
70+
github.com/ralvarezdev/go-flags v0.3.2 h1:l3f62CD5NysLAJH5XqSRGiakU/dn4pTGdX4yaBlAmMw=
71+
github.com/ralvarezdev/go-flags v0.3.2/go.mod h1:R3yVBYvzwqfOp26LidaiJ/zftVAnPC3pKunVpV/vosE=
72+
github.com/ralvarezdev/go-logger v0.4.6 h1:eZalm0WAdNuhzbaVh5D7gC6AFztdpqE/GQfjH2pipyE=
73+
github.com/ralvarezdev/go-logger v0.4.6/go.mod h1:zxuMDHqtV2eoJYtmo219lima0ZSk4p/AGj/cCc390P8=
74+
github.com/ralvarezdev/go-strings v0.1.7 h1:rO+4TJmHJTghRWl4Nq6gfnGSyNRerunJrkS03x1SLz4=
75+
github.com/ralvarezdev/go-strings v0.1.7/go.mod h1:8sFOqmPJpqzS7bTjf91EzUCITnwpmkfifwY80GxV5r8=
7676
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
7777
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
7878
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=

token/validator/ed25519.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import (
1212

1313
// Ed25519Validator handles parsing and validation of JWT tokens with ED25519 public key
1414
type Ed25519Validator struct {
15-
ed25519Key *ed25519.PublicKey
15+
publicKey *ed25519.PublicKey
1616
claimsValidator gojwtclaims.Validator
1717
mode *goflagmode.Flag
1818
}
@@ -44,7 +44,7 @@ func NewEd25519Validator(
4444
}
4545

4646
return &Ed25519Validator{
47-
ed25519Key: &ed25519Key,
47+
publicKey: &ed25519Key,
4848
claimsValidator: claimsValidator,
4949
mode: mode,
5050
}, nil
@@ -60,7 +60,7 @@ func (d *Ed25519Validator) GetToken(rawToken string) (*jwt.Token, error) {
6060
if _, ok := rawToken.Method.(*jwt.SigningMethodEd25519); !ok {
6161
return nil, ErrUnexpectedSigningMethod
6262
}
63-
return *d.ed25519Key, nil
63+
return *d.publicKey, nil
6464
},
6565
)
6666
if err != nil {

0 commit comments

Comments
 (0)