mirror of
https://github.com/hoppscotch/hoppscotch.git
synced 2026-04-25 16:55:59 +03:00
[GH-ISSUE #2203] [bug]: How to specify the token for self-hosted proxyscotch? #751
Labels
No labels
CodeDay
a11y
browser limited
bug
bug fix
cli
core
critical
design
desktop
discussion
docker
documentation
duplicate
enterprise
feature
feature
fosshack
future
good first issue
hacktoberfest
help wanted
i18n
invalid
major
minor
need information
need testing
not applicable to hoppscotch
not reproducible
pull-request
question
refactor
resolved
sandbox
self-host
spam
stale
testmu
wip
wont fix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/hoppscotch#751
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @zhzy0077 on GitHub (Mar 25, 2022).
Original GitHub issue: https://github.com/hoppscotch/hoppscotch/issues/2203
Is there an existing issue for this?
Current behavior
There's no way to specify a token for proxyscotch.
So I get response:
Steps to reproduce
proxyscotch-server-* --host 0.0.0.0:9159 --token 123456Environment
Production
Version
Self-hosted
@dislazy commented on GitHub (Apr 11, 2022):
all in https://firebase.google.cn/ ,include storage auth and more,set it packages/hoppscotch-app/.env
@liucent commented on GitHub (Aug 12, 2022):
Hi all, I checked proxyscotch code and I think it may be 'AccessToken' parameter in source code(proxyscotch/libproxy/proxy.go).
But there is no token or accesstoken parameter in .env. So is there any way to specify proxyscotch token on hoppscotch side, in settings page or other config file? Wish hoppscotch readme documents can add 'how to set proxyscotch token part'.
@biondizzle commented on GitHub (Oct 16, 2022):
@zhzy0077 @liucent
If you're selfhosting, the easiest way I found was to add
accessTokenthe payload object inpackages/hoppscotch-app/src/helpers/strategies/AxiosStrategy.tshere:github.com/hoppscotch/hoppscotch@6e7d28db7b/packages/hoppscotch-app/src/helpers/strategies/AxiosStrategy.ts (L31)so it will look like this:
And that will fill in the token to this struct:
github.com/hoppscotch/proxyscotch@2e94def1c2/libproxy/proxy.go (L30)Which will get set when the request body is decoded here:
github.com/hoppscotch/proxyscotch@2e94def1c2/libproxy/proxy.go (L206)I'm sure there's some way to add it into here:
github.com/hoppscotch/hoppscotch@6e7d28db7b/packages/hoppscotch-app/src/helpers/strategies/AxiosStrategy.ts (L16)If I could figure that out I would've submitted a PR so it gets set from an environment variable, but I don't know typescript and wasn't about to go down that rabbit hole.
Hope this helps.