Code Monkey home page Code Monkey logo

config's People

Contributors

dependabot[bot] avatar emily-jiang avatar jansupol avatar joakime avatar ljnelson avatar m0mus avatar mpredli01 avatar otaviojava avatar radcortez avatar senivam avatar step-security-bot avatar tomas-langer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

config's Issues

Ability to change and pick up configurations at run time

As an application deployer, I expect that the deployed application and/or its frameworks have the ability to recognize configuration changes at run time and deal with them in some manner that maintains application integrity, so that I can update certain configuration values without having to restart the application.

Source: #27 (comment)

Ability to add configuration stores

As an application or framework developer, I expect that there will be a way to provide support for additional configuration store(s) so that I can provide configuration properties from run time environments (such as K8s secrets, vaults, etc.).

Source: #27 (comment)

Handling of missing configuration property

As a component developer, I want to be in charge of what to do when configuration property is missing eg.: I want to be informed when a configuration property is missing, and I may choose to do any of the following: throw an exception, substitute some other value, or perform some other action in response.

Programmatic APIs to load config and read config

Like Oracle Helidon SE, provides a simple Config to load the config by programmatic approaches.

Config config=Config.create(); // provides alternative to customize the source, converters, etc.

String hostname=config.get("hostname");
int port=config.get("port");

Security Best Practices

Hi,

I’m a member of the Eclipse Foundation Security Team. I’ve analyzed this repository with Scorecard and StepSecurity to check if it was applying some supply chain security best practices.

The following issue(s) has(ve) been detected:

As a result, you will see some PRs coming both from me and/or the StepSecurity bot to provide fixes for those issues. This issue will serve as the parent for those PRs.

Thanks!

Francisco Perez

Add bean validation integration

In a ConfigurationProperties bean described in #19, allow add bean validation annotation to validate the config by parsing/loading time.

Supporting mutability/events

As an app developer, I want to be able to discover changes in configuration to be able to update my component with such a changed configuration.

ConfigProviderResolver vs. ConfigProvider

According to javadoc and location the ConfigProviderResolver class is intended for implementors of Jakarta Config, as the main entry point. ConfigProvider is then the main entry point for a user.
ConfigProvider only allows user to get hold of a Config instance, but does not have any support for more advanced use cases (such as registration of config, creating a new config using a builder).

It may be useful to create static methods on ConfigProvider, so end user never needs to use ConfigProviderResolver class.

e.g.:
ConfigProvider.newBuilder()
ConfigProvider.register(Config config)

Display senstive config values not in clear text

As an operations person, I want a way to define parts of the config whose values will not printed out in clear text but only as e.g. '**********' Sometimes config is also used for critical information like secret data which must not show up in logs etc.

Delete config properties

As an application developer, deployer or tester or a framework developer or tester, I expect to be able to specify that a configuration property should be removed in the event that it would otherwise have a value, so that I can easily make necessary adjustments to the configuration at deployment or testing time.

Based on #27 (comment) with some modifications

The validation of configuration keys

As a configuration file author, I want to have a means to know what configuration keys will be recognized, so that I can avoid errors arising from key name mistakes.

Config Profiles

As an application developer, I want to specify config properties based on different environments (dev, prod, test, different db vendors, etc.).

Slack channel for config

Dear committers, a slack channel config was created for Jakarta Config. I have invited the committers whose email address is available to me and the ones who are already in Jakarta EE slack workspace. When you see an slack invitation email, please feel free to join the channel.

If you have not got the invitation and would like to join, please click this link and then click on Join our Slack Workspace. Once you get into slack workspace, you will see the channel config.

The channel is for some initial brain strom or idea discussion not for decision making.

Support config injection

As an application or framework developer, I expect to be able to use DI mechanisms to acquire strongly-typed configuration values, so that I can easily acquire configuration relevant to the component without having to use the programmatic API.

Source: #27 (comment)

Have Support to Map

I believe shortly that a Jakarta Configuration will be a glue to configuration such as CDI does to communicate among specifications.

It is essential to have a unique configuration for the whole specification, to get reliability, and reusability, to reduce the number of bugs, and so on.

