keen-ioaccess-keys

Restrict access to single stream on keen


I have read access keys on keen.io And I have a use case where I would like to use these access keys. Actually, in my system, i want to make a separate stream for every customer account and want to make sure that this stream is only accessible (could be written/read) by that specific customer only. I want to use access keys for this purpose as I think it is their one of main use cases. Can anyone tell me how can I pass this information to an access key that it is only usable on a specific stream ONLY?


Solution

  • You would programmatically create an Access Key for each customer and set its permissions on creation so that it will autofill event properties with, for example, a customer id. With queries, you would set up the querying permissions with a filter so that it could only query event with that customer id.

    Similar to the JSON in this example here: https://keen.io/docs/access/access-keys/#access-key-json-example

    Then, any time that Access Key is used, it will only be able to query that specific data and all writes will include the autofill information that you set for that Access Key.