otdf-python 0.0.4__py3-none-any.whl → 0.0.6__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/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')])
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')])
181
+ add_checked_string_function(mod, 'gotdf_python_EncryptString', retval('char*'), [param('char*', 'inputText'), param('int64_t', 'config')])
182
+ add_checked_string_function(mod, 'gotdf_python_Hello', retval('char*'), [])
181
183
  add_checked_string_function(mod, 'gotdf_python_DecryptFile', retval('char*'), [param('char*', 'inputFilePath'), param('char*', 'outputFilePath'), param('int64_t', 'config')])
182
184
  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
185
  add_checked_string_function(mod, 'gotdf_python_DecryptStringPE', retval('char*'), [param('char*', 'inputText'), param('int64_t', 'config'), param('int64_t', 'token')])
184
186
  add_checked_string_function(mod, 'gotdf_python_EncryptFile', retval('char*'), [param('char*', 'inputFilePath'), param('char*', 'outputFilePath'), param('int64_t', 'config')])
185
187
  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
- add_checked_string_function(mod, 'gotdf_python_EncryptString', retval('char*'), [param('char*', 'inputText'), param('int64_t', 'config')])
187
- add_checked_string_function(mod, 'gotdf_python_Hello', retval('char*'), [])
188
188
 
189
189
  mod.generate(open('gotdf_python.c', 'w'))
190
190
 
@@ -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,6 +347,20 @@ class EncryptionConfig(go.GoClass):
347
347
 
348
348
 
349
349
  # ---- Functions ---
350
+ def EncryptString(inputText, config):
351
+ """EncryptString(str inputText, object config) str, str"""
352
+ return _gotdf_python.gotdf_python_EncryptString(inputText, config.handle)
353
+ def Hello():
354
+ """Hello() str
355
+
356
+ A simple "Hello, world" function, used for learning golang (e.g. unit testing),
357
+ as well as validating the necessary mechanisms to compile this library
358
+ into a Python wheel.
359
+
360
+ In the future, this function might be removed or replaced with a more
361
+ conventional & useful function like GetVersion()
362
+ """
363
+ return _gotdf_python.gotdf_python_Hello()
350
364
  def DecryptFile(inputFilePath, outputFilePath, config):
351
365
  """DecryptFile(str inputFilePath, str outputFilePath, object config) str, str"""
352
366
  return _gotdf_python.gotdf_python_DecryptFile(inputFilePath, outputFilePath, config.handle)
@@ -365,19 +379,5 @@ def EncryptFilePE(inputFilePath, outputFilePath, config, token):
365
379
  Encrypts a file as a PE (Person Entity), returning a TDF manifest and the cipher text.
366
380
  """
367
381
  return _gotdf_python.gotdf_python_EncryptFilePE(inputFilePath, outputFilePath, config.handle, token.handle)
368
- def EncryptString(inputText, config):
369
- """EncryptString(str inputText, object config) str, str"""
370
- return _gotdf_python.gotdf_python_EncryptString(inputText, config.handle)
371
- def Hello():
372
- """Hello() str
373
-
374
- A simple "Hello, world" function, used for learning golang (e.g. unit testing),
375
- as well as validating the necessary mechanisms to compile this library
376
- into a Python wheel.
377
-
378
- In the future, this function might be removed or replaced with a more
379
- conventional & useful function like GetVersion()
380
- """
381
- return _gotdf_python.gotdf_python_Hello()
382
382
 
383
383
 
@@ -1,7 +1,8 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: otdf_python
3
- Version: 0.0.4
3
+ Version: 0.0.6
4
4
  Home-page: https://github.com/b-long/opentdf-python-sdk
5
+ Author-email: b-long@users.noreply.github.com
5
6
  Description-Content-Type: text/markdown
6
7
  License-File: LICENSE
7
8
 
@@ -0,0 +1,10 @@
1
+ otdf_python/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
+ otdf_python/_gotdf_python.cpython-311-darwin.so,sha256=PrJJP1B5EpKrLIopxst_P3IGdkcFy8eYAYQMFxdpGBE,14765632
3
+ otdf_python/build.py,sha256=o3wOgQdBPigNSbmf8lvH8G1EJECOFAcvwZugQKfFk7U,16756
4
+ otdf_python/go.py,sha256=7kz0kwEbEJZp9ZJIvdcUryZmhahLRb5RrkhGBN2BDBY,49317
5
+ otdf_python/gotdf_python.py,sha256=CwGzQImPxYuQoBWBIivR7AtSSIt1omE44mQY0AWXwEo,13880
6
+ otdf_python-0.0.6.dist-info/LICENSE,sha256=51wzGxR-Rns8XaiGmDLq2OqPN3qWMpoQKV-fERpVzyM,1063
7
+ otdf_python-0.0.6.dist-info/METADATA,sha256=DWwMSGFW4PlVtvZkHXG7kRgrVwjgJbcSeKLAcRTIn50,415
8
+ otdf_python-0.0.6.dist-info/WHEEL,sha256=Wyh-_nZ0DJYolHNn1_hMa4lM7uDedD_RGVwbmTjyItk,91
9
+ otdf_python-0.0.6.dist-info/top_level.txt,sha256=A2vK95iTIxdu4pm8kDZlvHorBKCvSN5dvlMdFbIVXrA,12
10
+ otdf_python-0.0.6.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=skpt12w1l5WxI8FgcBSK950r-whK73Ne0k5bV6Sv4CY,14621432
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.4.dist-info/LICENSE,sha256=51wzGxR-Rns8XaiGmDLq2OqPN3qWMpoQKV-fERpVzyM,1063
7
- otdf_python-0.0.4.dist-info/METADATA,sha256=51VS1FDVGOGRTSkA6OB3OusYjOdnJj57VmMKiURAQvQ,369
8
- otdf_python-0.0.4.dist-info/WHEEL,sha256=Wyh-_nZ0DJYolHNn1_hMa4lM7uDedD_RGVwbmTjyItk,91
9
- otdf_python-0.0.4.dist-info/top_level.txt,sha256=A2vK95iTIxdu4pm8kDZlvHorBKCvSN5dvlMdFbIVXrA,12
10
- otdf_python-0.0.4.dist-info/RECORD,,