-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
feat: Extendable context #299
Conversation
WIP - I wanted to get my thoughts out of my head and into code to solicit feedback before I forgot them. I have yet to actually test them. |
@willhausman Hey Will! Looks good to me. The only thing to consider: as context becomes single point of fetching additional info for request processing it probably should be |
@paveltiunov Agreed. |
…er context is used.
8b8b4db
to
fca0347
Compare
@paveltiunov Alright, now it 's looking good from my end. |
@willhausman Yeah. Great job! Thanks for contributing this! |
Proposal for #295 and #296 questions.
Ability to extend context object per request (http or web socket). Essentially, divide responsibilities of
authInfo
andcontext
. This supports two approaches living side-by-side.requestId
now lives within thecontext
, can be accessed for requests made external to cubejs, and can be overridden if not usingx-request-id
header.With API:
Or with web sockets:
The only difference is how you interact with
extendContext()
, and websockets will pass in{ isSubscription: true }
, so your server could handle both situations if it needed to.