4
4
import time
5
5
from typing import Any , Callable , Dict , List
6
6
7
- import numpy as np
8
- import py_nillion_client as nillion
9
-
10
7
import nada_numpy as na
11
8
import nada_numpy .client as na_client
9
+ import numpy as np
10
+ import py_nillion_client as nillion
12
11
13
12
14
13
def async_timer (file_path : os .PathLike ) -> Callable :
@@ -92,6 +91,7 @@ async def store_secret_array(
92
91
secret_array : np .ndarray ,
93
92
name : str ,
94
93
nada_type : Any ,
94
+ permissions : nillion .Permissions = None ,
95
95
):
96
96
"""
97
97
Asynchronous function to store secret arrays on the nillion client.
@@ -105,6 +105,8 @@ async def store_secret_array(
105
105
secret_array (np.ndarray): Secret array.
106
106
name (str): Secrets name.
107
107
nada_type (Any): Nada type.
108
+ permissions (nillion.Permissions): Optional Permissions.
109
+
108
110
109
111
Returns:
110
112
str: Store ID.
@@ -118,6 +120,7 @@ async def store_secret_array(
118
120
party_id ,
119
121
party_name ,
120
122
secrets ,
123
+ permissions ,
121
124
)
122
125
return store_id
123
126
@@ -131,6 +134,8 @@ async def store_secret_value(
131
134
secret_value : Any ,
132
135
name : str ,
133
136
nada_type : Any ,
137
+ permissions : nillion .Permissions = None ,
138
+
134
139
):
135
140
"""
136
141
Asynchronous function to store secret values on the nillion client.
@@ -144,6 +149,7 @@ async def store_secret_value(
144
149
secret_value (Any): Secret single value.
145
150
name (str): Secrets name.
146
151
nada_type (Any): Nada type.
152
+ permissions (nillion.Permissions): Optional Permissions.
147
153
148
154
Returns:
149
155
str: Store ID.
@@ -163,6 +169,7 @@ async def store_secret_value(
163
169
party_id ,
164
170
party_name ,
165
171
secrets ,
172
+ permissions ,
166
173
)
167
174
return store_id
168
175
@@ -174,6 +181,7 @@ async def store_secrets(
174
181
party_id : str ,
175
182
party_name : str ,
176
183
secrets : nillion .Secrets ,
184
+ permissions : nillion .Permissions = None
177
185
):
178
186
"""
179
187
Asynchronous function to store secret values on the nillion client.
@@ -185,13 +193,14 @@ async def store_secrets(
185
193
party_id (str): Party ID.
186
194
party_name (str): Party name.
187
195
secrets (nillion.Secrets): Secrets.
196
+ permissions (nillion.Permissions): Optional Permissions.
188
197
189
198
Returns:
190
199
str: Store ID.
191
200
"""
192
201
secret_bindings = nillion .ProgramBindings (program_id )
193
202
secret_bindings .add_input_party (party_name , party_id )
194
- store_id = await client .store_secrets (cluster_id , secret_bindings , secrets , None )
203
+ store_id = await client .store_secrets (cluster_id , secret_bindings , secrets , permissions )
195
204
return store_id
196
205
197
206
@@ -233,4 +242,4 @@ async def compute(
233
242
if verbose :
234
243
print (f"✅ Compute complete for compute_id { compute_event .uuid } " )
235
244
print (f"🖥️ The result is { compute_event .result .value } " )
236
- return compute_event .result .value
245
+ return compute_event .result .value
0 commit comments