Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
How would you use rebus in a multi tenant application?
Would you choose:
a rebus queue for all tenants together or
a rebus queue (input / error) per tenant
Disclaimer: I know nothing about the context of your question :)
But I think I would prefer one message queue that processes the messages, and then pass around the tenant ID as a custom header on all relevant messages.
In fact, some of my colleagues are doing just that right now.
A few things turn out to be nifty when you want to pass around this kind of information in a header - i.e. I can recommend that you automatically transfer the tenant ID to outgoing messages by doing somethings like this:
Configure.With(...)
.(...)
.Events(e => {
e.MessageSent += (bus, dest, msg) => {
if (!MessageContext.HasCurrent) return;
var items = MessageContext.GetCurrent().Items;
if (!items.ContainsKey("custom-tenant-id")) return;
bus.AttachHeader(msg, "custom-tenant-id", items["custom-tenant-id"]);
};
})
.(...)
thus allowing for exchanging messages while not having to worry about the tenant ID along the way.
Related
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed last month.
Improve this question
I have a simple app that is using a dynammoDB table with node/express as the back end. I let users add and then edit things. I am trying to determine the best way to verify that a user owns the item that they are editing/deleting.
Here is what i've looked at. Is there a better method?
1. User cognito ID is part of the item when created
2. User token is sent as part of edit
3. Item is pulled from table when edit starts
4. Token is decoded and the id is compared to the one pulled from the table
The obvious problem here is that every edit requires a read. This seems wrong.
Another method
1. User cognito ID is part of the item when created
2. User token is sent as part of edit
3. Original id is sent from the item as well
4. Token is decoded and the decoded id is compared to the one sent
This doesn't require a read, but would let a clever person edit things that they shouldn't.
Is there another way that I am missing? I don't want to create some separate IAM policy for each user.
You should use DynamoDBs fine grained access control that can dynamically allow Cognito users only read/edit their own data:
https://aws.amazon.com/blogs/aws/fine-grained-access-control-for-amazon-dynamodb/
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
While it is super cool to work with Firebase in Unity, it is quite a learning curve.
Two questions have come up that I think are both general and important in the way Firebase is used:
Can any Firebase developers enlighten these?
If you set a Firebase Query to null, will it also set all listener events attached to that query to null?
Can you always use -= to remove an eventhandler, EVEN if this is not set? Is there a way to check if a query already has an Eventhandler (like ValueChanged) attached?
Best regards
Ole
you set a Firebase Query to null, will it also set all listener events attached to that query to null?
No. You will need to explicitly remove the listeners as shown here: How to remove all eventhandler
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
I want to migrate the data which already exists in my firebase database: Add a new field to all children; manipulate an existing field (ie a -> a + 3).
Since there is no real frontend available to do that, I wonder how it could be done?
If there is no real front end then:
If the database is small and you are using the RTD then download the JSON and edit it
If the database is large since you have no front end you should do it with Functions
How to do it with Functions
You have to create a Functions project that will have an HTTP request trigger, once you access that url, then the trigger will query the data and for each result will create new data.
For doing this the simplest way to start is following this video. You have to do the same but instead of returning something to the browser with send, just end the Function with a code 200 (if it worked).
I would recommend creating an extra node for verification something like migration_march: false and then set it to true once the migration is completed. That way you can avoid unintentional re-migrations. There should be a validation for this once the trigger is started.
Doing a query on Functions is fairly the same as doing it in any other SDK this is the Functions docs.
You will probably need to know how to work with promises since your algorithm is gonna be: a query where for each value found set a new value in another place and then move forward to the new value, here is an illustrative video (couldn't find the original video)
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 5 years ago.
Improve this question
Using Firebase as a backend for my mobile app, how can I get the information (on the client side) if a user was using my mobile-app within the last 4 weeks or if he didn't?
I somehow need to get the date of last usage (last read, or write operation, last login...)
I know there is the information of "last sign-in" in the admin SDK, however I'm not sure if this is supposed to be integrated in the app itself.
you can add lastOnline field to your user entity and change it everytime the user quit the application :
DatabaseReference userLastOnlineRef = FirebaseDatabse.getInstance().getReference("users/joe/lastOnline");
userLastOnlineRef.onDisconnect().setValue(ServerValue.TIMESTAMP);
link
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
Let say that I have a website with some information that could be access externally. Those information need to be only change by the respected client. Example: Google Analytic or WordPress API key. How can I create a system that work like that (no matter the programming language)?
A number of smart people are working on a standard, and it's called OAuth. It already has a number of sample implementations, so it's pretty easy to get started.
Simple:
Generate a key for each user
Deny access for each request without this key
Currently, I use a concatenation of multiple MD5s with a salt. The MD5s are generated off of various concatenations of user data.
A good way of generating a key would be to store a GUID (Globally Unique Identifier) on each user record n the database. GUID is going to be unique and almost impossible to guess.
There are also infrastructure services that manage all this for you like http://www.3scale.net (disclosure I work there), http://www.mashery.com and http://www.apigee.com/.