Looking at several platforms, we have several configurations that require more than properties, such as JPA connection, NoSQL client, JMS connection, etc.

It will be terrific if we have support for a more dynamic type such as a Map<String, String>.

It uses the prefix as an injection, and then it will put a key/pair dynamically. So, given this properties:

# datasource configuration
jakarta.datasource.db-kind = postgresql
jakarta.datasource.username = hibernate
jakarta.datasource.password = hibernate
jakarta.datasource.jdbc.url = jdbc:postgresql://localhost:5432/hibernate_db
jakarta.datasource.properties.dyamic=123

Using the injection:

@Inject
@ConfigProperty(name="jakarta.datasource") 
private Map<String, String> map;

It will provide the following keys:

db-kind = postgresql
username = hibernate
password = hibernate
jdbc.url = jdbc:postgresql://localhost:5432/hibernate_db
properties.dyamic=123

Application with default value and the value can be overwritten

As an operations person, I want to be able to overwrite/tweak certain configuration values which come as part of the application.

Otoh it should not be required to provide every configured value by the ops team. Applications must work out of the box - tweaking configuration values should only be required if really needed.

Update Spec document to comply with Loader and Configuration javadoc

The Spec document needs to be updated:

  • The @ConfigMapping -> @Configuration
  • The META-INF/jakarta-config.properties source MUST be supported
  • The nested interface @Configuration annotation is ignored
  • ....
  • Any other discrepancy currently in the Spec document needs to be aligned with the currently up-to-date javadoc

How to version packages

In MicroProfile, we have been using OSGi semantic versioning and it has worked very well. We need a way to properly version our APIs.

Supporting meta-data (schema)

As an app deployer and container administrator I want to be able to discover expected configuration options of a deployment (application). Such a discovery should allow me to read configuration keys, expected type (boolean, String), configured default value, and description.

Mandatory configuration validation

As an application developer I want to mark mandatory configuration keys, so that if values for them are missing during startup the application will fail early and eagerly.

This is a configuration consistency check at startup.

ConfigProviderResolver should be an interface

This is a follow up to #6.

The ConfigProviderResolver class should be an interface (to provide more flexibility to implementer). The cache and service loader operations should be moved to a package local utility class used from static methods of the interface.

Support empty strings

As an app developer and tester, I want to be able to configure empty String values in String options to access resources that may use these as semantically correct values (such as empty passwords).

Jakarta Config meetings

Let's use this issue for discussing time slots for Jakarta Config meetings.

Since Jakarta Config mailing list is not created yet, let's use this issue for discussing time slots for Jakarta Config meetings. I created a Doodle poll here:

https://doodle.com/poll/8u2ezuf7pvksu846

I added time slots which work for me (sorry about it), but I am fine to add more slots for consideration.

Resolve the inevitable naming clashes

As an application assembler who integrates components that may be using Jakarta Config but which I didn't develop, I want to resolve the inevitable naming clashes.

Add ConfigruationProperties to group config properties

Provides a Spring @ConfigurationProperties or MP @ConfigProperties/@ConfigMapping like annotation on interface, record and POJO classes, etc. to group config properties.

@ConfigurationProperties(prefix="server")
public record ServerConfig(
    @ConfigProperty(name="protocol", defaultValue="http") //named to "protocol" and set default value to "http"
    String schema, 
    String host,
    int port
){}

Config must be deterministic

As an application deployer who deploys an assembled application into some environment representing a location in configuration space, I want to ensure that if the application is deployed and started in exactly the same way twice, with no attendant changes to its configuration, it will have the same state in both occurrences, i.e. I want to ensure configuration is deterministic.

Provide JDK type conversions

As a user of the configuration API and/or injection mechanisms, I expect there to be a range of default value type conversions so that I can have configuration values of common JDK value types without having to explicitly enable or implement those conversions.
Source: #27 (comment)

TypeToken.mostSpecializedParameterizedSuperclass(Type type) should not return null

If, for some strange reason, you do this...

TypeToken<?> t = new TypeToken() {};

then you get

java.lang.NullPointerException: Cannot invoke "java.lang.reflect.ParameterizedType.getActualTypeArguments()" because the return value of "typetoken.TypeToken.mostSpecializedParameterizedSuperclass(java.lang.reflect.Type)" is null

