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

insertCredential fails when adding the second credential #856

Closed
devzsolt opened this issue Dec 20, 2018 · 1 comment
Closed

insertCredential fails when adding the second credential #856

devzsolt opened this issue Dec 20, 2018 · 1 comment

Comments

@devzsolt
Copy link

Credential service's insertCredential() calls getCredential() which fails to consider the scenario when a credential is not a single hash but a set of hashes in the DB.

First it causes a warning: WRONGTYPE Operation against a key holding the wrong kind of value
which is followed by the following error:

TypeError: Cannot read property 'properties' of undefined at processCredential (/path-to-project/node_modules/express-gateway/lib/services/credentials/credential.service.js:255:51) 
  at s.getCredential.credentialDao.getCredential.then.credential (/path-to-project/node_modules/express-gateway/lib/services/credentials/credential.service.js:138:14) 

It's possible to reproduce always by creating a user with a credential and then deactivating the credential and creating a new one for the same user. Only key-auth and jwt type credentials are affected by the bug.

devzsolt pushed a commit to devzsolt/express-gateway that referenced this issue Dec 20, 2018
resolves ExpressGateway#856
insertCredential will call dao's getAllCredentials() which can handle
key-auth and jwt type credentials that were affected by the bug
some extra error handling were also added
@XVincentX
Copy link
Member

Thanks for the fix. I hope to be able to jump on this soon, I just didn't have the time.

XVincentX pushed a commit to devzsolt/express-gateway that referenced this issue Jan 3, 2019
resolves ExpressGateway#856
insertCredential will call dao's getAllCredentials() which can handle
key-auth and jwt type credentials that were affected by the bug
some extra error handling were also added
nakardo added a commit to nakardo/express-gateway that referenced this issue Apr 5, 2019
gatherchou pushed a commit to yilu-tech/express-gateway that referenced this issue Jul 29, 2021
gatherchou pushed a commit to yilu-tech/express-gateway that referenced this issue Jul 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants