diff --git a/lib/config/definitions.js b/lib/config/definitions.js index f0f0f9c68ec65ec7bfc5dc9cd129f8ce9e41feb1..db7100df41c4989c530382fecb7fe57ce1ad1210 100644 --- a/lib/config/definitions.js +++ b/lib/config/definitions.js @@ -217,14 +217,6 @@ const options = [ type: 'string', admin: true, }, - { - name: 'oauth', - description: 'Whether token is of type Oauth or not', - stage: 'repository', - type: 'boolean', - default: false, - admin: true, - }, { name: 'username', description: 'Username for authentication. Currently Bitbucket only', diff --git a/lib/platform/gitlab/gl-got-wrapper.js b/lib/platform/gitlab/gl-got-wrapper.js index 51903b17a2d02ef31dbd2c6278e77bf2ad7c832e..e27f749ec666f5e34e680b179b966f24f8dcfe6d 100644 --- a/lib/platform/gitlab/gl-got-wrapper.js +++ b/lib/platform/gitlab/gl-got-wrapper.js @@ -15,14 +15,6 @@ async function get(path, options, retries = 5) { }; const method = opts.method || 'get'; const useCache = opts.useCache || true; - opts.headers = opts.headers || {}; - // istanbul ignore if - if (opts.oauth) { - opts.headers.authorization = `Bearer ${opts.token}`; - } else { - opts.headers['PRIVATE-TOKEN'] = opts.token; - } - delete opts.token; if (method === 'get' && useCache && cache[path]) { logger.trace({ path }, 'Returning cached result'); return cache[path]; diff --git a/lib/platform/gitlab/index.js b/lib/platform/gitlab/index.js index 18d844b4c871ecf2b5c81a816608813277ca7ccd..a6922baf263362e4363424a1d860f3efadc00560 100644 --- a/lib/platform/gitlab/index.js +++ b/lib/platform/gitlab/index.js @@ -97,20 +97,16 @@ function cleanRepo() { async function initRepo({ repository, token, - oauth, endpoint, gitAuthor, gitFs, localDir, }) { - const opts = hostRules.find( - { platform: 'gitlab' }, - { token, endpoint, oauth } - ); + const opts = hostRules.find({ platform: 'gitlab' }, { token, endpoint }); if (!opts.token) { throw new Error(`No token found for GitLab repository ${repository}`); } - hostRules.update({ ...opts, platform: 'gitlab', default: true, oauth }); + hostRules.update({ ...opts, platform: 'gitlab', default: true }); config = {}; get.reset(); config.repository = urlEscape(repository); @@ -148,7 +144,7 @@ async function initRepo({ const { host } = URL.parse(opts.endpoint); const url = GitStorage.getUrl({ gitFs, - auth: 'oauth2:' + (config.forkToken || opts.token), + auth: 'oauth2:' + opts.token, hostname: host || 'gitlab.com', repository, }); diff --git a/website/docs/self-hosted-configuration.md b/website/docs/self-hosted-configuration.md index 996d197b6571d1c1c6803b3f87e5a9641817777a..ef536422bc6386cc903ff33393d12d514a8949e2 100644 --- a/website/docs/self-hosted-configuration.md +++ b/website/docs/self-hosted-configuration.md @@ -56,10 +56,6 @@ Set it to a string specifing the transport used by Git (`https`, `http` or `ssh` You probably have no need for this option - it is an experimental setting for the Renovate hosted GitHub App. -## oauth - -Set this to true only if using an OAuth2 token from GitLab. - ## onboarding Set this to `false` if (a) you configure Renovate entirely on the bot side (i.e. empty `renovate.json` in repositories) and (b) you wish to run Renovate on every repository the bot has access to, and (c) you wish to skip the onboarding PRs.