Skip to content

Option to switch off basic-authentication#1168

Draft
joergdw wants to merge 9 commits intomainfrom
basic-auth-switch
Draft

Option to switch off basic-authentication#1168
joergdw wants to merge 9 commits intomainfrom
basic-auth-switch

Conversation

@joergdw
Copy link
Copy Markdown
Contributor

@joergdw joergdw commented Apr 23, 2026

This PR allows operators of app-autoscaler to control how "Basic Authentication" for sending custom metrics to the metricsforwarder is handled.

@joergdw joergdw force-pushed the basic-auth-switch branch from 61d8fbb to 8e22a6d Compare April 23, 2026 08:34
joergdw added 2 commits April 23, 2026 11:13
Replace direct CredHelperImpl and DefaultCustomMetricsCredentialType
assignments with the new CustomMetricsAuthConfig struct in test setup
code, analogous to the change in broker_suite_test.go.
joergdw added 6 commits April 24, 2026 13:58
Replace the string-based credential helper dispatch with a type-switch
on config.BasicAuthHandlingImplConfig. This removes the need for
separate credHelperImpl string and StoredProcedureConfig pointer
parameters. The API server now only creates a credential provider
when CustomMetricsAuthConfig is present (non-nil).
…ig parser

Move the sealed interface BasicAuthHandlingImplConfig and its
implementations (BasicAuthHandlingNative, BasicAuthHandlingStoredProc)
from api/config to the models package so both api/config and
metricsforwarder/config can use them without circular imports.

Introduce metricsforwarder/config/parser.go with rawConfig/toConfig
pattern (analog to api/config/parser.go). The metricsforwarder Config
uses its own CredentialHelperConfig field (models.BasicAuthHandlingImplConfig)
instead of reusing the apiserver CustomMetricsAuthConfig.
Replace the string+pointer parameters (credHelperImpl, StoredProcedureConfig)
with a single *models.BasicAuthHandlingImplConfig parameter. Update all
callers in api/config, metricsforwarder/config, operator/config, and the
shared test helper ExpectConfigureDatabasesCalledOnce. Regenerated fakes.
Replace conf.CredHelperImpl assignments and assertions with the new
typed CredentialHelperConfig field (models.BasicAuthHandlingNative)
in metricsforwarder test setup and config validation tests.
Update ConfigureDatabases test calls to use the new
*models.BasicAuthHandlingImplConfig parameter instead of the old
(storedProcedureConfig, credHelperImpl) pair.
@sonarqubecloud
Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
6.6% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant