public void configureAuthentication()

in src/main/java/org/apache/maven/plugins/changes/github/GitHubDownloader.java [182:206]


    public void configureAuthentication(
            SettingsDecrypter decrypter, String githubAPIServerId, Settings settings, Log log) {
        boolean configured = false;

        List<Server> servers = settings.getServers();

        for (Server server : servers) {
            if (server.getId().equals(githubAPIServerId)) {
                SettingsDecryptionResult result = decrypter.decrypt(new DefaultSettingsDecryptionRequest(server));
                for (SettingsProblem problem : result.getProblems()) {
                    log.error(problem.getMessage(), problem.getException());
                }
                server = result.getServer();
                String password = server.getPassword();
                client.withJwtToken(password);

                configured = true;
                break;
            }
        }

        if (!configured) {
            log.warn("Can't find server id [" + githubAPIServerId + "] configured in settings.xml");
        }
    }