adobe / bridgeService

The BridgeService is a library that allows your project to access java code to which you do not have implicite and normal access. Use cases are JS/Python/C++ accessing Java objects or java objects that are protected, and that you do not want to distribute as a library.
MIT License
6 stars 3 forks source link

Support for variable expansion of headers in environment variables #180

Closed maheshyem closed 1 month ago

maheshyem commented 1 month ago

Expected Behaviour

ibs-secret-xxx should be supported for environment variables

Actual Behaviour

ibs-secret-xxx is not supported for environment variables

Reproduce Scenario (including but not limited to)

Steps to Reproduce

For example set the header mailbox password environment variable with ibs-secret-mailboxPwd

{
    "callContent": {
        "fetchEmail": {
            "class": "com.adobe.campaign.tests.integro.tools.EmailClientTools",
            "method": "fetchEmail",
            "returnType": "java.util.ArrayList",
            "args": [
                null,
                "Happy Birthday"
            ]
        }
    },
    "environmentVariables": {
        "AC.UITEST.MAILING.PORT": "xxx",
        "AC.UITEST.MAILING.PREFIX": "xxx",
        "AC.UITEST.MAILING.PWD": "ibs-secret-mailboxPwd",
        "AC.UITEST.MAILING.PROVIDER": "xxx",
        "AC.UITEST.MAILING.FOLDER": "xxx",
        "AC.TEST.IMS.USER.TOKEN.ENABLED": "false"
    }
}

Platform and Version

{
  "deploymentMode": " - in production",
  "bridgeServiceVersion": "2.11.17",
  "hostVersion": "0.3.6.11",
  "overALLSystemState": "All systems up"
}

Sample Code that illustrates the problem

Provided above in steps

Logs taken while reproducing problem

{
    "title": "Error during call of target Java Class and Method.",
    "code": 500,
    "detail": "We experienced an exception when calling the provided method com.adobe.campaign.tests.integro.tools.EmailClientTools.fetchEmail.\nProvided error message : com.adobe.campaign.tests.integro.exceptions.TestAPIException: MessagingException message: [AUTHENTICATIONFAILED] Authentication failed.",
    "bridgeServiceException": "com.adobe.campaign.tests.bridge.service.exceptions.TargetJavaMethodCallException",
    "originalException": "com.adobe.campaign.tests.integro.exceptions.TestAPIException",
    "originalMessage": "MessagingException message: [AUTHENTICATIONFAILED] Authentication failed.",
    "failureAtStep": "fetchEmail",
    "stackTrace": [
        "com.adobe.campaign.tests.integro.tools.ClassicEmailClientTools.getConnectionStore(ClassicEmailClientTools.java:245)",
        "com.adobe.campaign.tests.integro.tools.ClassicEmailClientTools.fetchEmail(ClassicEmailClientTools.java:121)",
        "com.adobe.campaign.tests.integro.tools.ClassicEmailClientTools.fetchEmail(ClassicEmailClientTools.java:75)",
        "com.adobe.campaign.tests.integro.tools.ClassicEmailClientTools.fetchEmail(ClassicEmailClientTools.java:185)",
        "com.adobe.campaign.tests.integro.tools.EmailClientTools.fetchEmail(EmailClientTools.java:117)",
        "java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)",
        "java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)",
        "java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)",
        "java.base/java.lang.reflect.Method.invoke(Method.java:566)",
        "com.adobe.campaign.tests.bridge.service.CallContent.call(CallContent.java:172)",
        "com.adobe.campaign.tests.bridge.service.JavaCalls.lambda$call$0(JavaCalls.java:59)",
        "java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)",
        "java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)",
        "java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)",
        "java.base/java.lang.Thread.run(Thread.java:829)"
    ]
}
baubakg commented 1 month ago

problem reproduced. The problem is a header problem.