Uploaded image for project: 'WildFly'
  1. WildFly
  2. WFLY-8077

datasource subsystem - credential-reference doesn't work

    XMLWordPrintable

Details

    • Hide

      clone https://github.com/simkam/wildfly/commits/credential-reference
      and run tests
      mvn test -Dtest=CredentialReferenceDatasourceTestCase -DtestLogToFile=false

      or with fix for #1

      /subsystem=elytron/credential-store=store001:add(uri="cr-store://test/store001.jceks?create.storage=true", relative-to="jboss.server.data.dir", credential-reference={clear-text=joshua})
      /subsystem=elytron/credential-store=store001/alias=alias001:add(secret-value=chucknorris)
      /subsystem=datasources/data-source=test:add(connection-url="jdbc:h2:mem:test;DB_CLOSE_DELAY=-1", jndi-name="java:jboss/datasources/test", driver-name=h2, user-name=sa, credential-reference={store=store001, alias=alias001}
      
      Show
      clone https://github.com/simkam/wildfly/commits/credential-reference and run tests mvn test -Dtest=CredentialReferenceDatasourceTestCase -DtestLogToFile=false or with fix for #1 /subsystem=elytron/credential-store=store001:add(uri= "cr-store: //test/store001.jceks?create.storage= true " , relative-to= "jboss.server.data.dir" , credential-reference={clear-text=joshua}) /subsystem=elytron/credential-store=store001/alias=alias001:add(secret-value=chucknorris) /subsystem=datasources/data-source=test:add(connection-url= "jdbc:h2:mem:test;DB_CLOSE_DELAY=-1" , jndi-name= "java:jboss/datasources/test" , driver-name=h2, user-name=sa, credential-reference={store=store001, alias=alias001}

    Description

      There are more issues:

      1. credential reference is always (not)resolved to undefined. It works with ExampleDS and H2 because it accepts any password.
        I tried to fix it in f512ce274c8837f642e0a7a949018acdfd2a017e
      1. when #1 is fixed, <credential-reference clear-text="pass" /> works, but <credential-reference store="store" alias="alias" /> doesn't.
        18:00:07,970 ERROR [org.jboss.as.controller.management-operation] (management-handler-thread - 2) WFLYCTL0013: Operation ("add") failed - address: ([
            ("subsystem" => "datasources"),
            ("data-source" => "StoreAliasCredentialReferenceDatasource")
        ]): java.lang.IllegalArgumentException: value is null
                at org.jboss.dmr.ModelNode.<init>(ModelNode.java:167)
                at org.jboss.as.controller.OperationFailedException.<init>(OperationFailedException.java:59)
                at org.jboss.as.controller.OperationFailedException.<init>(OperationFailedException.java:98)
                at org.jboss.as.connector.subsystems.datasources.DataSourceModelNodeUtil.from(DataSourceModelNodeUtil.java:192)
                at org.jboss.as.connector.subsystems.datasources.AbstractDataSourceAdd.secondRuntimeStep(AbstractDataSourceAdd.java:328)
                at org.jboss.as.connector.subsystems.datasources.AbstractDataSourceAdd$1.execute(AbstractDataSourceAdd.java:137)
                at org.jboss.as.controller.AbstractOperationContext.executeStep(AbstractOperationContext.java:921)
                at org.jboss.as.controller.AbstractOperationContext.processStages(AbstractOperationContext.java:664)
                at org.jboss.as.controller.AbstractOperationContext.executeOperation(AbstractOperationContext.java:383)
                at org.jboss.as.controller.OperationContextImpl.executeOperation(OperationContextImpl.java:1390)
                at org.jboss.as.controller.ModelControllerImpl.internalExecute(ModelControllerImpl.java:419)
                at org.jboss.as.controller.ModelControllerImpl.lambda$execute$1(ModelControllerImpl.java:240)
                at org.wildfly.security.auth.server.SecurityIdentity.runAs(SecurityIdentity.java:193)
                at org.jboss.as.controller.ModelControllerImpl.execute(ModelControllerImpl.java:240)
                at org.jboss.as.controller.remote.ModelControllerClientOperationHandler$ExecuteRequestHandler.doExecute(ModelControllerClientOperationHandler.java:217)
                at org.jboss.as.controller.remote.ModelControllerClientOperationHandler$ExecuteRequestHandler.access$400(ModelControllerClientOperationHandler.java:137)
                at org.jboss.as.controller.remote.ModelControllerClientOperationHandler$ExecuteRequestHandler$1$1.run(ModelControllerClientOperationHandler.java:161)
                at org.jboss.as.controller.remote.ModelControllerClientOperationHandler$ExecuteRequestHandler$1$1.run(ModelControllerClientOperationHandler.java:157)
                at org.wildfly.security.auth.server.SecurityIdentity.runAs(SecurityIdentity.java:212)
                at org.jboss.as.controller.AccessAuditContext.doAs(AccessAuditContext.java:254)
                at org.jboss.as.controller.AccessAuditContext.doAs(AccessAuditContext.java:225)
                at org.jboss.as.controller.remote.ModelControllerClientOperationHandler$ExecuteRequestHandler$1.execute(ModelControllerClientOperationHandler.java:157)
                at org.jboss.as.protocol.mgmt.ManagementRequestContextImpl$1.doExecute(ManagementRequestContextImpl.java:70)
                at org.jboss.as.protocol.mgmt.ManagementRequestContextImpl$AsyncTaskRunner.run(ManagementRequestContextImpl.java:160)
                at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
                at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
                at java.lang.Thread.run(Thread.java:745)
                at org.jboss.threads.JBossThread.run(JBossThread.java:320)
        

      https://github.com/simkam/wildfly/commits/credential-reference contains tests and fix for #1

      Attachments

        Issue Links

          Activity

            People

              smaestri@redhat.com Stefano Maestri
              smaestri@redhat.com Stefano Maestri
              Martin Simka Martin Simka
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: