Skip to content

Suggest OAuth Store path as ENV variable #497

Description

@dhakehurst

Each of the refimpl services contains its own 'AuthenticationApplication' class with a hard coded relative path to the oslcOAuthStore.xml file.

to improve the ability to map this file to a docker volume, enabling one to more easily set provisional to false for entries in the file.
I suggest you make it configurable with an environment variable.

e.g.

    private AuthenticationApplication() {
        // Start of user code constructor_init
        // End of user code
        var AUTH_VAR = "OAUTH_STORE_FILE";
        final Map<String, String> env = System.getenv();
        oslcConsumerStoreFilename= "./oslcOAuthStore.xml";
        if (env.containsKey(AUTH_VAR)) {
            oslcConsumerStoreFilename = env.get(AUTH_VAR);
            log.debug("ENV variable '{}' found", AUTH_VAR);
        } else {
            log.debug("ENV variable '{}' not defined", AUTH_VAR);
        }
        oauth1TokenToApplicationConnector = new LRUCache<String, String>(2000);
        // Start of user code constructor_finalize
        // End of user code
    }

Activity

  1. berezovskyi commented on Feb 5, 2026

    @berezovskyi
    Member

    This sounds reasonable. Until Lyo adopts Jakarta Config, we should obtain the config value using https://github.com/eclipse-lyo/lyo.designer/blob/c40d2725828f1c0f300ba479cf098e5fe9cb8166/org.eclipse.lyo.oslc4j.codegenerator/src/org/eclipse/lyo/oslc4j/codegenerator/files/generateAdaptorServletListener.mtl#L156-L175 - this is what we use for the rest of the configurable properties with a predictable fallback. Would you be interested to submit a PR?

    You can make a PR on this repo and then ask @Jad-el-khoury to lift the change into https://github.com/eclipse-lyo/lyo.designer/tree/master/org.eclipse.lyo.oslc4j.codegenerator/src/org/eclipse/lyo/oslc4j/codegenerator

  2. dhakehurst commented on Feb 6, 2026

    @dhakehurst
    Author
  3. berezovskyi commented on Feb 6, 2026

    @berezovskyi
    Member

    @dhakehurst I just has a call with @Jad-el-khoury and briefly discussed this. Jad told me that it should be possible to map oslcOAuthStore.xml from outside the container without this code change. May I ask you to clarify again what is the challenge you are facing with the current behaviour, please?

  4. dhakehurst commented on Feb 6, 2026

    @dhakehurst
    Author
  5. berezovskyi commented on Feb 6, 2026

    @berezovskyi
    Member

    @dhakehurst please check out #503. The file on your side (outside the container) can be wherever you want.

  6. Jad-el-khoury commented on Feb 6, 2026

    @Jad-el-khoury
    Member

    Of course it's still good to define the path. it's too hard-coded indeed. So we can still do this MR. And you still have to map it to a docker volume anyway.

  7. dhakehurst commented on Feb 9, 2026

    @dhakehurst
    Author

    The file on your side (outside the container) can be wherever you want.

    but it is not clear where the path is inside the container, hence my request.

    So we can still do this MR.\

    great

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions