[PR #5516] [MERGED] [management] use the cache for the pkce state #23223

Closed
opened 2026-08-05 06:06:57 -04:00 by saavagebueno · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netbirdio/netbird/pull/5516
Author: @pascal-fischer
Created: 3/5/2026
Status: Merged
Merged: 3/9/2026
Merged by: @pascal-fischer

Base: mainHead: feature/cache-for-pkce-state


📝 Commits (3)

📊 Changes

11 files changed (+152 additions, -72 deletions)

View changed files

📝 management/internals/modules/reverseproxy/service/manager/manager_test.go (+9 -6)
📝 management/internals/server/boot.go (+11 -1)
📝 management/internals/server/server.go (+0 -1)
management/internals/shared/grpc/pkce_verifier.go (+61 -0)
📝 management/internals/shared/grpc/proxy.go (+10 -49)
📝 management/internals/shared/grpc/proxy_test.go (+43 -12)
📝 management/internals/shared/grpc/validate_session_test.go (+4 -1)
📝 management/server/account_test.go (+1 -1)
📝 management/server/http/handlers/proxy/auth_callback_integration_test.go (+4 -0)
📝 management/server/http/testing/testing_tools/channel/channel.go (+5 -1)
📝 proxy/management_integration_test.go (+4 -0)

📄 Description

Describe your changes

Stack

Checklist

  • Is it a bug fix
  • Is a typo/documentation fix
  • Is a feature enhancement
  • It is a refactor
  • Created tests that fail without the change (if possible)

By submitting this pull request, you confirm that you have read and agree to the terms of the Contributor License Agreement.

Documentation

Select exactly one:

  • I added/updated documentation for this change
  • Documentation is not needed for this change (explain why)

Docs PR URL (required if "docs added" is checked)

Paste the PR link from https://github.com/netbirdio/docs here:

https://github.com/netbirdio/docs/pull/__

Summary by CodeRabbit

  • New Features

    • Added a PKCE verifier store for OAuth flows with configurable backends (in-memory or Redis), TTL, and automatic cleanup.
  • Refactor

    • Replaced ad-hoc in-memory PKCE handling with a centralized PKCE store, updating proxy initialization to use the store for state storage and validation for more robust, single-use PKCE handling.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/netbirdio/netbird/pull/5516 **Author:** [@pascal-fischer](https://github.com/pascal-fischer) **Created:** 3/5/2026 **Status:** ✅ Merged **Merged:** 3/9/2026 **Merged by:** [@pascal-fischer](https://github.com/pascal-fischer) **Base:** `main` ← **Head:** `feature/cache-for-pkce-state` --- ### 📝 Commits (3) - [`78d513d`](https://github.com/netbirdio/netbird/commit/78d513ddccae7fb4c792f033871e877253f1802e) use the cache for the pkce state - [`603aba3`](https://github.com/netbirdio/netbird/commit/603aba308d5a3f148e10ec7e53d939265ebc0e25) remove proxy grpc close - [`745f51e`](https://github.com/netbirdio/netbird/commit/745f51e6ae92273203ad746413fe1a81bc159fab) fix test ### 📊 Changes **11 files changed** (+152 additions, -72 deletions) <details> <summary>View changed files</summary> 📝 `management/internals/modules/reverseproxy/service/manager/manager_test.go` (+9 -6) 📝 `management/internals/server/boot.go` (+11 -1) 📝 `management/internals/server/server.go` (+0 -1) ➕ `management/internals/shared/grpc/pkce_verifier.go` (+61 -0) 📝 `management/internals/shared/grpc/proxy.go` (+10 -49) 📝 `management/internals/shared/grpc/proxy_test.go` (+43 -12) 📝 `management/internals/shared/grpc/validate_session_test.go` (+4 -1) 📝 `management/server/account_test.go` (+1 -1) 📝 `management/server/http/handlers/proxy/auth_callback_integration_test.go` (+4 -0) 📝 `management/server/http/testing/testing_tools/channel/channel.go` (+5 -1) 📝 `proxy/management_integration_test.go` (+4 -0) </details> ### 📄 Description ## Describe your changes ## Issue ticket number and link ## Stack <!-- branch-stack --> ### Checklist - [ ] Is it a bug fix - [ ] Is a typo/documentation fix - [x] Is a feature enhancement - [ ] It is a refactor - [ ] Created tests that fail without the change (if possible) > By submitting this pull request, you confirm that you have read and agree to the terms of the [Contributor License Agreement](https://github.com/netbirdio/netbird/blob/main/CONTRIBUTOR_LICENSE_AGREEMENT.md). ## Documentation Select exactly one: - [ ] I added/updated documentation for this change - [x] Documentation is **not needed** for this change (explain why) ### Docs PR URL (required if "docs added" is checked) Paste the PR link from https://github.com/netbirdio/docs here: https://github.com/netbirdio/docs/pull/__ <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Added a PKCE verifier store for OAuth flows with configurable backends (in-memory or Redis), TTL, and automatic cleanup. * **Refactor** * Replaced ad-hoc in-memory PKCE handling with a centralized PKCE store, updating proxy initialization to use the store for state storage and validation for more robust, single-use PKCE handling. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
saavagebueno added the pull-request label 2026-08-05 06:06:57 -04:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: DYNR/netbird#23223