-
Notifications
You must be signed in to change notification settings - Fork 279
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[GWC-1363] Support Environment Parametrization for WMSLayer Credentials
This commit enhances security and configurability by enabling dynamic runtime resolution of HTTP Basic Authentication credentials for WMS layers. Credentials can now be injected from environment variables, reducing the need to hardcode sensitive values. This improves code maintainability, supports secure multi- environment deployments, and simplifies testing through dynamic configuration. 1. **Dynamic Environment Parametrization**: - Introduced `GeoWebCacheEnvironment#isAllowEnvParametrization()` to replace the static `ALLOW_ENV_PARAMETRIZATION` field, allowing runtime toggling. 2. **Environment Variable Resolution Refactor**: - Replaced direct static field checks with method calls. - Updated `resolveValue()` and related methods to use environment variables dynamically. 3. **WMS Credentials Management Update**: - Added `getResolvedHttpUsername()` and `getResolvedHttpPassword()` in `WMSHttpHelper`. - Created `setGeoWebCacheEnvironment()` for dependency injection. 4. **Testing Enhancements**: - Integrated the `system-rules` library for environment variable manipulation. - Added tests to cover default, custom, and parameterized credentials. 5. **Code Improvements**: - Replaced unsafe casts in `resolveValue()`. - Improved exception handling by switching from `Throwable` to `RuntimeException`. - Added better logging and documentation for credential handling.
- Loading branch information
Showing
12 changed files
with
567 additions
and
43 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.