Skip to content

v1.30.0

Latest
Compare
Choose a tag to compare
@aryanmehrotra aryanmehrotra released this 10 Jan 06:24
· 7 commits to development since this release
9e01054

Release v1.30.0

🚀 Features

1. GoFr's Context Support in gRPC Handlers

Introduced context integration for gRPC handlers, enabling efficient dependency and tracing management.
Automatically generates gRPC handler templates with built-in support for gofr's context using the gofr wrap grpc command of gofr cli.

Note: For details on setting up Protocol Buffers and gRPC in GoFr, visit the official Documentation and Example

🔧 Fixes

1. ExpectSelect Update in SQL Mocks

Refactored the ExpectSelect function in SQL mocks. Users can now set expected responses using the ReturnsResponse method, ensuring accurate mock behavior during tests.

  • Example Usage:

    var result, actualResult Response
    
    mockContainer, sqlMock := NewMockContainer(t)
    ctx := &gofr.Context{
      Container: mockContainer,
    }
    
    expectedResult := Response{
      // ... fill with expected values
    }
    
    sqlMock.ExpectSelect(ctx, &result, query).ReturnsResponse(expectedResult)
    
    ctx.SQL.Select(ctx, &actualResult, query)
    
    assert.Equal(t, actualResult, expectedResult)

2. Environment Variable Handling

  • OS-level environment variables now override values from .env, .<APP_ENV>.env configurations, ensuring consistent behaviour across environments.

3. Improved Logging

  • Removed sensitive information (e.g., usernames and passwords) from MongoDB connection logs by replacing uri with host.
  • Fixed inaccurate Redis connection logs and removed unnecessary SQL connection logs when no SQL connection is established.
  • Added error logs for database migration failures, improving visibility during debugging.

4. Security Fixes

  • Updated golang.org/x/crypto to v0.31.0 to resolve potential authorization bypass issues.
  • Updated go.mod in pkg/gofr/datasource/mongo for compatibility with Go commands.