]> git.apps.os.sepia.ceph.com Git - fscrypt.git/commit
actions: Simplify the callback mechanism
authorJoe Richey joerichey@google.com <joerichey@google.com>
Thu, 1 Jun 2017 00:54:35 +0000 (17:54 -0700)
committerJoe Richey joerichey@google.com <joerichey@google.com>
Mon, 26 Jun 2017 22:40:08 +0000 (15:40 -0700)
commitdefd27f75df3a6eef84ac33adf89b1ce255e738c
tree851a587fb4a12381e7a29e32759636021ecaf42c
parentd71b7f248e21f5254c32ecbf752a1dbe940a1177
actions: Simplify the callback mechanism

This commit makes the callbacks for getting keys easier to understand.
Functions which need keys now take a KeyFunc callback. This callback
contains a ProtectorInfo parameter (basically a read-only version of
metadata.ProtectorData) and a boolean which indicates if the call is
being retried. The documentation is also updated to say which functions
will retry the KeyFunc.

For selecting a protector, there is now an OptionFunc callback which
takes a slice of ProtectorOptions. A ProtectorOption is a ProtectorInfo
along with additional information about a linked filesystem (if
applicable).

This commit also adds in methods for getting the protector options for a
specific filesystem or policy. It also adds a function for getting the
policy descriptor for a specific path.

Change-Id: I41e0d94ffd44e7166b0c5cf1b5d18437960bdf90
actions/callback.go
actions/config.go
actions/config_test.go
actions/context.go
actions/context_test.go
actions/policy.go
actions/policy_test.go
actions/protector.go
actions/protector_test.go
crypto/crypto_test.go
crypto/key.go