This repository has been archived by the owner on Dec 2, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 417
Multi-tenanancy #75
Open
trotter
wants to merge
17
commits into
square:master
Choose a base branch
from
mashion:authentication
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Multi-tenanancy #75
Conversation
This file contains 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
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.
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 |
Thanks, @sbuss. I'll see about factoring those out. I hadn't actually considered just wrapping it within the server code itself. |
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
authentication
andnamespace
, which let you authenticate incoming requests and namespace event types per requests. You can see an example ofauthentication
intest/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?