insomnia/packages/insomnia-smoke-test/fixtures/constants.js
Opender Singh cf6dde4853
Basic auth e2e test (#2671)
* Add test

* WIP

* Passes

* Update

* Done

* Update

* Fix

* Remove id

* Works

* Run more tests

* Hmm

* await

* mostly works

* i sure hope this works in CI because it worked 40 times on my computer...

* add comments

* feat: replace tinyhttp with express and add basic auth route

* fix: response content-type header

* feat: works

* feat: this should work

* fix: slow down all requests

* fix: force refresh

* test: wait for timeline viewer to contain text after clicking it

* remove: delete oas3.yaml spec as it is redundant for now
2020-12-08 09:12:50 +13:00

14 lines
394 B
JavaScript

const getCreds = (user, pass, encoding) => ({
raw: { user, pass },
encoded: {
user: Buffer.from(user, encoding).toString(),
pass: Buffer.from(pass, encoding).toString(),
},
combined: Buffer.from(`${user}:${pass}`, encoding).toString('base64'),
});
export const basicAuthCreds = {
utf8: getCreds('user', 'pass', 'utf8'),
latin1: getCreds('user-é', 'pass-é', 'latin1'),
};