feat: add OAuth2 password grant support for event generator log-cache access#1265
Open
bonzofenix wants to merge 3 commits into
Open
feat: add OAuth2 password grant support for event generator log-cache access#1265bonzofenix wants to merge 3 commits into
bonzofenix wants to merge 3 commits into
Conversation
… access - Add password grant support to CF client configuration - New cf_oauth2_client for event generator to authenticate via resource owner password grant - Prevent thundering herd in token refresh with sync.Once pattern - Update fetcher factory to support password grant credentials - Add UaaCreds model for password grant configuration
This was referenced Jun 17, 2026
- Inline validateAPI() into Validate() — single call site, no reuse benefit - Precompute tokenURL and basicAuthHeader in CFOauth2HTTPClient constructor - Use models.GrantTypePassword constant instead of hardcoded "password" string - Add missing tests: UAACreds.IsPasswordGrant and introspect Basic auth header
- Remove extra blank line at cf/cfclient_wrapper_test.go:281 that caused gofmt formatting violation
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
Adds OAuth2 resource owner password grant support to the CF client and event generator, enabling log-cache access via user credentials instead of client credentials.
Changes
cf/config.go: Add password grant fields to CF client configurationcf/cfclient_wrapper.go: Support password grant in CF client wrappermodels/uaa_creds.go: New UaaCreds model for password grant configeventgenerator/metric/cf_oauth2_client.go: New OAuth2 token client with thundering-herd prevention (sync.Once)eventgenerator/metric/fetcher_factory.go: Wire password grant into fetcher factoryTesting
Part 1 of 4 — Split from #1149 for easier review.