Skip to content

feat: add gRPC auth middleware and enable standard OTEL tracing#2608

Merged
coolwednesday merged 11 commits intogofr-dev:developmentfrom
bhavishyaone:feature/grpc-auth-middleware
Jan 24, 2026
Merged

feat: add gRPC auth middleware and enable standard OTEL tracing#2608
coolwednesday merged 11 commits intogofr-dev:developmentfrom
bhavishyaone:feature/grpc-auth-middleware

Conversation

@bhavishyaone
Copy link
Copy Markdown
Contributor

Pull Request Template

Description:

  • I've been working on closing the gap between our gRPC and HTTP services (Issue POC : Identify Gaps between gRPC and HTTP services in GoFr #2576).
  • This PR brings Authentication to gRPC. I added interceptors for Basic Auth, API Keys, and OAuth so they match what we already have for HTTP.
  • I also tweaked the gRPC logger to handle standard OpenTelemetry tracing headers. It tries to use the standard OTEL way first, which makes it much easier to integrate with other tools.

Breaking Changes (if applicable):

  • Nope, no breaking changes.
  • The tracing update is backward compatible—if it doesn't find the standard headers, it falls back to our custom ones.

Additional Information:

  • I put all the new auth logic in pkg/gofr/grpc/middleware.
  • Added a bunch of tests in auth_test.go to cover the new interceptors.

Checklist:

  • I have formatted my code using goimport and golangci-lint.
  • All new code is covered by unit tests.
  • This PR does not decrease the overall code coverage.
  • I have reviewed the code comments and documentation for clarity.

Thank you for your contribution!

@coolwednesday
Copy link
Copy Markdown
Member

@bhavishyaone, Could you please fix the tests and address the linting issues as well?

For linting, make sure to install golangci-lint locally so you can run it on the modules before pushing your changes.

@coolwednesday coolwednesday force-pushed the feature/grpc-auth-middleware branch from f0455b4 to 008e51e Compare January 16, 2026 11:33
@coolwednesday coolwednesday force-pushed the feature/grpc-auth-middleware branch from 945d915 to 10efbec Compare January 21, 2026 11:43
@coolwednesday coolwednesday force-pushed the feature/grpc-auth-middleware branch from 89e4195 to d5a4854 Compare January 21, 2026 12:01
@coolwednesday coolwednesday merged commit 23b4062 into gofr-dev:development Jan 24, 2026
16 checks passed
Umang01-hash added a commit that referenced this pull request Jan 27, 2026
* Improve wording and grammar in getting started documentation

Correct grammatical structure for clarity.

* build(deps): bump google.golang.org/api from 0.259.0 to 0.260.0

Bumps [google.golang.org/api](https://github.com/googleapis/google-api-go-client) from 0.259.0 to 0.260.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.259.0...v0.260.0)

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

Signed-off-by: dependabot[bot] <[email protected]>

* Merge pull request #2869 from gofr-dev/dependabot/go_modules/pkg/gofr/datasource/pubsub/eventhub/github.com/Azure/azure-sdk-for-go/sdk/azcore-1.21.0

* build(deps): bump gofr.dev in /pkg/gofr/datasource/file/gcs (#2866)

* build(deps): bump gofr.dev in /pkg/gofr/datasource/file/sftp (#2868)

* build(deps): bump gofr.dev in /pkg/gofr/datasource/file/s3 (#2867)

* build(deps): bump github.com/Azure/azure-sdk-for-go/sdk/storage/azfile (#2863)

* build(deps): bump gofr.dev in /pkg/gofr/datasource/file/ftp (#2864)

* build(deps): bump github.com/segmentio/kafka-go from 0.4.49 to 0.4.50 (#2856)

* build(deps): bump crate-ci/typos in the actions group (#2855)

* build(deps): bump modernc.org/sqlite from 1.44.0 to 1.44.2 (#2857)

* build(deps): bump gofr.dev in /pkg/gofr/datasource/dbresolver (#2859)

* build(deps): bump gofr.dev in /examples/using-add-filestore (#2858)

* build(deps): bump gofr.dev in /pkg/gofr/datasource/pubsub/sqs (#2872)

* build(deps): bump google.golang.org/api in /pkg/gofr/datasource/file/gcs (#2865)

* build(deps): bump gofr.dev in /pkg/gofr/datasource/oracle (#2860)

* build(deps): bump gofr.dev in /pkg/gofr/datasource/pubsub/eventhub (#2870)

* build(deps): bump gofr.dev in /pkg/gofr/datasource/file/azure (#2862)

* fix  consumer group interpretition (#2875)

* Add gRPC auth middleware and enable standard OTEL tracing (#2608)

* version

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: BITTU KUMAR <[email protected]>
Co-authored-by: Umang Mundhra <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Bhavishya Sharma <[email protected]>
Co-authored-by: gizmo-rt <[email protected]>
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.

4 participants