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 +5 -1
- polyapi/variables.py +4 -3
- {polyapi_python-0.3.5.dev1.dist-info → polyapi_python-0.3.6.dev0.dist-info}/METADATA +1 -1
- {polyapi_python-0.3.5.dev1.dist-info → polyapi_python-0.3.6.dev0.dist-info}/RECORD +7 -7
- {polyapi_python-0.3.5.dev1.dist-info → polyapi_python-0.3.6.dev0.dist-info}/WHEEL +0 -0
- {polyapi_python-0.3.5.dev1.dist-info → polyapi_python-0.3.6.dev0.dist-info}/licenses/LICENSE +0 -0
- {polyapi_python-0.3.5.dev1.dist-info → polyapi_python-0.3.6.dev0.dist-info}/top_level.txt +0 -0
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
|
-
|
|
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
|
|
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"]["
|
|
82
|
+
if variable["variable"]["secrecy"] == "SECRET"
|
|
82
83
|
else GET_TEMPLATE.format(
|
|
83
84
|
variable_id=variable["id"], variable_type=variable_type
|
|
84
85
|
)
|
|
@@ -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=
|
|
23
|
+
polyapi/typedefs.py,sha256=MGDwWaijLNqokXF9UCHGAP-yKixOzztrH4Lsj800AJs,2328
|
|
24
24
|
polyapi/utils.py,sha256=vq2seXLhbp9pOvemhS71DDwi1h4YofI8TXiRDjt5Eoo,10308
|
|
25
|
-
polyapi/variables.py,sha256=
|
|
25
|
+
polyapi/variables.py,sha256=j7WWrGLr2O5SkWGxnsusnnfl25kVL3b6SQYcVGEoC8c,4277
|
|
26
26
|
polyapi/webhook.py,sha256=LWv28c2MLz_OKBI_Nn7WR4C-gs1SWgbdXsoxIIf-9UI,4886
|
|
27
|
-
polyapi_python-0.3.
|
|
28
|
-
polyapi_python-0.3.
|
|
29
|
-
polyapi_python-0.3.
|
|
30
|
-
polyapi_python-0.3.
|
|
31
|
-
polyapi_python-0.3.
|
|
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,,
|
|
File without changes
|
{polyapi_python-0.3.5.dev1.dist-info → polyapi_python-0.3.6.dev0.dist-info}/licenses/LICENSE
RENAMED
|
File without changes
|
|
File without changes
|