Package org.eclipse.jgit.transport

Examples of org.eclipse.jgit.transport.UsernamePasswordCredentialsProvider


  private void testCommitterVerification(UserModel user, String displayName, String emailAddress, boolean expectedSuccess) throws Exception {

    delete(user);

    CredentialsProvider cp = new UsernamePasswordCredentialsProvider(user.username, user.password);

    // fork from original to a temporary bare repo
    File verification = new File(GitBlitSuite.REPOSITORIES, "refchecks/verify-committer.git");
    if (verification.exists()) {
      FileUtils.delete(verification, FileUtils.RECURSIVE);
View Full Code Here


  private void testMergeCommitterVerification(boolean expectedSuccess) throws Exception {
    UserModel user = getUser();

    delete(user);

    CredentialsProvider cp = new UsernamePasswordCredentialsProvider(user.username, user.password);

    // fork from original to a temporary bare repo
    File verification = new File(GitBlitSuite.REPOSITORIES, "refchecks/verify-committer.git");
    if (verification.exists()) {
      FileUtils.delete(verification, FileUtils.RECURSIVE);
View Full Code Here

    repositories().updateRepositoryModel(origin.name, origin, false);

    UserModel user = getUser();
    delete(user);

    CredentialsProvider cp = new UsernamePasswordCredentialsProvider(user.username, user.password);

    // fork from original to a temporary bare repo
    File refChecks = new File(GitBlitSuite.REPOSITORIES, forkName);
    if (refChecks.exists()) {
      FileUtils.delete(refChecks, FileUtils.RECURSIVE);
View Full Code Here

    user.canCreate = canCreate;
    user.canAdmin = canAdmin;

    gitblit().addUser(user);

    CredentialsProvider cp = new UsernamePasswordCredentialsProvider(user.username, user.password);

    // fork from original to a temporary bare repo
    File tmpFolder = File.createTempFile("gitblit", "").getParentFile();
    File createCheck = new File(tmpFolder, "ticgit.git");
    if (createCheck.exists()) {
View Full Code Here

          continue;
        }
      }

      // clone/pull this repository
      CredentialsProvider credentials = new UsernamePasswordCredentialsProvider(
          Constants.FEDERATION_USER, registration.token);
      logger.info(MessageFormat.format("Pulling federated repository {0} from {1} @ {2}",
          repository.name, registration.name, registration.url));

      CloneResult result = JGitUtils.cloneRepository(registrationFolderFile, repository.name,
View Full Code Here

    JschConfigTestSessionFactory sessionFactory = new JschConfigTestSessionFactory(roKeyPair);
    SshSessionFactory.setInstance(sessionFactory);

    CloneCommand clone = Git.cloneRepository();
    clone.setCredentialsProvider(new UsernamePasswordCredentialsProvider(username, password));
    clone.setURI(MessageFormat.format("{0}/ticgit.git", url));
    clone.setDirectory(ticgitFolder);
    clone.setBare(false);
    clone.setCloneAllBranches(true);
    Git git = clone.call();
View Full Code Here

  @Test
  public void testListRemote_Dumb_Auth() throws Exception {
    Repository dst = createBareRepository();
    Transport t = Transport.open(dst, dumbAuthBasicURI);
    t.setCredentialsProvider(new UsernamePasswordCredentialsProvider(
        AppServer.username, AppServer.password));
    try {
      t.openFetch();
    } finally {
      t.close();
    }
    t = Transport.open(dst, dumbAuthBasicURI);
    t.setCredentialsProvider(new UsernamePasswordCredentialsProvider(
        AppServer.username, ""));
    try {
      t.openFetch();
      fail("connection opened even info/refs needs auth basic and we provide wrong password");
    } catch (TransportException err) {
View Full Code Here

   * @throws IOException
   */
  public Repo(String branchName) throws IOException {
    try {
      prop.load(new FileInputStream("git.properties"));
      this.upc = new UsernamePasswordCredentialsProvider(prop.getProperty("username").trim(),
                                 prop.getProperty("password").trim());
    } catch (Exception e) {
      e.printStackTrace();
    }
    this.branchName = branchName;
View Full Code Here

     */
    public static CredentialsProvider getCredentials( GitScmProviderRepository repository )
    {
        if ( StringUtils.isNotBlank( repository.getUser() ) && StringUtils.isNotBlank( repository.getPassword() ) )
        {
            return new UsernamePasswordCredentialsProvider( repository.getUser().trim(),
                                                            repository.getPassword().trim() );
        }
        return null;
    }
View Full Code Here

        Git.cloneRepository()
                .setURI(gitUrl)
                .setDirectory(new File(directory))
                .setCloneAllBranches(true)
                .setBare(true)
                .setCredentialsProvider(new UsernamePasswordCredentialsProvider(authId, authPw))
                .call();
    }
View Full Code Here

TOP

Related Classes of org.eclipse.jgit.transport.UsernamePasswordCredentialsProvider

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.