private void validateProjectKey(Key key) {
        if (StringUtils.isEmpty(key.getProject())) {
            throw new IllegalArgumentException("Project key is undefined");
        }
        if (StringUtils.isEmpty(key.getRole()) && (key.getRoles() == null || key.getRoles().isEmpty())) {
            throw new IllegalArgumentException("Invalid key: at least one role must be assigned to the key " + key.getProject());
        }
    }
Adds new project keys from the secure storage and removes previous project keys if any.
<p>
    Note. The method is blocking and shouldn't be run in the event loop thread.
</p>

@param projectKeys new projects to be added to the store.
server/src/main/java/com/epam/aidial/core/server/security/ApiKeyStore.java