mirror of
https://github.com/alexgo-io/stacks-puppet-node.git
synced 2026-04-10 22:41:53 +08:00
require data_privkey (will be the signing key in a token file for a name)
This commit is contained in:
@@ -153,7 +153,7 @@ def app_get_datastore_pubkey( session ):
|
||||
return None
|
||||
|
||||
|
||||
def app_publish( dev_blockchain_id, app_domain, app_method_list, app_index_uris, app_index_file, app_driver_hints=[], data_privkey=None, proxy=None, wallet_keys=None, config_path=CONFIG_PATH ):
|
||||
def app_publish( dev_blockchain_id, app_domain, app_method_list, app_index_uris, app_index_file, data_privkey, app_driver_hints=[], proxy=None, config_path=CONFIG_PATH ):
|
||||
"""
|
||||
Instantiate an application.
|
||||
* replicate the (opaque) app index file to "index.html" to each URL in app_uris
|
||||
@@ -170,11 +170,6 @@ def app_publish( dev_blockchain_id, app_domain, app_method_list, app_index_uris,
|
||||
Return {'error': ...} on error
|
||||
"""
|
||||
|
||||
if data_privkey is None:
|
||||
assert wallet_keys, 'Missing both data private key and wallet keys'
|
||||
data_privkey = wallet_keys.get('data_privkey')
|
||||
assert data_privkey, "Wallet does not have a data private key"
|
||||
|
||||
proxy = get_default_proxy() if proxy is None else proxy
|
||||
|
||||
# replicate configuration data (method list and app URIs)
|
||||
@@ -283,7 +278,7 @@ def app_get_resource( blockchain_id, app_domain, res_name, app_config=None, data
|
||||
return {'status': True, 'res': res['data']}
|
||||
|
||||
|
||||
def app_put_resource( blockchain_id, app_domain, res_name, res_data, app_config=None, data_privkey=None, proxy=None, wallet_keys=None, config_path=CONFIG_PATH ):
|
||||
def app_put_resource( blockchain_id, app_domain, res_name, res_data, data_privkey, app_config=None, proxy=None, config_path=CONFIG_PATH ):
|
||||
"""
|
||||
Store data to a named application resource in mutable storage.
|
||||
|
||||
@@ -302,11 +297,6 @@ def app_put_resource( blockchain_id, app_domain, res_name, res_data, app_config=
|
||||
except:
|
||||
raise AssertionError("Resource must be a JSON-serializable string")
|
||||
|
||||
if data_privkey is None:
|
||||
assert wallet_keys, 'Missing both data private key and wallet keys'
|
||||
data_privkey = wallet_keys.get('data_privkey')
|
||||
assert data_privkey, "Wallet does not have a data private key"
|
||||
|
||||
proxy = get_default_proxy() if proxy is None else proxy
|
||||
|
||||
res_data_id = storage.make_fq_data_id(app_domain, res_name)
|
||||
@@ -328,7 +318,7 @@ def app_put_resource( blockchain_id, app_domain, res_name, res_data, app_config=
|
||||
return {'status': True, 'version': res_blob['version']}
|
||||
|
||||
|
||||
def app_delete_resource( blockchain_id, app_domain, res_name, app_config=None, data_privkey=None, proxy=None, wallet_keys=None, config_path=CONFIG_PATH ):
|
||||
def app_delete_resource( blockchain_id, app_domain, res_name, data_privkey, app_config=None, proxy=None, config_path=CONFIG_PATH ):
|
||||
"""
|
||||
Remove data from a named application resource in mutable storage.
|
||||
|
||||
@@ -341,11 +331,6 @@ def app_delete_resource( blockchain_id, app_domain, res_name, app_config=None, d
|
||||
Return {'error': ...} on error
|
||||
"""
|
||||
|
||||
if data_privkey is None:
|
||||
assert wallet_keys, "No data private key or wallet given"
|
||||
data_privkey = wallet_keys.get('data_privkey', None)
|
||||
assert data_privkey, "Wallet does not contain a data private key"
|
||||
|
||||
data_pubkey = get_pubkey_hex(data_privkey)
|
||||
|
||||
proxy = get_default_proxy() if proxy is None else proxy
|
||||
|
||||
Reference in New Issue
Block a user