File D:\maven-qcr-plugin-testsunitaires\qcr4java\jenkins-master\target\site\qc\core\src\main\java\hudson\cli\CliTransportAuthenticator.java.html

1 package hudson.cli;
2
3 import hudson.ExtensionList;
4 import hudson.ExtensionPoint;
5 import hudson.remoting.Channel;
6 import hudson.security.SecurityRealm;
7 import jenkins.model.Jenkins;
8
9 /**
10 * Perform {@link SecurityRealm} independent authentication.
11 *
12 * <p>
13 * Implementing this extension point requires changes in the CLI module, as during authentication
14 * neither side trusts each other enough to start code-transfer. But it does allow us to
15 * use different implementations of the same protocol.
16 *
17 * <h2>Current Implementations</h2>
18 * <p>
19 * Starting 1.419, CLI supports SSH public key based client/server mutual authentication.
20 * The protocol name of this is "ssh".
21 *
22 * @author Kohsuke Kawaguchi
23 * @since 1.419
24 */
25 public abstract class CliTransportAuthenticator implements ExtensionPoint {
26 /**
27 * Checks if this implementation supports the specified protocol.
28 *
29 * @param protocol
30 * Identifier. CLI.jar is hard-coded with the built-in knowledge about a specific protocol.
31 * @return
32 * true if this implementation supports the specified protocol,
33 * in which case {@link #authenticate(String, Channel, Connection)} would be called next.
34 */
35 public abstract boolean supportsProtocol(String protocol);
36
37 /**
38 * Performs authentication.
39 *
40 * <p>
41 * The authentication
42 *
43 * @param protocol
44 * Protocol identifier that {@link #supportsProtocol(String)} returned true.
45 * @param channel
46 * Communication channel to the client.
47 * @param con
48 */
49 public abstract void authenticate(String protocol, Channel channel, Connection con);
50
51 public static ExtensionList<CliTransportAuthenticator> all() {
52 return Jenkins.getInstance().getExtensionList(CliTransportAuthenticator.class);
53 }
54 }
55