Skip to content

Commit

Permalink
Merge pull request #5007 from poikilotherm/5006-enhance-secretdir
Browse files Browse the repository at this point in the history
FISH-788 Support sub-directories for MPCONFIG SecretDirConfigSource. #5006
  • Loading branch information
Alan committed Feb 1, 2021
1 parent fa786d5 commit 0f5e522
Show file tree
Hide file tree
Showing 7 changed files with 948 additions and 353 deletions.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,12 @@ public PayaraConfigSource() {
configService = null;
}

/**
* Should only be used for test purposes
* @param configService Usually a mocked implementation
*/
PayaraConfigSource(ConfigProviderResolverImpl configService) {
this.domainConfiguration = null;
this.configService = configService;
}
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
import fish.payara.nucleus.microprofile.config.converters.CharacterConverter;
import fish.payara.nucleus.microprofile.config.converters.ShortConverter;
import fish.payara.nucleus.microprofile.config.source.PayaraExpressionConfigSource;
import fish.payara.nucleus.executorservice.PayaraExecutorService;
import org.eclipse.microprofile.config.Config;
import org.eclipse.microprofile.config.spi.ConfigBuilder;
import org.eclipse.microprofile.config.spi.ConfigProviderResolver;
Expand Down Expand Up @@ -102,7 +103,7 @@
import fish.payara.nucleus.microprofile.config.source.PasswordAliasConfigSource;
import fish.payara.nucleus.microprofile.config.source.PayaraServerProperties;
import fish.payara.nucleus.microprofile.config.source.PropertiesConfigSource;
import fish.payara.nucleus.microprofile.config.source.SecretsDirConfigSource;
import fish.payara.nucleus.microprofile.config.source.DirConfigSource;
import fish.payara.nucleus.microprofile.config.source.ServerConfigSource;
import fish.payara.nucleus.microprofile.config.source.SystemPropertyConfigSource;

Expand Down Expand Up @@ -131,6 +132,10 @@ public class ConfigProviderResolverImpl extends ConfigProviderResolver {

@Inject
private ServerContext context;

// Some sources might want to execute background tasks in a controlled fashion
@Inject
private PayaraExecutorService executorService;

// Gives access to deployed applications
@Inject
Expand Down Expand Up @@ -284,6 +289,10 @@ public ConfigBuilder getBuilder() {
return new PayaraConfigBuilder(this);
}

public PayaraExecutorService getExecutor() {
return this.executorService;
}

Config getNamedConfig(String applicationName) {
Config result = null;
ApplicationInfo info = applicationRegistry.get(applicationName);
Expand All @@ -309,7 +318,7 @@ private List<ConfigSource> getDefaultSources(String appName, String moduleName)
sources.add(new SystemPropertyConfigSource());
sources.add(new JNDIConfigSource());
sources.add(new PayaraServerProperties());
sources.add(new SecretsDirConfigSource());
sources.add(new DirConfigSource());
sources.add(new PasswordAliasConfigSource());
if (appName != null) {
sources.add(new ApplicationConfigSource(appName));
Expand Down
Loading

0 comments on commit 0f5e522

Please sign in to comment.