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

[bug] subscription not working with Authorization header #60

Open
guihalt opened this issue Apr 6, 2020 · 0 comments
Open

[bug] subscription not working with Authorization header #60

guihalt opened this issue Apr 6, 2020 · 0 comments

Comments

@guihalt
Copy link

guihalt commented Apr 6, 2020

Without Authorization header (and server auth disabled), it works as expected:

[15:41:23] vagrant: tmp $ graphqurl http://localhost:4000 -q 'subscription {ottRightCreated {right { id } } }'
@oclif/config reading core plugin /usr/local/lib/node_modules/graphqurl +0ms
@oclif/config loadJSON /usr/local/lib/node_modules/graphqurl/package.json +0ms
@oclif/config loadJSON /usr/local/lib/node_modules/graphqurl/oclif.manifest.json +1ms
@oclif/config loadJSON /usr/local/lib/node_modules/graphqurl/.oclif.manifest.json +1ms
@oclif/config reading user plugins pjson /home/vagrant/.local/share/graphqurl/package.json +0ms
@oclif/config loadJSON /home/vagrant/.local/share/graphqurl/package.json +1ms
@oclif/config config done +0ms
gq init version: @oclif/command@1.5.19 argv: [ 'http://localhost:4000', '-q', 'subscription {ottRightCreated {right { id } } }' ] +0ms
Executing query... event received
{
"data": {
"ottRightCreated": {
"right": {
"id": "ck8on7hw606vj0712rw45zxj5"
}
}
}
}
Waiting... \u28f7
^C
[15:42:04] vagrant: tmp $

Once server auth is enabled, adding the auth header works with queries

