Authenticate a Tugboat Repository to a provider

Links a Tugboat Repository to a git repository at one of the supported providers.

Arguments

  • repo - Required
    The ID of the tugboat repository to authenticate

  • comment - Optional
    If true, the authentication is used by the provider to post comments to pull requests. Default = false.

Bitbucket

  • owner - Optional
    The Bitbucket repo "owner". This is not required when updating an existing Bitbucket authentication or when adding a comment authentication

  • slug - Optional
    The Bitbucket repo "slug", or repo name. This is not required when updating an existing Bitbucket authentication or when adding a comment authentication

One of the following sets of arguments is required. They are tried in this order if multiple sets are provided

  • refresh
    A Bitbucket OAuth refresh token

OR

  • user
    A Bitbucket username
  • apppass
    A Bitbucket application password for the provided user

OR

  • user
    A Bitbucket username
  • pass
    The password for the provided username

Tugboat does not store these values. It uses them to acquire an OAuth token from the Bitbucket API and then discards these values. When 2-factor authentication is enabled for a Bitbucket account, user/pass cannot be used for authentication

Git

  • url
    The URL to a plain git repository.

GitHub

  • owner - Optional
    The GitHub repo "owner". This is not required when updating an existing GitHub authentication or when adding a comment authentication

  • reponame - Optional
    The GitHub repo "name". This is not required when updating an existing GitHub authentication or when adding a comment authentication

One of the following sets of arguments is required. They are tried in this order if multiple sets are provided

  • token
    A GitHub personal access token

OR

  • access
    A GitHub OAuth access token

OR

  • user
    A GitHub account username
  • pass
    The password for the provided username
  • otp
    A 2-factor token for the provided account

Tugboat does not store these values. It uses them to acquire an OAuth token from the GitHub API and then discards these values.

GitLab

  • server - Optional
    If using a GitLab instance other than https://gitlab.com, specify the server URL here. This is not required when updating an existing GitLab authentication or when adding a comment authentication

  • app_id - Optional
    If using a GitLab instance other than https://gitlab.com, an OAuth application ID is required. This is not required when updating an existing GitLab authentication or when adding a comment authentication

  • app_secret - Optional
    If using a GitLab instance other than https://gitlab.com, an OAuth application Secret is required. This is not required when updating an existing GitLab authentication or when adding a comment authentication

  • namespace - Optional
    The GitLab repo "namespace". This is not required when updating an existing GitLab authentication or when adding a comment authentication

  • project - Optional
    The GitLab project name. This is not required when updating an existing GitLab authentication or when adding a comment authentication

One of the following sets of arguments is required. They are tried in this order if multiple sets are provided

  • token
    A GitLab personal access token

OR

  • access
    A GitLab OAuth access token

OR

  • user
    A GitLab account username
  • pass
    The password for the provided username

Tugboat does not store these values. It uses them to acquire an OAuth token from the GitLab API and then discards these values.

Stash/Bitbucket Server

  • server - Optional
    The URL to the Bitbucket Server or Stash instance. This is not required when updating an existing Bitbucket authentication or when adding a comment authentication

  • project - Optional
    The Bitbucket Server or Stash repo "project". This is not required when updating an existing authentication or when adding a comment authentication

  • slug - Optional
    The Bitbucket Server or Stash repo "slug", or repo name. This is not required when updating an existing authentication or when adding a comment authentication

  • git_port - Optional
    If using an SSH port for git checkouts other than the default 7999, specify it here. This is not required when updating an existing authentication or when adding a comment authentication

One of the following sets of arguments is required. They are tried in this order if multiple sets are provided

  • token
    A Bitbucket Server personal access token

OR

  • user
    A Bitbucket Server or Stash account username

  • pass
    The password for the provided Bitbucket Server or Stash account

When using user/pass authentication. Tugboat does store these values in plain text due to limitations on the Bitbucket Server and Stash API. If this is the authentication method you choose to use, we recommend setting up a "bot" account on your Bitbucket Server or Stash instance.

Example

socket.emit('tugboat', 'repos', 'auth', args, callback);

results matching ""

    No results matching ""