@@ -247,7 +247,7 @@ func (b *backend) delegatedLogin(ctx context.Context, req *logical.Request, data
247247 return nil , err
248248 }
249249 trustee := claims ["iss" ].(string )
250- if ! contains (config .TrusteeList , trustee ) {
250+ if ! containsIgnoreCase (config .TrusteeList , trustee ) {
251251 return nil , fmt .Errorf ("this %s address is not trusted" , trustee )
252252 }
253253 delegateJWT , ok := claims ["delegate" ].(string )
@@ -522,7 +522,7 @@ func (b *backend) verifyTrustee(ctx context.Context, rawToken string, trustees [
522522 if ! ok {
523523 return nil , fmt .Errorf ("JWT has no issuer - iss" )
524524 }
525- if ! contains (trustees , ethereumAddress ) {
525+ if ! containsIgnoreCase (trustees , ethereumAddress ) {
526526 return nil , fmt .Errorf ("we don't trust this issuer: %s" , ethereumAddress )
527527 }
528528 jti , ok := unverifiedJwt ["jti" ].(string )
@@ -546,7 +546,7 @@ func (b *backend) verifyTrustee(ctx context.Context, rawToken string, trustees [
546546 }
547547 address := crypto .PubkeyToAddress (* pubkey )
548548
549- if ethereumAddress == address .Hex () {
549+ if strings . ToUpper ( ethereumAddress ) == strings . ToUpper ( address .Hex () ) {
550550 validateJwt , err := jwt .Parse (token , func (t * jwt.Token ) (interface {}, error ) {
551551 return pubkey , nil
552552 })
@@ -557,4 +557,4 @@ func (b *backend) verifyTrustee(ctx context.Context, rawToken string, trustees [
557557 return claims , claims .Valid ()
558558 }
559559 return nil , fmt .Errorf ("Error verifying token" )
560- }
560+ }
0 commit comments