Storage Converter Plugin

About

When installed, Storage Converter plugins can be configured to apply to all storage requests for a certain Path, or matching a certain metadata selector. This lets you apply plugins to only a subset of storage requests.

A typical example is to apply some form of encryption to the Key Storage stored under the /keys path. In this case you can also have the plugin apply only to Private keys, by using the metadata selector.

The three methods are called when a resource is read, created, or updated, respectively.

Your plugin can do any of the following:

Do nothing and return null, this will result that no changes to the stored data or metadata will be made.

Modify the content being written or read, by reading the incoming data via the HasInputStream object, and returning a new HasInputStream object which will provide the modified data.

If you are doing the typical “encrypt/decrypt”, you will want to encrypt during create, update, and decrypt during the read operation

Modify the metadata being written or read, by calling methods on the ResourceMetaBuilder object. This object will provide the metadata values that would be written/read. You can change the values by setting new values in the object.