diff --git a/internal/authenticator/auto_authenticator.go b/internal/authenticator/auto_authenticator.go index 5775e4f..1f1069e 100644 --- a/internal/authenticator/auto_authenticator.go +++ b/internal/authenticator/auto_authenticator.go @@ -17,7 +17,7 @@ type AutoAuthenticator struct { AllowedAccessTypes []acl.AccessType TopicManager *topics.Manager Company string - JwtConfig config.JWT + JWTConfig config.JWT Validator validator.Client Parser *jwt.Parser } @@ -56,17 +56,17 @@ func (a AutoAuthenticator) ACL( return false, ErrInvalidClaims } - if claims[a.JwtConfig.IssName] == nil { + if claims[a.JWTConfig.IssName] == nil { return false, ErrIssNotFound } - issuer := fmt.Sprintf("%v", claims[a.JwtConfig.IssName]) + issuer := fmt.Sprintf("%v", claims[a.JWTConfig.IssName]) - if claims[a.JwtConfig.SubName] == nil { + if claims[a.JWTConfig.SubName] == nil { return false, ErrSubNotFound } - sub, _ := claims[a.JwtConfig.SubName].(string) + sub, _ := claims[a.JWTConfig.SubName].(string) topicTemplate := a.TopicManager.ParseTopic(topic, issuer, sub) if topicTemplate == nil { diff --git a/internal/authenticator/auto_authenticator_test.go b/internal/authenticator/auto_authenticator_test.go index f287089..b269c58 100644 --- a/internal/authenticator/auto_authenticator_test.go +++ b/internal/authenticator/auto_authenticator_test.go @@ -87,7 +87,7 @@ func (suite *AutoAuthenticatorTestSuite) SetupSuite() { Company: "snapp", Parser: jwt.NewParser(), TopicManager: topics.NewTopicManager(cfg.Topics, hid, "snapp", cfg.IssEntityMap, cfg.IssPeerMap, zap.NewNop()), - JwtConfig: config.JWT{ + JWTConfig: config.JWT{ IssName: "iss", SubName: "sub", SigningMethod: "rsa256", diff --git a/internal/authenticator/builder.go b/internal/authenticator/builder.go index 7cac495..b16e440 100644 --- a/internal/authenticator/builder.go +++ b/internal/authenticator/builder.go @@ -144,7 +144,7 @@ func (b Builder) autoAuthenticator(vendor config.Vendor) (*AutoAuthenticator, er vendor.IssPeerMap, b.Logger.Named("topic-manager"), ), - JwtConfig: vendor.Jwt, + JWTConfig: vendor.Jwt, Validator: client, Parser: jwt.NewParser(), }, nil