Projects >> hudson >>9e68fed9fe7c493d8a22bf5583154e7c843c660f

Chunk
Conflicting content
            || rest.startsWith("/signup")
            || rest.startsWith("/tcpSlaveAgentListener")
            // XXX SlaveComputer.doSlaveAgentJnlp; there should be an annotation to request unprotected access
<<<<<<< HEAD
            || rest.matches("/computer/[^/]+/slave-agent[.]jnlp") && "true".equals(Stapler.getCurrentRequest().getParameter("encrypt"))
=======
            || rest.matches("/computer/.+/slave-agent[.]jnlp") && "true".equals(Stapler.getCurrentRequest().getParameter("encrypt"))
>>>>>>> 17d152817f6cce6a230147d3be8c49de232dc153
            || rest.startsWith("/cli")
            || rest.startsWith("/federatedLoginService/")
            || rest.startsWith("/securityRealm"))
Solution content
            || rest.startsWith("/signup")
            || rest.startsWith("/tcpSlaveAgentListener")
            // XXX SlaveComputer.doSlaveAgentJnlp; there should be an annotation to request unprotected access
            || rest.matches("/computer/[^/]+/slave-agent[.]jnlp") && "true".equals(Stapler.getCurrentRequest().getParameter("encrypt"))
            || rest.startsWith("/cli")
            || rest.startsWith("/federatedLoginService/")
            || rest.startsWith("/securityRealm"))
File
Jenkins.java
Developer's decision
Version 1
Kind of conflict
Method invocation
Chunk
Conflicting content
        }
    }
<<<<<<< HEAD
    @PresetData(DataSet.ANONYMOUS_READONLY)
    public void testAnonymousCannotGetSecrets() throws Exception {
        jenkins.setNodes(Collections.singletonList(createNewJnlpSlave("test")));
=======
        // XXX this should be the only part with ANONYMOUS_READONLY
>>>>>>> 17d152817f6cce6a230147d3be8c49de232dc153
        try {
            new WebClient().goTo("computer/test/slave-agent.jnlp", "application/x-java-jnlp-file");
            fail("anonymous users must not be able to get secrets");
Solution content
        }
    }

    @PresetData(DataSet.ANONYMOUS_READONLY)
    public void testAnonymousCannotGetSecrets() throws Exception {
        jenkins.setNodes(Collections.singletonList(createNewJnlpSlave("test")));
        try {
            new WebClient().goTo("computer/test/slave-agent.jnlp", "application/x-java-jnlp-file");
            fail("anonymous users must not be able to get secrets");
File
JnlpAccessWithSecuredHudsonTest.java
Developer's decision
Version 1
Kind of conflict
Annotation
Comment
Method invocation
Method signature
Chunk
Conflicting content
        }
    }

<<<<<<< HEAD
    @PresetData(DataSet.NO_ANONYMOUS_READACCESS)
    @SuppressWarnings("SleepWhileInLoop")
    public void testServiceUsingDirectSecret() throws Exception {
        Slave slave = createNewJnlpSlave("test");
        jenkins.setNodes(Collections.singletonList(slave));
        new WebClient().goTo("computer/test/slave-agent.jnlp?encrypt=true", "application/octet-stream");
        String secret = slave.getComputer().getJnlpMac();
        // To watch it fail: secret = secret.replace('1', '2');
        ProcessBuilder pb = new ProcessBuilder(JavaEnvUtils.getJreExecutable("java"), "-jar", Which.jarFile(Launcher.class).getAbsolutePath(), "-jnlpUrl", getURL() + "computer/test/slave-agent.jnlp", "-secret", secret);
        try {
            pb = (ProcessBuilder) ProcessBuilder.class.getMethod("inheritIO").invoke(pb);
        } catch (NoSuchMethodException x) {
            // prior to Java 7
        }
        System.err.println("Running: " + pb.command());
        Process p = pb.start();
        try {
            for (int i = 0; i < /* one minute */600; i++) {
                if (slave.getComputer().isOnline()) {
                    System.err.println("JNLP slave successfully connected");
                    return;
                }
                Thread.sleep(100);
            }
            fail("JNLP slave agent failed to connect");
        } finally {
            p.destroy();
        }
    }
=======
    // XXX try to use -secret
>>>>>>> 17d152817f6cce6a230147d3be8c49de232dc153

}
Solution content
        }
    }

    @PresetData(DataSet.NO_ANONYMOUS_READACCESS)
    @SuppressWarnings("SleepWhileInLoop")
    public void testServiceUsingDirectSecret() throws Exception {
        Slave slave = createNewJnlpSlave("test");
        jenkins.setNodes(Collections.singletonList(slave));
        new WebClient().goTo("computer/test/slave-agent.jnlp?encrypt=true", "application/octet-stream");
        String secret = slave.getComputer().getJnlpMac();
        // To watch it fail: secret = secret.replace('1', '2');
        ProcessBuilder pb = new ProcessBuilder(JavaEnvUtils.getJreExecutable("java"), "-jar", Which.jarFile(Launcher.class).getAbsolutePath(), "-jnlpUrl", getURL() + "computer/test/slave-agent.jnlp", "-secret", secret);
        try {
            pb = (ProcessBuilder) ProcessBuilder.class.getMethod("inheritIO").invoke(pb);
        } catch (NoSuchMethodException x) {
            // prior to Java 7
        }
        System.err.println("Running: " + pb.command());
        Process p = pb.start();
        try {
            for (int i = 0; i < /* one minute */600; i++) {
                if (slave.getComputer().isOnline()) {
                    System.err.println("JNLP slave successfully connected");
                    return;
                }
                Thread.sleep(100);
            }
            fail("JNLP slave agent failed to connect");
        } finally {
            p.destroy();
        }
    }

}
File
JnlpAccessWithSecuredHudsonTest.java
Developer's decision
Version 1
Kind of conflict
Annotation
Comment
Method declaration