mon: Monitor: check caps considering command's requirements

Fixes: #5648

Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
mon: Monitor: purge old permission checking format on handle_command()

Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
mon: services: no longer needed to enforce caps on a per-service basis

We now perform all perm checks for commands on Monitor::handle_command().
Services no longer need to check them.

Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
mon: AuthMonitor: change 'auth add' behaviour

If an entity already existed, 'auth add' would smash its key and caps
with whatever was on the supplied keyring file; if a keyring weren't
specified, we would simply generate a new key and destroy all existing
caps (unless caps were specified and happened to be different from the
already in-place caps).  This behaviour is obviously sketchy.

With this patch we now enforce the following behaviour:

- if the command reproduces the current state (same key, same caps), we
  return 0; else,
- if entity exists and supplied key OR caps are different, return -EINVAL
- if entity does not exist in current state, check if we are about to
  create it (by checking the pending state); if so, wait for the new state
  to be committed and re-handle the command then
- else create a new entity.

Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>