Skip to content

Issues when configuring blocked API endpoint policy #12232

Description

@vera

What steps does it take to reproduce the issue?

While configuring blocked API endpoints today, I ran into two issues:

  1. The documentation gives example values for dataverse.api.blocked.endpoints that start with api/:

    Image

    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-users the 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...

    endpointList = jvmEndpointList
    .orElse(settingsService.getValueForKey(SettingsServiceBean.Key.BlockedApiEndpoints, ""));

    ..and the old setting docs give an example without /api.

    Image

    So it seems to me that the JVM setting documentation isn't correct...?

  2. I received log warnings about my unblock key being weak, but I think it's an error in the code.

    } else if (passwordValidatorService.validate(key).size() == 0) {
    logger.warning("Weak unblock key detected. Please use a stronger key for better security.");
    }

    * @return A List with error messages. Empty when the password is valid.

    If the length of the list returned by validate is 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

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

Status
In Progress 💻

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions