Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

webkey authentication error returns stack trace #3482

Closed
aerth opened this issue Dec 25, 2020 · 1 comment · Fixed by #3483
Closed

webkey authentication error returns stack trace #3482

aerth opened this issue Dec 25, 2020 · 1 comment · Fixed by #3483
Labels
app-platform App/Sandstorm integration features

Comments

@aerth
Copy link

aerth commented Dec 25, 2020

This happens when I give an invalid password at the prompt after doing a git pull using the gogs clone address:
It does not happen when I don't give a password.

No password, output is good:

remote: Missing or invalid authorization header.
remote: 
remote: This address serves APIs, which allow external apps (such as a phone app) to
remote: access data on your Sandstorm server. This address is not meant to be opened
remote: in a regular browser.
fatal: Authentication failed for 'https://123456@api-123.hostname.example/user/repo.git/'

Incorrect password, returns stack trace and a 500 status code

remote: ERROR: The server threw an exception. Details:
remote: 
remote: (remote):0: failed: remote exception: remote exception: Error: Invalid authorization token [403]
remote:     at validateWebkey (imports/server/gateway-router.js:134:11)
remote:     at imports/server/gateway-router.js:409:7
remote:     at imports/server/async-helpers.ts:24:17
remote:     at imports/server/async-helpers.ts:12:3
remote:     at runWithEnvironment (packages/meteor.js:1286:24)
remote:     at packages/meteor.js:1299:14
remote:     at imports/server/async-helpers.ts:22:5
remote:     at new Promise (<anonymous>)
remote:     at inMeteor (imports/server/async-helpers.ts:21:10)
remote:     at GatewayRouterImpl.openApiSession (imports/server/gateway-router.js:403:12)
remote:     at /node_modules/capnp.js:174:21
remote:     at /programs/server/npm/node_modules/meteor/promise/node_modules/meteor-promise/fiber_pool.js:43:40
remote: stack: XXXX XXXX
fatal: unable to access 'https://123456@api-123.hostname.example/user/repo.git/': The requested URL returned error: 500

@zenhack
Copy link
Collaborator

zenhack commented Dec 25, 2020

Looks like this is the source of the problem:

// TODO(someday): Produce an appropriate HTTP error code.

Probably we just want to return an instance of ApiSession that responds to everything with the specified status code.

zenhack added a commit to zenhack/sandstorm that referenced this issue Dec 25, 2020
Instead of throwing an exception when given an invalid token, we return
an implementation of WebSession/ApiSession that responds to requests
with an error code.
zenhack added a commit to zenhack/sandstorm that referenced this issue Dec 25, 2020
Instead of throwing an exception when given an invalid token, we return
an implementation of WebSession/ApiSession that responds to requests
with an error code.
@ocdtrekkie ocdtrekkie linked a pull request Dec 26, 2020 that will close this issue
@ocdtrekkie ocdtrekkie added the app-platform App/Sandstorm integration features label Dec 26, 2020
kentonv added a commit that referenced this issue Jan 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
app-platform App/Sandstorm integration features
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants