marklogic / ml-gradle

Gradle plugin for automating everything involving MarkLogic
Other
72 stars 78 forks source link

username required on mlInit #688

Closed kgmanuel closed 6 months ago

kgmanuel commented 9 months ago

Describe the bug At version 4.3.4, mlinit never required a username to be supplied. At 4.7.0, it now ends up with this error message:

Unable to connect to MarkLogic app server at http://localhost:8001; cause: username must be of type String

To Reproduce Steps to reproduce the behavior:

  1. create a build.gradle file with the following content:
    plugins {
    id "com.marklogic.ml-gradle" version "4.7.0"
    }
  2. run the mlInit command on a new install:
    gradle mlInit -PmlHost=localhost

Expected behavior complete, i.e. end up with Build Successful

rjrudin commented 9 months ago

The reason for this is covered in the 4.5.0 release notes - https://github.com/marklogic/ml-gradle/releases/tag/4.5.0 . All tasks now require mlUsername and mlPassword to be specified, as those no longer default to values of "admin" (which has long been a bad security practice).

rjrudin commented 9 months ago

@kgmanuel https://docs.marklogic.com/REST/POST/admin/v1/init states that it's possible to call the init endpoint without any authentication if no authentication has been setup. Was that the case in your test, or had you already configured authentication for MarkLogic?

kgmanuel commented 9 months ago

@rjrudin i was just about to post the details of the function docs. This is a fresh install of a marklogic cluster. i wasn't aware that init would be used/useable on an already configured instance (to update license).

I think the same applies for /admin/v1/instance-admin. the equivalent task is mlInstallAdmin. And this task uses a different set of input, i.e. mlAdminUsername and mlAdminPassword. Hence, mlUsername and mlPassword should also not be required.