This repository was archived by the owner on Dec 2, 2020. It is now read-only.
Conversation
User may need to make a db request, which will require a callback.
Users may need to check the database to figure out how to namespace the type, therefore we really have to work with a callback.
Contributor
Author
|
So... everything seems to work now, but the code is quite a mess. @mbostock, you have time to talk about this sometime? I'm happy to come up to SF. |
|
I really like these namespace changes. Thanks for writing this, @trotter I have a style nit, though. The authentication checking pattern and the namespace application pattern are repeated several times and seem like they could be factored out. Is there a reason that the authentication doesn't just wrap |
Contributor
Author
|
Thanks, @sbuss. I'll see about factoring those out. I hadn't actually considered just wrapping it within the server code itself. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I've been working lately on adding some multi-tenancy to cube and would love to get feedback on the approach. I've modified the server config to take two additional parameters
authenticationandnamespace, which let you authenticate incoming requests and namespace event types per requests. You can see an example ofauthenticationintest/authenticated-collector-test.js. I haven't added a test for the namespacing yet, because it involves checking mongo to verify that the type was namespaced. Unfortunately, I don't really know how to test that with node/vows. Any help there would be appreciated.So... what do you think of this approach? Prefer something else? Think this is interesting?