dsek-lth / gateway Goto Github PK
View Code? Open in Web Editor NEWHTTP/ZeroMQ gateway for website services.
HTTP/ZeroMQ gateway for website services.
Eftersom login-service nu lagrar sin token i cookies behöver åtminstone Set-cookie
-headern vidarebefordras.
Detta gör det lättare att ha separata definitioner för vilka services vi ska ansluta oss till beroende på t.ex. om man kör via docker-compose eller bara npm.
Integrera med Keycloak. All autentisering borde kunna skötas i gateway, och det blir nog det lättaste stället att göra det på
När profile-service
konverterats till http borde den så klart anslutas till resten av backend. Se Dsek-LTH/profile-service#1 för status.
Vill kunna selektivt neka tillgång till olika queries/services på post-nivå och användarnivå. Denna information kommer ligga i vår auth-JWT, men gateway måste kolla detta innan den skickar en request vidare. Inspiration: https://medium.com/the-guild/authentication-and-authorization-in-graphql-and-how-graphql-modules-can-help-fadc1ee5b0c2
Svar direkt från hoarDer:
{
"errors": [
{
"message": "request not authenticated",
"locations": [
{
"line": 2,
"column": 3
}
],
"path": [
"checkOutUnit"
],
"extensions": {
"code": "UNAUTHENTICATED",
"exception": {
"stacktrace": [
"AuthenticationError: request not authenticated",
" at checkOutUnit (/usr/src/app/dist/main.js:308:23)",
" at /usr/src/app/node_modules/graphql-tools/dist/makeExecutableSchema.js:64:22",
" at field.resolve (/usr/src/app/node_modules/apollo-server-express/node_modules/graphql-extensions/dist/index.js:133:26)",
" at resolveFieldValueOrError (/usr/src/app/node_modules/graphql/execution/execute.js:467:18)",
" at resolveField (/usr/src/app/node_modules/graphql/execution/execute.js:434:16)",
" at /usr/src/app/node_modules/graphql/execution/execute.js:244:18",
" at /usr/src/app/node_modules/graphql/jsutils/promiseReduce.js:23:10",
" at Array.reduce (<anonymous>)",
" at promiseReduce (/usr/src/app/node_modules/graphql/jsutils/promiseReduce.js:20:17)",
" at executeFieldsSerially (/usr/src/app/node_modules/graphql/execution/execute.js:241:37)"
]
}
}
}
],
"data": null
}
Svar om query görs via gateway:
{
"errors": [
{
"message": "[object Object]",
"locations": [
{
"line": 39,
"column": 11
}
],
"path": [
"checkOutUnit"
]
}
],
"data": null
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.