From 603e03410a1887284b20254eb8765a8b5bc33ef7 Mon Sep 17 00:00:00 2001 From: Daniel Larimer Date: Mon, 31 Jul 2017 17:19:56 -0400 Subject: [PATCH] Initial Implementation of Auth Caching #113 TODO: certify that all auths specified when generating a sync or asyc call from code are properly cached. --- contracts/eoslib/auth.h | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 contracts/eoslib/auth.h diff --git a/contracts/eoslib/auth.h b/contracts/eoslib/auth.h new file mode 100644 index 00000000000..f3e839cba95 --- /dev/null +++ b/contracts/eoslib/auth.h @@ -0,0 +1,29 @@ +/** + * @file auth.h + * @brief Defines C API for interfacing with authority caching + */ +#pragma once +#include + +extern "C" { + +/** + * @defgroup authcache Authority Cache + * @brief APIs for saving, using, and clearing authorization + * @ingroup contractdev + * + * There are cases where one contract needs to generate a message in the name of another + * contract. A contract can cache the authority on the current message and then use that + * authority while generating a synchronous message in the future. + * + * These methods require the specified scope. An authority cached in one scope cannot be + * loaded in another. + * + * @{ + */ +void cache_auth( AccountName scope, AccountName account, PermissionName perm ); +void load_auth( AccountName scope, AccountName account, PermissionName perm ); +void clear_auth( AccountName scope, AccountName account, PermissionName perm ); +///@} + +}