-
Notifications
You must be signed in to change notification settings - Fork 538
Description
What steps does it take to reproduce the issue?
While configuring blocked API endpoints today, I ran into two issues:
-
The documentation gives example values for
dataverse.api.blocked.endpointsthat start withapi/:
See https://guides.dataverse.org/en/6.8/installation/config.html#dataverse-api-blocked-endpoints
However, when I set
DATAVERSE_API_BLOCKED_ENDPOINTS=api/admin,api/builtin-usersthe endpoints were still unblocked and freely accessible.I had to set
DATAVERSE_API_BLOCKED_ENDPOINTS=admin,builtin-users.From looking at the code, I guess it makes sense, because it seems to me that the handling of the config values doesn't differ depending on if the config value comes from the old deprecated DB setting or the new JVM setting...
dataverse/src/main/java/edu/harvard/iq/dataverse/api/filter/ApiBlockingFilter.java
Lines 91 to 92 in 15f7b0d
endpointList = jvmEndpointList .orElse(settingsService.getValueForKey(SettingsServiceBean.Key.BlockedApiEndpoints, "")); dataverse/src/main/java/edu/harvard/iq/dataverse/api/filter/ApiBlockingFilter.java
Line 111 in 15f7b0d
updateBlockedPoints(endpointList); ..and the old setting docs give an example without
/api.
So it seems to me that the JVM setting documentation isn't correct...?
-
I received log warnings about my unblock key being weak, but I think it's an error in the code.
dataverse/src/main/java/edu/harvard/iq/dataverse/api/filter/ApiBlockingFilter.java
Lines 107 to 109 in 15f7b0d
} else if (passwordValidatorService.validate(key).size() == 0) { logger.warning("Weak unblock key detected. Please use a stronger key for better security."); } dataverse/src/main/java/edu/harvard/iq/dataverse/validation/PasswordValidatorServiceBean.java
Line 146 in ba35f99
* @return A List with error messages. Empty when the password is valid. If the length of the list returned by
validateis 0, it means there were no errors, so the key is fine and not weak, right?
Which version of Dataverse are you using?
6.8, but I checked and the issues seem to apply to current develop branch as well
Any related open or closed issues to this bug report?
Didn't find any
Are you thinking about creating a pull request for this issue?
Help is always welcome, is this bug something you or your organization plan to fix?
Sure