Skip to content

Conversation

@Umang01-hash
Copy link
Member

@Umang01-hash Umang01-hash commented Dec 27, 2025

Release v1.51.0

🚀 New Feature


🔐 Role-Based Access Control (RBAC)

GoFr introduces a config-driven RBAC middleware for enforcing authorization across HTTP APIs without adding role or permission logic inside handlers.


Key Highlights

  • Authorization defined entirely via JSON/YAML configuration

  • Permission-based model

    • Roles define permissions
    • Endpoints require permissions
  • Header-based and JWT-based role extraction

    • JWT-based RBAC supported via GoFr OAuth
    • JWT takes precedence when both are configured
  • Role inheritance support

  • Exact permission matching (no wildcards)

  • Gorilla/mux-compatible route matching

    • Supports path variables and constraints
  • Safe-by-default enforcement

    • Only routes defined in RBAC config are enforced

Usage

Enable RBAC using default config paths:

app := gofr.New()
app.EnableRBAC()

Or specify a custom RBAC config file:

app.EnableRBAC("configs/rbac.json")

JWT Integration

RBAC integrates with GoFr OAuth for JWT-based authorization:

app.EnableOAuth("https://auth.example.com/.well-known/jwks.json", 10)
app.EnableRBAC("configs/rbac.json")

Roles are extracted from JWT claims using configurable claim paths.


Observability

  • Debug logs include route matching and authorization decision details.
  • Roles are excluded from traces to avoid PII leakage.

📚 Documentation
Refer to the RBAC documentation for configuration details and advanced usage.

goginenibhavani2000 and others added 30 commits July 17, 2025 19:41
Umang01-hash and others added 27 commits December 24, 2025 11:46
Bumps [gofr.dev](https://github.com/gofr-dev/gofr) from 1.50.1 to 1.50.2.
- [Release notes](https://github.com/gofr-dev/gofr/releases)
- [Commits](v1.50.1...v1.50.2)

---
updated-dependencies:
- dependency-name: gofr.dev
  dependency-version: 1.50.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Bumps [google.golang.org/api](https://github.com/googleapis/google-api-go-client) from 0.257.0 to 0.258.0.
- [Release notes](https://github.com/googleapis/google-api-go-client/releases)
- [Changelog](https://github.com/googleapis/google-api-go-client/blob/main/CHANGES.md)
- [Commits](googleapis/google-api-go-client@v0.257.0...v0.258.0)

---
updated-dependencies:
- dependency-name: google.golang.org/api
  dependency-version: 0.258.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Bumps [github.com/Azure/azure-sdk-for-go/sdk/storage/azfile](https://github.com/Azure/azure-sdk-for-go) from 1.2.0 to 1.5.3.
- [Release notes](https://github.com/Azure/azure-sdk-for-go/releases)
- [Commits](Azure/azure-sdk-for-go@v1.2...sdk/storage/azfile/v1.5.3)

---
updated-dependencies:
- dependency-name: github.com/Azure/azure-sdk-for-go/sdk/storage/azfile
  dependency-version: 1.5.3
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
…urce/file/azure/github.com/Azure/azure-sdk-for-go/sdk/storage/azfile-1.5.3
…/datasource/file/azure/github.com/Azure/azure-sdk-for-go/sdk/storage/azfile-1.5.3
…/datasource/file/gcs/google.golang.org/api-0.258.0
chore: enhance documentation grammar and readability
* remove metrics implementation in RBAC

* fix doc
@Umang01-hash Umang01-hash merged commit 1f25395 into main Dec 27, 2025
28 checks passed
@Umang01-hash Umang01-hash deleted the release/v1.51.0 branch December 27, 2025 09:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants