OpenIDConnect icon indicating copy to clipboard operation
OpenIDConnect copied to clipboard

waterline validation error

Open ariutta opened this issue 10 years ago • 3 comments

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

ariutta avatar Mar 23 '15 04:03 ariutta

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 https://github.com/agmoyano/OpenIDConnect/blob/db34de850500a496440490fc0fccb2fc182c811d/index.js#L186. 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 https://github.com/agmoyano/OpenIDConnect/issues/18.

markkopaas avatar Mar 23 '15 19:03 markkopaas

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 < https://github.com/agmoyano/OpenIDConnect/blob/db34de850500a496440490fc0fccb2fc182c811d/index.js#L186 . 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 https://github.com/agmoyano/OpenIDConnect/issues/18.

— Reply to this email directly or view it on GitHub https://github.com/agmoyano/OpenIDConnect/issues/18#issuecomment-85159858 .

ariutta avatar Mar 25 '15 18:03 ariutta

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.

ariutta avatar Apr 06 '15 05:04 ariutta