Package org.eclipse.jgit.transport

Examples of org.eclipse.jgit.transport.UsernamePasswordCredentialsProvider


        File serverDir = new File("target/git/server/test.git");
        Utils.deleteRecursive(serverDir);
        Git.init().setBare(true).setDirectory(serverDir).call();

        JSch.setConfig("StrictHostKeyChecking", "no");
        CredentialsProvider.setDefault(new UsernamePasswordCredentialsProvider("sshd", "sshd"));
        GitSshdSessionFactory.setInstance(new GitSshdSessionFactory());

        File dir = new File("target/git/local/test.git");
        Utils.deleteRecursive(dir);
        Git.cloneRepository()
View Full Code Here


                .setMessage("changed")
                .setCommitter("admin", "admin@example.com")
                .call();
        git.push()
                .setRemote("origin")
                .setCredentialsProvider(new UsernamePasswordCredentialsProvider("admin", "admin"))
                .call();
        SpeakeasyUserPage page = product.visit(SpeakeasyUserPage.class);
        assertEquals("Git changed test", page.getPlugins().get("git").getName());
        page.uninstallPlugin("git");
    }
View Full Code Here

      log.debug("Creating git repo folder structure  ");
    }   
   
    String parentDirName = "/tmp/" + UUID.randomUUID().toString();
    CredentialsProvider credentialsProvider =
                                              new UsernamePasswordCredentialsProvider(
                                                                                      System.getProperty(CartridgeConstants.INTERNAL_GIT_USERNAME),
                                                                                      System.getProperty(CartridgeConstants.INTERNAL_GIT_PASSWORD).toCharArray());
    // Clone
    // --------------------------
    FileRepository localRepo = null;
View Full Code Here

    if (repoUsername != null && repoUsername.trim().length() > 0 && repoPassword != null
        && repoPassword.trim().length() > 0) {
      if (log.isDebugEnabled()) {
        log.debug("External repo credentails are passed: " + repoUsername);
      }
      credentialsProvider = new UsernamePasswordCredentialsProvider(repoUsername, repoPassword.toCharArray());
    }

    // Initialize temp local file repo
    FileRepository localRepo = null;
    try {
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

        initializeRepository();
    }

    void initializeRepository() {
        UsernamePasswordCredentialsProvider user = new UsernamePasswordCredentialsProvider(username, password);
        File workingDir = workspaceProvider.getRootDirectory();
        File gitDirectory = new File(workingDir, ".git");
        LOGGER.info("working dir: " + workingDir.getAbsolutePath());

        try {
View Full Code Here

    public void doInWorkingDirectory(String username,
                                     String password,
                                     String comment,
                                     String previousVersion,
                                     FileBasedProctorStore.ProctorUpdater updater) throws StoreException.TestUpdateException {
        UsernamePasswordCredentialsProvider user = new UsernamePasswordCredentialsProvider(username, password);
        final File workingDir = workspaceProvider.getRootDirectory();
        try {
            git = Git.open(workingDir);
            git.pull().setCredentialsProvider(user).call();
            final FileBasedProctorStore.RcsClient rcsClient = new GitProctorCore.GitRcsClient(git);
View Full Code Here

                          final Git git,
                          final String username,
                          final String password) {
        this.directory = directory;
        this.git = git;
        this.user = new UsernamePasswordCredentialsProvider(username, password);
    }
View Full Code Here

      log.debug("Creating git repo folder structure  ");
    }   
   
    String parentDirName = "/tmp/" + UUID.randomUUID().toString();
    CredentialsProvider credentialsProvider =
                                              new UsernamePasswordCredentialsProvider(
                                                                                      System.getProperty(CartridgeConstants.INTERNAL_GIT_USERNAME),
                                                                                      System.getProperty(CartridgeConstants.INTERNAL_GIT_PASSWORD).toCharArray());
    // Clone
    // --------------------------
    FileRepository localRepo = null;
View Full Code Here

     */
    private void pushToRemoteRepo(RepositoryContext gitRepoCtx) {

        PushCommand pushCmd = gitRepoCtx.getGit().push();
        if(!gitRepoCtx.getKeyBasedAuthentication()) {
            UsernamePasswordCredentialsProvider credentialsProvider = createCredentialsProvider(gitRepoCtx);
            if (credentialsProvider != null)
                pushCmd.setCredentialsProvider(credentialsProvider);
        }

        try {
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.