polyapi-python 0.3.5.dev1__py3-none-any.whl → 0.3.6.dev0__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.
polyapi/typedefs.py CHANGED
@@ -40,11 +40,15 @@ class SpecificationDto(TypedDict):
40
40
  language: str
41
41
 
42
42
 
43
+ # Enum for variable secrecy levels
44
+ Secrecy = Literal['SECRET', 'OBSCURED', 'NONE']
45
+
46
+
43
47
  class VariableSpecification(TypedDict):
44
48
  environmentId: str
45
49
  value: Any
46
50
  valueType: PropertyType
47
- secret: bool
51
+ secrecy: Secrecy
48
52
 
49
53
 
50
54
  class VariableSpecDto(TypedDict):
polyapi/variables.py CHANGED
@@ -2,11 +2,11 @@ import os
2
2
  from typing import List
3
3
 
4
4
  from polyapi.schema import map_primitive_types
5
- from polyapi.typedefs import PropertyType, VariableSpecDto
5
+ from polyapi.typedefs import PropertyType, VariableSpecDto, Secrecy
6
6
  from polyapi.utils import add_import_to_init, init_the_init
7
7
 
8
8
 
9
- # GET is only included if the variable is not a secret
9
+ # GET is only included if the variable is not SECRET
10
10
  GET_TEMPLATE = """
11
11
  @staticmethod
12
12
  def get() -> {variable_type}:
@@ -76,9 +76,10 @@ def generate_variables(variables: List[VariableSpecDto]):
76
76
 
77
77
  def render_variable(variable: VariableSpecDto):
78
78
  variable_type = _get_variable_type(variable["variable"]["valueType"])
79
+ # Only include get() method if secrecy is not SECRET
79
80
  get_method = (
80
81
  ""
81
- if variable["variable"]["secret"]
82
+ if variable["variable"]["secrecy"] == "SECRET"
82
83
  else GET_TEMPLATE.format(
83
84
  variable_id=variable["id"], variable_type=variable_type
84
85
  )
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: polyapi-python
3
- Version: 0.3.5.dev1
3
+ Version: 0.3.6.dev0
4
4
  Summary: The Python Client for PolyAPI, the IPaaS by Developers for Developers
5
5
  Author-email: Dan Fellin <dan@polyapi.io>
6
6
  License: MIT License
@@ -20,12 +20,12 @@ polyapi/rendered_spec.py,sha256=nJEj2vRgG3N20fU4s-ThRtOIwAuTzXwXuOBIkXljDVc,2240
20
20
  polyapi/schema.py,sha256=ZSzeUjpqigLvE4tFKB7y4AaZG-W5N5Z9wMH-F-vjMBU,4616
21
21
  polyapi/server.py,sha256=YXWxhYBx-hluwDQ8Jvfpy2s8ogz0GsNTMcZVNcP5ca8,2147
22
22
  polyapi/sync.py,sha256=PGdC0feBBjEVrF3d9EluW_OAxbWuzSrfh84czma8kWg,6476
23
- polyapi/typedefs.py,sha256=KniVl7vwcDOhgAJmHSgTJKkP0rKWvSLIPOGsWuf9jRU,2239
23
+ polyapi/typedefs.py,sha256=MGDwWaijLNqokXF9UCHGAP-yKixOzztrH4Lsj800AJs,2328
24
24
  polyapi/utils.py,sha256=vq2seXLhbp9pOvemhS71DDwi1h4YofI8TXiRDjt5Eoo,10308
25
- polyapi/variables.py,sha256=d36-trnfTL_8m2NkorMiImb4O3UrJbiFV38CHxV5i0A,4200
25
+ polyapi/variables.py,sha256=j7WWrGLr2O5SkWGxnsusnnfl25kVL3b6SQYcVGEoC8c,4277
26
26
  polyapi/webhook.py,sha256=LWv28c2MLz_OKBI_Nn7WR4C-gs1SWgbdXsoxIIf-9UI,4886
27
- polyapi_python-0.3.5.dev1.dist-info/licenses/LICENSE,sha256=6b_I7aPVp8JXhqQwdw7_B84Ca0S4JGjHj0sr_1VOdB4,1068
28
- polyapi_python-0.3.5.dev1.dist-info/METADATA,sha256=YptreUILVlcZGNQomNmBqYS1UVozCFhSWRVzR4lmBrE,5782
29
- polyapi_python-0.3.5.dev1.dist-info/WHEEL,sha256=DnLRTWE75wApRYVsjgc6wsVswC54sMSJhAEd4xhDpBk,91
30
- polyapi_python-0.3.5.dev1.dist-info/top_level.txt,sha256=CEFllOnzowci_50RYJac-M54KD2IdAptFsayVVF_f04,8
31
- polyapi_python-0.3.5.dev1.dist-info/RECORD,,
27
+ polyapi_python-0.3.6.dev0.dist-info/licenses/LICENSE,sha256=6b_I7aPVp8JXhqQwdw7_B84Ca0S4JGjHj0sr_1VOdB4,1068
28
+ polyapi_python-0.3.6.dev0.dist-info/METADATA,sha256=W1C6j1oRkKpu4Wd0Vyz9ATCJsstQs7R-lIfcRdBASZI,5782
29
+ polyapi_python-0.3.6.dev0.dist-info/WHEEL,sha256=DnLRTWE75wApRYVsjgc6wsVswC54sMSJhAEd4xhDpBk,91
30
+ polyapi_python-0.3.6.dev0.dist-info/top_level.txt,sha256=CEFllOnzowci_50RYJac-M54KD2IdAptFsayVVF_f04,8
31
+ polyapi_python-0.3.6.dev0.dist-info/RECORD,,