Macaroon.add_third_party_caveat
add_third_party_caveat
, go back to Macaroon module for more information.
add_third_party_caveat(macaroon, location, predicate, caveat_key, nonce \\ nil)
Specs
add_third_party_caveat( Macaroon.Types.Macaroon.t(), binary(), binary(), binary(), false | nil | binary() ) :: Macaroon.Types.Macaroon.t()
Add a third-party caveat to a Macaroon provided a location
, predicate
, and random secret caveat_key
location
is a hint to where the client must go to prove this caveat
predicate
is a string that contains caveat_key
and the predicate we want to have this caveat assert
you should encrypt this in such a way that only the other party can decrypt it (pub/priv keys)
OR
retreieve an ID from the other service first and use that as the ID.
caveat_key
is the freshly generated secret key that will be encrypted using the current signature of the Macaroon
nonce
- you SHOULD NOT override this unless you know what you're doing (it defaults to secure random bytes)
it is used when encrypting the caveat_key
and should never be static unless you are testing something that requires
the signature to be static.