Open-Source API Development Ecosystem • https://hoppscotch.io • Offline, On-Prem & Cloud • Web, Desktop & CLI • Open-Source Alternative to Postman, Insomnia
TypeScript apiapi-clientapi-restapi-testingdeveloper-toolsgraphqlhttphttp-clientpwarestrest-apispatestingtesting-toolstoolsvuevuejswebsocket
fix: auth-headers in collection bug (#3652)
Nivedinfc4c15e52d92
diff --git a/packages/hoppscotch-common/locales/en.json b/packages/hoppscotch-common/locales/en.jsonindex 55b9a1cb9..e20c0744d 100644--- a/packages/hoppscotch-common/locales/en.json+++ b/packages/hoppscotch-common/locales/en.json@@ -139,9 +139,11 @@"generate_token": "Generate Token","graphql_headers": "Authorization Headers are sent as part of the payload to connection_init","include_in_url": "Include in URL",+ "inherited_from": "Inherited from {auth} from Parent Collection {collection} ","learn": "Learn how","pass_key_by": "Pass by","password": "Password",+ "save_to_inherit": "Please save this request in any collection to inherit the authorization","token": "Token","type": "Authorization Type","username": "Username",@@ -173,7 +175,7 @@"name_length_insufficient": "Collection name should be at least 3 characters long","new": "New Collection","order_changed": "Collection Order Updated",- "properties":"Colection Properties",+ "properties":"Collection Properties","properties_updated": "Collection Properties Updated","renamed": "Collection renamed","request_in_use": "Request in use",@@ -975,4 +977,4 @@"team": "Team Workspace","title": "Workspaces"}-}\ No newline at end of file+}diff --git a/packages/hoppscotch-common/src/components/http/Authorization.vue b/packages/hoppscotch-common/src/components/http/Authorization.vueindex 684a1aec0..8dcff55da 100644--- a/packages/hoppscotch-common/src/components/http/Authorization.vue+++ b/packages/hoppscotch-common/src/components/http/Authorization.vue@@ -154,13 +154,17 @@</div><div v-if="auth.authType === 'inherit'" class="p-4"><span v-if="inheritedProperties?.auth">- Inherited- {{ getAuthName(inheritedProperties.auth.inheritedAuth.authType) }}- from Parent Collection {{ inheritedProperties?.auth.parentName }}+ {{+ t("authorization.inherited_from", {+ auth: getAuthName(+ inheritedProperties.auth.inheritedAuth.authType+ ),+ collection: inheritedProperties?.auth.parentName,+ })+ }}</span><span v-else>- Please save this request in any collection to inherit the- authorization+ {{ t("authorization.save_to_inherit") }}</span></div><div v-if="auth.authType === 'bearer'">diff --git a/packages/hoppscotch-common/src/helpers/import-export/import/insomnia.ts b/packages/hoppscotch-common/src/helpers/import-export/import/insomnia.tsindex 91698f8bc..e6aaf7f0a 100644--- a/packages/hoppscotch-common/src/helpers/import-export/import/insomnia.ts+++ b/packages/hoppscotch-common/src/helpers/import-export/import/insomnia.ts@@ -199,6 +199,8 @@ const getHoppFolder = (getHoppFolder(f, resources)),requests: getRequestsIn(folderRes, resources).map(getHoppRequest),+ auth: { authType: "inherit", authActive: true },+ headers: [],})const getHoppCollections = (doc: InsomniaDoc) =>diff --git a/packages/hoppscotch-common/src/helpers/import-export/import/openapi.ts b/packages/hoppscotch-common/src/helpers/import-export/import/openapi.tsindex b1afd05dd..febf950eb 100644--- a/packages/hoppscotch-common/src/helpers/import-export/import/openapi.ts+++ b/packages/hoppscotch-common/src/helpers/import-export/import/openapi.ts@@ -592,6 +592,8 @@ const convertOpenApiDocToHopp = (name,folders: [],requests: paths,+ auth: { authType: "inherit", authActive: true },+ headers: [],}),])}diff --git a/packages/hoppscotch-common/src/helpers/import-export/import/postman.ts b/packages/hoppscotch-common/src/helpers/import-export/import/postman.tsindex a18eff3fa..ed16bf3af 100644--- a/packages/hoppscotch-common/src/helpers/import-export/import/postman.ts+++ b/packages/hoppscotch-common/src/helpers/import-export/import/postman.ts@@ -292,6 +292,8 @@ const getHoppFolder = (ig: ItemGroup<Item>): HoppCollection =>A.map(getHoppFolder)),requests: pipe(ig.items.all(), A.filter(isPMItem), A.map(getHoppRequest)),+ auth: { authType: "inherit", authActive: true },+ headers: [],})export const getHoppCollection = (coll: PMCollection) => getHoppFolder(coll)