Given that mostSpecializedParameterizedSuperclass is a private method which is only ever called from the constructor of TypeToken, it isn't a good idea for it to ever return null. If it does ever return null (through misuse of TypeToken), the result will be a generic NPE rather than an specific exception with a helpful error message.

Suggest throwing some flavour of ConfigException rather than returning null. The exception message can be specific to the if block which is throwing it.

Alternatively, if mostSpecializedParameterizedSuperclass can return null, put a null check in the TypeToken constructor and throw the ConfigException from there. However, at this point you will have lost some context about what the (very unexpected) problem is.

Credit to @Azquelt for spotting this issue.

Move project to GitHub/jakartaee

As spec/api projects are being moved to GitHub/jakartaee, I wonder if the config team is ready to action this. It's a relatively simple operation, and redirects will be automatically put in place.

If the team members agree and give me permission, I can create the action bug to get this moved if needed.

Move this repo to https://github.com/jakartaee

In the steering committee we voted to moved all specification projects from eclipse-ee4j to jakartaee. As such this repo should move to in due time.

Moving is fairly automatic, and redirects will be automatically put in place from the current location here to the new location.

Extra from: https://www.eclipse.org/lists/jakarta.ee-spec/msg02073.html

"We voted on it in 2019 and then in 2020 we added it explicitly to our 2021 plan and voted on that plan. I think we just need to start executing. I sent about 30 emails like the following in an attempt to add some shape to it and kick off the move in the spec projects.

Also note that many projects have indeed moved: https://github.com/jakartaee/

Support to load a single value

Currently, Jakarta Config allows for loading config into an interface

@Configuration
public interface A {
   String value();
}

The most use-cases, however, are as follows:

if (config.property('NAME1')) {
     // do something
}
if (config.property('NAME2')) {
   // do something else
}

The convenient way is to allow the possibility to load the single value as Loader.bootstrap().path("NAME1").asString().
In MP config, there is a similar notion: config.getValue("NAME1", String.class)


There are the following possibilities:

  1. Allow just few methods: asInt(), asBoolean, asString
  2. Allow all primitive types: boolean, byte, short, float, double, int, long, char, and String
  3. Allow just asString() and more generic as(Class<T> type) and as(TypeToken type) - this has an advantage that later on the config could support as(UserDefinedType), but a disadvantage that we should define a way to pass convertors to the Loader.

The use-case usually checks whether the property is present. That can be implemented by:

  1. returning null when not available
  2. returning Optional<> (my favourite)
  3. throwing NoSuchObjectException
  4. implement a complementary isProperty()

In the case of Optional, it would be possible to use:
loader.path("my.property").asString().ifPresent(myProperty -> doSomething(myProperty))

Make Strings a first class citizen

Nice to have: As app developer, I want to read single String values without having to type a lot.

String values is a big part of configuration business. It should be easy to consume the configuration

Consider moving "troubleshooting" methods to another interface

Currently Config contains methods to access meta configuration ("ConfigConfig"), such as getConfigSources()

These methods may be confusing for end user, as they should not be used (except for troubleshooting purposes, or for some advanced use cases - @struberg, could you please share such a use case here?).

These may be moved to a separate class (and should be moved if we go with tree structure).

Property expression

As an app developer and tester, I want to be able to make my config value refer to other config property.

Support Nested Config

Support the nested config in a Map or Collection under another config, depends on #19

@ConfigurationProperties(prefix= "app")
class AppConfig{
String name;
Map<ServerConfig> servers;
}

@EachProperty//micronaut provides such a feature to configure property for  every nested config, etc.
class ServerConfig (){}

Support mutability/atomicity

As an app developer, I want to read multiple configuration values which belong together in an atomic way.

Often business logic doesn't only need a single value but multiple values which belong to each other. like a server hostname, port and path.
It should be possible to read them in a single atomic access.
If we support mutability, we need to ensure the atomic access.

Migrate code from MicroProfile Config to this repo

Since this repo is to rehome MicroProfile Config to Jakarta EE. The first step is to create a baseline on Jakarta Config. I will create a PR for this baseline and then we can discuss to take in feedback.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.