[15:44:09] vagrant: tmp $ graphqurl http://localhost:4000 -H 'Authorization: Bearer eyJraWQiOiJ0UXhVR0pDWVNyS0dNOTBSMDlCQUIzSUttVzBFMmJ1RnFRakdZTFk1V3JJIiwiYWxnIjoiUlMyNTYifQ.eyJ2ZXIiOjEsImp0aSI6IkFULkpYUjB5cC1fQWxCZkRBOE4wRy01MldGV09kMGNvU3VFcnFEVHBjTWltZ2siLCJpc3MiOiJodHRwczovL2hhcm1vbmljaW5jLXZvcy5va3RhcHJldmlldy5jb20vb2F1dGgyL2F1c2Zqc2I0bjl4YUhSSVJRMGg3IiwiYXVkIjoiVk9TIFNjaGVkdWxlciIsImlhdCI6MTU4NjE1OTkyOCwiZXhwIjoxNTg2MjQ2MzI4LCJjaWQiOiIwb2Fmamw1cHp1VUJybFZtVjBoNyIsInNjcCI6WyJkZWZhdWx0Il0sInN1YiI6IjBvYWZqbDVwenVVQnJsVm1WMGg3In0.fhCCl3LnbO23PP3eTRKfHM8jGf9lNfcBGRuzfmygX99MJzMejKrhcz5BQUiMYRnibrJgUCYAvgt6vYRO-99yj8TJ4jddij6GxeyhHQwIzTLLhj745KRf-3l1Mu8roSYBgE76LL9PA5vyxn5WBhlFofPLr7Y0pszzXB4dFee1Kb6Fy3ghFqqodKYV_6fBsdMc2yZH-JLGpucuYIWK_DQ_jz0GKg5Xs48-hIJlB2IDn9lf_v6kPDp5ItmTeipxOPF8YcapWWQvBduoI1rUrIX1PbuDpMgYcNc9s3r18Qc8rqAlqRNCr-Eq0YyXG2eCGQ7w3PkpaWe8KfIGU2FEPRWjEA' -q 'query {envAll {backendVersion}}'
@oclif/config reading core plugin /usr/local/lib/node_modules/graphqurl +0ms
@oclif/config loadJSON /usr/local/lib/node_modules/graphqurl/package.json +0ms
@oclif/config loadJSON /usr/local/lib/node_modules/graphqurl/oclif.manifest.json +2ms
@oclif/config loadJSON /usr/local/lib/node_modules/graphqurl/.oclif.manifest.json +0ms
@oclif/config reading user plugins pjson /home/vagrant/.local/share/graphqurl/package.json +0ms
@oclif/config loadJSON /home/vagrant/.local/share/graphqurl/package.json +1ms
@oclif/config config done +0ms
gq init version: @oclif/command@1.5.19 argv: [ 'http://localhost:4000', '-H', 'Authorization: Bearer eyJraWQiOiJ0UXhVR0pDWVNyS0dNOTBSMDlCQUIzSUttVzBFMmJ1RnFRakdZTFk1V3JJIiwiYWxnIjoiUlMyNTYifQ.eyJ2ZXIiOjEsImp0aSI6IkFULkpYUjB5cC1fQWxCZkRBOE4wRy01MldGV09kMGNvU3VFcnFEVHBjTWltZ2siLCJpc3MiOiJodHRwczovL2hhcm1vbmljaW5jLXZvcy5va3RhcHJldmlldy5jb20vb2F1dGgyL2F1c2Zqc2I0bjl4YUhSSVJRMGg3IiwiYXVkIjoiVk9TIFNjaGVkdWxlciIsImlhdCI6MTU4NjE1OTkyOCwiZXhwIjoxNTg2MjQ2MzI4LCJjaWQiOiIwb2Fmamw1cHp1VUJybFZtVjBoNyIsInNjcCI6WyJkZWZhdWx0Il0sInN1YiI6IjBvYWZqbDVwenVVQnJsVm1WMGg3In0.fhCCl3LnbO23PP3eTRKfHM8jGf9lNfcBGRuzfmygX99MJzMejKrhcz5BQUiMYRnibrJgUCYAvgt6vYRO-99yj8TJ4jddij6GxeyhHQwIzTLLhj745KRf-3l1Mu8roSYBgE76LL9PA5vyxn5WBhlFofPLr7Y0pszzXB4dFee1Kb6Fy3ghFqqodKYV_6fBsdMc2yZH-JLGpucuYIWK_DQ_jz0GKg5Xs48-hIJlB2IDn9lf_v6kPDp5ItmTeipxOPF8YcapWWQvBduoI1rUrIX1PbuDpMgYcNc9s3r18Qc8rqAlqRNCr-Eq0YyXG2eCGQ7w3PkpaWe8KfIGU2FEPRWjEA', '-q', 'query {envAll {backendVersion}}' ] +0ms
Executing query... done
{
"data": {
"envAll": {
"backendVersion": "465",
"__typename": "EnvPayload"
}
}
}
[15:44:46] vagrant: tmp $

But fail with subscription

