// Path: mini-git-server-server/src/main/java/com/google/gerrit/server/IdentifiedUser.java
// public class IdentifiedUser extends CurrentUser {
// 	private final String username;
// 
// 	/** Create an IdentifiedUser, ignoring any per-request state. */
//   @Singleton
//   public static class GenericFactory {
//     public IdentifiedUser create(String username) {
//       return new IdentifiedUser(username);
//     }
//   }
// 
//   private static final Logger log =
//       LoggerFactory.getLogger(IdentifiedUser.class);
// 
//   private IdentifiedUser(String username) {
// 	  this.username = username;
//   }
// 
//   /** @return the user's user name; null if one has not been selected/assigned. */
//   public String getUserName() {
//     return username;
//   }
// 
//   public PersonIdent newRefLogIdent() {
//     return newRefLogIdent(new Date(), TimeZone.getDefault());
//   }
// 
//   public PersonIdent newRefLogIdent(final Date when, final TimeZone tz) {
//     String user = getUserName();
// 
//     String host = "unknown";
// 
//     return new PersonIdent(user, user + "@" + host, when, tz);
//   }
// 
//   public PersonIdent newCommitterIdent(final Date when, final TimeZone tz) {
// 
//       String user = getUserName();
// 
//       String host= "unknown";
// 
//       String email = user + "@" + host;
// 
//     return new PersonIdent(user, email, when, tz);
//   }
// 
//   @Override
//   public String toString() {
//     return "IdentifiedUser[" + getUserName() + "]";
//   }
// }
// 
// Path: mini-git-server-server/src/main/java/com/google/gerrit/server/ssh/SshInfo.java
// public interface SshInfo {
//   List<HostKey> getHostKeys();
// }
// 
// Path: mini-git-server-sshd/src/main/java/com/google/gerrit/sshd/SshScope.java
// static class Context {
//   private static final Key<RequestCleanup> RC_KEY =
//       Key.get(RequestCleanup.class);
// 
//   private final RequestCleanup cleanup;
//   private final SshSession session;
//   private final String commandLine;
//   private final Map<Key<?>, Object> map;
// 
//   final long created;
//   volatile long started;
//   volatile long finished;
// 
//   Context(final SshSession s, final String c) {
//     cleanup = new RequestCleanup();
//     session = s;
//     commandLine = c;
// 
//     map = new HashMap<Key<?>, Object>();
//     map.put(RC_KEY, cleanup);
// 
//     final long now = System.currentTimeMillis();
//     created = now;
//     started = now;
//     finished = now;
//   }
// 
//   private Context(Context p, SshSession s, String c) {
//     cleanup = new RequestCleanup();
//     session = s;
//     commandLine = c;
// 
//     map = new HashMap<Key<?>, Object>();
//     map.put(RC_KEY, cleanup);
// 
//     created = p.created;
//     started = p.started;
//     finished = p.finished;
// 
//     p.cleanup.add(cleanup);
//   }
// 
//   String getCommandLine() {
//     return commandLine;
//   }
// 
//   synchronized <T> T get(Key<T> key, Provider<T> creator) {
//     @SuppressWarnings("unchecked")
//     T t = (T) map.get(key);
//     if (t == null) {
//       t = creator.get();
//       map.put(key, t);
//     }
//     return t;
//   }
// 
//   synchronized Context subContext(SshSession newSession, String newCommandLine) {
//     return new Context(this, newSession, newCommandLine);
//   }
// }


