A Client can mix in one or more AccessLevel
s to enable API calls for
read, write, and master operations.
Extension of HttpAdapter that uses Dispatch rather than Spray+akka Helps avoid dependency conflicts in use cases such as Spark
A Client mixing in Master
can make Keen IO API calls requiring a master
key, such as deleting data, creating saved queries, and performing
administrative functions.
A Client mixing in Master
can make Keen IO API calls requiring a master
key, such as deleting data, creating saved queries, and performing
administrative functions.
A Master
client can also perform all Reader and Writer API calls
and does not require additional keys configured for these. However, this
should not be considered a shortcut! Please keep your master key as
secure as possible by not deploying it where it isn't strictly needed.
A master key must be configured e.g. by setting the masterKey
field in an
anonymous class override.
Initializing a Client with master access
val keen = new Client with Master { override val masterKey = "myMasterKey" }
A Client mixing in Reader
can make Keen IO API calls requiring a read
key.
A Client mixing in Reader
can make Keen IO API calls requiring a read
key.
A read key must be configured e.g. by setting the readKey
field in an
anonymous class override.
Initializing a Client with read access
val keen = new Client with Reader { override val readKey = "myReadKey" }
A Client mixing in Writer
can make Keen IO API calls requiring a write
key.
A Client mixing in Writer
can make Keen IO API calls requiring a write
key.
A write key must be configured e.g. by setting the writeKey
field in an
anonymous class override.
Initializing a Client with write access
val keen = new Client with Writer { override val writeKey = "myWriteKey" }
A Client can mix in one or more
AccessLevel
s to enable API calls for read, write, and master operations.The intention of this approach is to make it a compile-time error to call an API method requiring a write key if you haven't statically declared that the client should be a writer, for example.
This also means that runtime checks for presence of optional settings (keys for access levels you don't need) are pushed up to the time of client instantiation: if you've forgotten to provide a write key in your deployment environment, we won't wait to throw a runtime exception at the point that you make a write call, perhaps long after your app has started and you've gone home for the weekend.
Client with read and write access:
https://keen.io/docs/security/