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

waterline validation error #18

Open
ariutta opened this issue Mar 23, 2015 · 3 comments
Open

waterline validation error #18

ariutta opened this issue Mar 23, 2015 · 3 comments

Comments

@ariutta
Copy link

ariutta commented Mar 23, 2015

The waterline validation error at the bottom is shown in the terminal when you click the "Get Token" button on the "Test Auth Flows" page http://localhost:3001/test?code=CODE_VALUE in the example. It's coming from this line. Making it not required removes the error, as in this temporary fix, but should it be required?

GET /test?code=94dcf9cee9d3665e37d8408542e03875 200 80.880 ms - 1056
Unhandled rejection Error (E_VALIDATION) :: 1 attribute is invalid
    at WLValidationError.WLError (/Users/ariutta/Sites/OpenIDConnect-master/node_modules/modelling/node_modules/waterline/lib/waterline/error/WLError.js:33:18)
    at new WLValidationError (/Users/ariutta/Sites/OpenIDConnect-master/node_modules/modelling/node_modules/waterline/lib/waterline/error/WLValidationError.js:20:28)
    at /Users/ariutta/Sites/OpenIDConnect-master/node_modules/modelling/node_modules/waterline/lib/waterline/query/validate.js:45:43
    at allValidationsChecked (/Users/ariutta/Sites/OpenIDConnect-master/node_modules/modelling/node_modules/waterline/lib/waterline/core/validations.js:203:5)
    at done (/Users/ariutta/Sites/OpenIDConnect-master/node_modules/modelling/node_modules/waterline/node_modules/async/lib/async.js:135:19)
    at /Users/ariutta/Sites/OpenIDConnect-master/node_modules/modelling/node_modules/waterline/node_modules/async/lib/async.js:32:16
    at /Users/ariutta/Sites/OpenIDConnect-master/node_modules/modelling/node_modules/waterline/lib/waterline/core/validations.js:194:14
    at done (/Users/ariutta/Sites/OpenIDConnect-master/node_modules/modelling/node_modules/waterline/node_modules/async/lib/async.js:135:19)
    at /Users/ariutta/Sites/OpenIDConnect-master/node_modules/modelling/node_modules/waterline/node_modules/async/lib/async.js:32:16
    at /Users/ariutta/Sites/OpenIDConnect-master/node_modules/modelling/node_modules/waterline/lib/waterline/core/validations.js:157:64
    at /Users/ariutta/Sites/OpenIDConnect-master/node_modules/modelling/node_modules/waterline/node_modules/async/lib/async.js:125:13
    at Array.forEach (native)
    at _each (/Users/ariutta/Sites/OpenIDConnect-master/node_modules/modelling/node_modules/waterline/node_modules/async/lib/async.js:46:24)
    at Object.async.each (/Users/ariutta/Sites/OpenIDConnect-master/node_modules/modelling/node_modules/waterline/node_modules/async/lib/async.js:124:9)
    at validate (/Users/ariutta/Sites/OpenIDConnect-master/node_modules/modelling/node_modules/waterline/lib/waterline/core/validations.js:156:11)
    at /Users/ariutta/Sites/OpenIDConnect-master/node_modules/modelling/node_modules/waterline/node_modules/async/lib/async.js:125:13
@markkopaas
Copy link
Collaborator

When you try to exchange code to access token and refresh token, then the
both of these remain related to the code(i.e. auth object). At least it has
been the idea. So it appears to be bug that refresh token is created
without token object. Are you willing to research more?

Markko

On Monday, March 23, 2015, Anders Riutta [email protected] wrote:

The waterline validation error at the bottom is shown in the terminal when
you click the "Get Token" button on the "Test Auth Flows" page
http://localhost:3001/test?code=CODE_VALUE in the example. It's coming
from this line

auth: {model: 'auth', required: true},
.
Making it not required removes the error, as in this temporary fix
https://github.com/ariutta/OpenIDConnect/blob/1c6b91ebc7e97ec94bf8aa38723ecc7a0dd303dd/index.js#L187,
but should it be required?

GET /test?code=94dcf9cee9d3665e37d8408542e03875 200 80.880 ms - 1056
Unhandled rejection Error (E_VALIDATION) :: 1 attribute is invalid
at WLValidationError.WLError (/Users/ariutta/Sites/OpenIDConnect-master/node_modules/modelling/node_modules/waterline/lib/waterline/error/WLError.js:33:18)
at new WLValidationError (/Users/ariutta/Sites/OpenIDConnect-master/node_modules/modelling/node_modules/waterline/lib/waterline/error/WLValidationError.js:20:28)
at /Users/ariutta/Sites/OpenIDConnect-master/node_modules/modelling/node_modules/waterline/lib/waterline/query/validate.js:45:43
at allValidationsChecked (/Users/ariutta/Sites/OpenIDConnect-master/node_modules/modelling/node_modules/waterline/lib/waterline/core/validations.js:203:5)
at done (/Users/ariutta/Sites/OpenIDConnect-master/node_modules/modelling/node_modules/waterline/node_modules/async/lib/async.js:135:19)
at /Users/ariutta/Sites/OpenIDConnect-master/node_modules/modelling/node_modules/waterline/node_modules/async/lib/async.js:32:16
at /Users/ariutta/Sites/OpenIDConnect-master/node_modules/modelling/node_modules/waterline/lib/waterline/core/validations.js:194:14
at done (/Users/ariutta/Sites/OpenIDConnect-master/node_modules/modelling/node_modules/waterline/node_modules/async/lib/async.js:135:19)
at /Users/ariutta/Sites/OpenIDConnect-master/node_modules/modelling/node_modules/waterline/node_modules/async/lib/async.js:32:16
at /Users/ariutta/Sites/OpenIDConnect-master/node_modules/modelling/node_modules/waterline/lib/waterline/core/validations.js:157:64
at /Users/ariutta/Sites/OpenIDConnect-master/node_modules/modelling/node_modules/waterline/node_modules/async/lib/async.js:125:13
at Array.forEach (native)
at _each (/Users/ariutta/Sites/OpenIDConnect-master/node_modules/modelling/node_modules/waterline/node_modules/async/lib/async.js:46:24)
at Object.async.each (/Users/ariutta/Sites/OpenIDConnect-master/node_modules/modelling/node_modules/waterline/node_modules/async/lib/async.js:124:9)
at validate (/Users/ariutta/Sites/OpenIDConnect-master/node_modules/modelling/node_modules/waterline/lib/waterline/core/validations.js:156:11)
at /Users/ariutta/Sites/OpenIDConnect-master/node_modules/modelling/node_modules/waterline/node_modules/async/lib/async.js:125:13


