Version Requirement: The GitLab Git connection requires Apidog On-Premises image version 2.7.29 or later.
GitLab Configuration#
To integrate with GitLab, create a new OAuth app in the GitLab settings. For the GitLab SaaS version, visit the following URL:https://gitlab.com/-/user_settings/applications.
Configuration Steps#
1.
Redirect Callback URL: Set the callback URL to your Apidog On-Premises API domain, followed by /api/v1/projects/git-connections/gitlab-callback.https://your-apidog-domain.com/api/v1/projects/git-connections/gitlab-callback
2.
Scopes: Ensure that the api scope is selected.
3.
Once the OAuth app is created, make a note of the Application ID and Application Secret. Then, configure the following environment variables:
| Environment Variable | Description | Default Value | Notes |
|---|
GIT_CONNECTION_GITLAB_COM_ENABLE | Whether to enable GitLab.com connection | false | Set to true to enable GitLab.com integration |
GITLAB_COM_AUTH_HOST | GitLab.com authentication host URL | - | Use https://gitlab.com for SaaS GitLab or your enterprise GitLab host |
GITLAB_COM_KEY | GitLab.com OAuth application client ID | - | Required for GitLab OAuth authentication |
GITLAB_COM_SECRET | GitLab.com OAuth application client secret | - | Required for GitLab OAuth authentication |
GITLAB_SCOPE | GitLab OAuth scope permissions | - | Define required permissions (e.g., api, read_user, read_repository). Must match the scope configured in your GitLab application |
GITLAB_REDIRECT_URI | GitLab OAuth redirect URI | - | Must match the redirect URI configured in your GitLab application |
GIT_CONNECTION_GITLAB_COM_REJECT_UNAUTHORIZED | SSL certificate validation for GitLab.com | true | Set to false for self-signed certificates in enterprise environments |
Configuration Example for GitLab SaaS Version#
- name: GIT_CONNECTION_GITLAB_COM_ENABLE
value: 'true'
- name: GITLAB_COM_AUTH_HOST
value: 'https://gitlab.com'
- name: GITLAB_COM_KEY
value: <your-gitlab-client-id>
- name: GITLAB_COM_SECRET
value: <your-gitlab-client-secret>
- name: GITLAB_SCOPE
value: 'api'
- name: GITLAB_REDIRECT_URI
value: 'https://your-apidog-domain.com/api/v1/projects/git-connections/gitlab-callback'
- name: GIT_CONNECTION_GITLAB_COM_REJECT_UNAUTHORIZED
value: 'true'
Configuration Example for GitLab Enterprise Version#
- name: GIT_CONNECTION_GITLAB_COM_ENABLE
value: 'true'
- name: GITLAB_COM_AUTH_HOST
value: 'https://gitlab.yourcompany.com'
- name: GITLAB_COM_KEY
value: <your-enterprise-gitlab-client-id>
- name: GITLAB_COM_SECRET
value: <your-enterprise-gitlab-client-secret>
- name: GITLAB_SCOPE
value: 'api'
- name: GITLAB_REDIRECT_URI
value: 'https://your-apidog-domain.com/api/v1/projects/git-connections/gitlab-callback'
- name: GIT_CONNECTION_GITLAB_COM_REJECT_UNAUTHORIZED
value: 'false'