[PR #2791] [MERGED] feat: use environment variable to specify proxyscotch access token #4067

Closed
opened 2026-03-17 01:38:14 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/hoppscotch/hoppscotch/pull/2791
Author: @biondizzle
Created: 10/16/2022
Status: Merged
Merged: 10/29/2022
Merged by: @AndrewBastin

Base: mainHead: #2203_specify_access_token_for_self_hosted_proxyscotch


📝 Commits (4)

  • d58fae7 #2203 - Use environment variable to specify proxyscotch access token
  • db18bec Merge branch 'main' into #2203_specify_access_token_for_self_hosted_proxyscotch
  • 0339f77 use Nullish Coalescing
  • 59d58cc Merge branch 'main' into #2203_specify_access_token_for_self_hosted_proxyscotch

📊 Changes

3 files changed (+6 additions, -0 deletions)

View changed files

📝 packages/hoppscotch-app/.env.example (+3 -0)
📝 packages/hoppscotch-app/src/helpers/strategies/AxiosStrategy.ts (+1 -0)
📝 packages/hoppscotch-app/src/vite-envs.d.ts (+2 -0)

📄 Description

Closes #2203

Description

Currently no way of specifying the access token to a self-hosted version of Proxyscotch. This adds an optional environment variable to do so.

This will pass accessToken to the Proxy where it will get filled into this struct:
github.com/hoppscotch/proxyscotch@2e94def1c2/libproxy/proxy.go (L30)

Which will get set when the request body is decoded in these two spots:
github.com/hoppscotch/proxyscotch@2e94def1c2/libproxy/proxy.go (L197)
github.com/hoppscotch/proxyscotch@2e94def1c2/libproxy/proxy.go (L206)

And then be validated here:
github.com/hoppscotch/proxyscotch@2e94def1c2/libproxy/proxy.go (L216)

Checks

  • My pull request adheres to the code style of this project
  • All the tests have passed

Additional Information

I don't know typescript so not sure if I needed to add accessToken to github.com/hoppscotch/hoppscotch@6e7d28db7b/packages/hoppscotch-app/src/helpers/strategies/AxiosStrategy.ts (L16)

Also, not sure if the environment variable needs to be added to any of the workflows YAMLs but decided not to add it since clearly the current prod version of this has been working fine without the need for this environment variable. Assuming that's because https://proxy.hoppscotch.io/ is secured via incoming source restriction.

Just let me know what you want changed and I'll do it real quick, or feel free to modify it to your heart's content.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/hoppscotch/hoppscotch/pull/2791 **Author:** [@biondizzle](https://github.com/biondizzle) **Created:** 10/16/2022 **Status:** ✅ Merged **Merged:** 10/29/2022 **Merged by:** [@AndrewBastin](https://github.com/AndrewBastin) **Base:** `main` ← **Head:** `#2203_specify_access_token_for_self_hosted_proxyscotch` --- ### 📝 Commits (4) - [`d58fae7`](https://github.com/hoppscotch/hoppscotch/commit/d58fae798dda73b9ae998220c6ca0adf3f8cf106) #2203 - Use environment variable to specify proxyscotch access token - [`db18bec`](https://github.com/hoppscotch/hoppscotch/commit/db18bec1f1823e886d8047a8980784652c1c4f54) Merge branch 'main' into #2203_specify_access_token_for_self_hosted_proxyscotch - [`0339f77`](https://github.com/hoppscotch/hoppscotch/commit/0339f77387e2b691c4f45c8c9c5ebf7a30303cf0) use Nullish Coalescing - [`59d58cc`](https://github.com/hoppscotch/hoppscotch/commit/59d58cc81cacdc1122d2e0d46ba6bcb5455de5ec) Merge branch 'main' into #2203_specify_access_token_for_self_hosted_proxyscotch ### 📊 Changes **3 files changed** (+6 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `packages/hoppscotch-app/.env.example` (+3 -0) 📝 `packages/hoppscotch-app/src/helpers/strategies/AxiosStrategy.ts` (+1 -0) 📝 `packages/hoppscotch-app/src/vite-envs.d.ts` (+2 -0) </details> ### 📄 Description <!-- Thanks for creating this pull request 🤗 Please make sure that the pull request is limited to one type (docs, feature, etc.) and keep it as small as possible. You can open multiple prs instead of opening a huge one. --> <!-- If this pull request closes an issue, please mention the issue number below --> Closes #2203 ### Description Currently no way of specifying the access token to a self-hosted version of Proxyscotch. This adds an optional environment variable to do so. This will pass `accessToken` to the Proxy where it will get filled into this struct: https://github.com/hoppscotch/proxyscotch/blob/2e94def1c28106f556718feb33232a8d1a8471b5/libproxy/proxy.go#L30 Which will get set when the request body is decoded in these two spots: https://github.com/hoppscotch/proxyscotch/blob/2e94def1c28106f556718feb33232a8d1a8471b5/libproxy/proxy.go#L197 https://github.com/hoppscotch/proxyscotch/blob/2e94def1c28106f556718feb33232a8d1a8471b5/libproxy/proxy.go#L206 And then be validated here: https://github.com/hoppscotch/proxyscotch/blob/2e94def1c28106f556718feb33232a8d1a8471b5/libproxy/proxy.go#L216 <!-- You can also choose to add a list of changes and if they have been completed or not by using the markdown to-do list syntax - [ ] Not Completed - [x] Completed --> ### Checks <!-- Make sure your pull request passes the CI checks and do check the following fields as needed - --> - [x] My pull request adheres to the code style of this project <!-- - [ ] My code requires changes to the documentation - [ ] I have updated the documentation as required --> - [x] All the tests have passed ### Additional Information I don't know typescript so not sure if I needed to add `accessToken` to https://github.com/hoppscotch/hoppscotch/blob/6e7d28db7b8f9ce3fe5735bcb59e2c32195111c0/packages/hoppscotch-app/src/helpers/strategies/AxiosStrategy.ts#L16 Also, not sure if the environment variable needs to be added to any of the workflows YAMLs but decided not to add it since clearly the current prod version of this has been working fine without the need for this environment variable. Assuming that's because https://proxy.hoppscotch.io/ is secured via incoming source restriction. Just let me know what you want changed and I'll do it real quick, or feel free to modify it to your heart's content. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-17 01:38:14 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/hoppscotch#4067
No description provided.