README.md in keen-1.0.0 vs README.md in keen-1.1.0
- old
+ new
@@ -353,10 +353,12 @@
This is helpful for tracking email clickthroughs. See the [redirect documentation](https://keen.io/docs/data-collection/redirect/?s=gh-gem) for further information.
#### Generating scoped keys
+Note, Scoped Keys are now *deprecated* in favor of [access keys](https://keen.io/docs/api/#access-keys?s=gh-gem).
+
A [scoped key](https://keen.io/docs/security/#scoped-key?s=gh-gem) is a string, generated with your API Key, that represents some encrypted authentication and query options.
Use them to control what data queries have access to.
``` ruby
# "my-api-key" should be your MASTER API key
@@ -367,10 +369,38 @@
}]}).encrypt! # "4d1982fe601b359a5cab7ac7845d3bf27026936cdbf8ce0ab4ebcb6930d6cf7f139e..."
```
You can use the scoped key created in Ruby for API requests from any client. Scoped keys are commonly used in JavaScript, where credentials are visible and need to be protected.
+#### Access Keys
+
+You can use access keys to restrict the functionality of a key you use with the Keen API. Access keys can also enrich events that you send.
+
+[Read up](https://keen.io/docs/api/#access-keys?s=gh-gem) on the full key body options.
+
+Create a key that automatically adds information to each event published with that key:
+
+``` ruby
+key_body = {
+ "name" => "autofill foo",
+ "is_active" => true,
+ "permitted" => ["writes"],
+ "options" => {
+ "writes" => {
+ "autofill": {
+ "foo": "bar"
+ }
+ }
+ }
+}
+
+new_key = client.access_keys.create(key_body)
+autofill_write_key = new_key["key"]
+```
+
+You can `revoke` and `unrevoke` keys to disable or enable access. `all` will return all current keys for the project, while `get("key-value-here")` will return info for a single key. You can also `update` and `delete` keys.
+
### Additional options
##### HTTP Read Timeout
The default `Net::HTTP` timeout is 60 seconds. That's usually enough, but if you're querying over a large collection you may need to increase it. The timeout on the API side is 300 seconds, so that's as far as you'd want to go. You can configure a read timeout (in seconds) by setting a `KEEN_READ_TIMEOUT` environment variable, or by passing in a `read_timeout` option to the client constructor as follows:
@@ -414,9 +444,14 @@
It's not just us humans that browse the web. Spiders, crawlers, and bots share the pipes too. When it comes to analytics, this can cause a mild headache. Events generated by bots can inflate your metrics and eat up your event quota.
If you want some bot protection, check out the [Voight-Kampff](https://github.com/biola/Voight-Kampff) gem. Use the gem's `request.bot?` method to detect bots and avoid logging events.
### Changelog
+
+##### 1.1.0
++ Add support for access keys
++ Move saved queries into the Keen namespace
++ Deprecate scoped keys in favor of access keys
##### 1.0.0
+ Remove support for ruby 1.9.3
+ Update a few dependencies