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

"auth" is not allowed when running seed script via docker #31

Open
anurupr opened this issue Sep 26, 2019 · 3 comments
Open

"auth" is not allowed when running seed script via docker #31

anurupr opened this issue Sep 26, 2019 · 3 comments
Labels
bug Something isn't working

Comments

@anurupr
Copy link

anurupr commented Sep 26, 2019

I haven't tested it outside of docker to confirm if it is a universal issue with the code

I'm getting this error after setting up appy via docker and then running the seed script

[1] "auth" is not allowed
ERROR    seed.js:629:9 seed —     at Object.exports.process (/backend/node_modules/hapi/node_modules/joi/lib/errors.js:201:19)
ERROR    seed.js:629:9 seed —     at internals.Object._validateWithOptions (/backend/node_modules/hapi/node_modules/joi/lib/types/any/index.js:751:31)
ERROR    seed.js:629:9 seed —     at module.exports.internals.Any.root.validate (/backend/node_modules/hapi/node_modules/joi/lib/index.js:146:23)
ERROR    seed.js:629:9 seed —     at module.exports.internals.Any.root.attempt (/backend/node_modules/hapi/node_modules/joi/lib/index.js:176:29)
ERROR    seed.js:629:9 seed —     at module.exports.internals.Any.root.assert (/backend/node_modules/hapi/node_modules/joi/lib/index.js:171:14)
ERROR    seed.js:629:9 seed —     at Object.exports.inject (/backend/node_modules/hapi/node_modules/shot/lib/index.js:52:17)
ERROR    seed.js:629:9 seed —     at internals.Server.inject (/backend/node_modules/hapi/lib/server.js:309:32)
ERROR    seed.js:629:9 seed —     at seed (/backend/scripts/seed.js:313:31)
ERROR    seed.js:629:9 seed —     at <anonymous>
ERROR    seed.js:629:9 seed —     at process._tickDomainCallback (internal/process/next_tick.js:229:7)

This is the block of code where the issue is happening

    injectOptions = RestHapi.testHelper.mockInjection(request)
    let result = await server.inject(injectOptions)

Specifically failing at server.inject.

If i replace the auth key with credentials and use the same value as request.credentials. the script completes. If this is only an issue with hapijs . please go ahead and close this issue

@JKHeadley
Copy link
Owner

Apologies, I've been swamped and haven't been able to visit issues in a while. I believe this is due to an update in rest-hapi moving to hapi v18:

hapijs/hapi#3871 (comment)

See the section Migration Checklist -> server.inject() Authentication

The fix should be simple and I believe @anurupr mentioned it. I will try to push an update soon.

@JKHeadley
Copy link
Owner

A quick update here. The issue seems to step from rest-hapi >1.8 updating to hapi 18 while appy is still using other hapi libraries that depend on hapi 17.

A quick fix for now is to set your rest-hapi version to be explicitly v1.7

@metinjakupi
Copy link

bump!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants