otdf-python 0.0.12__py3-none-any.whl → 0.0.13__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- otdf_python/_gotdf_python.cpython-311-darwin.so +0 -0
- otdf_python/build.py +6 -6
- otdf_python/gotdf_python.py +70 -70
- {otdf_python-0.0.12.dist-info → otdf_python-0.0.13.dist-info}/METADATA +6 -6
- otdf_python-0.0.13.dist-info/RECORD +10 -0
- otdf_python-0.0.12.dist-info/RECORD +0 -10
- {otdf_python-0.0.12.dist-info → otdf_python-0.0.13.dist-info}/LICENSE +0 -0
- {otdf_python-0.0.12.dist-info → otdf_python-0.0.13.dist-info}/WHEEL +0 -0
- {otdf_python-0.0.12.dist-info → otdf_python-0.0.13.dist-info}/top_level.txt +0 -0
|
Binary file
|
otdf_python/build.py
CHANGED
|
@@ -149,11 +149,6 @@ mod.add_function('Slice_uint8_elem', retval('uint8_t'), [param('int64_t', 'handl
|
|
|
149
149
|
mod.add_function('Slice_uint8_subslice', retval('int64_t'), [param('int64_t', 'handle'), param('int', 'st'), param('int', 'ed')])
|
|
150
150
|
mod.add_function('Slice_uint8_set', None, [param('int64_t', 'handle'), param('int', 'idx'), param('uint8_t', 'value')])
|
|
151
151
|
mod.add_function('Slice_uint8_append', None, [param('int64_t', 'handle'), param('uint8_t', 'value')])
|
|
152
|
-
mod.add_function('gotdf_python_TokenAuth_CTor', retval('int64_t'), [])
|
|
153
|
-
mod.add_function('gotdf_python_TokenAuth_AccessToken_Get', retval('char*'), [param('int64_t', 'handle')])
|
|
154
|
-
mod.add_function('gotdf_python_TokenAuth_AccessToken_Set', None, [param('int64_t', 'handle'), param('char*', 'val')])
|
|
155
|
-
mod.add_function('gotdf_python_TokenAuth_NpeClientId_Get', retval('char*'), [param('int64_t', 'handle')])
|
|
156
|
-
mod.add_function('gotdf_python_TokenAuth_NpeClientId_Set', None, [param('int64_t', 'handle'), param('char*', 'val')])
|
|
157
152
|
mod.add_function('gotdf_python_DecryptionConfig_CTor', retval('int64_t'), [])
|
|
158
153
|
mod.add_function('gotdf_python_DecryptionConfig_ClientId_Get', retval('char*'), [param('int64_t', 'handle')])
|
|
159
154
|
mod.add_function('gotdf_python_DecryptionConfig_ClientId_Set', None, [param('int64_t', 'handle'), param('char*', 'val')])
|
|
@@ -178,13 +173,18 @@ mod.add_function('gotdf_python_EncryptionConfig_KasUrl_Get', retval('char*'), [p
|
|
|
178
173
|
mod.add_function('gotdf_python_EncryptionConfig_KasUrl_Set', None, [param('int64_t', 'handle'), param('char*', 'val')])
|
|
179
174
|
mod.add_function('gotdf_python_EncryptionConfig_DataAttributes_Get', retval('int64_t'), [param('int64_t', 'handle')])
|
|
180
175
|
mod.add_function('gotdf_python_EncryptionConfig_DataAttributes_Set', None, [param('int64_t', 'handle'), param('int64_t', 'val')])
|
|
181
|
-
|
|
176
|
+
mod.add_function('gotdf_python_TokenAuth_CTor', retval('int64_t'), [])
|
|
177
|
+
mod.add_function('gotdf_python_TokenAuth_AccessToken_Get', retval('char*'), [param('int64_t', 'handle')])
|
|
178
|
+
mod.add_function('gotdf_python_TokenAuth_AccessToken_Set', None, [param('int64_t', 'handle'), param('char*', 'val')])
|
|
179
|
+
mod.add_function('gotdf_python_TokenAuth_NpeClientId_Get', retval('char*'), [param('int64_t', 'handle')])
|
|
180
|
+
mod.add_function('gotdf_python_TokenAuth_NpeClientId_Set', None, [param('int64_t', 'handle'), param('char*', 'val')])
|
|
182
181
|
add_checked_string_function(mod, 'gotdf_python_DecryptFilePE', retval('char*'), [param('char*', 'inputFilePath'), param('char*', 'outputFilePath'), param('int64_t', 'config'), param('int64_t', 'token')])
|
|
183
182
|
add_checked_string_function(mod, 'gotdf_python_DecryptStringPE', retval('char*'), [param('char*', 'inputText'), param('int64_t', 'config'), param('int64_t', 'token')])
|
|
184
183
|
add_checked_string_function(mod, 'gotdf_python_EncryptFile', retval('char*'), [param('char*', 'inputFilePath'), param('char*', 'outputFilePath'), param('int64_t', 'config')])
|
|
185
184
|
add_checked_string_function(mod, 'gotdf_python_EncryptFilePE', retval('char*'), [param('char*', 'inputFilePath'), param('char*', 'outputFilePath'), param('int64_t', 'config'), param('int64_t', 'token')])
|
|
186
185
|
add_checked_string_function(mod, 'gotdf_python_EncryptString', retval('char*'), [param('char*', 'inputText'), param('int64_t', 'config')])
|
|
187
186
|
add_checked_string_function(mod, 'gotdf_python_Hello', retval('char*'), [])
|
|
187
|
+
add_checked_string_function(mod, 'gotdf_python_DecryptFile', retval('char*'), [param('char*', 'inputFilePath'), param('char*', 'outputFilePath'), param('int64_t', 'config')])
|
|
188
188
|
|
|
189
189
|
mod.generate(open('gotdf_python.c', 'w'))
|
|
190
190
|
|
otdf_python/gotdf_python.py
CHANGED
|
@@ -44,73 +44,6 @@ os.chdir(cwd)
|
|
|
44
44
|
|
|
45
45
|
# ---- Structs ---
|
|
46
46
|
|
|
47
|
-
# Python type for struct gotdf_python.TokenAuth
|
|
48
|
-
class TokenAuth(go.GoClass):
|
|
49
|
-
""""""
|
|
50
|
-
def __init__(self, *args, **kwargs):
|
|
51
|
-
"""
|
|
52
|
-
handle=A Go-side object is always initialized with an explicit handle=arg
|
|
53
|
-
otherwise parameters can be unnamed in order of field names or named fields
|
|
54
|
-
in which case a new Go object is constructed first
|
|
55
|
-
"""
|
|
56
|
-
if len(kwargs) == 1 and 'handle' in kwargs:
|
|
57
|
-
self.handle = kwargs['handle']
|
|
58
|
-
_gotdf_python.IncRef(self.handle)
|
|
59
|
-
elif len(args) == 1 and isinstance(args[0], go.GoClass):
|
|
60
|
-
self.handle = args[0].handle
|
|
61
|
-
_gotdf_python.IncRef(self.handle)
|
|
62
|
-
else:
|
|
63
|
-
self.handle = _gotdf_python.gotdf_python_TokenAuth_CTor()
|
|
64
|
-
_gotdf_python.IncRef(self.handle)
|
|
65
|
-
if 0 < len(args):
|
|
66
|
-
self.AccessToken = args[0]
|
|
67
|
-
if "AccessToken" in kwargs:
|
|
68
|
-
self.AccessToken = kwargs["AccessToken"]
|
|
69
|
-
if 1 < len(args):
|
|
70
|
-
self.NpeClientId = args[1]
|
|
71
|
-
if "NpeClientId" in kwargs:
|
|
72
|
-
self.NpeClientId = kwargs["NpeClientId"]
|
|
73
|
-
def __del__(self):
|
|
74
|
-
_gotdf_python.DecRef(self.handle)
|
|
75
|
-
def __str__(self):
|
|
76
|
-
pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
|
|
77
|
-
sv = 'gotdf_python.TokenAuth{'
|
|
78
|
-
first = True
|
|
79
|
-
for v in pr:
|
|
80
|
-
if callable(v[1]):
|
|
81
|
-
continue
|
|
82
|
-
if first:
|
|
83
|
-
first = False
|
|
84
|
-
else:
|
|
85
|
-
sv += ', '
|
|
86
|
-
sv += v[0] + '=' + str(v[1])
|
|
87
|
-
return sv + '}'
|
|
88
|
-
def __repr__(self):
|
|
89
|
-
pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
|
|
90
|
-
sv = 'gotdf_python.TokenAuth ( '
|
|
91
|
-
for v in pr:
|
|
92
|
-
if not callable(v[1]):
|
|
93
|
-
sv += v[0] + '=' + str(v[1]) + ', '
|
|
94
|
-
return sv + ')'
|
|
95
|
-
@property
|
|
96
|
-
def AccessToken(self):
|
|
97
|
-
return _gotdf_python.gotdf_python_TokenAuth_AccessToken_Get(self.handle)
|
|
98
|
-
@AccessToken.setter
|
|
99
|
-
def AccessToken(self, value):
|
|
100
|
-
if isinstance(value, go.GoClass):
|
|
101
|
-
_gotdf_python.gotdf_python_TokenAuth_AccessToken_Set(self.handle, value.handle)
|
|
102
|
-
else:
|
|
103
|
-
_gotdf_python.gotdf_python_TokenAuth_AccessToken_Set(self.handle, value)
|
|
104
|
-
@property
|
|
105
|
-
def NpeClientId(self):
|
|
106
|
-
return _gotdf_python.gotdf_python_TokenAuth_NpeClientId_Get(self.handle)
|
|
107
|
-
@NpeClientId.setter
|
|
108
|
-
def NpeClientId(self, value):
|
|
109
|
-
if isinstance(value, go.GoClass):
|
|
110
|
-
_gotdf_python.gotdf_python_TokenAuth_NpeClientId_Set(self.handle, value.handle)
|
|
111
|
-
else:
|
|
112
|
-
_gotdf_python.gotdf_python_TokenAuth_NpeClientId_Set(self.handle, value)
|
|
113
|
-
|
|
114
47
|
# Python type for struct gotdf_python.DecryptionConfig
|
|
115
48
|
class DecryptionConfig(go.GoClass):
|
|
116
49
|
""""""
|
|
@@ -336,6 +269,73 @@ class EncryptionConfig(go.GoClass):
|
|
|
336
269
|
else:
|
|
337
270
|
raise TypeError("supplied argument type {t} is not a go.GoClass".format(t=type(value)))
|
|
338
271
|
|
|
272
|
+
# Python type for struct gotdf_python.TokenAuth
|
|
273
|
+
class TokenAuth(go.GoClass):
|
|
274
|
+
""""""
|
|
275
|
+
def __init__(self, *args, **kwargs):
|
|
276
|
+
"""
|
|
277
|
+
handle=A Go-side object is always initialized with an explicit handle=arg
|
|
278
|
+
otherwise parameters can be unnamed in order of field names or named fields
|
|
279
|
+
in which case a new Go object is constructed first
|
|
280
|
+
"""
|
|
281
|
+
if len(kwargs) == 1 and 'handle' in kwargs:
|
|
282
|
+
self.handle = kwargs['handle']
|
|
283
|
+
_gotdf_python.IncRef(self.handle)
|
|
284
|
+
elif len(args) == 1 and isinstance(args[0], go.GoClass):
|
|
285
|
+
self.handle = args[0].handle
|
|
286
|
+
_gotdf_python.IncRef(self.handle)
|
|
287
|
+
else:
|
|
288
|
+
self.handle = _gotdf_python.gotdf_python_TokenAuth_CTor()
|
|
289
|
+
_gotdf_python.IncRef(self.handle)
|
|
290
|
+
if 0 < len(args):
|
|
291
|
+
self.AccessToken = args[0]
|
|
292
|
+
if "AccessToken" in kwargs:
|
|
293
|
+
self.AccessToken = kwargs["AccessToken"]
|
|
294
|
+
if 1 < len(args):
|
|
295
|
+
self.NpeClientId = args[1]
|
|
296
|
+
if "NpeClientId" in kwargs:
|
|
297
|
+
self.NpeClientId = kwargs["NpeClientId"]
|
|
298
|
+
def __del__(self):
|
|
299
|
+
_gotdf_python.DecRef(self.handle)
|
|
300
|
+
def __str__(self):
|
|
301
|
+
pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
|
|
302
|
+
sv = 'gotdf_python.TokenAuth{'
|
|
303
|
+
first = True
|
|
304
|
+
for v in pr:
|
|
305
|
+
if callable(v[1]):
|
|
306
|
+
continue
|
|
307
|
+
if first:
|
|
308
|
+
first = False
|
|
309
|
+
else:
|
|
310
|
+
sv += ', '
|
|
311
|
+
sv += v[0] + '=' + str(v[1])
|
|
312
|
+
return sv + '}'
|
|
313
|
+
def __repr__(self):
|
|
314
|
+
pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
|
|
315
|
+
sv = 'gotdf_python.TokenAuth ( '
|
|
316
|
+
for v in pr:
|
|
317
|
+
if not callable(v[1]):
|
|
318
|
+
sv += v[0] + '=' + str(v[1]) + ', '
|
|
319
|
+
return sv + ')'
|
|
320
|
+
@property
|
|
321
|
+
def AccessToken(self):
|
|
322
|
+
return _gotdf_python.gotdf_python_TokenAuth_AccessToken_Get(self.handle)
|
|
323
|
+
@AccessToken.setter
|
|
324
|
+
def AccessToken(self, value):
|
|
325
|
+
if isinstance(value, go.GoClass):
|
|
326
|
+
_gotdf_python.gotdf_python_TokenAuth_AccessToken_Set(self.handle, value.handle)
|
|
327
|
+
else:
|
|
328
|
+
_gotdf_python.gotdf_python_TokenAuth_AccessToken_Set(self.handle, value)
|
|
329
|
+
@property
|
|
330
|
+
def NpeClientId(self):
|
|
331
|
+
return _gotdf_python.gotdf_python_TokenAuth_NpeClientId_Get(self.handle)
|
|
332
|
+
@NpeClientId.setter
|
|
333
|
+
def NpeClientId(self, value):
|
|
334
|
+
if isinstance(value, go.GoClass):
|
|
335
|
+
_gotdf_python.gotdf_python_TokenAuth_NpeClientId_Set(self.handle, value.handle)
|
|
336
|
+
else:
|
|
337
|
+
_gotdf_python.gotdf_python_TokenAuth_NpeClientId_Set(self.handle, value)
|
|
338
|
+
|
|
339
339
|
|
|
340
340
|
# ---- Slices ---
|
|
341
341
|
|
|
@@ -347,9 +347,6 @@ class EncryptionConfig(go.GoClass):
|
|
|
347
347
|
|
|
348
348
|
|
|
349
349
|
# ---- Functions ---
|
|
350
|
-
def DecryptFile(inputFilePath, outputFilePath, config):
|
|
351
|
-
"""DecryptFile(str inputFilePath, str outputFilePath, object config) str, str"""
|
|
352
|
-
return _gotdf_python.gotdf_python_DecryptFile(inputFilePath, outputFilePath, config.handle)
|
|
353
350
|
def DecryptFilePE(inputFilePath, outputFilePath, config, token):
|
|
354
351
|
"""DecryptFilePE(str inputFilePath, str outputFilePath, object config, object token) str, str"""
|
|
355
352
|
return _gotdf_python.gotdf_python_DecryptFilePE(inputFilePath, outputFilePath, config.handle, token.handle)
|
|
@@ -379,5 +376,8 @@ def Hello():
|
|
|
379
376
|
conventional & useful function like GetVersion()
|
|
380
377
|
"""
|
|
381
378
|
return _gotdf_python.gotdf_python_Hello()
|
|
379
|
+
def DecryptFile(inputFilePath, outputFilePath, config):
|
|
380
|
+
"""DecryptFile(str inputFilePath, str outputFilePath, object config) str, str"""
|
|
381
|
+
return _gotdf_python.gotdf_python_DecryptFile(inputFilePath, outputFilePath, config.handle)
|
|
382
382
|
|
|
383
383
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: otdf_python
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.13
|
|
4
4
|
Home-page: https://github.com/b-long/opentdf-python-sdk
|
|
5
5
|
Author-email: b-long@users.noreply.github.com
|
|
6
6
|
Description-Content-Type: text/markdown
|
|
@@ -86,11 +86,11 @@ def get_encrypt_config(data_attributes: list | None = None):
|
|
|
86
86
|
else:
|
|
87
87
|
# Create config without attributes
|
|
88
88
|
config: EncryptionConfig = EncryptionConfig(
|
|
89
|
-
ClientId=
|
|
90
|
-
ClientSecret=
|
|
91
|
-
PlatformEndpoint=
|
|
92
|
-
TokenEndpoint=
|
|
93
|
-
KasUrl=
|
|
89
|
+
ClientId="opentdf-sdk",
|
|
90
|
+
ClientSecret="secret",
|
|
91
|
+
PlatformEndpoint=platformEndpoint,
|
|
92
|
+
TokenEndpoint="http://localhost:8888/auth/realms/opentdf/protocol/openid-connect/token",
|
|
93
|
+
KasUrl=f"http://{platformEndpoint}/kas",
|
|
94
94
|
)
|
|
95
95
|
|
|
96
96
|
# NOTE: Structs from golang can be printed, like below
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
otdf_python/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
+
otdf_python/_gotdf_python.cpython-311-darwin.so,sha256=kfXHmkRdxKJjy96_DvpJGttjUWz_WW4DQtXYG19pj7o,15710712
|
|
3
|
+
otdf_python/build.py,sha256=WwdUm0ey-MV1OuYjVcp12cKprHkHzGiupk4GphbhP9U,16756
|
|
4
|
+
otdf_python/go.py,sha256=7kz0kwEbEJZp9ZJIvdcUryZmhahLRb5RrkhGBN2BDBY,49317
|
|
5
|
+
otdf_python/gotdf_python.py,sha256=UtT6rqs7pEM7KiXEVApKBAP_Xx1s1_6mifL6_TVqN_g,13880
|
|
6
|
+
otdf_python-0.0.13.dist-info/LICENSE,sha256=51wzGxR-Rns8XaiGmDLq2OqPN3qWMpoQKV-fERpVzyM,1063
|
|
7
|
+
otdf_python-0.0.13.dist-info/METADATA,sha256=bxByPukjuI1ikWmEykxSZoaYTrcSYbJbKGDIABaiB1A,4934
|
|
8
|
+
otdf_python-0.0.13.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
|
|
9
|
+
otdf_python-0.0.13.dist-info/top_level.txt,sha256=A2vK95iTIxdu4pm8kDZlvHorBKCvSN5dvlMdFbIVXrA,12
|
|
10
|
+
otdf_python-0.0.13.dist-info/RECORD,,
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
otdf_python/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
-
otdf_python/_gotdf_python.cpython-311-darwin.so,sha256=WaiZ__LO-HDPQBKuWhBNR3gFvNbvzhwapCGDGnC86Mg,15204536
|
|
3
|
-
otdf_python/build.py,sha256=n992UQdwhJukysD1zgty1LrOnNTPEGAAG9MOWGlaJqs,16756
|
|
4
|
-
otdf_python/go.py,sha256=7kz0kwEbEJZp9ZJIvdcUryZmhahLRb5RrkhGBN2BDBY,49317
|
|
5
|
-
otdf_python/gotdf_python.py,sha256=1-Agpw4XFW01MudVbpiuf59ZRKSzvARXv-ojOlbeKsE,13880
|
|
6
|
-
otdf_python-0.0.12.dist-info/LICENSE,sha256=51wzGxR-Rns8XaiGmDLq2OqPN3qWMpoQKV-fERpVzyM,1063
|
|
7
|
-
otdf_python-0.0.12.dist-info/METADATA,sha256=udqnlCw0jdvLs_aDGRWPfBjCn4HXYxeAocYh3wv0NYA,4964
|
|
8
|
-
otdf_python-0.0.12.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
|
|
9
|
-
otdf_python-0.0.12.dist-info/top_level.txt,sha256=A2vK95iTIxdu4pm8kDZlvHorBKCvSN5dvlMdFbIVXrA,12
|
|
10
|
-
otdf_python-0.0.12.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|