review feedback tweaks
This commit is contained in:
@@ -146,7 +146,7 @@ export class CatalogClient implements CatalogApi {
|
||||
`${await this.discoveryApi.getBaseUrl('catalog')}/entities/by-uid/${uid}`,
|
||||
{
|
||||
headers: options?.token
|
||||
? { authorization: `Bearer ${options.token}` }
|
||||
? { Authorization: `Bearer ${options.token}` }
|
||||
: {},
|
||||
method: 'DELETE',
|
||||
},
|
||||
@@ -171,7 +171,7 @@ export class CatalogClient implements CatalogApi {
|
||||
const url = `${await this.discoveryApi.getBaseUrl('catalog')}${path}`;
|
||||
const response = await fetch(url, {
|
||||
headers: options?.token
|
||||
? { authorization: `Bearer ${options.token}` }
|
||||
? { Authorization: `Bearer ${options.token}` }
|
||||
: {},
|
||||
});
|
||||
|
||||
@@ -191,7 +191,7 @@ export class CatalogClient implements CatalogApi {
|
||||
const url = `${await this.discoveryApi.getBaseUrl('catalog')}${path}`;
|
||||
const response = await fetch(url, {
|
||||
headers: options?.token
|
||||
? { authorization: `Bearer ${options.token}` }
|
||||
? { Authorization: `Bearer ${options.token}` }
|
||||
: {},
|
||||
});
|
||||
|
||||
|
||||
@@ -57,7 +57,7 @@ describe('<ImportComponentPage />', () => {
|
||||
new CatalogImportClient({
|
||||
discoveryApi: {} as any,
|
||||
githubAuthApi: {
|
||||
getAccessToken: (_, __) => Promise.resolve('token'),
|
||||
getAccessToken: async () => 'token',
|
||||
},
|
||||
identityApi,
|
||||
configApi: {} as any,
|
||||
|
||||
@@ -63,7 +63,6 @@ describe('CatalogClientWrapper', () => {
|
||||
|
||||
describe('getEntities', () => {
|
||||
it('injects authorization token', async () => {
|
||||
expect.assertions(2);
|
||||
const client = new CatalogClientWrapper({
|
||||
client: new MockedCatalogClient({ discoveryApi }),
|
||||
identityApi,
|
||||
@@ -79,7 +78,6 @@ describe('CatalogClientWrapper', () => {
|
||||
|
||||
describe('getLocationById', () => {
|
||||
it('omits authorization token when guest', async () => {
|
||||
expect.assertions(2);
|
||||
const client = new CatalogClientWrapper({
|
||||
client: new MockedCatalogClient({ discoveryApi }),
|
||||
identityApi: guestIdentityApi,
|
||||
@@ -99,7 +97,6 @@ describe('CatalogClientWrapper', () => {
|
||||
name: 'name',
|
||||
};
|
||||
it('injects authorization token', async () => {
|
||||
expect.assertions(2);
|
||||
const client = new CatalogClientWrapper({
|
||||
client: new MockedCatalogClient({ discoveryApi }),
|
||||
identityApi,
|
||||
@@ -117,7 +114,6 @@ describe('CatalogClientWrapper', () => {
|
||||
describe('addLocation', () => {
|
||||
const location = { target: 'target' };
|
||||
it('injects authorization token', async () => {
|
||||
expect.assertions(2);
|
||||
const client = new CatalogClientWrapper({
|
||||
client: new MockedCatalogClient({ discoveryApi }),
|
||||
identityApi,
|
||||
@@ -140,7 +136,6 @@ describe('CatalogClientWrapper', () => {
|
||||
},
|
||||
};
|
||||
it('injects authorization token', async () => {
|
||||
expect.assertions(2);
|
||||
const client = new CatalogClientWrapper({
|
||||
client: new MockedCatalogClient({ discoveryApi }),
|
||||
identityApi,
|
||||
@@ -158,7 +153,6 @@ describe('CatalogClientWrapper', () => {
|
||||
describe('removeEntityByUid', () => {
|
||||
it('injects authorization token', async () => {
|
||||
const uid = 'uid';
|
||||
expect.assertions(2);
|
||||
const client = new CatalogClientWrapper({
|
||||
client: new MockedCatalogClient({ discoveryApi }),
|
||||
identityApi,
|
||||
|
||||
@@ -41,7 +41,7 @@ export class FossaClient implements FossaApi {
|
||||
const apiUrl = `${await this.discoveryApi.getBaseUrl('proxy')}/fossa`;
|
||||
const idToken = await this.identityApi.getIdToken();
|
||||
const response = await fetch(`${apiUrl}/${path}`, {
|
||||
headers: idToken ? { authorization: `Bearer ${idToken}` } : {},
|
||||
headers: idToken ? { Authorization: `Bearer ${idToken}` } : {},
|
||||
});
|
||||
if (response.status === 200) {
|
||||
return await response.json();
|
||||
|
||||
@@ -60,7 +60,7 @@ export class RollbarClient implements RollbarApi {
|
||||
const url = `${await this.discoveryApi.getBaseUrl('rollbar')}${path}`;
|
||||
const idToken = await this.identityApi.getIdToken();
|
||||
const response = await fetch(url, {
|
||||
headers: idToken ? { authorization: `Bearer ${idToken}` } : {},
|
||||
headers: idToken ? { Authorization: `Bearer ${idToken}` } : {},
|
||||
});
|
||||
|
||||
if (!response.ok) {
|
||||
|
||||
Reference in New Issue
Block a user