All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.ajoberstar.grgit.auth.AuthConfig.groovy Maven / Gradle / Ivy

There is a newer version: 1.8.0-rc.1
Show newest version
/*
 * Copyright 2012-2015 the original author or authors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.ajoberstar.grgit.auth

import org.ajoberstar.grgit.Credentials
import org.ajoberstar.grgit.exception.GrgitException

/**
 * Stores configuration options for how to authenticate with remote
 * repositories.
 *
 * 

* The following system properties can be set to configure how * authentication is performed with remote repositories. All "allow" * properties default to {@code true}. *

* *
    *
  • {@code org.ajoberstar.grgit.auth.force={hardcoded|interactive|sshagent|pageant}}
  • *
  • {@code org.ajoberstar.grgit.auth.hardcoded.allow={true|false}}
  • *
  • {@code org.ajoberstar.grgit.auth.interactive.allow={true|false}}
  • *
  • {@code org.ajoberstar.grgit.auth.sshagent.allow={true|false}}
  • *
  • {@code org.ajoberstar.grgit.auth.pageant.allow={true|false}}
  • *
* *

* In order to set default hardocded credentials, use the following properties. * Note that unless hardcoded credentials are disabled, using these properties * will supersede the use of interactive creds, ssh-agent, or Pageant. However, * they will not take precedence over credentials provided directly to a * repository during the clone, init, or open. *

* *
    *
  • {@code org.ajoberstar.grgit.auth.username=}
  • *
  • {@code org.ajoberstar.grgit.auth.password=}
  • *
* *

* In order to add a non-standard SSH key to use as your credentials, * use the following property. *

* *
    *
  • {@code org.ajoberstar.grgit.auth.ssh.private=}
  • *
* *

* The following order is used to determine which authentication option * is used. *

* *
    *
  1. Hardcoded credentials, if provided.
  2. *
  3. Ssh-Agent, if available.
  4. *
  5. Pageant, if available.
  6. *
  7. Interactive credentials, if needed.
  8. *
* * @since 0.2.0 */ class AuthConfig { /** * System property name used to force a specific authentication option. */ static final String FORCE_OPTION = 'org.ajoberstar.grgit.auth.force' static final String USERNAME_OPTION = 'org.ajoberstar.grgit.auth.username' static final String PASSWORD_OPTION = 'org.ajoberstar.grgit.auth.password' static final String SSH_PRIVATE_KEY_OPTION = 'org.ajoberstar.grgit.auth.ssh.private' /** * Set of all authentication options that are allowed in this * configuration. */ final Set




© 2015 - 2025 Weber Informatics LLC | Privacy Policy