Skip to content

Open-Source API Development Ecosystem • https://hoppscotch.io • Offline, On-Prem & Cloud • Web, Desktop & CLI • Open-Source Alternative to Postman, Insomnia

feat: add support for AWS Signature auth type (#4142)

Anwarul Islam703b71de2ced
diff --git a/packages/hoppscotch-common/locales/en.json b/packages/hoppscotch-common/locales/en.json
index 30d2db11b..15a8d96a7 100644
--- a/packages/hoppscotch-common/locales/en.json
+++ b/packages/hoppscotch-common/locales/en.json
@@ -174,7 +174,16 @@
"save_to_inherit": "Please save this request in any collection to inherit the authorization",
"token": "Token",
"type": "Authorization Type",
- "username": "Username"
+ "username": "Username",
+ "aws_signature": {
+ "access_key": "Access Key",
+ "secret_key": "Secret Key",
+ "service_name": "Service Name",
+ "aws_region": "AWS Region",
+ "service_token": "Service Token",
+ "advance_config": "Advanced Configuration",
+ "advance_config_description": "Hoppscotch automatically assigns default values to certain fields if no explicit value is provided"
+ }
},
"collection": {
"created": "Collection created",
diff --git a/packages/hoppscotch-common/package.json b/packages/hoppscotch-common/package.json
index bc2f5288b..b909e201d 100644
--- a/packages/hoppscotch-common/package.json
+++ b/packages/hoppscotch-common/package.json
@@ -49,6 +49,7 @@
"@vueuse/core": "10.7.0",
"acorn-walk": "8.3.0",
"axios": "1.7.5",
+ "aws4fetch": "1.0.19",
"buffer": "6.0.3",
"cookie-es": "1.0.0",
"dioc": "3.0.2",
diff --git a/packages/hoppscotch-common/src/components.d.ts b/packages/hoppscotch-common/src/components.d.ts
index 92ec415bb..06dfe2ae5 100644
--- a/packages/hoppscotch-common/src/components.d.ts
+++ b/packages/hoppscotch-common/src/components.d.ts
@@ -5,230 +5,238 @@
// Read more: https://github.com/vuejs/core/pull/3399
export {}
-declare module "vue" {
+declare module 'vue' {
export interface GlobalComponents {
- AccessTokens: (typeof import("./components/accessTokens/index.vue"))["default"]
- AccessTokensGenerateModal: (typeof import("./components/accessTokens/GenerateModal.vue"))["default"]
- AccessTokensList: (typeof import("./components/accessTokens/List.vue"))["default"]
- AccessTokensOverview: (typeof import("./components/accessTokens/Overview.vue"))["default"]
- AppActionHandler: (typeof import("./components/app/ActionHandler.vue"))["default"]
- AppBanner: (typeof import("./components/app/Banner.vue"))["default"]
- AppContextMenu: (typeof import("./components/app/ContextMenu.vue"))["default"]
- AppDeveloperOptions: (typeof import("./components/app/DeveloperOptions.vue"))["default"]
+ AccessTokens: typeof import('./components/accessTokens/index.vue')['default']
+ AccessTokensGenerateModal: typeof import('./components/accessTokens/GenerateModal.vue')['default']
+ AccessTokensList: typeof import('./components/accessTokens/List.vue')['default']
+ AccessTokensOverview: typeof import('./components/accessTokens/Overview.vue')['default']
+ AppActionHandler: typeof import('./components/app/ActionHandler.vue')['default']
+ AppBanner: typeof import('./components/app/Banner.vue')['default']
+ AppContextMenu: typeof import('./components/app/ContextMenu.vue')['default']
+ AppDeveloperOptions: typeof import('./components/app/DeveloperOptions.vue')['default']
AppDrawer: (typeof import("./components/app/Drawer.vue"))["default"]
- AppFooter: (typeof import("./components/app/Footer.vue"))["default"]
- AppGitHubStarButton: (typeof import("./components/app/GitHubStarButton.vue"))["default"]
- AppHeader: (typeof import("./components/app/Header.vue"))["default"]
- AppInspection: (typeof import("./components/app/Inspection.vue"))["default"]
- AppInterceptor: (typeof import("./components/app/Interceptor.vue"))["default"]
- AppLogo: (typeof import("./components/app/Logo.vue"))["default"]
- AppOptions: (typeof import("./components/app/Options.vue"))["default"]
- AppPaneLayout: (typeof import("./components/app/PaneLayout.vue"))["default"]
+ AppFooter: typeof import('./components/app/Footer.vue')['default']
+ AppGitHubStarButton: typeof import('./components/app/GitHubStarButton.vue')['default']
+ AppHeader: typeof import('./components/app/Header.vue')['default']
+ AppInspection: typeof import('./components/app/Inspection.vue')['default']
+ AppInterceptor: typeof import('./components/app/Interceptor.vue')['default']
+ AppLogo: typeof import('./components/app/Logo.vue')['default']
+ AppOptions: typeof import('./components/app/Options.vue')['default']
+ AppPaneLayout: typeof import('./components/app/PaneLayout.vue')['default']
AppPWAPrompt: (typeof import("./components/app/PWAPrompt.vue"))["default"]
- AppShare: (typeof import("./components/app/Share.vue"))["default"]
- AppShortcuts: (typeof import("./components/app/Shortcuts.vue"))["default"]
- AppShortcutsEntry: (typeof import("./components/app/ShortcutsEntry.vue"))["default"]
- AppShortcutsPrompt: (typeof import("./components/app/ShortcutsPrompt.vue"))["default"]
- AppSidenav: (typeof import("./components/app/Sidenav.vue"))["default"]
- AppSpotlight: (typeof import("./components/app/spotlight/index.vue"))["default"]
- AppSpotlightEntry: (typeof import("./components/app/spotlight/Entry.vue"))["default"]
- AppSpotlightEntryGQLHistory: (typeof import("./components/app/spotlight/entry/GQLHistory.vue"))["default"]
- AppSpotlightEntryGQLRequest: (typeof import("./components/app/spotlight/entry/GQLRequest.vue"))["default"]
- AppSpotlightEntryIconSelected: (typeof import("./components/app/spotlight/entry/IconSelected.vue"))["default"]
- AppSpotlightEntryRESTHistory: (typeof import("./components/app/spotlight/entry/RESTHistory.vue"))["default"]
- AppSpotlightEntryRESTRequest: (typeof import("./components/app/spotlight/entry/RESTRequest.vue"))["default"]
- AppSpotlightEntryRESTTeamRequestEntry: (typeof import("./components/app/spotlight/entry/RESTTeamRequestEntry.vue"))["default"]
- AppSpotlightSearch: (typeof import("./components/app/SpotlightSearch.vue"))["default"]
- AppSupport: (typeof import("./components/app/Support.vue"))["default"]
- AppWhatsNewDialog: (typeof import("./components/app/WhatsNewDialog.vue"))["default"]
- Collections: (typeof import("./components/collections/index.vue"))["default"]
- CollectionsAdd: (typeof import("./components/collections/Add.vue"))["default"]
- CollectionsAddFolder: (typeof import("./components/collections/AddFolder.vue"))["default"]
- CollectionsAddRequest: (typeof import("./components/collections/AddRequest.vue"))["default"]
- CollectionsCollection: (typeof import("./components/collections/Collection.vue"))["default"]
- CollectionsEdit: (typeof import("./components/collections/Edit.vue"))["default"]
- CollectionsEditFolder: (typeof import("./components/collections/EditFolder.vue"))["default"]
- CollectionsEditRequest: (typeof import("./components/collections/EditRequest.vue"))["default"]
- CollectionsGraphql: (typeof import("./components/collections/graphql/index.vue"))["default"]
- CollectionsGraphqlAdd: (typeof import("./components/collections/graphql/Add.vue"))["default"]
- CollectionsGraphqlAddFolder: (typeof import("./components/collections/graphql/AddFolder.vue"))["default"]
- CollectionsGraphqlAddRequest: (typeof import("./components/collections/graphql/AddRequest.vue"))["default"]
- CollectionsGraphqlCollection: (typeof import("./components/collections/graphql/Collection.vue"))["default"]
- CollectionsGraphqlEdit: (typeof import("./components/collections/graphql/Edit.vue"))["default"]
- CollectionsGraphqlEditFolder: (typeof import("./components/collections/graphql/EditFolder.vue"))["default"]
- CollectionsGraphqlEditRequest: (typeof import("./components/collections/graphql/EditRequest.vue"))["default"]
- CollectionsGraphqlFolder: (typeof import("./components/collections/graphql/Folder.vue"))["default"]
- CollectionsGraphqlImportExport: (typeof import("./components/collections/graphql/ImportExport.vue"))["default"]
- CollectionsGraphqlRequest: (typeof import("./components/collections/graphql/Request.vue"))["default"]
- CollectionsImportExport: (typeof import("./components/collections/ImportExport.vue"))["default"]
- CollectionsMyCollections: (typeof import("./components/collections/MyCollections.vue"))["default"]
- CollectionsProperties: (typeof import("./components/collections/Properties.vue"))["default"]
- CollectionsRequest: (typeof import("./components/collections/Request.vue"))["default"]
- CollectionsRunner: (typeof import("./components/collections/Runner.vue"))["default"]
- CollectionsSaveRequest: (typeof import("./components/collections/SaveRequest.vue"))["default"]
- CollectionsTeamCollections: (typeof import("./components/collections/TeamCollections.vue"))["default"]
- CookiesAllModal: (typeof import("./components/cookies/AllModal.vue"))["default"]
- CookiesEditCookie: (typeof import("./components/cookies/EditCookie.vue"))["default"]
- Embeds: (typeof import("./components/embeds/index.vue"))["default"]
- EmbedsHeader: (typeof import("./components/embeds/Header.vue"))["default"]
- EmbedsRequest: (typeof import("./components/embeds/Request.vue"))["default"]
- Environments: (typeof import("./components/environments/index.vue"))["default"]
- EnvironmentsAdd: (typeof import("./components/environments/Add.vue"))["default"]
- EnvironmentsImportExport: (typeof import("./components/environments/ImportExport.vue"))["default"]
- EnvironmentsMy: (typeof import("./components/environments/my/index.vue"))["default"]
- EnvironmentsMyDetails: (typeof import("./components/environments/my/Details.vue"))["default"]
- EnvironmentsMyEnvironment: (typeof import("./components/environments/my/Environment.vue"))["default"]
- EnvironmentsProperties: (typeof import("./components/environments/Properties.vue"))["default"]
- EnvironmentsSelector: (typeof import("./components/environments/Selector.vue"))["default"]
- EnvironmentsTeams: (typeof import("./components/environments/teams/index.vue"))["default"]
- EnvironmentsTeamsDetails: (typeof import("./components/environments/teams/Details.vue"))["default"]
- EnvironmentsTeamsEnvironment: (typeof import("./components/environments/teams/Environment.vue"))["default"]
- FirebaseLogin: (typeof import("./components/firebase/Login.vue"))["default"]
- FirebaseLogout: (typeof import("./components/firebase/Logout.vue"))["default"]
- GraphqlAuthorization: (typeof import("./components/graphql/Authorization.vue"))["default"]
- GraphqlField: (typeof import("./components/graphql/Field.vue"))["default"]
- GraphqlHeaders: (typeof import("./components/graphql/Headers.vue"))["default"]
- GraphqlQuery: (typeof import("./components/graphql/Query.vue"))["default"]
- GraphqlRequest: (typeof import("./components/graphql/Request.vue"))["default"]
- GraphqlRequestOptions: (typeof import("./components/graphql/RequestOptions.vue"))["default"]
- GraphqlRequestTab: (typeof import("./components/graphql/RequestTab.vue"))["default"]
- GraphqlResponse: (typeof import("./components/graphql/Response.vue"))["default"]
- GraphqlSidebar: (typeof import("./components/graphql/Sidebar.vue"))["default"]
- GraphqlSubscriptionLog: (typeof import("./components/graphql/SubscriptionLog.vue"))["default"]
- GraphqlTabHead: (typeof import("./components/graphql/TabHead.vue"))["default"]
- GraphqlType: (typeof import("./components/graphql/Type.vue"))["default"]
- GraphqlTypeLink: (typeof import("./components/graphql/TypeLink.vue"))["default"]
- GraphqlVariable: (typeof import("./components/graphql/Variable.vue"))["default"]
- History: (typeof import("./components/history/index.vue"))["default"]
- HistoryGraphqlCard: (typeof import("./components/history/graphql/Card.vue"))["default"]
- HistoryRestCard: (typeof import("./components/history/rest/Card.vue"))["default"]
- HoppButtonPrimary: (typeof import("@hoppscotch/ui"))["HoppButtonPrimary"]
- HoppButtonSecondary: (typeof import("@hoppscotch/ui"))["HoppButtonSecondary"]
- HoppSmartAnchor: (typeof import("@hoppscotch/ui"))["HoppSmartAnchor"]
- HoppSmartCheckbox: (typeof import("@hoppscotch/ui"))["HoppSmartCheckbox"]
- HoppSmartConfirmModal: (typeof import("@hoppscotch/ui"))["HoppSmartConfirmModal"]
- HoppSmartExpand: (typeof import("@hoppscotch/ui"))["HoppSmartExpand"]
- HoppSmartFileChip: (typeof import("@hoppscotch/ui"))["HoppSmartFileChip"]
- HoppSmartInput: (typeof import("@hoppscotch/ui"))["HoppSmartInput"]
- HoppSmartIntersection: (typeof import("@hoppscotch/ui"))["HoppSmartIntersection"]
- HoppSmartItem: (typeof import("@hoppscotch/ui"))["HoppSmartItem"]
- HoppSmartLink: (typeof import("@hoppscotch/ui"))["HoppSmartLink"]
- HoppSmartModal: (typeof import("@hoppscotch/ui"))["HoppSmartModal"]
- HoppSmartPicture: (typeof import("@hoppscotch/ui"))["HoppSmartPicture"]
- HoppSmartPlaceholder: (typeof import("@hoppscotch/ui"))["HoppSmartPlaceholder"]
- HoppSmartProgressRing: (typeof import("@hoppscotch/ui"))["HoppSmartProgressRing"]
- HoppSmartRadio: (typeof import("@hoppscotch/ui"))["HoppSmartRadio"]
- HoppSmartRadioGroup: (typeof import("@hoppscotch/ui"))["HoppSmartRadioGroup"]
- HoppSmartSelectWrapper: (typeof import("@hoppscotch/ui"))["HoppSmartSelectWrapper"]
- HoppSmartSlideOver: (typeof import("@hoppscotch/ui"))["HoppSmartSlideOver"]
- HoppSmartSpinner: (typeof import("@hoppscotch/ui"))["HoppSmartSpinner"]
- HoppSmartTab: (typeof import("@hoppscotch/ui"))["HoppSmartTab"]
- HoppSmartTabs: (typeof import("@hoppscotch/ui"))["HoppSmartTabs"]
- HoppSmartToggle: (typeof import("@hoppscotch/ui"))["HoppSmartToggle"]
- HoppSmartTree: (typeof import("@hoppscotch/ui"))["HoppSmartTree"]
- HoppSmartWindow: (typeof import("@hoppscotch/ui"))["HoppSmartWindow"]
- HoppSmartWindows: (typeof import("@hoppscotch/ui"))["HoppSmartWindows"]
- HttpAuthorization: (typeof import("./components/http/Authorization.vue"))["default"]
- HttpAuthorizationApiKey: (typeof import("./components/http/authorization/ApiKey.vue"))["default"]
- HttpAuthorizationBasic: (typeof import("./components/http/authorization/Basic.vue"))["default"]
- HttpBody: (typeof import("./components/http/Body.vue"))["default"]
- HttpBodyParameters: (typeof import("./components/http/BodyParameters.vue"))["default"]
- HttpCodegen: (typeof import("./components/http/Codegen.vue"))["default"]
- HttpCodegenModal: (typeof import("./components/http/CodegenModal.vue"))["default"]
- HttpHeaders: (typeof import("./components/http/Headers.vue"))["default"]
- HttpImportCurl: (typeof import("./components/http/ImportCurl.vue"))["default"]
- HttpKeyValue: (typeof import("./components/http/KeyValue.vue"))["default"]
+ AppShare: typeof import('./components/app/Share.vue')['default']
+ AppShortcuts: typeof import('./components/app/Shortcuts.vue')['default']
+ AppShortcutsEntry: typeof import('./components/app/ShortcutsEntry.vue')['default']
+ AppShortcutsPrompt: typeof import('./components/app/ShortcutsPrompt.vue')['default']
+ AppSidenav: typeof import('./components/app/Sidenav.vue')['default']
+ AppSpotlight: typeof import('./components/app/spotlight/index.vue')['default']
+ AppSpotlightEntry: typeof import('./components/app/spotlight/Entry.vue')['default']
+ AppSpotlightEntryGQLHistory: typeof import('./components/app/spotlight/entry/GQLHistory.vue')['default']
+ AppSpotlightEntryGQLRequest: typeof import('./components/app/spotlight/entry/GQLRequest.vue')['default']
+ AppSpotlightEntryIconSelected: typeof import('./components/app/spotlight/entry/IconSelected.vue')['default']
+ AppSpotlightEntryRESTHistory: typeof import('./components/app/spotlight/entry/RESTHistory.vue')['default']
+ AppSpotlightEntryRESTRequest: typeof import('./components/app/spotlight/entry/RESTRequest.vue')['default']
+ AppSpotlightEntryRESTTeamRequestEntry: typeof import('./components/app/spotlight/entry/RESTTeamRequestEntry.vue')['default']
+ AppSpotlightSearch: typeof import('./components/app/SpotlightSearch.vue')['default']
+ AppSupport: typeof import('./components/app/Support.vue')['default']
+ AppWhatsNewDialog: typeof import('./components/app/WhatsNewDialog.vue')['default']
+ Collections: typeof import('./components/collections/index.vue')['default']
+ CollectionsAdd: typeof import('./components/collections/Add.vue')['default']
+ CollectionsAddFolder: typeof import('./components/collections/AddFolder.vue')['default']
+ CollectionsAddRequest: typeof import('./components/collections/AddRequest.vue')['default']
+ CollectionsCollection: typeof import('./components/collections/Collection.vue')['default']
+ CollectionsEdit: typeof import('./components/collections/Edit.vue')['default']
+ CollectionsEditFolder: typeof import('./components/collections/EditFolder.vue')['default']
+ CollectionsEditRequest: typeof import('./components/collections/EditRequest.vue')['default']
+ CollectionsGraphql: typeof import('./components/collections/graphql/index.vue')['default']
+ CollectionsGraphqlAdd: typeof import('./components/collections/graphql/Add.vue')['default']
+ CollectionsGraphqlAddFolder: typeof import('./components/collections/graphql/AddFolder.vue')['default']
+ CollectionsGraphqlAddRequest: typeof import('./components/collections/graphql/AddRequest.vue')['default']
+ CollectionsGraphqlCollection: typeof import('./components/collections/graphql/Collection.vue')['default']
+ CollectionsGraphqlEdit: typeof import('./components/collections/graphql/Edit.vue')['default']
+ CollectionsGraphqlEditFolder: typeof import('./components/collections/graphql/EditFolder.vue')['default']
+ CollectionsGraphqlEditRequest: typeof import('./components/collections/graphql/EditRequest.vue')['default']
+ CollectionsGraphqlFolder: typeof import('./components/collections/graphql/Folder.vue')['default']
+ CollectionsGraphqlImportExport: typeof import('./components/collections/graphql/ImportExport.vue')['default']
+ CollectionsGraphqlRequest: typeof import('./components/collections/graphql/Request.vue')['default']
+ CollectionsImportExport: typeof import('./components/collections/ImportExport.vue')['default']
+ CollectionsMyCollections: typeof import('./components/collections/MyCollections.vue')['default']
+ CollectionsProperties: typeof import('./components/collections/Properties.vue')['default']
+ CollectionsRequest: typeof import('./components/collections/Request.vue')['default']
+ CollectionsRunner: typeof import('./components/collections/Runner.vue')['default']
+ CollectionsSaveRequest: typeof import('./components/collections/SaveRequest.vue')['default']
+ CollectionsTeamCollections: typeof import('./components/collections/TeamCollections.vue')['default']
+ CookiesAllModal: typeof import('./components/cookies/AllModal.vue')['default']
+ CookiesEditCookie: typeof import('./components/cookies/EditCookie.vue')['default']
+ Embeds: typeof import('./components/embeds/index.vue')['default']
+ EmbedsHeader: typeof import('./components/embeds/Header.vue')['default']
+ EmbedsRequest: typeof import('./components/embeds/Request.vue')['default']
+ Environments: typeof import('./components/environments/index.vue')['default']
+ EnvironmentsAdd: typeof import('./components/environments/Add.vue')['default']
+ EnvironmentsImportExport: typeof import('./components/environments/ImportExport.vue')['default']
+ EnvironmentsMy: typeof import('./components/environments/my/index.vue')['default']
+ EnvironmentsMyDetails: typeof import('./components/environments/my/Details.vue')['default']
+ EnvironmentsMyEnvironment: typeof import('./components/environments/my/Environment.vue')['default']
+ EnvironmentsProperties: typeof import('./components/environments/Properties.vue')['default']
+ EnvironmentsSelector: typeof import('./components/environments/Selector.vue')['default']
+ EnvironmentsTeams: typeof import('./components/environments/teams/index.vue')['default']
+ EnvironmentsTeamsDetails: typeof import('./components/environments/teams/Details.vue')['default']
+ EnvironmentsTeamsEnvironment: typeof import('./components/environments/teams/Environment.vue')['default']
+ FirebaseLogin: typeof import('./components/firebase/Login.vue')['default']
+ FirebaseLogout: typeof import('./components/firebase/Logout.vue')['default']
+ GraphqlAuthorization: typeof import('./components/graphql/Authorization.vue')['default']
+ GraphqlField: typeof import('./components/graphql/Field.vue')['default']
+ GraphqlHeaders: typeof import('./components/graphql/Headers.vue')['default']
+ GraphqlQuery: typeof import('./components/graphql/Query.vue')['default']
+ GraphqlRequest: typeof import('./components/graphql/Request.vue')['default']
+ GraphqlRequestOptions: typeof import('./components/graphql/RequestOptions.vue')['default']
+ GraphqlRequestTab: typeof import('./components/graphql/RequestTab.vue')['default']
+ GraphqlResponse: typeof import('./components/graphql/Response.vue')['default']
+ GraphqlSidebar: typeof import('./components/graphql/Sidebar.vue')['default']
+ GraphqlSubscriptionLog: typeof import('./components/graphql/SubscriptionLog.vue')['default']
+ GraphqlTabHead: typeof import('./components/graphql/TabHead.vue')['default']
+ GraphqlType: typeof import('./components/graphql/Type.vue')['default']
+ GraphqlTypeLink: typeof import('./components/graphql/TypeLink.vue')['default']
+ GraphqlVariable: typeof import('./components/graphql/Variable.vue')['default']
+ History: typeof import('./components/history/index.vue')['default']
+ HistoryGraphqlCard: typeof import('./components/history/graphql/Card.vue')['default']
+ HistoryRestCard: typeof import('./components/history/rest/Card.vue')['default']
+ HoppButtonPrimary: typeof import('@hoppscotch/ui')['HoppButtonPrimary']
+ HoppButtonSecondary: typeof import('@hoppscotch/ui')['HoppButtonSecondary']
+ HoppSmartAnchor: typeof import('@hoppscotch/ui')['HoppSmartAnchor']
+ HoppSmartCheckbox: typeof import('@hoppscotch/ui')['HoppSmartCheckbox']
+ HoppSmartConfirmModal: typeof import('@hoppscotch/ui')['HoppSmartConfirmModal']
+ HoppSmartExpand: typeof import('@hoppscotch/ui')['HoppSmartExpand']
+ HoppSmartFileChip: typeof import('@hoppscotch/ui')['HoppSmartFileChip']
+ HoppSmartInput: typeof import('@hoppscotch/ui')['HoppSmartInput']
+ HoppSmartIntersection: typeof import('@hoppscotch/ui')['HoppSmartIntersection']
+ HoppSmartItem: typeof import('@hoppscotch/ui')['HoppSmartItem']
+ HoppSmartLink: typeof import('@hoppscotch/ui')['HoppSmartLink']
+ HoppSmartModal: typeof import('@hoppscotch/ui')['HoppSmartModal']
+ HoppSmartPicture: typeof import('@hoppscotch/ui')['HoppSmartPicture']
+ HoppSmartPlaceholder: typeof import('@hoppscotch/ui')['HoppSmartPlaceholder']
+ HoppSmartProgressRing: typeof import('@hoppscotch/ui')['HoppSmartProgressRing']
+ HoppSmartRadio: typeof import('@hoppscotch/ui')['HoppSmartRadio']
+ HoppSmartRadioGroup: typeof import('@hoppscotch/ui')['HoppSmartRadioGroup']
+ HoppSmartSelectWrapper: typeof import('@hoppscotch/ui')['HoppSmartSelectWrapper']
+ HoppSmartSlideOver: typeof import('@hoppscotch/ui')['HoppSmartSlideOver']
+ HoppSmartSpinner: typeof import('@hoppscotch/ui')['HoppSmartSpinner']
+ HoppSmartTab: typeof import('@hoppscotch/ui')['HoppSmartTab']
+ HoppSmartTabs: typeof import('@hoppscotch/ui')['HoppSmartTabs']
+ HoppSmartToggle: typeof import('@hoppscotch/ui')['HoppSmartToggle']
+ HoppSmartTree: typeof import('@hoppscotch/ui')['HoppSmartTree']
+ HoppSmartWindow: typeof import('@hoppscotch/ui')['HoppSmartWindow']
+ HoppSmartWindows: typeof import('@hoppscotch/ui')['HoppSmartWindows']
+ HttpAuthorization: typeof import('./components/http/Authorization.vue')['default']
+ HttpAuthorizationAkamaiEG: typeof import('./components/http/authorization/AkamaiEG.vue')['default']
+ HttpAuthorizationApiKey: typeof import('./components/http/authorization/ApiKey.vue')['default']
+ HttpAuthorizationASAP: typeof import('./components/http/authorization/ASAP.vue')['default']
+ HttpAuthorizationAWSSign: typeof import('./components/http/authorization/AWSSign.vue')['default']
+ HttpAuthorizationBasic: typeof import('./components/http/authorization/Basic.vue')['default']
+ HttpAuthorizationHAWK: typeof import('./components/http/authorization/HAWK.vue')['default']
+ HttpAuthorizationNTLM: typeof import('./components/http/authorization/NTLM.vue')['default']
+ HttpAuthorizationOAuth2: typeof import('./components/http/authorization/OAuth2.vue')['default']
+ HttpAuthorizationOAuth2Authorization: (typeof import("./components/http/authorization/OAuth2Authorization.vue"))["default"]
+ HttpBody: typeof import('./components/http/Body.vue')['default']
+ HttpBodyParameters: typeof import('./components/http/BodyParameters.vue')['default']
+ HttpCodegen: typeof import('./components/http/Codegen.vue')['default']
+ HttpCodegenModal: typeof import('./components/http/CodegenModal.vue')['default']
+ HttpHeaders: typeof import('./components/http/Headers.vue')['default']
+ HttpImportCurl: typeof import('./components/http/ImportCurl.vue')['default']
+ HttpKeyValue: typeof import('./components/http/KeyValue.vue')['default']
HttpOAuth2Authorization: (typeof import("./components/http/OAuth2Authorization.vue"))["default"]
- HttpParameters: (typeof import("./components/http/Parameters.vue"))["default"]
- HttpPreRequestScript: (typeof import("./components/http/PreRequestScript.vue"))["default"]
- HttpRawBody: (typeof import("./components/http/RawBody.vue"))["default"]
- HttpReqChangeConfirmModal: (typeof import("./components/http/ReqChangeConfirmModal.vue"))["default"]
- HttpRequest: (typeof import("./components/http/Request.vue"))["default"]
- HttpRequestOptions: (typeof import("./components/http/RequestOptions.vue"))["default"]
- HttpRequestTab: (typeof import("./components/http/RequestTab.vue"))["default"]
- HttpRequestVariables: (typeof import("./components/http/RequestVariables.vue"))["default"]
- HttpResponse: (typeof import("./components/http/Response.vue"))["default"]
- HttpResponseMeta: (typeof import("./components/http/ResponseMeta.vue"))["default"]
- HttpSidebar: (typeof import("./components/http/Sidebar.vue"))["default"]
- HttpTabHead: (typeof import("./components/http/TabHead.vue"))["default"]
- HttpTestResult: (typeof import("./components/http/TestResult.vue"))["default"]
- HttpTestResultEntry: (typeof import("./components/http/TestResultEntry.vue"))["default"]
- HttpTestResultEnv: (typeof import("./components/http/TestResultEnv.vue"))["default"]
- HttpTestResultReport: (typeof import("./components/http/TestResultReport.vue"))["default"]
- HttpTests: (typeof import("./components/http/Tests.vue"))["default"]
- HttpURLEncodedParams: (typeof import("./components/http/URLEncodedParams.vue"))["default"]
- IconLucideActivity: (typeof import("~icons/lucide/activity"))["default"]
- IconLucideAlertTriangle: (typeof import("~icons/lucide/alert-triangle"))["default"]
- IconLucideArrowLeft: (typeof import("~icons/lucide/arrow-left"))["default"]
- IconLucideArrowUpRight: (typeof import("~icons/lucide/arrow-up-right"))["default"]
+ HttpParameters: typeof import('./components/http/Parameters.vue')['default']
+ HttpPreRequestScript: typeof import('./components/http/PreRequestScript.vue')['default']
+ HttpRawBody: typeof import('./components/http/RawBody.vue')['default']
+ HttpReqChangeConfirmModal: typeof import('./components/http/ReqChangeConfirmModal.vue')['default']
+ HttpRequest: typeof import('./components/http/Request.vue')['default']
+ HttpRequestOptions: typeof import('./components/http/RequestOptions.vue')['default']
+ HttpRequestTab: typeof import('./components/http/RequestTab.vue')['default']
+ HttpRequestVariables: typeof import('./components/http/RequestVariables.vue')['default']
+ HttpResponse: typeof import('./components/http/Response.vue')['default']
+ HttpResponseInterface: typeof import('./components/http/ResponseInterface.vue')['default']
+ HttpResponseMeta: typeof import('./components/http/ResponseMeta.vue')['default']
+ HttpSidebar: typeof import('./components/http/Sidebar.vue')['default']
+ HttpTabHead: typeof import('./components/http/TabHead.vue')['default']
+ HttpTestResult: typeof import('./components/http/TestResult.vue')['default']
+ HttpTestResultEntry: typeof import('./components/http/TestResultEntry.vue')['default']
+ HttpTestResultEnv: typeof import('./components/http/TestResultEnv.vue')['default']
+ HttpTestResultReport: typeof import('./components/http/TestResultReport.vue')['default']
+ HttpTests: typeof import('./components/http/Tests.vue')['default']
+ HttpURLEncodedParams: typeof import('./components/http/URLEncodedParams.vue')['default']
+ IconLucideActivity: typeof import('~icons/lucide/activity')['default']
+ IconLucideAlertTriangle: typeof import('~icons/lucide/alert-triangle')['default']
+ IconLucideArrowLeft: typeof import('~icons/lucide/arrow-left')['default']
+ IconLucideArrowUpRight: typeof import('~icons/lucide/arrow-up-right')['default']
IconLucideBrush: (typeof import("~icons/lucide/brush"))["default"]
- IconLucideCheckCircle: (typeof import("~icons/lucide/check-circle"))["default"]
- IconLucideChevronRight: (typeof import("~icons/lucide/chevron-right"))["default"]
- IconLucideGlobe: (typeof import("~icons/lucide/globe"))["default"]
- IconLucideHelpCircle: (typeof import("~icons/lucide/help-circle"))["default"]
- IconLucideInbox: (typeof import("~icons/lucide/inbox"))["default"]
- IconLucideInfo: (typeof import("~icons/lucide/info"))["default"]
- IconLucideLayers: (typeof import("~icons/lucide/layers"))["default"]
- IconLucideListEnd: (typeof import("~icons/lucide/list-end"))["default"]
- IconLucideMinus: (typeof import("~icons/lucide/minus"))["default"]
+ IconLucideCheckCircle: typeof import('~icons/lucide/check-circle')['default']
+ IconLucideChevronRight: typeof import('~icons/lucide/chevron-right')['default']
+ IconLucideGlobe: typeof import('~icons/lucide/globe')['default']
+ IconLucideHelpCircle: typeof import('~icons/lucide/help-circle')['default']
+ IconLucideInbox: typeof import('~icons/lucide/inbox')['default']
+ IconLucideInfo: typeof import('~icons/lucide/info')['default']
+ IconLucideLayers: typeof import('~icons/lucide/layers')['default']
+ IconLucideListEnd: typeof import('~icons/lucide/list-end')['default']
+ IconLucideMinus: typeof import('~icons/lucide/minus')['default']
IconLucideRss: (typeof import("~icons/lucide/rss"))["default"]
- IconLucideSearch: (typeof import("~icons/lucide/search"))["default"]
- IconLucideUsers: (typeof import("~icons/lucide/users"))["default"]
- IconLucideX: (typeof import("~icons/lucide/x"))["default"]
- ImportExportBase: (typeof import("./components/importExport/Base.vue"))["default"]
- ImportExportImportExportList: (typeof import("./components/importExport/ImportExportList.vue"))["default"]
- ImportExportImportExportSourcesList: (typeof import("./components/importExport/ImportExportSourcesList.vue"))["default"]
- ImportExportImportExportStepsFileImport: (typeof import("./components/importExport/ImportExportSteps/FileImport.vue"))["default"]
- ImportExportImportExportStepsMyCollectionImport: (typeof import("./components/importExport/ImportExportSteps/MyCollectionImport.vue"))["default"]
- ImportExportImportExportStepsUrlImport: (typeof import("./components/importExport/ImportExportSteps/UrlImport.vue"))["default"]
- InterceptorsErrorPlaceholder: (typeof import("./components/interceptors/ErrorPlaceholder.vue"))["default"]
- InterceptorsExtensionSubtitle: (typeof import("./components/interceptors/ExtensionSubtitle.vue"))["default"]
- LensesHeadersRenderer: (typeof import("./components/lenses/HeadersRenderer.vue"))["default"]
- LensesHeadersRendererEntry: (typeof import("./components/lenses/HeadersRendererEntry.vue"))["default"]
- LensesRenderersAudioLensRenderer: (typeof import("./components/lenses/renderers/AudioLensRenderer.vue"))["default"]
- LensesRenderersHTMLLensRenderer: (typeof import("./components/lenses/renderers/HTMLLensRenderer.vue"))["default"]
- LensesRenderersImageLensRenderer: (typeof import("./components/lenses/renderers/ImageLensRenderer.vue"))["default"]
- LensesRenderersJSONLensRenderer: (typeof import("./components/lenses/renderers/JSONLensRenderer.vue"))["default"]
- LensesRenderersPDFLensRenderer: (typeof import("./components/lenses/renderers/PDFLensRenderer.vue"))["default"]
- LensesRenderersRawLensRenderer: (typeof import("./components/lenses/renderers/RawLensRenderer.vue"))["default"]
- LensesRenderersVideoLensRenderer: (typeof import("./components/lenses/renderers/VideoLensRenderer.vue"))["default"]
- LensesRenderersXMLLensRenderer: (typeof import("./components/lenses/renderers/XMLLensRenderer.vue"))["default"]
- LensesResponseBodyRenderer: (typeof import("./components/lenses/ResponseBodyRenderer.vue"))["default"]
+ IconLucideSearch: typeof import('~icons/lucide/search')['default']
+ IconLucideUsers: typeof import('~icons/lucide/users')['default']
+ IconLucideX: typeof import('~icons/lucide/x')['default']
+ ImportExportBase: typeof import('./components/importExport/Base.vue')['default']
+ ImportExportImportExportList: typeof import('./components/importExport/ImportExportList.vue')['default']
+ ImportExportImportExportSourcesList: typeof import('./components/importExport/ImportExportSourcesList.vue')['default']
+ ImportExportImportExportStepsFileImport: typeof import('./components/importExport/ImportExportSteps/FileImport.vue')['default']
+ ImportExportImportExportStepsMyCollectionImport: typeof import('./components/importExport/ImportExportSteps/MyCollectionImport.vue')['default']
+ ImportExportImportExportStepsUrlImport: typeof import('./components/importExport/ImportExportSteps/UrlImport.vue')['default']
+ InterceptorsErrorPlaceholder: typeof import('./components/interceptors/ErrorPlaceholder.vue')['default']
+ InterceptorsExtensionSubtitle: typeof import('./components/interceptors/ExtensionSubtitle.vue')['default']
+ LensesHeadersRenderer: typeof import('./components/lenses/HeadersRenderer.vue')['default']
+ LensesHeadersRendererEntry: typeof import('./components/lenses/HeadersRendererEntry.vue')['default']
+ LensesRenderersAudioLensRenderer: typeof import('./components/lenses/renderers/AudioLensRenderer.vue')['default']
+ LensesRenderersHTMLLensRenderer: typeof import('./components/lenses/renderers/HTMLLensRenderer.vue')['default']
+ LensesRenderersImageLensRenderer: typeof import('./components/lenses/renderers/ImageLensRenderer.vue')['default']
+ LensesRenderersJSONLensRenderer: typeof import('./components/lenses/renderers/JSONLensRenderer.vue')['default']
+ LensesRenderersPDFLensRenderer: typeof import('./components/lenses/renderers/PDFLensRenderer.vue')['default']
+ LensesRenderersRawLensRenderer: typeof import('./components/lenses/renderers/RawLensRenderer.vue')['default']
+ LensesRenderersVideoLensRenderer: typeof import('./components/lenses/renderers/VideoLensRenderer.vue')['default']
+ LensesRenderersXMLLensRenderer: typeof import('./components/lenses/renderers/XMLLensRenderer.vue')['default']
+ LensesResponseBodyRenderer: typeof import('./components/lenses/ResponseBodyRenderer.vue')['default']
ModalsNativeCACertificates: (typeof import("./../../hoppscotch-selfhost-desktop/src/components/modals/NativeCACertificates.vue"))["default"]
ModalsNativeClientCertificates: (typeof import("./../../hoppscotch-selfhost-desktop/src/components/modals/NativeClientCertificates.vue"))["default"]
ModalsNativeClientCertsAdd: (typeof import("./../../hoppscotch-selfhost-desktop/src/components/modals/NativeClientCertsAdd.vue"))["default"]
- ProfileUserDelete: (typeof import("./components/profile/UserDelete.vue"))["default"]
- RealtimeCommunication: (typeof import("./components/realtime/Communication.vue"))["default"]
- RealtimeConnectionConfig: (typeof import("./components/realtime/ConnectionConfig.vue"))["default"]
- RealtimeLog: (typeof import("./components/realtime/Log.vue"))["default"]
- RealtimeLogEntry: (typeof import("./components/realtime/LogEntry.vue"))["default"]
- RealtimeSubscription: (typeof import("./components/realtime/Subscription.vue"))["default"]
- SettingsExtension: (typeof import("./components/settings/Extension.vue"))["default"]
+ ProfileUserDelete: typeof import('./components/profile/UserDelete.vue')['default']
+ RealtimeCommunication: typeof import('./components/realtime/Communication.vue')['default']
+ RealtimeConnectionConfig: typeof import('./components/realtime/ConnectionConfig.vue')['default']
+ RealtimeLog: typeof import('./components/realtime/Log.vue')['default']
+ RealtimeLogEntry: typeof import('./components/realtime/LogEntry.vue')['default']
+ RealtimeSubscription: typeof import('./components/realtime/Subscription.vue')['default']
+ SettingsExtension: typeof import('./components/settings/Extension.vue')['default']
SettingsNativeInterceptor: (typeof import("./../../hoppscotch-selfhost-desktop/src/components/settings/NativeInterceptor.vue"))["default"]
- SettingsProxy: (typeof import("./components/settings/Proxy.vue"))["default"]
- Share: (typeof import("./components/share/index.vue"))["default"]
- ShareCreateModal: (typeof import("./components/share/CreateModal.vue"))["default"]
- ShareCustomizeModal: (typeof import("./components/share/CustomizeModal.vue"))["default"]
- ShareModal: (typeof import("./components/share/Modal.vue"))["default"]
- ShareRequest: (typeof import("./components/share/Request.vue"))["default"]
- ShareTemplatesButton: (typeof import("./components/share/templates/Button.vue"))["default"]
- ShareTemplatesEmbeds: (typeof import("./components/share/templates/Embeds.vue"))["default"]
- ShareTemplatesLink: (typeof import("./components/share/templates/Link.vue"))["default"]
- SmartAccentModePicker: (typeof import("./components/smart/AccentModePicker.vue"))["default"]
- SmartChangeLanguage: (typeof import("./components/smart/ChangeLanguage.vue"))["default"]
- SmartColorModePicker: (typeof import("./components/smart/ColorModePicker.vue"))["default"]
- SmartEnvInput: (typeof import("./components/smart/EnvInput.vue"))["default"]
- TabPrimary: (typeof import("./components/tab/Primary.vue"))["default"]
- TabSecondary: (typeof import("./components/tab/Secondary.vue"))["default"]
- Teams: (typeof import("./components/teams/index.vue"))["default"]
- TeamsAdd: (typeof import("./components/teams/Add.vue"))["default"]
- TeamsEdit: (typeof import("./components/teams/Edit.vue"))["default"]
- TeamsInvite: (typeof import("./components/teams/Invite.vue"))["default"]
- TeamsMemberStack: (typeof import("./components/teams/MemberStack.vue"))["default"]
- TeamsModal: (typeof import("./components/teams/Modal.vue"))["default"]
- TeamsTeam: (typeof import("./components/teams/Team.vue"))["default"]
- Tippy: (typeof import("vue-tippy"))["Tippy"]
- WorkspaceCurrent: (typeof import("./components/workspace/Current.vue"))["default"]
- WorkspaceSelector: (typeof import("./components/workspace/Selector.vue"))["default"]
+ SettingsProxy: typeof import('./components/settings/Proxy.vue')['default']
+ Share: typeof import('./components/share/index.vue')['default']
+ ShareCreateModal: typeof import('./components/share/CreateModal.vue')['default']
+ ShareCustomizeModal: typeof import('./components/share/CustomizeModal.vue')['default']
+ ShareModal: typeof import('./components/share/Modal.vue')['default']
+ ShareRequest: typeof import('./components/share/Request.vue')['default']
+ ShareTemplatesButton: typeof import('./components/share/templates/Button.vue')['default']
+ ShareTemplatesEmbeds: typeof import('./components/share/templates/Embeds.vue')['default']
+ ShareTemplatesLink: typeof import('./components/share/templates/Link.vue')['default']
+ SmartAccentModePicker: typeof import('./components/smart/AccentModePicker.vue')['default']
+ SmartChangeLanguage: typeof import('./components/smart/ChangeLanguage.vue')['default']
+ SmartColorModePicker: typeof import('./components/smart/ColorModePicker.vue')['default']
+ SmartEnvInput: typeof import('./components/smart/EnvInput.vue')['default']
+ TabPrimary: typeof import('./components/tab/Primary.vue')['default']
+ TabSecondary: typeof import('./components/tab/Secondary.vue')['default']
+ Teams: typeof import('./components/teams/index.vue')['default']
+ TeamsAdd: typeof import('./components/teams/Add.vue')['default']
+ TeamsEdit: typeof import('./components/teams/Edit.vue')['default']
+ TeamsInvite: typeof import('./components/teams/Invite.vue')['default']
+ TeamsMemberStack: typeof import('./components/teams/MemberStack.vue')['default']
+ TeamsModal: typeof import('./components/teams/Modal.vue')['default']
+ TeamsTeam: typeof import('./components/teams/Team.vue')['default']
+ Tippy: typeof import('vue-tippy')['Tippy']
+ WorkspaceCurrent: typeof import('./components/workspace/Current.vue')['default']
+ WorkspaceSelector: typeof import('./components/workspace/Selector.vue')['default']
}
}
diff --git a/packages/hoppscotch-common/src/components/graphql/Authorization.vue b/packages/hoppscotch-common/src/components/graphql/Authorization.vue
index d35fd83e3..c61319c55 100644
--- a/packages/hoppscotch-common/src/components/graphql/Authorization.vue
+++ b/packages/hoppscotch-common/src/components/graphql/Authorization.vue
@@ -32,68 +32,14 @@
@keyup.escape="hide()"
>
<HoppSmartItem
- v-if="!isRootCollection"
- label="Inherit"
- :icon="authName === 'Inherit' ? IconCircleDot : IconCircle"
- :active="authName === 'Inherit'"
+ v-for="item in authTypes"
+ :key="item.key"
+ :label="item.label"
+ :icon="item.key === authType ? IconCircleDot : IconCircle"
+ :active="item.key === authType"
@click="
() => {
- auth.authType = 'inherit'
- hide()
- }
- "
- />
- <HoppSmartItem
- label="None"
- :icon="authName === 'None' ? IconCircleDot : IconCircle"
- :active="authName === 'None'"
- @click="
- () => {
- auth.authType = 'none'
- hide()
- }
- "
- />
- <HoppSmartItem
- label="Basic Auth"
- :icon="authName === 'Basic Auth' ? IconCircleDot : IconCircle"
- :active="authName === 'Basic Auth'"
- @click="
- () => {
- auth.authType = 'basic'
- hide()
- }
- "
- />
- <HoppSmartItem
- label="Bearer Token"
- :icon="authName === 'Bearer' ? IconCircleDot : IconCircle"
- :active="authName === 'Bearer'"
- @click="
- () => {
- auth.authType = 'bearer'
- hide()
- }
- "
- />
- <HoppSmartItem
- label="OAuth 2.0"
- :icon="authName === 'OAuth 2.0' ? IconCircleDot : IconCircle"
- :active="authName === 'OAuth 2.0'"
- @click="
- () => {
- selectOAuth2AuthType()
- hide()
- }
- "
- />
- <HoppSmartItem
- label="API key"
- :icon="authName === 'API key' ? IconCircleDot : IconCircle"
- :active="authName === 'API key'"
- @click="
- () => {
- auth.authType = 'api-key'
+ item.handler ? item.handler() : (auth.authType = item.key)
hide()
}
"
@@ -168,13 +114,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'">
@@ -194,11 +144,14 @@
placeholder="Token"
/>
</div>
- <HttpOAuth2Authorization v-model="auth" source="GraphQL" />
+ <HttpAuthorizationOAuth2 v-model="auth" source="GraphQL" />
</div>
<div v-if="auth.authType === 'api-key'">
<HttpAuthorizationApiKey v-model="auth" />
</div>
+ <div v-if="auth.authType === 'aws-signature'">
+ <HttpAuthorizationAWSSign v-model="auth" />
+ </div>
</div>
<div
class="z-[9] sticky top-upperTertiaryStickyFold h-full min-w-[12rem] max-w-1/3 flex-shrink-0 overflow-auto overflow-x-auto bg-primary p-4"
@@ -237,6 +190,12 @@ import IconTrash2 from "~icons/lucide/trash-2"
import { getDefaultAuthCodeOauthFlowParams } from "~/services/oauth/flows/authCode"
+type AuthType = {
+ key: HoppGQLAuth["authType"]
+ label: string
+ handler?: () => void
+}
+
const t = useI18n()
const colorMode = useColorMode()
@@ -263,26 +222,6 @@ onMounted(() => {
const auth = useVModel(props, "modelValue", emit)
-const AUTH_KEY_NAME = {
- basic: "Basic Auth",
- bearer: "Bearer",
- "oauth-2": "OAuth 2.0",
- "api-key": "API key",
- none: "None",
- inherit: "Inherit",
-} as const
-
-const authType = pluckRef(auth, "authType")
-
-const authName = computed(() =>
- AUTH_KEY_NAME[authType.value] ? AUTH_KEY_NAME[authType.value] : "None"
-)
-
-const getAuthName = (type: HoppGQLAuth["authType"] | undefined) => {
- if (!type) return "None"
- return AUTH_KEY_NAME[type] ? AUTH_KEY_NAME[type] : "None"
-}
-
const selectOAuth2AuthType = () => {
const defaultGrantTypeInfo: HoppGQLAuthOAuth2["grantTypeInfo"] = {
...getDefaultAuthCodeOauthFlowParams(),
@@ -307,6 +246,59 @@ const selectOAuth2AuthType = () => {
}
}
+const authTypes: AuthType[] = [
+ {
+ key: "inherit",
+ label: "Inherit",
+ },
+ {
+ key: "none",
+ label: "None",
+ },
+ {
+ key: "basic",
+ label: "Basic Auth",
+ },
+ {
+ key: "bearer",
+ label: "Bearer",
+ },
+ {
+ key: "oauth-2",
+ label: "OAuth 2.0",
+ handler: selectOAuth2AuthType,
+ },
+ {
+ key: "api-key",
+ label: "API Key",
+ },
+ {
+ key: "aws-signature",
+ label: "AWS Signature",
+ },
+]
+
+const AUTH_KEY_NAME: Record<HoppGQLAuth["authType"], string> = {
+ basic: "Basic Auth",
+ bearer: "Bearer",
+ "oauth-2": "OAuth 2.0",
+ "api-key": "API key",
+ none: "None",
+ inherit: "Inherit",
+ "aws-signature": "AWS Signature",
+}
+
+const authType = pluckRef(auth, "authType")
+
+const authName = computed(() =>
+ AUTH_KEY_NAME[authType.value] ? AUTH_KEY_NAME[authType.value] : "None"
+)
+
+const getAuthName = (type: HoppGQLAuth["authType"] | undefined) => {
+ if (!type) return "None"
+ return AUTH_KEY_NAME[type] ? AUTH_KEY_NAME[type] : "None"
+}
+
const authActive = pluckRef(auth, "authActive")
const clearContent = () => {
diff --git a/packages/hoppscotch-common/src/components/graphql/Headers.vue b/packages/hoppscotch-common/src/components/graphql/Headers.vue
index 1a6904fcf..c2cb058b7 100644
--- a/packages/hoppscotch-common/src/components/graphql/Headers.vue
+++ b/packages/hoppscotch-common/src/components/graphql/Headers.vue
@@ -231,26 +231,25 @@ import { useColorMode } from "@composables/theming"
import { useToast } from "@composables/toast"
import {
GQLHeader,
- HoppGQLAuth,
HoppGQLRequest,
parseRawKeyValueEntriesE,
rawKeyValueEntriesToString,
RawKeyValueEntry,
} from "@hoppscotch/data"
-import { useVModel } from "@vueuse/core"
+import { computedAsync, useVModel } from "@vueuse/core"
+import { AwsV4Signer } from "aws4fetch"
import * as A from "fp-ts/Array"
import * as E from "fp-ts/Either"
import * as O from "fp-ts/Option"
import * as RA from "fp-ts/ReadonlyArray"
import { flow, pipe } from "fp-ts/function"
import { clone, cloneDeep, isEqual } from "lodash-es"
-import { computed, reactive, ref, toRef, watch } from "vue"
+import { reactive, ref, toRef, watch } from "vue"
import draggable from "vuedraggable-es"
import { useNestedSetting } from "~/composables/settings"
import { throwError } from "~/helpers/functional/error"
import { objRemoveKey } from "~/helpers/functional/object"
-import { HoppGQLHeader } from "~/helpers/graphql"
import { commonHeaders } from "~/helpers/headers"
import { HoppInheritedProperty } from "~/helpers/types/HoppInheritedProperties"
import { toggleNestedSetting } from "~/newstore/settings"
@@ -524,7 +523,7 @@ const clearContent = () => {
bulkHeaders.value = ""
}
-const getComputedAuthHeaders = (
+const getComputedAuthHeaders = async (
req?: HoppGQLRequest,
auth?: HoppGQLRequest["auth"]
) => {
@@ -537,7 +536,7 @@ const getComputedAuthHeaders = (
if (!request.auth || !request.auth.authActive) return []
- const headers: HoppGQLHeader[] = []
+ const headers: GQLHeader[] = []
// TODO: Support a better b64 implementation than btoa ?
if (request.auth.authType === "basic") {
@@ -548,6 +547,7 @@ const getComputedAuthHeaders = (
active: true,
key: "Authorization",
value: `Basic ${btoa(`${username}:${password}`)}`,
+ description: "",
})
} else if (
request.auth.authType === "bearer" ||
@@ -563,6 +563,7 @@ const getComputedAuthHeaders = (
active: true,
key: "Authorization",
value: `Bearer ${token}`,
+ description: "",
})
} else if (request.auth.authType === "api-key") {
const { key, addTo } = request.auth
@@ -572,6 +573,35 @@ const getComputedAuthHeaders = (
active: true,
key,
value: request.auth.value ?? "",
+ description: "",
+ })
+ }
+ } else if (request.auth.authType === "aws-signature") {
+ const { addTo } = request.auth
+ if (addTo === "HEADERS") {
+ const currentDate = new Date()
+ const amzDate = currentDate.toISOString().replace(/[:-]|\.\d{3}/g, "")
+
+ const { url } = req as HoppGQLRequest
+
+ const signer = new AwsV4Signer({
+ datetime: amzDate,
+ accessKeyId: request.auth.accessKey,
+ secretAccessKey: request.auth.secretKey,
+ region: request.auth.region ?? "us-east-1",
+ service: request.auth.serviceName,
+ url,
+ })
+
+ const sign = await signer.sign()
+
+ sign.headers.forEach((x, k) => {
+ headers.push({
+ active: true,
+ key: k,
+ value: x,
+ description: "",
+ })
})
}
}
@@ -579,23 +609,23 @@ const getComputedAuthHeaders = (
return headers
}
-const getComputedHeaders = (req: HoppGQLRequest) => {
+const getComputedHeaders = async (req: HoppGQLRequest) => {
return [
- ...getComputedAuthHeaders(req).map((header) => ({
+ ...(await getComputedAuthHeaders(req)).map((header) => ({
source: "auth" as const,
header,
})),
]
}
-const computedHeaders = computed(() =>
- getComputedHeaders(request.value).map((header, index) => ({
+const computedHeaders = computedAsync(async () =>
+ (await getComputedHeaders(request.value)).map((header, index) => ({
id: `header-${index}`,
...header,
}))
)
-const inheritedProperties = computed(() => {
+const inheritedProperties = computedAsync(async () => {
if (!props.inheritedProperties?.auth || !props.inheritedProperties.headers)
return []
@@ -642,10 +672,10 @@ const inheritedProperties = computed(() => {
}
}[]
- const computedAuthHeader = getComputedAuthHeaders(
+ const [computedAuthHeader] = await getComputedAuthHeaders(
request.value,
- props.inheritedProperties.auth.inheritedAuth as HoppGQLAuth
- )[0]
+ props.inheritedProperties.auth.inheritedAuth
+ )
if (
computedAuthHeader &&
diff --git a/packages/hoppscotch-common/src/components/graphql/RequestOptions.vue b/packages/hoppscotch-common/src/components/graphql/RequestOptions.vue
index 17f68aa50..f54aa333a 100644
--- a/packages/hoppscotch-common/src/components/graphql/RequestOptions.vue
+++ b/packages/hoppscotch-common/src/components/graphql/RequestOptions.vue
@@ -1,58 +1,56 @@
<template>
- <div class="h-full">
- <HoppSmartTabs
- v-model="selectedOptionTab"
- styles="sticky top-0 bg-primary z-10 border-b-0"
- :render-inactive-tabs="true"
+ <HoppSmartTabs
+ v-model="selectedOptionTab"
+ styles="sticky bg-primary top-0 z-10 border-b-0"
+ :render-inactive-tabs="true"
+ >
+ <HoppSmartTab
+ :id="'query'"
+ :label="`${t('tab.query')}`"
+ :indicator="request.query && request.query.length > 0 ? true : false"
>
- <HoppSmartTab
- :id="'query'"
- :label="`${t('tab.query')}`"
- :indicator="request.query && request.query.length > 0 ? true : false"
- >
- <GraphqlQuery
- v-model="request.query"
- @run-query="runQuery"
- @save-request="saveRequest"
- />
- </HoppSmartTab>
- <HoppSmartTab
- :id="'variables'"
- :label="`${t('tab.variables')}`"
- :indicator="
- request.variables && request.variables.length > 0 ? true : false
- "
- >
- <GraphqlVariable
- v-model="request.variables"
- @run-query="runQuery"
- @save-request="saveRequest"
- />
- </HoppSmartTab>
- <HoppSmartTab
- :id="'headers'"
- :label="`${t('tab.headers')}`"
- :info="activeGQLHeadersCount === 0 ? null : `${activeGQLHeadersCount}`"
- >
- <GraphqlHeaders
- v-model="request"
- :inherited-properties="inheritedProperties"
- @change-tab="changeOptionTab"
- />
- </HoppSmartTab>
- <HoppSmartTab :id="'authorization'" :label="`${t('tab.authorization')}`">
- <GraphqlAuthorization
- v-model="request.auth"
- :inherited-properties="inheritedProperties"
- />
- </HoppSmartTab>
- </HoppSmartTabs>
- <CollectionsSaveRequest
- mode="graphql"
- :show="showSaveRequestModal"
- @hide-modal="hideRequestModal"
- />
- </div>
+ <GraphqlQuery
+ v-model="request.query"
+ @run-query="runQuery"
+ @save-request="saveRequest"
+ />
+ </HoppSmartTab>
+ <HoppSmartTab
+ :id="'variables'"
+ :label="`${t('tab.variables')}`"
+ :indicator="
+ request.variables && request.variables.length > 0 ? true : false
+ "
+ >
+ <GraphqlVariable
+ v-model="request.variables"
+ @run-query="runQuery"
+ @save-request="saveRequest"
+ />
+ </HoppSmartTab>
+ <HoppSmartTab
+ :id="'headers'"
+ :label="`${t('tab.headers')}`"
+ :info="activeGQLHeadersCount === 0 ? null : `${activeGQLHeadersCount}`"
+ >
+ <GraphqlHeaders
+ v-model="request"
+ :inherited-properties="inheritedProperties"
+ @change-tab="changeOptionTab"
+ />
+ </HoppSmartTab>
+ <HoppSmartTab :id="'authorization'" :label="`${t('tab.authorization')}`">
+ <GraphqlAuthorization
+ v-model="request.auth"
+ :inherited-properties="inheritedProperties"
+ />
+ </HoppSmartTab>
+ </HoppSmartTabs>
+ <CollectionsSaveRequest
+ mode="graphql"
+ :show="showSaveRequestModal"
+ @hide-modal="hideRequestModal"
+ />
</template>
<script setup lang="ts">
diff --git a/packages/hoppscotch-common/src/components/http/Authorization.vue b/packages/hoppscotch-common/src/components/http/Authorization.vue
index 7f04db264..fa9c598f7 100644
--- a/packages/hoppscotch-common/src/components/http/Authorization.vue
+++ b/packages/hoppscotch-common/src/components/http/Authorization.vue
@@ -32,68 +32,14 @@
@keyup.escape="hide()"
>
<HoppSmartItem
- v-if="!isRootCollection"
- label="Inherit"
- :icon="authName === 'Inherit' ? IconCircleDot : IconCircle"
- :active="authName === 'Inherit'"
+ v-for="item in authTypes"
+ :key="item.key"
+ :label="item.label"
+ :icon="item.key === authType ? IconCircleDot : IconCircle"
+ :active="item.key === authType"
@click="
() => {
- auth.authType = 'inherit'
- hide()
- }
- "
- />
- <HoppSmartItem
- label="None"
- :icon="authName === 'None' ? IconCircleDot : IconCircle"
- :active="authName === 'None'"
- @click="
- () => {
- auth.authType = 'none'
- hide()
- }
- "
- />
- <HoppSmartItem
- label="Basic Auth"
- :icon="authName === 'Basic Auth' ? IconCircleDot : IconCircle"
- :active="authName === 'Basic Auth'"
- @click="
- () => {
- auth.authType = 'basic'
- hide()
- }
- "
- />
- <HoppSmartItem
- label="Bearer Token"
- :icon="authName === 'Bearer' ? IconCircleDot : IconCircle"
- :active="authName === 'Bearer'"
- @click="
- () => {
- auth.authType = 'bearer'
- hide()
- }
- "
- />
- <HoppSmartItem
- label="OAuth 2.0"
- :icon="authName === 'OAuth 2.0' ? IconCircleDot : IconCircle"
- :active="authName === 'OAuth 2.0'"
- @click="
- () => {
- selectOAuth2AuthType()
- hide()
- }
- "
- />
- <HoppSmartItem
- label="API key"
- :icon="authName === 'API key' ? IconCircleDot : IconCircle"
- :active="authName === 'API key'"
- @click="
- () => {
- auth.authType = 'api-key'
+ item.handler ? item.handler() : (auth.authType = item.key)
hide()
}
"
@@ -174,6 +120,7 @@
placeholder="Token"
:auto-complete-env="true"
:envs="envs"
+ class="px-4"
/>
</div>
</div>
@@ -189,7 +136,7 @@
"
/>
</div>
- <HttpOAuth2Authorization
+ <HttpAuthorizationOAuth2
v-model="auth"
:is-collection-property="isCollectionProperty"
:envs="envs"
@@ -199,6 +146,9 @@
<div v-if="auth.authType === 'api-key'">
<HttpAuthorizationApiKey v-model="auth" :envs="envs" />
</div>
+ <div v-if="auth.authType === 'aws-signature'">
+ <HttpAuthorizationAWSSign v-model="auth" :envs="envs" />
+ </div>
</div>
<div
class="z-[9] sticky top-upperTertiaryStickyFold h-full min-w-[12rem] max-w-1/3 flex-shrink-0 overflow-auto overflow-x-auto bg-primary p-4"
@@ -272,26 +222,52 @@ onMounted(() => {
}
})
-const AUTH_KEY_NAME = {
- basic: "Basic Auth",
- bearer: "Bearer",
- "oauth-2": "OAuth 2.0",
- "api-key": "API key",
- none: "None",
- inherit: "Inherit",
-} as const
+type AuthType = {
+ key: HoppRESTAuth["authType"]
+ label: string
+ handler?: () => void
+}
-const authType = pluckRef(auth, "authType")
-const authName = computed(() =>
- AUTH_KEY_NAME[authType.value] ? AUTH_KEY_NAME[authType.value] : "None"
-)
+const authTypes: AuthType[] = [
+ {
+ key: "inherit",
+ label: "Inherit",
+ },
+ {
+ key: "none",
+ label: "None",
+ },
+ {
+ key: "basic",
+ label: "Basic Auth",
+ },
+ {
+ key: "bearer",
+ label: "Bearer",
+ },
+ {
+ key: "oauth-2",
+ label: "OAuth 2.0",
+ handler: selectOAuth2AuthType,
+ },
+ {
+ key: "api-key",
+ label: "API Key",
+ },
+ {
+ key: "aws-signature",
+ label: "AWS Signature",
+ },
+]
+const authType = pluckRef(auth, "authType")
const getAuthName = (type: HoppRESTAuth["authType"] | undefined) => {
if (!type) return "None"
- return AUTH_KEY_NAME[type] ? AUTH_KEY_NAME[type] : "None"
+ return authTypes.find((a) => a.key === type)?.label || "None"
}
+const authName = computed(() => getAuthName(authType.value))
-const selectOAuth2AuthType = () => {
+function selectOAuth2AuthType() {
const defaultGrantTypeInfo: HoppRESTAuthOAuth2["grantTypeInfo"] = {
...getDefaultAuthCodeOauthFlowParams(),
grantType: "AUTHORIZATION_CODE",
diff --git a/packages/hoppscotch-common/src/components/http/Headers.vue b/packages/hoppscotch-common/src/components/http/Headers.vue
index a19517359..03936ae49 100644
--- a/packages/hoppscotch-common/src/components/http/Headers.vue
+++ b/packages/hoppscotch-common/src/components/http/Headers.vue
@@ -253,17 +253,17 @@ import {
rawKeyValueEntriesToString,
RawKeyValueEntry,
} from "@hoppscotch/data"
-import { useVModel } from "@vueuse/core"
-import { useService } from "dioc/vue"
import * as A from "fp-ts/Array"
import * as E from "fp-ts/Either"
import { flow, pipe } from "fp-ts/function"
import * as O from "fp-ts/Option"
import * as RA from "fp-ts/ReadonlyArray"
import { cloneDeep, isEqual } from "lodash-es"
-import { computed, reactive, ref, toRef, watch } from "vue"
+import { reactive, ref, toRef, watch } from "vue"
import draggable from "vuedraggable-es"
+import { computedAsync, useVModel } from "@vueuse/core"
+import { useService } from "dioc/vue"
import { useNestedSetting } from "~/composables/settings"
import linter from "~/helpers/editor/linting/rawKeyValue"
import { throwError } from "~/helpers/functional/error"
@@ -545,16 +545,18 @@ const clearContent = () => {
const aggregateEnvs = useReadonlyStream(aggregateEnvs$, getAggregateEnvs())
-const computedHeaders = computed(() =>
- getComputedHeaders(request.value, aggregateEnvs.value, false).map(
- (header, index) => ({
- id: `header-${index}`,
- ...header,
- })
- )
+const computedHeaders = computedAsync(
+ async () =>
+ (await getComputedHeaders(request.value, aggregateEnvs.value, false)).map(
+ (header, index) => ({
+ id: `header-${index}`,
+ ...header,
+ })
+ ),
+ []
)
-const inheritedProperties = computed(() => {
+const inheritedProperties = computedAsync(async () => {
if (!props.inheritedProperties?.auth || !props.inheritedProperties.headers)
return []
@@ -601,12 +603,12 @@ const inheritedProperties = computed(() => {
}
}[]
- const computedAuthHeader = getComputedAuthHeaders(
+ const [computedAuthHeader] = await getComputedAuthHeaders(
aggregateEnvs.value,
request.value,
props.inheritedProperties.auth.inheritedAuth,
false
- )[0]
+ )
if (
computedAuthHeader &&
diff --git a/packages/hoppscotch-common/src/components/http/authorization/ASAP.vue b/packages/hoppscotch-common/src/components/http/authorization/ASAP.vue
new file mode 100644
index 000000000..1a36b6fea
--- /dev/null
+++ b/packages/hoppscotch-common/src/components/http/authorization/ASAP.vue
@@ -0,0 +1,192 @@
+<template>
+ <div class="flex flex-1 border-b border-dividerLight">
+ <SmartEnvInput
+ v-model="auth.issuer"
+ :auto-complete-env="true"
+ placeholder="Issuer"
+ :envs="envs"
+ />
+ </div>
+ <div class="flex flex-1 border-b border-dividerLight">
+ <SmartEnvInput
+ v-model="auth.audience"
+ :auto-complete-env="true"
+ placeholder="Audience"
+ :envs="envs"
+ />
+ </div>
+ <div class="flex flex-1 border-b border-dividerLight">
+ <SmartEnvInput
+ v-model="auth.keyId"
+ :auto-complete-env="true"
+ placeholder="Key ID"
+ :envs="envs"
+ />
+ </div>
+
+ <div class="flex items-center border-b border-dividerLight">
+ <span class="flex items-center">
+ <label class="ml-4 text-secondaryLight"> Algorithm </label>
+ <tippy
+ interactive
+ trigger="click"
+ theme="popover"
+ :on-shown="() => authTippyActions.focus()"
+ >
+ <HoppSmartSelectWrapper>
+ <HoppButtonSecondary
+ :label="auth.algorithm"
+ class="ml-2 rounded-none pr-8"
+ />
+ </HoppSmartSelectWrapper>
+ <template #content="{ hide }">
+ <div
+ ref="authTippyActions"
+ class="flex flex-col focus:outline-none"
+ tabindex="0"
+ @keyup.escape="hide()"
+ >
+ <HoppSmartItem
+ v-for="alg in algorithms"
+ :key="alg"
+ :icon="auth.algorithm === alg ? IconCircleDot : IconCircle"
+ :active="auth.algorithm === alg"
+ :label="alg"
+ @click="
+ () => {
+ auth.algorithm = alg
+ hide()
+ }
+ "
+ />
+ </div>
+ </template>
+ </tippy>
+ </span>
+ </div>
+
+ <div class="flex flex-1 border-b border-dividerLight items-center">
+ <label class="ml-4 text-secondaryLight"> Private Key </label>
+ <label :for="`attachment`" class="p-0">
+ <input
+ :id="`attachment`"
+ :name="`attachment`"
+ type="file"
+ multiple
+ class="cursor-pointer p-1 text-tiny text-secondaryLight transition file:mr-2 file:cursor-pointer file:rounded file:border-0 file:bg-primaryLight file:px-4 file:py-1 file:text-tiny file:text-secondary file:transition hover:text-secondaryDark hover:file:bg-primaryDark hover:file:text-secondaryDark"
+ @change="setPrivateKey($event)"
+ />
+ </label>
+ </div>
+ <pre>
+ {{ auth.privateKey }}
+ </pre>
+
+ <!-- advanced config -->
+
+ <div>
+ <!-- label as advanced config here -->
+ <div class="p-4">
+ <label class="text-secondaryLight"> Optional Configuration </label>
+ </div>
+ <div class="flex flex-1 border-b border-dividerLight h-[300px]">
+ <label class="ml-4 text-secondaryLight"> Additional Claims </label>
+ <div class="h-full relative">
+ <div ref="claimsRef" class="absolute inset-0"></div>
+ </div>
+ </div>
+ <div class="flex flex-1 border-b border-dividerLight">
+ <SmartEnvInput
+ v-model="auth.subject"
+ :auto-complete-env="true"
+ placeholder="Subject"
+ :envs="envs"
+ />
+ </div>
+ <div class="flex flex-1 border-b border-dividerLight">
+ <SmartEnvInput
+ v-model="auth.expiresIn"
+ :auto-complete-env="true"
+ placeholder="Expires In"
+ :envs="envs"
+ />
+ </div>
+ </div>
+</template>
+
+<script setup lang="ts">
+import IconCircle from "~icons/lucide/circle"
+import IconCircleDot from "~icons/lucide/circle-dot"
+import { useI18n } from "@composables/i18n"
+import { HoppRESTAuthASAP } from "@hoppscotch/data"
+import { useVModel } from "@vueuse/core"
+import { ref } from "vue"
+import { AggregateEnvironment } from "~/newstore/environments"
+import { useCodemirror } from "~/composables/codemirror"
+import { reactive } from "vue"
+import { Ref } from "vue"
+import { getEditorLangForMimeType } from "~/helpers/editorutils"
+import JSONLinter from "~/helpers/editor/linting/json"
+
+const t = useI18n()
+
+const props = defineProps<{
+ modelValue: HoppRESTAuthASAP
+ envs?: AggregateEnvironment[]
+}>()
+
+const emit = defineEmits<{
+ (e: "update:modelValue", value: HoppRESTAuthASAP): void
+}>()
+
+const auth = useVModel(props, "modelValue", emit)
+
+const claimsRef = ref<any | null>(null)
+const codemirrorValue: Ref<string | undefined> =
+ typeof auth.value.additionalClaims === "string"
+ ? ref(auth.value.additionalClaims)
+ : ref(undefined)
+
+useCodemirror(
+ claimsRef,
+ codemirrorValue,
+ reactive({
+ extendedEditorConfig: {
+ mode: getEditorLangForMimeType("application/json"),
+ placeholder: t("request.raw_body").toString(),
+ },
+ linter: JSONLinter,
+ completer: null,
+ environmentHighlights: true,
+ })
+)
+
+const algorithms: HoppRESTAuthASAP["algorithm"][] = [
+ "RS256",
+ "RS384",
+ "RS512",
+ "PS256",
+ "PS384",
+ "PS512",
+ "ES256",
+ "ES384",
+ "ES512",
+]
+
+const setPrivateKey = (e: Event) => {
+ const target = e.target as HTMLInputElement
+ const file = target.files?.[0]
+ if (!file) return
+
+ const reader = new FileReader()
+ reader.onload = (e) => {
+ const result = e.target?.result
+ if (typeof result !== "string") return
+
+ auth.value.privateKey = result
+ }
+ reader.readAsText(file)
+}
+
+const authTippyActions = ref<any | null>(null)
+</script>
diff --git a/packages/hoppscotch-common/src/components/http/authorization/AWSSign.vue b/packages/hoppscotch-common/src/components/http/authorization/AWSSign.vue
new file mode 100644
index 000000000..6b3a5d3e9
--- /dev/null
+++ b/packages/hoppscotch-common/src/components/http/authorization/AWSSign.vue
@@ -0,0 +1,140 @@
+<template>
+ <div class="flex flex-1 border-b border-dividerLight">
+ <SmartEnvInput
+ v-model="auth.accessKey"
+ :auto-complete-env="true"
+ :placeholder="t('authorization.aws_signature.access_key')"
+ :envs="envs"
+ />
+ </div>
+ <div class="flex flex-1 border-b border-dividerLight">
+ <SmartEnvInput
+ v-model="auth.secretKey"
+ :auto-complete-env="true"
+ :placeholder="t('authorization.aws_signature.secret_key')"
+ :envs="envs"
+ />
+ </div>
+
+ <!-- advanced config -->
+
+ <div class="flex flex-col divide-y divide-dividerLight">
+ <!-- label as advanced config here -->
+ <div class="p-4 flex flex-col space-y-1">
+ <label class="">
+ {{ t("authorization.aws_signature.advance_config") }}
+ </label>
+ <p class="text-secondaryLight">
+ {{ t("authorization.aws_signature.advance_config_description") }}
+ </p>
+ </div>
+ <div class="flex flex-1">
+ <SmartEnvInput
+ v-model="auth.region"
+ :auto-complete-env="true"
+ :placeholder="t('authorization.aws_signature.aws_region')"
+ :envs="envs"
+ />
+ </div>
+ <div class="flex flex-1">
+ <SmartEnvInput
+ v-model="auth.serviceName"
+ :auto-complete-env="true"
+ :placeholder="t('authorization.aws_signature.service_name')"
+ :envs="envs"
+ />
+ </div>
+ <div class="flex flex-1">
+ <SmartEnvInput
+ v-model="auth.serviceToken"
+ :auto-complete-env="true"
+ :placeholder="t('authorization.aws_signature.service_token')"
+ :envs="envs"
+ />
+ </div>
+ <div class="flex items-center !border-b border-dividerLight">
+ <span class="flex items-center">
+ <label class="ml-4 text-secondaryLight">
+ {{ t("authorization.pass_key_by") }}
+ </label>
+ <tippy
+ interactive
+ trigger="click"
+ theme="popover"
+ :on-shown="() => authTippyActions.focus()"
+ >
+ <HoppSmartSelectWrapper>
+ <HoppButtonSecondary
+ :label="
+ auth.addTo
+ ? auth.addTo === 'HEADERS'
+ ? t('authorization.pass_by_headers_label')
+ : t('authorization.pass_by_query_params_label')
+ : t('state.none')
+ "
+ class="ml-2 rounded-none pr-8"
+ />
+ </HoppSmartSelectWrapper>
+ <template #content="{ hide }">
+ <div
+ ref="authTippyActions"
+ class="flex flex-col focus:outline-none"
+ tabindex="0"
+ @keyup.escape="hide()"
+ >
+ <HoppSmartItem
+ :icon="auth.addTo === 'HEADERS' ? IconCircleDot : IconCircle"
+ :active="auth.addTo === 'HEADERS'"
+ :label="t('authorization.pass_by_headers_label')"
+ @click="
+ () => {
+ auth.addTo = 'HEADERS'
+ hide()
+ }
+ "
+ />
+ <HoppSmartItem
+ :icon="
+ auth.addTo === 'QUERY_PARAMS' ? IconCircleDot : IconCircle
+ "
+ :active="auth.addTo === 'QUERY_PARAMS'"
+ :label="t('authorization.pass_by_query_params_label')"
+ @click="
+ () => {
+ auth.addTo = 'QUERY_PARAMS'
+ hide()
+ }
+ "
+ />
+ </div>
+ </template>
+ </tippy>
+ </span>
+ </div>
+ </div>
+</template>
+
+<script setup lang="ts">
+import IconCircle from "~icons/lucide/circle"
+import IconCircleDot from "~icons/lucide/circle-dot"
+import { useI18n } from "@composables/i18n"
+import { HoppRESTAuthAWSSignature } from "@hoppscotch/data"
+import { useVModel } from "@vueuse/core"
+import { AggregateEnvironment } from "~/newstore/environments"
+import { ref } from "vue"
+
+const t = useI18n()
+
+const props = defineProps<{
+ modelValue: HoppRESTAuthAWSSignature
+ envs?: AggregateEnvironment[]
+}>()
+
+const emit = defineEmits<{
+ (e: "update:modelValue", value: HoppRESTAuthAWSSignature): void
+}>()
+
+const auth = useVModel(props, "modelValue", emit)
+
+const authTippyActions = ref<any | null>(null)
+</script>
diff --git a/packages/hoppscotch-common/src/components/http/authorization/AkamaiEG.vue b/packages/hoppscotch-common/src/components/http/authorization/AkamaiEG.vue
new file mode 100644
index 000000000..99a43f096
--- /dev/null
+++ b/packages/hoppscotch-common/src/components/http/authorization/AkamaiEG.vue
@@ -0,0 +1,96 @@
+<template>
+ <div class="flex flex-1 border-b border-dividerLight">
+ <SmartEnvInput
+ v-model="auth.accessToken"
+ :auto-complete-env="true"
+ placeholder="Access Token"
+ :envs="envs"
+ />
+ </div>
+ <div class="flex flex-1 border-b border-dividerLight">
+ <SmartEnvInput
+ v-model="auth.clientToken"
+ :auto-complete-env="true"
+ placeholder="Client Token"
+ :envs="envs"
+ />
+ </div>
+ <div class="flex flex-1 border-b border-dividerLight">
+ <SmartEnvInput
+ v-model="auth.clientSecret"
+ :auto-complete-env="true"
+ placeholder="Client Secret"
+ :envs="envs"
+ />
+ </div>
+
+ <!-- advanced config -->
+
+ <div>
+ <!-- label as advanced config here -->
+ <div class="p-4">
+ <label class="text-secondaryLight"> Advanced Configuration </label>
+ <p>
+ Hoppscotch automatically assigns default values to certain fields if no
+ explicit value is provided.
+ </p>
+ </div>
+ <div class="flex flex-1 border-b border-dividerLight">
+ <SmartEnvInput
+ v-model="auth.nonce"
+ :auto-complete-env="true"
+ placeholder="Nonce"
+ :envs="envs"
+ />
+ </div>
+ <div class="flex flex-1 border-b border-dividerLight">
+ <SmartEnvInput
+ v-model="auth.timestamp"
+ :auto-complete-env="true"
+ placeholder="Timestamp"
+ :envs="envs"
+ />
+ </div>
+ <div class="flex flex-1 border-b border-dividerLight">
+ <SmartEnvInput
+ v-model="auth.host"
+ :auto-complete-env="true"
+ placeholder="Host"
+ :envs="envs"
+ />
+ </div>
+ <div class="flex flex-1 border-b border-dividerLight">
+ <SmartEnvInput
+ v-model="auth.headersToSign"
+ :auto-complete-env="true"
+ placeholder="Headers to Sign"
+ :envs="envs"
+ />
+ </div>
+ <div class="flex flex-1 border-b border-dividerLight">
+ <SmartEnvInput
+ v-model="auth.maxBody"
+ :auto-complete-env="true"
+ placeholder="Max Body Size"
+ :envs="envs"
+ />
+ </div>
+ </div>
+</template>
+
+<script setup lang="ts">
+import { HoppRESTAuthAkamaiEdgeGrid } from "@hoppscotch/data"
+import { useVModel } from "@vueuse/core"
+import { AggregateEnvironment } from "~/newstore/environments"
+
+const props = defineProps<{
+ modelValue: HoppRESTAuthAkamaiEdgeGrid
+ envs?: AggregateEnvironment[]
+}>()
+
+const emit = defineEmits<{
+ (e: "update:modelValue", value: HoppRESTAuthAkamaiEdgeGrid): void
+}>()
+
+const auth = useVModel(props, "modelValue", emit)
+</script>
diff --git a/packages/hoppscotch-common/src/components/http/authorization/HAWK.vue b/packages/hoppscotch-common/src/components/http/authorization/HAWK.vue
new file mode 100644
index 000000000..db1eebb38
--- /dev/null
+++ b/packages/hoppscotch-common/src/components/http/authorization/HAWK.vue
@@ -0,0 +1,152 @@
+<template>
+ <div class="flex flex-1 border-b border-dividerLight">
+ <SmartEnvInput
+ v-model="auth.authId"
+ :auto-complete-env="true"
+ placeholder="HAWK Auth ID"
+ :envs="envs"
+ />
+ </div>
+ <div class="flex flex-1 border-b border-dividerLight">
+ <SmartEnvInput
+ v-model="auth.authKey"
+ :auto-complete-env="true"
+ placeholder="HAWK Auth Key"
+ :envs="envs"
+ />
+ </div>
+
+ <div class="flex items-center border-b border-dividerLight">
+ <span class="flex items-center">
+ <label class="ml-4 text-secondaryLight"> Algorithm </label>
+ <tippy
+ interactive
+ trigger="click"
+ theme="popover"
+ :on-shown="() => authTippyActions.focus()"
+ >
+ <HoppSmartSelectWrapper>
+ <HoppButtonSecondary
+ :label="auth.algorithm"
+ class="ml-2 rounded-none pr-8"
+ />
+ </HoppSmartSelectWrapper>
+ <template #content="{ hide }">
+ <div
+ ref="authTippyActions"
+ class="flex flex-col focus:outline-none"
+ tabindex="0"
+ @keyup.escape="hide()"
+ >
+ <HoppSmartItem
+ v-for="alg in algorithms"
+ :key="alg"
+ :icon="auth.algorithm === alg ? IconCircleDot : IconCircle"
+ :active="auth.algorithm === alg"
+ :label="alg"
+ @click="
+ () => {
+ auth.algorithm = alg
+ hide()
+ }
+ "
+ />
+ </div>
+ </template>
+ </tippy>
+ </span>
+ </div>
+
+ <!-- advanced config -->
+
+ <div>
+ <!-- label as advanced config here -->
+ <div class="p-4">
+ <label class="text-secondaryLight"> Optional Config </label>
+ </div>
+ <div class="flex flex-1 border-b border-dividerLight">
+ <SmartEnvInput
+ v-model="auth.user"
+ :auto-complete-env="true"
+ :placeholder="t('authorization.username')"
+ :envs="envs"
+ />
+ </div>
+ <div class="flex flex-1 border-b border-dividerLight">
+ <SmartEnvInput
+ v-model="auth.nonce"
+ :auto-complete-env="true"
+ placeholder="Nonce"
+ :envs="envs"
+ />
+ </div>
+ <div class="flex flex-1 border-b border-dividerLight">
+ <SmartEnvInput
+ v-model="auth.ext"
+ :auto-complete-env="true"
+ placeholder="ext"
+ :envs="envs"
+ />
+ </div>
+ <div class="flex flex-1 border-b border-dividerLight">
+ <SmartEnvInput
+ v-model="auth.app"
+ :auto-complete-env="true"
+ placeholder="app"
+ :envs="envs"
+ />
+ </div>
+ <div class="flex flex-1 border-b border-dividerLight">
+ <SmartEnvInput
+ v-model="auth.dlg"
+ :auto-complete-env="true"
+ placeholder="dlg"
+ :envs="envs"
+ />
+ </div>
+ <div class="flex flex-1 border-b border-dividerLight">
+ <SmartEnvInput
+ v-model="auth.timestamp"
+ :auto-complete-env="true"
+ placeholder="Timestamp"
+ :envs="envs"
+ />
+ </div>
+ </div>
+
+ <div class="px-4 mt-6">
+ <HoppSmartCheckbox
+ :on="auth.includePayloadHash"
+ @change="auth.includePayloadHash = !auth.includePayloadHash"
+ >
+ Include Payload Hash
+ </HoppSmartCheckbox>
+ </div>
+</template>
+
+<script setup lang="ts">
+import IconCircle from "~icons/lucide/circle"
+import IconCircleDot from "~icons/lucide/circle-dot"
+import { useI18n } from "@composables/i18n"
+import { HoppRESTAuthHAWK } from "@hoppscotch/data"
+import { useVModel } from "@vueuse/core"
+import { ref } from "vue"
+import { AggregateEnvironment } from "~/newstore/environments"
+
+const t = useI18n()
+
+const props = defineProps<{
+ modelValue: HoppRESTAuthHAWK
+ envs?: AggregateEnvironment[]
+}>()
+
+const emit = defineEmits<{
+ (e: "update:modelValue", value: HoppRESTAuthHAWK): void
+}>()
+
+const auth = useVModel(props, "modelValue", emit)
+
+const algorithms: HoppRESTAuthHAWK["algorithm"][] = ["sha256", "sha1"]
+
+const authTippyActions = ref<any | null>(null)
+</script>
diff --git a/packages/hoppscotch-common/src/components/http/authorization/NTLM.vue b/packages/hoppscotch-common/src/components/http/authorization/NTLM.vue
new file mode 100644
index 000000000..28de9f804
--- /dev/null
+++ b/packages/hoppscotch-common/src/components/http/authorization/NTLM.vue
@@ -0,0 +1,77 @@
+<template>
+ <div class="flex flex-1 border-b border-dividerLight">
+ <SmartEnvInput
+ v-model="auth.username"
+ :auto-complete-env="true"
+ :placeholder="t('authorization.username')"
+ :envs="envs"
+ />
+ </div>
+ <div class="flex flex-1 border-b border-dividerLight">
+ <input
+ v-model="auth.password"
+ name="password"
+ :placeholder="t('authorization.password')"
+ class="flex flex-1 bg-transparent px-4 py-2"
+ type="password"
+ />
+ </div>
+
+ <!-- advanced config -->
+
+ <div>
+ <!-- label as advanced config here -->
+ <div class="p-4">
+ <label class="text-secondaryLight"> Advanced Configuration </label>
+ <p>
+ Hoppscotch automatically assigns default values to certain fields if no
+ explicit value is provided.
+ </p>
+ </div>
+ <div class="flex flex-1 border-b border-dividerLight">
+ <SmartEnvInput
+ v-model="auth.domain"
+ :auto-complete-env="true"
+ placeholder="Domain"
+ :envs="envs"
+ />
+ </div>
+ <div class="flex flex-1 border-b border-dividerLight">
+ <SmartEnvInput
+ v-model="auth.workstation"
+ :auto-complete-env="true"
+ placeholder="Workstation"
+ :envs="envs"
+ />
+ </div>
+
+ <div class="px-4 mt-6">
+ <HoppSmartCheckbox
+ :on="auth.retryingRequest"
+ @change="auth.retryingRequest = !auth.retryingRequest"
+ >
+ Disable Retrying Requset
+ </HoppSmartCheckbox>
+ </div>
+ </div>
+</template>
+
+<script setup lang="ts">
+import { useI18n } from "@composables/i18n"
+import { HoppRESTAuthNTLM } from "@hoppscotch/data"
+import { useVModel } from "@vueuse/core"
+import { AggregateEnvironment } from "~/newstore/environments"
+
+const t = useI18n()
+
+const props = defineProps<{
+ modelValue: HoppRESTAuthNTLM
+ envs?: AggregateEnvironment[]
+}>()
+
+const emit = defineEmits<{
+ (e: "update:modelValue", value: HoppRESTAuthNTLM): void
+}>()
+
+const auth = useVModel(props, "modelValue", emit)
+</script>
diff --git a/packages/hoppscotch-common/src/components/http/OAuth2Authorization.vue b/packages/hoppscotch-common/src/components/http/authorization/OAuth2.vue
similarity index 95%
rename from packages/hoppscotch-common/src/components/http/OAuth2Authorization.vue
rename to packages/hoppscotch-common/src/components/http/authorization/OAuth2.vue
index afe17575a..48a76d6bf 100644
--- a/packages/hoppscotch-common/src/components/http/OAuth2Authorization.vue
+++ b/packages/hoppscotch-common/src/components/http/authorization/OAuth2.vue
@@ -182,11 +182,7 @@
</template>
<script setup lang="ts">
-import {
- HoppGQLAuthOAuth2,
- HoppRESTAuthOAuth2,
- parseTemplateStringE,
-} from "@hoppscotch/data"
+import { HoppGQLAuthOAuth2, HoppRESTAuthOAuth2 } from "@hoppscotch/data"
import { useService } from "dioc/vue"
import * as E from "fp-ts/Either"
import { Ref, computed, ref } from "vue"
@@ -194,7 +190,7 @@ import { z } from "zod"
import { useI18n } from "~/composables/i18n"
import { refWithCallbackOnChange } from "~/composables/ref"
import { useToast } from "~/composables/toast"
-import { getCombinedEnvVariables } from "~/helpers/preRequest"
+import { replaceTemplateStringsInObjectValues } from "~/helpers/auth"
import { AggregateEnvironment } from "~/newstore/environments"
import authCode, {
AuthCodeOauthFlowParams,
@@ -1057,55 +1053,6 @@ const generateOAuthToken = async () => {
}
}
-const replaceTemplateStringsInObjectValues = <
- T extends Record<string, unknown>,
->(
- obj: T
-) => {
- const envs = getCombinedEnvVariables()
-
- const requestVariables =
- props.source === "REST"
- ? restTabsService.currentActiveTab.value.document.request.requestVariables.map(
- ({ key, value }) => ({
- key,
- value,
- secret: false,
- })
- )
- : []
-
- // Ensure request variables are prioritized by removing any selected/global environment variables with the same key
- const selectedEnvVars = envs.selected.filter(
- ({ key }) =>
- !requestVariables.some(({ key: reqVarKey }) => reqVarKey === key)
- )
- const globalEnvVars = envs.global.filter(
- ({ key }) =>
- !requestVariables.some(({ key: reqVarKey }) => reqVarKey === key)
- )
-
- const envVars = [...selectedEnvVars, ...globalEnvVars, ...requestVariables]
-
- const newObj: Partial<T> = {}
-
- for (const key in obj) {
- const val = obj[key]
-
- if (typeof val === "string") {
- const parseResult = parseTemplateStringE(val, envVars)
-
- newObj[key] = E.isRight(parseResult)
- ? (parseResult.right as T[typeof key])
- : (val as T[typeof key])
- } else {
- newObj[key] = val
- }
- }
-
- return newObj as T
-}
-
const grantTypeTippyActions = ref<HTMLElement | null>(null)
const pkceTippyActions = ref<HTMLElement | null>(null)
const authTippyActions = ref<HTMLElement | null>(null)
diff --git a/packages/hoppscotch-common/src/helpers/RequestRunner.ts b/packages/hoppscotch-common/src/helpers/RequestRunner.ts
index 22ed93468..685c6d0f1 100644
--- a/packages/hoppscotch-common/src/helpers/RequestRunner.ts
+++ b/packages/hoppscotch-common/src/helpers/RequestRunner.ts
@@ -185,7 +185,7 @@ export function runRESTRequest$(
const res = getFinalEnvsFromPreRequest(
tab.value.document.request.preRequestScript,
getCombinedEnvVariables()
- ).then((envs) => {
+ ).then(async (envs) => {
if (cancelCalled) return E.left("cancellation" as const)
if (E.isLeft(envs)) {
@@ -254,7 +254,9 @@ export function runRESTRequest$(
variables: finalEnvsWithNonEmptyValues,
})
- const [stream, cancelRun] = createRESTNetworkRequestStream(effectiveRequest)
+ const [stream, cancelRun] = createRESTNetworkRequestStream(
+ await effectiveRequest
+ )
cancelFunc = cancelRun
const subscription = stream
diff --git a/packages/hoppscotch-common/src/helpers/auth/index.ts b/packages/hoppscotch-common/src/helpers/auth/index.ts
new file mode 100644
index 000000000..1a1c049c3
--- /dev/null
+++ b/packages/hoppscotch-common/src/helpers/auth/index.ts
@@ -0,0 +1,56 @@
+import { getService } from "~/modules/dioc"
+import { getCombinedEnvVariables } from "../preRequest"
+import { RESTTabService } from "~/services/tab/rest"
+import { parseTemplateStringE } from "@hoppscotch/data"
+import * as E from "fp-ts/Either"
+
+export const replaceTemplateStringsInObjectValues = <
+ T extends Record<string, unknown>,
+>(
+ obj: T,
+ source: "REST" | "GQL" = "REST"
+) => {
+ const envs = getCombinedEnvVariables()
+ const restTabsService = getService(RESTTabService)
+
+ const requestVariables =
+ source === "REST"
+ ? restTabsService.currentActiveTab.value.document.request.requestVariables.map(
+ ({ key, value }) => ({
+ key,
+ value,
+ secret: false,
+ })
+ )
+ : []
+
+ // Ensure request variables are prioritized by removing any selected/global environment variables with the same key
+ const selectedEnvVars = envs.selected.filter(
+ ({ key }) =>
+ !requestVariables.some(({ key: reqVarKey }) => reqVarKey === key)
+ )
+ const globalEnvVars = envs.global.filter(
+ ({ key }) =>
+ !requestVariables.some(({ key: reqVarKey }) => reqVarKey === key)
+ )
+
+ const envVars = [...selectedEnvVars, ...globalEnvVars, ...requestVariables]
+
+ const newObj: Partial<T> = {}
+
+ for (const key in obj) {
+ const val = obj[key]
+
+ if (typeof val === "string") {
+ const parseResult = parseTemplateStringE(val, envVars)
+
+ newObj[key] = E.isRight(parseResult)
+ ? (parseResult.right as T[typeof key])
+ : (val as T[typeof key])
+ } else {
+ newObj[key] = val
+ }
+ }
+
+ return newObj as T
+}
diff --git a/packages/hoppscotch-common/src/helpers/graphql/connection.ts b/packages/hoppscotch-common/src/helpers/graphql/connection.ts
index f8a9cf819..e4fc846b0 100644
--- a/packages/hoppscotch-common/src/helpers/graphql/connection.ts
+++ b/packages/hoppscotch-common/src/helpers/graphql/connection.ts
@@ -1,5 +1,6 @@
import { GQLHeader, HoppGQLAuth, makeGQLRequest } from "@hoppscotch/data"
import { OperationType } from "@urql/core"
+import { AwsV4Signer } from "aws4fetch"
import * as E from "fp-ts/Either"
import {
GraphQLEnumType,
@@ -286,6 +287,33 @@ export const runGQLOperation = async (options: RunQueryOptions) => {
} else if (addTo === "QUERY_PARAMS") {
params[key] = value
}
+ } else if (auth.authType === "aws-signature") {
+ const { accessKey, secretKey, region, serviceName, addTo } = auth
+
+ const currentDate = new Date()
+ const amzDate = currentDate.toISOString().replace(/[:-]|\.\d{3}/g, "")
+
+ const signer = new AwsV4Signer({
+ datetime: amzDate,
+ signQuery: addTo === "QUERY_PARAMS",
+ accessKeyId: accessKey,
+ secretAccessKey: secretKey,
+ region: region ?? "us-east-1",
+ service: serviceName,
+ url,
+ })
+
+ const sign = await signer.sign()
+
+ if (addTo === "HEADERS") {
+ sign.headers.forEach((v, k) => {
+ finalHeaders[k] = v
+ })
+ } else if (addTo === "QUERY_PARAMS") {
+ for (const [k, v] of sign.url.searchParams) {
+ params[k] = v
+ }
+ }
}
}
diff --git a/packages/hoppscotch-common/src/helpers/graphql/index.ts b/packages/hoppscotch-common/src/helpers/graphql/index.ts
index 5965a2c8f..1ce9b9473 100644
--- a/packages/hoppscotch-common/src/helpers/graphql/index.ts
+++ b/packages/hoppscotch-common/src/helpers/graphql/index.ts
@@ -4,18 +4,6 @@ import * as N from "fp-ts/number"
import * as S from "fp-ts/string"
import { lodashIsEqualEq, mapThenEq, undefinedEq } from "./eq"
-export type HoppGQLParam = {
- key: string
- value: string
- active: boolean
-}
-
-export type HoppGQLHeader = {
- key: string
- value: string
- active: boolean
-}
-
export type FormDataKeyValue = {
key: string
active: boolean
diff --git a/packages/hoppscotch-common/src/helpers/utils/EffectiveURL.ts b/packages/hoppscotch-common/src/helpers/utils/EffectiveURL.ts
index ba44757e5..239e6c319 100644
--- a/packages/hoppscotch-common/src/helpers/utils/EffectiveURL.ts
+++ b/packages/hoppscotch-common/src/helpers/utils/EffectiveURL.ts
@@ -24,6 +24,7 @@ import {
import { arrayFlatMap, arraySort } from "../functional/array"
import { toFormData } from "../functional/formData"
import { tupleWithSameKeysToRecord } from "../functional/record"
+import { AwsV4Signer } from "aws4fetch"
export interface EffectiveHoppRESTRequest extends HoppRESTRequest {
/**
@@ -47,7 +48,7 @@ export interface EffectiveHoppRESTRequest extends HoppRESTRequest {
* @param showKeyIfSecret Whether to show the key if the value is a secret
* @returns The list of headers
*/
-export const getComputedAuthHeaders = (
+export const getComputedAuthHeaders = async (
envVars: Environment["variables"],
req?:
| HoppRESTRequest
@@ -131,6 +132,34 @@ export const getComputedAuthHeaders = (
description: "",
})
}
+ } else if (request.auth.authType === "aws-signature") {
+ const { addTo } = request.auth
+ if (addTo === "HEADERS") {
+ const currentDate = new Date()
+ const amzDate = currentDate.toISOString().replace(/[:-]|\.\d{3}/g, "")
+ const { method, endpoint } = req as HoppRESTRequest
+ const signer = new AwsV4Signer({
+ method: method,
+ datetime: amzDate,
+ accessKeyId: parseTemplateString(request.auth.accessKey, envVars),
+ secretAccessKey: parseTemplateString(request.auth.secretKey, envVars),
+ region:
+ parseTemplateString(request.auth.region, envVars) ?? "us-east-1",
+ service: parseTemplateString(request.auth.serviceName, envVars),
+ url: parseTemplateString(endpoint, envVars),
+ })
+
+ const sign = await signer.sign()
+
+ sign.headers.forEach((x, k) => {
+ headers.push({
+ active: true,
+ key: k,
+ value: x,
+ description: "",
+ })
+ })
+ }
}
return headers
@@ -186,7 +215,7 @@ export type ComputedHeader = {
* @param showKeyIfSecret Whether to show the key if the value is a secret
* @returns The headers that are generated along with the source of that header
*/
-export const getComputedHeaders = (
+export const getComputedHeaders = async (
req:
| HoppRESTRequest
| {
@@ -196,14 +225,16 @@ export const getComputedHeaders = (
envVars: Environment["variables"],
parse = true,
showKeyIfSecret = false
-): ComputedHeader[] => {
+): Promise<ComputedHeader[]> => {
return [
- ...getComputedAuthHeaders(
- envVars,
- req,
- undefined,
- parse,
- showKeyIfSecret
+ ...(
+ await getComputedAuthHeaders(
+ envVars,
+ req,
+ undefined,
+ parse,
+ showKeyIfSecret
+ )
).map((header) => ({
source: "auth" as const,
header,
@@ -227,22 +258,55 @@ export type ComputedParam = {
* @param envVars The environment variables active
* @returns The params that are generated along with the source of that header
*/
-export const getComputedParams = (
+export const getComputedParams = async (
req: HoppRESTRequest,
envVars: Environment["variables"]
-): ComputedParam[] => {
+): Promise<ComputedParam[]> => {
// When this gets complex, its best to split this function off (like with getComputedHeaders)
// API-key auth can be added to query params
- if (!req.auth || !req.auth.authActive) {
- return []
- }
+ if (!req.auth || !req.auth.authActive) return []
- if (req.auth.authType !== "api-key" && req.auth.authType !== "oauth-2") {
+ if (
+ req.auth.authType !== "api-key" &&
+ req.auth.authType !== "oauth-2" &&
+ req.auth.authType !== "aws-signature"
+ )
return []
- }
- if (req.auth.addTo !== "QUERY_PARAMS") {
- return []
+ if (req.auth.addTo !== "QUERY_PARAMS") return []
+
+ if (req.auth.authType === "aws-signature") {
+ const { addTo } = req.auth
+ const params: ComputedParam[] = []
+ if (addTo === "QUERY_PARAMS") {
+ const currentDate = new Date()
+ const amzDate = currentDate.toISOString().replace(/[:-]|\.\d{3}/g, "")
+
+ const signer = new AwsV4Signer({
+ method: req.method,
+ datetime: amzDate,
+ signQuery: true,
+ accessKeyId: parseTemplateString(req.auth.accessKey, envVars),
+ secretAccessKey: parseTemplateString(req.auth.secretKey, envVars),
+ region: parseTemplateString(req.auth.region, envVars) ?? "us-east-1",
+ service: parseTemplateString(req.auth.serviceName, envVars),
+ url: parseTemplateString(req.endpoint, envVars),
+ })
+ const sign = await signer.sign()
+
+ for (const [k, v] of sign.url.searchParams) {
+ params.push({
+ source: "auth" as const,
+ param: {
+ active: true,
+ key: k,
+ value: v,
+ description: "",
+ },
+ })
+ }
+ }
+ return params
}
if (req.auth.authType === "api-key") {
@@ -259,19 +323,21 @@ export const getComputedParams = (
]
}
- const { grantTypeInfo } = req.auth
-
- return [
- {
- source: "auth",
- param: {
- active: true,
- key: "access_token",
- value: parseTemplateString(grantTypeInfo.token, envVars, false, true),
- description: "",
+ if (req.auth.authType === "oauth-2") {
+ const { grantTypeInfo } = req.auth
+ return [
+ {
+ source: "auth",
+ param: {
+ active: true,
+ key: "access_token",
+ value: parseTemplateString(grantTypeInfo.token, envVars),
+ description: "",
+ },
},
- },
- ]
+ ]
+ }
+ return []
}
// Resolves environment variables in the body
@@ -405,18 +471,15 @@ function getFinalBodyFromRequest(
*
* @returns An object with extra fields defining a complete request
*/
-export function getEffectiveRESTRequest(
+export async function getEffectiveRESTRequest(
request: HoppRESTRequest,
environment: Environment,
showKeyIfSecret = false
-): EffectiveHoppRESTRequest {
+): Promise<EffectiveHoppRESTRequest> {
const effectiveFinalHeaders = pipe(
- getComputedHeaders(
- request,
- environment.variables,
- true,
- showKeyIfSecret
- ).map((h) => h.header),
+ (await getComputedHeaders(request, environment.variables)).map(
+ (h) => h.header
+ ),
A.concat(request.headers),
A.filter((x) => x.active && x.key !== ""),
A.map((x) => ({
@@ -437,7 +500,9 @@ export function getEffectiveRESTRequest(
)
const effectiveFinalParams = pipe(
- getComputedParams(request, environment.variables).map((p) => p.param),
+ (await getComputedParams(request, environment.variables)).map(
+ (p) => p.param
+ ),
A.concat(request.params),
A.filter((x) => x.active && x.key !== ""),
A.map((x) => ({
@@ -500,8 +565,8 @@ export function getEffectiveRESTRequest(
export function getEffectiveRESTRequestStream(
request$: Observable<HoppRESTRequest>,
environment$: Observable<Environment>
-): Observable<EffectiveHoppRESTRequest> {
+): Observable<Promise<EffectiveHoppRESTRequest>> {
return combineLatest([request$, environment$]).pipe(
- map(([request, env]) => getEffectiveRESTRequest(request, env))
+ map(async ([request, env]) => await getEffectiveRESTRequest(request, env))
)
}
diff --git a/packages/hoppscotch-common/src/newstore/collections.ts b/packages/hoppscotch-common/src/newstore/collections.ts
index b55e64a9c..d73abc3c1 100644
--- a/packages/hoppscotch-common/src/newstore/collections.ts
+++ b/packages/hoppscotch-common/src/newstore/collections.ts
@@ -10,7 +10,7 @@ import {
import { cloneDeep } from "lodash-es"
import { pluck } from "rxjs/operators"
import { resolveSaveContextOnRequestReorder } from "~/helpers/collection/request"
-import { HoppGQLHeader } from "~/helpers/graphql"
+import { GQLHeader } from "@hoppscotch/data"
import { HoppInheritedProperty } from "~/helpers/types/HoppInheritedProperties"
import { getService } from "~/modules/dioc"
import { getI18n } from "~/modules/i18n"
@@ -117,7 +117,7 @@ export function cascadeParentCollectionForHeaderAuth(
const parentFolderAuth = parentFolder.auth as HoppRESTAuth | HoppGQLAuth
const parentFolderHeaders = parentFolder.headers as
| HoppRESTHeaders
- | HoppGQLHeader[]
+ | GQLHeader[]
// check if the parent folder has authType 'inherit' and if it is the root folder
if (
diff --git a/packages/hoppscotch-data/src/collection/v/3.ts b/packages/hoppscotch-data/src/collection/v/3.ts
index d06cf6b18..841dcb516 100644
--- a/packages/hoppscotch-data/src/collection/v/3.ts
+++ b/packages/hoppscotch-data/src/collection/v/3.ts
@@ -1,18 +1,25 @@
import { defineVersion } from "verzod"
import { z } from "zod"
-import { GQLHeader as GQLHeaderV1 } from "../../graphql/v/1"
-import { GQLHeader as GQLHeaderV2 } from "../../graphql/v/6"
+import { GQLHeader as V1_GQLHeader } from "../../graphql/v/1"
import { HoppRESTHeaders as V1_HoppRESTHeaders } from "../../rest/v/1"
-import { HoppRESTHeaders as V2_HoppRESTHeaders } from "../../rest/v/7"
-import { HoppRESTAuth } from "../../rest/v/7"
-import { HoppGQLAuth } from "../../graphql/v/6"
+
+import { HoppGQLAuth, GQLHeader as V2_GQLHeader } from "../../graphql/v/6"
+import {
+ HoppRESTAuth,
+ HoppRESTHeaders as V2_HoppRESTHeaders,
+} from "../../rest/v/7"
+
import { v2_baseCollectionSchema, V2_SCHEMA } from "./2"
const v3_baseCollectionSchema = v2_baseCollectionSchema.extend({
v: z.literal(3),
- headers: z.union([V2_HoppRESTHeaders, z.array(GQLHeaderV2)]),
+
+ // AWS Signature Authorization type addition
auth: z.union([HoppRESTAuth, HoppGQLAuth]),
+
+ // `description` field addition under `headers`
+ headers: z.union([V2_HoppRESTHeaders, z.array(V2_GQLHeader)]),
})
type Input = z.input<typeof v3_baseCollectionSchema> & {
@@ -32,7 +39,7 @@ export default defineVersion({
initial: false,
schema: V3_SCHEMA,
up(old: z.infer<typeof V2_SCHEMA>) {
- const headers = (old.headers as V1_HoppRESTHeaders | GQLHeaderV1[]).map(
+ const headers = (old.headers as V1_HoppRESTHeaders | V1_GQLHeader[]).map(
(header) => ({
...header,
description: "",
diff --git a/packages/hoppscotch-data/src/graphql/index.ts b/packages/hoppscotch-data/src/graphql/index.ts
index 7c2565f10..5144712c4 100644
--- a/packages/hoppscotch-data/src/graphql/index.ts
+++ b/packages/hoppscotch-data/src/graphql/index.ts
@@ -13,12 +13,11 @@ export {
HoppGQLAuthInherit,
HoppGQLAuthNone,
} from "./v/2"
-export { GQLHeader } from "./v/6"
-
-export { HoppGQLAuth, HoppGQLAuthOAuth2 } from "./v/6"
export { HoppGQLAuthAPIKey } from "./v/4"
+export { GQLHeader, HoppGQLAuth, HoppGQLAuthOAuth2 } from "./v/6"
+
export const GQL_REQ_SCHEMA_VERSION = 6
const versionedObject = z.object({
diff --git a/packages/hoppscotch-data/src/graphql/v/6.ts b/packages/hoppscotch-data/src/graphql/v/6.ts
index efc2330af..66b41e26f 100644
--- a/packages/hoppscotch-data/src/graphql/v/6.ts
+++ b/packages/hoppscotch-data/src/graphql/v/6.ts
@@ -1,25 +1,40 @@
import { defineVersion } from "verzod"
import { z } from "zod"
-import { V5_SCHEMA } from "./5"
-import { HoppRESTAuthOAuth2 } from "./../../rest/v/7"
+import { HoppRESTAuthAWSSignature } from "./../../rest/v/7"
import {
+ HoppGQLAuthAPIKey,
HoppGQLAuthBasic,
HoppGQLAuthBearer,
HoppGQLAuthInherit,
HoppGQLAuthNone,
} from "./2"
-import { HoppGQLAuthAPIKey } from "./4"
+import { HoppGQLAuthOAuth2, V5_SCHEMA } from "./5"
export { HoppRESTAuthOAuth2 as HoppGQLAuthOAuth2 } from "../../rest/v/7"
+// Both REST & GQL have the same schema definition for AWS Signature Authorization type
+export const HoppGQLAuthAWSSignature = HoppRESTAuthAWSSignature
+
+export type HoppGQLAuthAWSSignature = z.infer<typeof HoppGQLAuthAWSSignature>
+
+export const GQLHeader = z.object({
+ key: z.string().catch(""),
+ value: z.string().catch(""),
+ active: z.boolean().catch(true),
+ description: z.string().catch(""),
+})
+
+export type GQLHeader = z.infer<typeof GQLHeader>
+
export const HoppGQLAuth = z
.discriminatedUnion("authType", [
HoppGQLAuthNone,
HoppGQLAuthInherit,
HoppGQLAuthBasic,
HoppGQLAuthBearer,
+ HoppGQLAuthOAuth2,
HoppGQLAuthAPIKey,
- HoppRESTAuthOAuth2, // both rest and gql have the same auth type for oauth2
+ HoppGQLAuthAWSSignature,
])
.and(
z.object({
@@ -29,19 +44,10 @@ export const HoppGQLAuth = z
export type HoppGQLAuth = z.infer<typeof HoppGQLAuth>
-export const GQLHeader = z.object({
- key: z.string().catch(""),
- value: z.string().catch(""),
- active: z.boolean().catch(true),
- description: z.string().catch(""),
-})
-
-export type GQLHeader = z.infer<typeof GQLHeader>
-
export const V6_SCHEMA = V5_SCHEMA.extend({
v: z.literal(6),
- headers: z.array(GQLHeader).catch([]),
auth: HoppGQLAuth,
+ headers: z.array(GQLHeader).catch([]),
})
export default defineVersion({
diff --git a/packages/hoppscotch-data/src/rest/index.ts b/packages/hoppscotch-data/src/rest/index.ts
index 8e8636fe4..0c26cb35a 100644
--- a/packages/hoppscotch-data/src/rest/index.ts
+++ b/packages/hoppscotch-data/src/rest/index.ts
@@ -8,15 +8,14 @@ import { lodashIsEqualEq, mapThenEq, undefinedEq } from "../utils/eq"
import V0_VERSION from "./v/0"
import V1_VERSION from "./v/1"
-import V2_VERSION from "./v/2"
+import V2_VERSION, { HoppRESTRequestVariables } from "./v/2"
import V3_VERSION from "./v/3"
import V4_VERSION from "./v/4"
import V5_VERSION from "./v/5"
import V6_VERSION, { HoppRESTReqBody } from "./v/6"
import V7_VERSION, { HoppRESTAuth } from "./v/7"
-import { HoppRESTHeaders, HoppRESTParams } from "./v/7"
-import { HoppRESTRequestVariables } from "./v/2"
+import { HoppRESTParams, HoppRESTHeaders } from "./v/7"
export * from "./content-types"
@@ -28,22 +27,24 @@ export {
HoppRESTAuthNone,
HoppRESTReqBodyFormData,
} from "./v/1"
-
export {
ClientCredentialsGrantTypeParams,
ImplicitOauthFlowParams,
PasswordGrantTypeParams,
} from "./v/3"
-export { AuthCodeGrantTypeParams } from "./v/5"
-export { HoppRESTAuthOAuth2, HoppRESTAuth } from "./v/7"
-
-export { HoppRESTAuthAPIKey } from "./v/4"
-
export { HoppRESTRequestVariables } from "./v/2"
+export { HoppRESTAuthAPIKey } from "./v/4"
+export { AuthCodeGrantTypeParams } from "./v/5"
export { HoppRESTReqBody } from "./v/6"
-export { HoppRESTHeaders } from "./v/7"
+export {
+ HoppRESTAuth,
+ HoppRESTAuthAWSSignature,
+ HoppRESTAuthOAuth2,
+ HoppRESTHeaders,
+ HoppRESTParams,
+} from "./v/7"
const versionedObject = z.object({
// v is a stringified number
diff --git a/packages/hoppscotch-data/src/rest/v/7.ts b/packages/hoppscotch-data/src/rest/v/7.ts
index 719dedd95..3df3ba8f4 100644
--- a/packages/hoppscotch-data/src/rest/v/7.ts
+++ b/packages/hoppscotch-data/src/rest/v/7.ts
@@ -1,6 +1,12 @@
-import { defineVersion } from "verzod"
import { z } from "zod"
-
+import { defineVersion } from "verzod"
+import {
+ HoppRESTAuthAPIKey,
+ HoppRESTAuthBasic,
+ HoppRESTAuthBearer,
+ HoppRESTAuthInherit,
+ HoppRESTAuthNone,
+} from "./1"
import { V6_SCHEMA } from "./6"
import { AuthCodeGrantTypeParams as AuthCodeGrantTypeParamsOld } from "./5"
@@ -10,13 +16,6 @@ import {
ImplicitOauthFlowParams,
PasswordGrantTypeParams,
} from "./3"
-import {
- HoppRESTAuthAPIKey,
- HoppRESTAuthBasic,
- HoppRESTAuthBearer,
- HoppRESTAuthInherit,
- HoppRESTAuthNone,
-} from "./1"
// Add refreshToken to all grant types except Implicit
export const AuthCodeGrantTypeParams = AuthCodeGrantTypeParamsOld.extend({
@@ -36,23 +35,6 @@ export const HoppRESTAuthOAuth2 = z.object({
export type HoppRESTAuthOAuth2 = z.infer<typeof HoppRESTAuthOAuth2>
-export const HoppRESTAuth = z
- .discriminatedUnion("authType", [
- HoppRESTAuthNone,
- HoppRESTAuthInherit,
- HoppRESTAuthBasic,
- HoppRESTAuthBearer,
- HoppRESTAuthOAuth2,
- HoppRESTAuthAPIKey,
- ])
- .and(
- z.object({
- authActive: z.boolean(),
- })
- )
-
-export type HoppRESTAuth = z.infer<typeof HoppRESTAuth>
-
export const HoppRESTParams = z.array(
z.object({
key: z.string().catch(""),
@@ -75,6 +57,41 @@ export const HoppRESTHeaders = z.array(
export type HoppRESTHeaders = z.infer<typeof HoppRESTHeaders>
+// in this new version, we add a new auth type for AWS Signature
+// this auth type is used for AWS Signature V5 authentication
+// it requires the user to provide the access key id, secret access key, region, service name, and service token
+
+export const HoppRESTAuthAWSSignature = z.object({
+ authType: z.literal("aws-signature"),
+ accessKey: z.string().catch(""),
+ secretKey: z.string().catch(""),
+ region: z.string().catch(""),
+ serviceName: z.string().catch(""),
+ serviceToken: z.string().optional(),
+ signature: z.object({}).optional(),
+ addTo: z.enum(["HEADERS", "QUERY_PARAMS"]).catch("HEADERS"),
+})
+
+export type HoppRESTAuthAWSSignature = z.infer<typeof HoppRESTAuthAWSSignature>
+
+export const HoppRESTAuth = z
+ .discriminatedUnion("authType", [
+ HoppRESTAuthNone,
+ HoppRESTAuthInherit,
+ HoppRESTAuthBasic,
+ HoppRESTAuthBearer,
+ HoppRESTAuthOAuth2,
+ HoppRESTAuthAPIKey,
+ HoppRESTAuthAWSSignature,
+ ])
+ .and(
+ z.object({
+ authActive: z.boolean(),
+ })
+ )
+
+export type HoppRESTAuth = z.infer<typeof HoppRESTAuth>
+
export const V7_SCHEMA = V6_SCHEMA.extend({
v: z.literal("7"),
params: HoppRESTParams,
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 8bdd393df..f522dbd5d 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -373,7 +373,7 @@ importers:
version: 3.2.5
tsup:
specifier: 8.0.2
typescript:
specifier: 5.3.3
version: 5.3.3
@@ -464,6 +464,9 @@ importers:
acorn-walk:
specifier: 8.3.0
version: 8.3.0
+ aws4fetch:
+ specifier: 1.0.19
+ version: 1.0.19
axios:
specifier: 1.7.5
version: 1.7.5
@@ -779,7 +782,7 @@ importers:
vite-plugin-checker:
specifier: 0.6.2
vite-plugin-fonts:
specifier: 0.7.0
@@ -898,7 +901,7 @@ importers:
version: 2.8.4
ts-jest:
specifier: 27.1.5
typescript:
specifier: 4.9.5
version: 4.9.5
@@ -1082,7 +1085,7 @@ importers:
version: 0.14.9(@vue/[email protected])([email protected])
unplugin-vue-components:
specifier: 0.21.0
vite:
specifier: 4.5.0
@@ -1091,7 +1094,7 @@ importers:
vite-plugin-inspect:
specifier: 0.7.38
vite-plugin-pages:
specifier: 0.26.0
@@ -1251,7 +1254,7 @@ importers:
version: 0.17.4(@vue/[email protected])([email protected])
unplugin-vue-components:
specifier: 0.25.2
vite:
specifier: 4.5.0
@@ -1263,7 +1266,7 @@ importers:
vite-plugin-inspect:
specifier: 0.7.42
vite-plugin-pages:
specifier: 0.31.0
@@ -1305,7 +1308,7 @@ importers:
'@intlify/unplugin-vue-i18n':
specifier: 1.2.0
'@types/cors':
specifier: 2.8.13
version: 2.8.13
@@ -1371,7 +1374,7 @@ importers:
version: 0.14.9(@vue/[email protected])([email protected])
unplugin-vue-components:
specifier: 0.21.0
vue:
specifier: 3.3.9
version: 3.3.9([email protected])
@@ -5762,6 +5765,9 @@ packages:
resolution: {integrity: sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ==}
engines: {node: '>= 0.4'}
+ resolution: {integrity: sha512-N+F8pZ9hVjckkHODDyalITRNxBJxAGX5ShkVoAgHwqERXsW8Iu5ziFx3SCjGlxx/YStWBTZx4HI/GCMvTBu5kQ==}
+
resolution: {integrity: sha512-fZu86yCo+svH3uqJ/yTdQ0QHpQu5oL+/QE+QPSv6BZSkDAoky9vytxp7u5qk83OJFS3kEBcesWni9WTZAv3tSw==}
@@ -15941,11 +15947,11 @@ snapshots:
'@intlify/[email protected]': {}
dependencies:
'@intlify/bundle-utils': 7.5.1([email protected]([email protected]([email protected])))
'@intlify/shared': 9.13.1
- '@rollup/pluginutils': 5.1.0([email protected])
+ '@rollup/pluginutils': 5.1.0([email protected])
'@vue/compiler-sfc': 3.3.10
debug: 4.3.4([email protected])
fast-glob: 3.3.2
@@ -18806,6 +18812,8 @@ snapshots:
dependencies:
possible-typed-array-names: 1.0.0
+
dependencies:
follow-redirects: 1.15.6
@@ -24474,12 +24482,12 @@ snapshots:
postcss: 8.4.32
dependencies:
lilconfig: 3.1.1
yaml: 2.4.2
optionalDependencies:
- postcss: 8.4.40
+ postcss: 8.4.32
@@ -26100,7 +26108,7 @@ snapshots:
dependencies:
bs-logger: 0.2.6
fast-json-stable-stringify: 2.1.0
@@ -26115,6 +26123,7 @@ snapshots:
optionalDependencies:
'@babel/core': 7.24.5
'@types/jest': 27.5.2
+ babel-jest: 29.7.0(@babel/[email protected])
dependencies:
@@ -26320,7 +26329,7 @@ snapshots:
dependencies:
bundle-require: 4.1.0([email protected])
cac: 6.7.14
@@ -26330,7 +26339,7 @@ snapshots:
execa: 5.1.1
globby: 11.1.0
joycon: 3.1.1
resolve-from: 5.0.0
rollup: 4.17.2
source-map: 0.8.0-beta.0
@@ -26338,7 +26347,7 @@ snapshots:
tree-kill: 1.2.2
optionalDependencies:
'@swc/core': 1.4.2
- postcss: 8.4.40
+ postcss: 8.4.32
typescript: 5.3.3
transitivePeerDependencies:
- supports-color
@@ -26559,7 +26568,7 @@ snapshots:
transitivePeerDependencies:
- supports-color
dependencies:
'@antfu/utils': 0.5.2
'@rollup/pluginutils': 4.2.1
@@ -26570,7 +26579,7 @@ snapshots:
magic-string: 0.26.7
minimatch: 5.1.6
resolve: 1.22.8
vue: 3.3.9([email protected])
optionalDependencies:
'@babel/parser': 7.24.5
@@ -26581,7 +26590,7 @@ snapshots:
- vite
- webpack
dependencies:
'@antfu/utils': 0.5.2
'@rollup/pluginutils': 4.2.1
@@ -26592,7 +26601,7 @@ snapshots:
magic-string: 0.26.7
minimatch: 5.1.6
resolve: 1.22.8
vue: 3.3.9([email protected])
optionalDependencies:
'@babel/parser': 7.24.5
@@ -26603,6 +26612,25 @@ snapshots:
- vite
- webpack
+ dependencies:
+ '@antfu/utils': 0.7.7
+ '@rollup/pluginutils': 5.1.0([email protected])
+ chokidar: 3.6.0
+ debug: 4.3.4([email protected])
+ fast-glob: 3.3.2
+ local-pkg: 0.4.3
+ magic-string: 0.30.10
+ minimatch: 9.0.4
+ resolve: 1.22.8
+ unplugin: 1.10.1
+ vue: 3.3.9([email protected])
+ optionalDependencies:
+ '@babel/parser': 7.24.5
+ transitivePeerDependencies:
+ - rollup
+ - supports-color
+
dependencies:
'@antfu/utils': 0.7.7
@@ -26622,7 +26650,7 @@ snapshots:
- rollup
- supports-color
dependencies:
acorn: 8.11.3
chokidar: 3.6.0
@@ -26630,11 +26658,11 @@ snapshots:
webpack-virtual-modules: 0.4.6
optionalDependencies:
esbuild: 0.20.2
- rollup: 2.79.1
+ rollup: 3.29.4
webpack: 5.91.0(@swc/[email protected])([email protected])
dependencies:
acorn: 8.11.3
chokidar: 3.6.0
@@ -26642,7 +26670,7 @@ snapshots:
webpack-virtual-modules: 0.4.6
optionalDependencies:
esbuild: 0.20.2
- rollup: 2.79.1
+ rollup: 3.29.4
webpack: 5.91.0(@swc/[email protected])([email protected])
@@ -26787,7 +26815,7 @@ snapshots:
- supports-color
- terser
dependencies:
'@babel/code-frame': 7.24.2
ansi-escapes: 4.3.2
@@ -26809,6 +26837,7 @@ snapshots:
vscode-uri: 3.0.8
optionalDependencies:
eslint: 8.57.0
+ meow: 8.1.2
optionator: 0.9.4
typescript: 5.3.2
vue-tsc: 1.8.24([email protected])
@@ -26854,10 +26883,25 @@ snapshots:
dependencies:
dependencies:
'@antfu/utils': 0.7.7
- '@rollup/pluginutils': 5.1.0([email protected])
+ '@rollup/pluginutils': 5.1.0([email protected])
+ debug: 4.3.4([email protected])
+ error-stack-parser-es: 0.1.1
+ fs-extra: 11.2.0
+ open: 9.1.0
+ picocolors: 1.0.0
+ sirv: 2.0.4
+ transitivePeerDependencies:
+ - rollup
+ - supports-color
+
+ dependencies:
+ '@antfu/utils': 0.7.7
+ '@rollup/pluginutils': 5.1.0([email protected])
debug: 4.3.4([email protected])
error-stack-parser-es: 0.1.1
fs-extra: 11.2.0