-
Notifications
You must be signed in to change notification settings - Fork 566
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support Hocon/Json Configuration Source for MP (#4347)
* Support Hocon/Json Configuration Source for MP (#4218) * Support Hocon/Json Configuration Source for MP 1. Meta-config is refactored to allow it to be customizable by users for other types. 2. Hocon/Json is parsed as a config source only via meta-config. * Create hocon includer per instance of hocon config source and add justification comment for security bug filtering * Remove support of application.conf/json hocon/json as default discoverable sources * Initial commit for Mp config-source provider implementation * Add MP meta-config provider test for Environment Variables * Add Yaml MP meta-config provider tests and various resolution to review feedback * Add helidon-config-yaml-mp as a dependency of helidon-microprofile-cdi * Declare "uses io.helidon.config.mp.spi.MpMetaConfigProvider" in config-mp’s module-info and set priority of all implementations of MpMetaConfigProvider to 300 * Various updates/cleanups from review feedback * Add helidon-config-yaml dependency to metrics examples after they were failing because of dependency on yaml-mp * Replace javax.inject with jakarta.inject and javax.enterprise with jakarta.enterprise
- Loading branch information
Showing
79 changed files
with
2,944 additions
and
230 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
46 changes: 46 additions & 0 deletions
46
...onfig-mp/src/main/java/io/helidon/config/mp/MpEnvironmentVariablesMetaConfigProvider.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/* | ||
* Copyright (c) 2020, 2022 Oracle and/or its affiliates. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package io.helidon.config.mp; | ||
|
||
import java.util.List; | ||
import java.util.Set; | ||
|
||
import io.helidon.common.Prioritized; | ||
import io.helidon.config.Config; | ||
import io.helidon.config.mp.spi.MpMetaConfigProvider; | ||
|
||
import org.eclipse.microprofile.config.spi.ConfigSource; | ||
|
||
/** | ||
* Helidon MicroProfile meta-config provider for Environment Variables. | ||
*/ | ||
class MpEnvironmentVariablesMetaConfigProvider implements MpMetaConfigProvider, Prioritized { | ||
@Override | ||
public Set<String> supportedTypes() { | ||
return Set.of("environment-variables"); | ||
} | ||
|
||
@Override | ||
public List<? extends ConfigSource> create(String type, Config metaConfig, String profile) { | ||
return List.of(MpConfigSources.environmentVariables()); | ||
} | ||
|
||
@Override | ||
public int priority() { | ||
return 300; | ||
} | ||
} |
Oops, something went wrong.