import com.google.gerrit.server.IdentifiedUser;
import com.google.gerrit.server.config.CanonicalWebUrl;
import com.google.gerrit.server.ssh.SshInfo;
import com.google.gerrit.sshd.SshScope.Context;
import com.google.inject.Inject;
import com.google.inject.Provider;
import org.apache.sshd.common.Factory;
import org.apache.sshd.server.Command;
import org.apache.sshd.server.Environment;
import org.apache.sshd.server.ExitCallback;
import org.apache.sshd.server.SessionAware;
import org.apache.sshd.server.session.ServerSession;
import org.eclipse.jgit.lib.Constants;
import org.eclipse.jgit.util.SystemReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.MalformedURLException;
import java.net.URL;
      this.context = new Context(session.getAttribute(SshSession.KEY), "");
    }

    public void start(final Environment env) throws IOException {
      Context old = SshScope.set(context);
      String message;
      try {
        message = messageFactory.get().getMessage();
      } finally {
        SshScope.set(old);
      }
      err.write(Constants.encodeASCII(message.toString()));
      err.flush();

      in.close();
      out.close();
      err.close();
      exit.onExit(127);
    }

    public void destroy() {
    }
  }

  static class MessageFactory {
    private final IdentifiedUser user;
    private final SshInfo sshInfo;
    private final Provider<String> urlProvider;

    @Inject
// Path: mini-git-server-server/src/main/java/com/google/gerrit/server/IdentifiedUser.java
// public class IdentifiedUser extends CurrentUser {
// 	private final String username;
// 
// 	/** Create an IdentifiedUser, ignoring any per-request state. */
//   @Singleton
//   public static class GenericFactory {
//     public IdentifiedUser create(String username) {
//       return new IdentifiedUser(username);
//     }
//   }
// 
//   private static final Logger log =
//       LoggerFactory.getLogger(IdentifiedUser.class);
// 
//   private IdentifiedUser(String username) {
// 	  this.username = username;
//   }
// 
//   /** @return the user's user name; null if one has not been selected/assigned. */
//   public String getUserName() {
//     return username;
//   }
// 
//   public PersonIdent newRefLogIdent() {
//     return newRefLogIdent(new Date(), TimeZone.getDefault());
//   }
// 
//   public PersonIdent newRefLogIdent(final Date when, final TimeZone tz) {
//     String user = getUserName();
// 
//     String host = "unknown";
// 
//     return new PersonIdent(user, user + "@" + host, when, tz);
//   }
// 
//   public PersonIdent newCommitterIdent(final Date when, final TimeZone tz) {
// 
//       String user = getUserName();
// 
//       String host= "unknown";
// 
//       String email = user + "@" + host;
// 
//     return new PersonIdent(user, email, when, tz);
//   }
// 
//   @Override
//   public String toString() {
//     return "IdentifiedUser[" + getUserName() + "]";
//   }
// }
// 
// Path: mini-git-server-server/src/main/java/com/google/gerrit/server/ssh/SshInfo.java
// public interface SshInfo {
//   List<HostKey> getHostKeys();
// }
// 
// Path: mini-git-server-sshd/src/main/java/com/google/gerrit/sshd/SshScope.java
// static class Context {
//   private static final Key<RequestCleanup> RC_KEY =
//       Key.get(RequestCleanup.class);
// 
//   private final RequestCleanup cleanup;
//   private final SshSession session;
//   private final String commandLine;
//   private final Map<Key<?>, Object> map;
// 
//   final long created;
//   volatile long started;
//   volatile long finished;
// 
//   Context(final SshSession s, final String c) {
//     cleanup = new RequestCleanup();
//     session = s;
//     commandLine = c;
// 
//     map = new HashMap<Key<?>, Object>();
//     map.put(RC_KEY, cleanup);
// 
//     final long now = System.currentTimeMillis();
//     created = now;
//     started = now;
//     finished = now;
//   }
// 
//   private Context(Context p, SshSession s, String c) {
//     cleanup = new RequestCleanup();
//     session = s;
//     commandLine = c;
// 
//     map = new HashMap<Key<?>, Object>();
//     map.put(RC_KEY, cleanup);
// 
//     created = p.created;
//     started = p.started;
//     finished = p.finished;
// 
//     p.cleanup.add(cleanup);
//   }
// 
//   String getCommandLine() {
//     return commandLine;
//   }
// 
//   synchronized <T> T get(Key<T> key, Provider<T> creator) {
//     @SuppressWarnings("unchecked")
//     T t = (T) map.get(key);
//     if (t == null) {
//       t = creator.get();
//       map.put(key, t);
//     }
//     return t;
//   }
// 
//   synchronized Context subContext(SshSession newSession, String newCommandLine) {
//     return new Context(this, newSession, newCommandLine);
//   }
// }


// Path: mini-git-server-sshd/src/main/java/com/google/gerrit/sshd/NoShell.java
import com.google.gerrit.server.IdentifiedUser;
import com.google.gerrit.server.config.CanonicalWebUrl;
import com.google.gerrit.server.ssh.SshInfo;
import com.google.gerrit.sshd.SshScope.Context;
import com.google.inject.Inject;
import com.google.inject.Provider;
import org.apache.sshd.common.Factory;
import org.apache.sshd.server.Command;
import org.apache.sshd.server.Environment;
import org.apache.sshd.server.ExitCallback;
import org.apache.sshd.server.SessionAware;
import org.apache.sshd.server.session.ServerSession;
import org.eclipse.jgit.lib.Constants;
import org.eclipse.jgit.util.SystemReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.MalformedURLException;
import java.net.URL;

      this.context = new Context(session.getAttribute(SshSession.KEY), "");
    }

    public void start(final Environment env) throws IOException {
      Context old = SshScope.set(context);
      String message;
      try {
        message = messageFactory.get().getMessage();
      } finally {
        SshScope.set(old);
      }
      err.write(Constants.encodeASCII(message.toString()));
      err.flush();

      in.close();
      out.close();
      err.close();
      exit.onExit(127);
    }

    public void destroy() {
    }
  }

  static class MessageFactory {
    private final IdentifiedUser user;
    private final SshInfo sshInfo;
    private final Provider<String> urlProvider;

    @Inject
    MessageFactory(IdentifiedUser user, SshInfo sshInfo,