[15:44:46] vagrant: tmp $ graphqurl http://localhost:4000 -H 'Authorization: Bearer eyJraWQiOiJ0UXhVR0pDWVNyS0dNOTBSMDlCQUIzSUttVzBFMmJ1RnFRakdZTFk1V3JJIiwiYWxnIjoiUlMyNTYifQ.eyJ2ZXIiOjEsImp0aSI6IkFULkpYUjB5cC1fQWxCZkRBOE4wRy01MldGV09kMGNvU3VFcnFEVHBjTWltZ2siLCJpc3MiOiJodHRwczovL2hhcm1vbmljaW5jLXZvcy5va3RhcHJldmlldy5jb20vb2F1dGgyL2F1c2Zqc2I0bjl4YUhSSVJRMGg3IiwiYXVkIjoiVk9TIFNjaGVkdWxlciIsImlhdCI6MTU4NjE1OTkyOCwiZXhwIjoxNTg2MjQ2MzI4LCJjaWQiOiIwb2Fmamw1cHp1VUJybFZtVjBoNyIsInNjcCI6WyJkZWZhdWx0Il0sInN1YiI6IjBvYWZqbDVwenVVQnJsVm1WMGg3In0.fhCCl3LnbO23PP3eTRKfHM8jGf9lNfcBGRuzfmygX99MJzMejKrhcz5BQUiMYRnibrJgUCYAvgt6vYRO-99yj8TJ4jddij6GxeyhHQwIzTLLhj745KRf-3l1Mu8roSYBgE76LL9PA5vyxn5WBhlFofPLr7Y0pszzXB4dFee1Kb6Fy3ghFqqodKYV_6fBsdMc2yZH-JLGpucuYIWK_DQ_jz0GKg5Xs48-hIJlB2IDn9lf_v6kPDp5ItmTeipxOPF8YcapWWQvBduoI1rUrIX1PbuDpMgYcNc9s3r18Qc8rqAlqRNCr-Eq0YyXG2eCGQ7w3PkpaWe8KfIGU2FEPRWjEA' -q 'subscription {ottRightCreated {right { id } } }'
@oclif/config reading core plugin /usr/local/lib/node_modules/graphqurl +0ms
@oclif/config loadJSON /usr/local/lib/node_modules/graphqurl/package.json +0ms
@oclif/config loadJSON /usr/local/lib/node_modules/graphqurl/oclif.manifest.json +2ms
@oclif/config loadJSON /usr/local/lib/node_modules/graphqurl/.oclif.manifest.json +0ms
@oclif/config reading user plugins pjson /home/vagrant/.local/share/graphqurl/package.json +0ms
@oclif/config loadJSON /home/vagrant/.local/share/graphqurl/package.json +1ms
@oclif/config config done +0ms
gq init version: @oclif/command@1.5.19 argv: [ 'http://localhost:4000', '-H', 'Authorization: Bearer eyJraWQiOiJ0UXhVR0pDWVNyS0dNOTBSMDlCQUIzSUttVzBFMmJ1RnFRakdZTFk1V3JJIiwiYWxnIjoiUlMyNTYifQ.eyJ2ZXIiOjEsImp0aSI6IkFULkpYUjB5cC1fQWxCZkRBOE4wRy01MldGV09kMGNvU3VFcnFEVHBjTWltZ2siLCJpc3MiOiJodHRwczovL2hhcm1vbmljaW5jLXZvcy5va3RhcHJldmlldy5jb20vb2F1dGgyL2F1c2Zqc2I0bjl4YUhSSVJRMGg3IiwiYXVkIjoiVk9TIFNjaGVkdWxlciIsImlhdCI6MTU4NjE1OTkyOCwiZXhwIjoxNTg2MjQ2MzI4LCJjaWQiOiIwb2Fmamw1cHp1VUJybFZtVjBoNyIsInNjcCI6WyJkZWZhdWx0Il0sInN1YiI6IjBvYWZqbDVwenVVQnJsVm1WMGg3In0.fhCCl3LnbO23PP3eTRKfHM8jGf9lNfcBGRuzfmygX99MJzMejKrhcz5BQUiMYRnibrJgUCYAvgt6vYRO-99yj8TJ4jddij6GxeyhHQwIzTLLhj745KRf-3l1Mu8roSYBgE76LL9PA5vyxn5WBhlFofPLr7Y0pszzXB4dFee1Kb6Fy3ghFqqodKYV_6fBsdMc2yZH-JLGpucuYIWK_DQ_jz0GKg5Xs48-hIJlB2IDn9lf_v6kPDp5ItmTeipxOPF8YcapWWQvBduoI1rUrIX1PbuDpMgYcNc9s3r18Qc8rqAlqRNCr-Eq0YyXG2eCGQ7w3PkpaWe8KfIGU2FEPRWjEA', '-q', 'subscription {ottRightCreated {right { id } } }' ] +0ms
Executing query... error
^C
[15:45:57] vagrant: tmp $

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

1 participant