Skip to content

Commit

Permalink
chore(deps): bump got from 11.8.3 to 12.0.1 (#7370)
Browse files Browse the repository at this point in the history
* chore(deps): bump got from 11.8.3 to 12.0.1
* update limit syntax
* update CancelError import
* update timeout syntax
* set missing user/pass to empty string for basic auth
* fix opm badge

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: chris48s <chris.shaw480@gmail.com>
Co-authored-by: chris48s <chris48s@users.noreply.github.com>
  • Loading branch information
3 people authored Jan 29, 2022
1 parent a682ff4 commit 0f288a4
Show file tree
Hide file tree
Showing 9 changed files with 848 additions and 114 deletions.
4 changes: 3 additions & 1 deletion core/base-service/auth-helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,9 @@ class AuthHelper {

get _basicAuth() {
const { _user: username, _pass: password } = this
return this.isConfigured ? { username, password } : undefined
return this.isConfigured
? { username: username || '', password: password || '' }
: undefined
}

/*
Expand Down
4 changes: 2 additions & 2 deletions core/base-service/auth-helper.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,10 @@ describe('AuthHelper', function () {
]).expect({ username: 'admin', password: 'abc123' })
given({ userKey: 'myci_user' }, { myci_user: 'admin' }).expect({
username: 'admin',
password: undefined,
password: '',
})
given({ passKey: 'myci_pass' }, { myci_pass: 'abc123' }).expect({
username: undefined,
username: '',
password: 'abc123',
})
given({ userKey: 'myci_user', passKey: 'myci_pass' }, {}).expect(
Expand Down
6 changes: 3 additions & 3 deletions core/base-service/got.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import got from 'got'
import got, { CancelError } from 'got'
import { Inaccessible, InvalidResponse } from './errors.js'
import {
fetchLimitBytes as fetchLimitBytesDefault,
Expand All @@ -10,14 +10,14 @@ const userAgent = getUserAgent()
async function sendRequest(gotWrapper, url, options) {
const gotOptions = Object.assign({}, options)
gotOptions.throwHttpErrors = false
gotOptions.retry = 0
gotOptions.retry = { limit: 0 }
gotOptions.headers = gotOptions.headers || {}
gotOptions.headers['User-Agent'] = userAgent
try {
const resp = await gotWrapper(url, gotOptions)
return { res: resp, buffer: resp.body }
} catch (err) {
if (err instanceof got.CancelError) {
if (err instanceof CancelError) {
throw new InvalidResponse({
underlyingError: new Error('Maximum response size exceeded'),
})
Expand Down
2 changes: 1 addition & 1 deletion core/got-test-client.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import got from 'got'

// https://github.com/nock/nock/issues/1523
export default got.extend({ retry: 0 })
export default got.extend({ retry: { limit: 0 } })
2 changes: 1 addition & 1 deletion core/server/influx-metrics.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export default class InfluxMetrics {
url: this._config.url,
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
body: await this.metrics(),
timeout: this._config.timeoutMillseconds,
timeout: { request: this._config.timeoutMillseconds },
username: this._config.username,
password: this._config.password,
throwHttpErrors: false,
Expand Down
1 change: 1 addition & 0 deletions core/server/influx-metrics.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { expect } from 'chai'
import log from './log.js'
import InfluxMetrics from './influx-metrics.js'
import '../register-chai-plugins.spec.js'

describe('Influx metrics', function () {
const metricInstance = {
metrics() {
Expand Down
Loading

0 comments on commit 0f288a4

Please sign in to comment.