Release v1.25.0
✨ Features
BadgerDB Tracing
- Added context support and tracing for BadgerDB datasource operations, enhancing observability and tracking within the BadgerDB storage layer.(Released pkg/gofr/datasource/kv-store/badger - v0.2.0)
Redis Authentication Support
-
Users can now connect to Redis instances requiring a username, password, or both. Configure these credentials in the
.envfile located in theconfigsfolder:-
REDIS_USER: User credential for connecting to the Redis server. Multiple users with different permissions can be configured within a single Redis instance. For more details, refer to the official Redis documentation. -
REDIS_PASSWORD: Password credential required only if authentication is enabled on the Redis instance.
-
Enhanced Authentication Retrieval in Context
-
The
GetAuthInfomethod on the context provides easy access to various authentication methods, allowing developers to retrieve:-
JWT Claims: Use
GetAuthInfo().GetClaims()when OAuth is enabled, returning ajwt.MapClaimsresponse. -
Username: Use
GetAuthInfo().GetUsername()for basic authentication, returning the username or an empty string if basic auth is not enabled. -
API Key: Use
GetAuthInfo().GetAPIKey()for API key-based authentication, returning the API key or an empty string if API key auth is not enabled.
-
🛠️ Fixes
Static File Route Issue
-
Resolved a bug in the
AddStaticFilesmethod where static files could not be accessed via specified routes. Now, running the following code:func main() { app := gofr.New() app.AddStaticFiles("/", "./static") app.Run() }
Files within the
./staticdirectory can be accessed properly, e.g.,http://localhost:9000/abc.jpeg, without encountering a "route not registered" error.
Controlled Access to OpenAPI Files
- Prevented direct access to the
openapi.jsonfile via static routes. The file is now restricted to access through explicitly defined routes such as/.well-known/swaggeror/.well-known/openapi.jsonfor secure and controlled API documentation access.