Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Runtime config retrieval and application #1290

Merged
merged 45 commits into from
Feb 3, 2025

Conversation

BehnamMozafari
Copy link
Contributor

@BehnamMozafari BehnamMozafari commented Jan 16, 2025

  • UIDOperatorVerticle gets latest config from injected IConfigService on each request and attaches it to routingcontext
  • Currently `"refresh_token_expires_after_seconds", "identity_token_expires_after_seconds", "refresh_identity_token_after_seconds", "max_bidstream_lifetime_seconds", "sharing_token_expiry_seconds" and "max_sharing_lifetime_seconds" are updated on each request.
  • ConfigService implements IConfigService and has a ConfigRetriever injected into it, which retrieves config from the core endpoint
    Feature Flag:
  • /conf/remote-config-feat-flag/remote-config-feat-flag.json used to toggle feature flag, will be overridden by volume mounted configmap
  • featureFlagConfigRetriever in Main.run() listens to changes in remote-config-feat-flag.json and calls ConfigServiceManager
  • ConfigServiceManager manages active config service through DelegatingConfigService (which implements IConfigService).

…e in UIDOperatorVerticleTest

"identity_token_expires_after_seconds", "max_bidstream_lifetime_seconds", "max_sharing_lifetime_seconds" and "sharing_token_expiry_seconds" now are retrieved from RoutingContext in handlers.
…nfigService

Moved validation logic from UIDOperatorVerticle and UIDOperatorService to ConfigValidatorUtil
configValidationHandler is set as a config processor for configRetriever in ConfigService
ConfigService returns a Future when created and takes ConfigRetriever in "create" method
"run()" method in Main waits for ConfigService Future to complete before creating UIDOperatorVerticle
Removed use of reflection to access private attributes/methods
Removed unnecessary tests
Updated remaining tests to inject ConfigRetriever into ConfigService
…ication

# Conflicts:
#	src/main/java/com/uid2/operator/Main.java
#	src/main/java/com/uid2/operator/service/UIDOperatorService.java
Set http store to optional
Added default value for max_bidstream_lifetime_seconds
ConfigServiceManager handles switching between dynamic and static config
StaticConfigService implements IConfigService, serving config from static files
Main creates new ConfigServiceManager instance and injects it into UIDOperatorVerticle
Also Added feature flag config value to local-config.json, Made create method static in ConfigServiceManager
Removed ConfigServiceManager from constructor
Allows for switches between static and dynamic config services without having to change UIDOperatorVerticle
ConfigRetriever in Main listens for feature flag changes and publishes to eventbus
ConfigServiceManager listens to eventbus and updates DelegatingConfigService active ConfigService
Added tests to verify config changes are reflected in endpoints
static config values are set from main config rather than ConfigService
- removed bootstrap config as a store from ConfigRetrieverFactory
- exclusive config retriever to listen to changes in mounted configmap
- listener directly interacts with ConfigServiceManager rather than publishing to EventBus
@BehnamMozafari BehnamMozafari self-assigned this Jan 16, 2025
@BehnamMozafari BehnamMozafari changed the title Runtime config retrieval and applicatoin Runtime config retrieval and application Jan 17, 2025
- Made feature flag json file generic
- Small refactoring
- ConfigRetrieverFactory now creates ConfigRetriever from bootstrap config
- Add runtime-config-defaults.json to serve as defaults for running locally
- Refactor Const names in Const.Config
- Update ConfigValidatorUtil log messages
- update config scan period for local-config.json
- remove unnecessary config values
- make ConfigRetrieverFactory create method static
- extract runtime config creation to helper method in Main
- Added token config validation to UIDOperatorService
- fix type inconsistencies
- minor code cleanup
- replace getConfig() method from BenchmarkCommon with final static fields
- Copy feat-flag.json file in dockerfiles
- Remove unnecessary config values
- Add runtime_config_store config value
@BehnamMozafari BehnamMozafari merged commit 418f2bf into main Feb 3, 2025
4 checks passed
@BehnamMozafari BehnamMozafari deleted the bmz-UID2-4606-runtime-config-application branch February 3, 2025 05:57
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