Reply to this email directly or view it on GitHub
#18.

@ariutta
Copy link
Author

ariutta commented Mar 25, 2015

Thanks for the tip. Yes, I will try to make time to dig into it more within
the next two weeks or so.
On Mar 23, 2015 12:32 PM, "markkopaas" [email protected] wrote:

When you try to exchange code to access token and refresh token, then the
both of these remain related to the code(i.e. auth object). At least it has
been the idea. So it appears to be bug that refresh token is created
without token object. Are you willing to research more?

Markko

On Monday, March 23, 2015, Anders Riutta [email protected] wrote:

The waterline validation error at the bottom is shown in the terminal
when
you click the "Get Token" button on the "Test Auth Flows" page
http://localhost:3001/test?code=CODE_VALUE in the example. It's coming
from this line
<

auth: {model: 'auth', required: true},

.
Making it not required removes the error, as in this temporary fix
<
https://github.com/ariutta/OpenIDConnect/blob/1c6b91ebc7e97ec94bf8aa38723ecc7a0dd303dd/index.js#L187
,
but should it be required?

GET /test?code=94dcf9cee9d3665e37d8408542e03875 200 80.880 ms - 1056
Unhandled rejection Error (E_VALIDATION) :: 1 attribute is invalid
at WLValidationError.WLError
(/Users/ariutta/Sites/OpenIDConnect-master/node_modules/modelling/node_modules/waterline/lib/waterline/error/WLError.js:33:18)
at new WLValidationError
(/Users/ariutta/Sites/OpenIDConnect-master/node_modules/modelling/node_modules/waterline/lib/waterline/error/WLValidationError.js:20:28)
at
/Users/ariutta/Sites/OpenIDConnect-master/node_modules/modelling/node_modules/waterline/lib/waterline/query/validate.js:45:43
at allValidationsChecked
(/Users/ariutta/Sites/OpenIDConnect-master/node_modules/modelling/node_modules/waterline/lib/waterline/core/validations.js:203:5)
at done
(/Users/ariutta/Sites/OpenIDConnect-master/node_modules/modelling/node_modules/waterline/node_modules/async/lib/async.js:135:19)
at
/Users/ariutta/Sites/OpenIDConnect-master/node_modules/modelling/node_modules/waterline/node_modules/async/lib/async.js:32:16
at
/Users/ariutta/Sites/OpenIDConnect-master/node_modules/modelling/node_modules/waterline/lib/waterline/core/validations.js:194:14
at done
(/Users/ariutta/Sites/OpenIDConnect-master/node_modules/modelling/node_modules/waterline/node_modules/async/lib/async.js:135:19)
at
/Users/ariutta/Sites/OpenIDConnect-master/node_modules/modelling/node_modules/waterline/node_modules/async/lib/async.js:32:16
at
/Users/ariutta/Sites/OpenIDConnect-master/node_modules/modelling/node_modules/waterline/lib/waterline/core/validations.js:157:64
at
/Users/ariutta/Sites/OpenIDConnect-master/node_modules/modelling/node_modules/waterline/node_modules/async/lib/async.js:125:13
at Array.forEach (native)
at _each
(/Users/ariutta/Sites/OpenIDConnect-master/node_modules/modelling/node_modules/waterline/node_modules/async/lib/async.js:46:24)
at Object.async.each
(/Users/ariutta/Sites/OpenIDConnect-master/node_modules/modelling/node_modules/waterline/node_modules/async/lib/async.js:124:9)
at validate
(/Users/ariutta/Sites/OpenIDConnect-master/node_modules/modelling/node_modules/waterline/lib/waterline/core/validations.js:156:11)
at
/Users/ariutta/Sites/OpenIDConnect-master/node_modules/modelling/node_modules/waterline/node_modules/async/lib/async.js:125:13


Reply to this email directly or view it on GitHub
#18.


Reply to this email directly or view it on GitHub
#18 (comment)
.

@ariutta
Copy link
Author

ariutta commented Apr 6, 2015

So it looks as if this happens:

GET /test?code=abc123... 200
Create auth, access and refresh models. This works.

POST /user/token 200

GET /test?code=abc123... 200
Try to create refresh model for a second time, but only pass in { auth: null } for values. This throws the error.

Not sure what's going on with the second GET.

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

No branches or pull requests

2 participants