stackit-secretsmanager 0.0.1a0__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.
@@ -0,0 +1,84 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ STACKIT Secrets Manager API
5
+
6
+ This API provides endpoints for managing the Secrets-Manager.
7
+
8
+ The version of the OpenAPI document: 1.4.0
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501 docstring might be too long
13
+
14
+ from __future__ import annotations
15
+
16
+ import json
17
+ import pprint
18
+ from typing import Any, ClassVar, Dict, List, Optional, Set
19
+
20
+ from pydantic import BaseModel, ConfigDict, Field, StrictBool
21
+ from typing_extensions import Self
22
+
23
+
24
+ class UpdateUserPayload(BaseModel):
25
+ """
26
+ UpdateUserPayload
27
+ """
28
+
29
+ write: Optional[StrictBool] = Field(
30
+ default=None,
31
+ description="Is true if the user has write access to the secrets engine. Is false for a read-only user.",
32
+ )
33
+ __properties: ClassVar[List[str]] = ["write"]
34
+
35
+ model_config = ConfigDict(
36
+ populate_by_name=True,
37
+ validate_assignment=True,
38
+ protected_namespaces=(),
39
+ )
40
+
41
+ def to_str(self) -> str:
42
+ """Returns the string representation of the model using alias"""
43
+ return pprint.pformat(self.model_dump(by_alias=True))
44
+
45
+ def to_json(self) -> str:
46
+ """Returns the JSON representation of the model using alias"""
47
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
48
+ return json.dumps(self.to_dict())
49
+
50
+ @classmethod
51
+ def from_json(cls, json_str: str) -> Optional[Self]:
52
+ """Create an instance of UpdateUserPayload from a JSON string"""
53
+ return cls.from_dict(json.loads(json_str))
54
+
55
+ def to_dict(self) -> Dict[str, Any]:
56
+ """Return the dictionary representation of the model using alias.
57
+
58
+ This has the following differences from calling pydantic's
59
+ `self.model_dump(by_alias=True)`:
60
+
61
+ * `None` is only added to the output dict for nullable fields that
62
+ were set at model initialization. Other fields with value `None`
63
+ are ignored.
64
+ """
65
+ excluded_fields: Set[str] = set([])
66
+
67
+ _dict = self.model_dump(
68
+ by_alias=True,
69
+ exclude=excluded_fields,
70
+ exclude_none=True,
71
+ )
72
+ return _dict
73
+
74
+ @classmethod
75
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
76
+ """Create an instance of UpdateUserPayload from a dict"""
77
+ if obj is None:
78
+ return None
79
+
80
+ if not isinstance(obj, dict):
81
+ return cls.model_validate(obj)
82
+
83
+ _obj = cls.model_validate({"write": obj.get("write")})
84
+ return _obj
@@ -0,0 +1,95 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ STACKIT Secrets Manager API
5
+
6
+ This API provides endpoints for managing the Secrets-Manager.
7
+
8
+ The version of the OpenAPI document: 1.4.0
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501 docstring might be too long
13
+
14
+ from __future__ import annotations
15
+
16
+ import json
17
+ import pprint
18
+ from typing import Any, ClassVar, Dict, List, Optional, Set
19
+
20
+ from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr
21
+ from typing_extensions import Self
22
+
23
+
24
+ class User(BaseModel):
25
+ """
26
+ User
27
+ """
28
+
29
+ description: StrictStr = Field(description="A user chosen description to differentiate between multiple users.")
30
+ id: StrictStr = Field(description="A auto generated unique id which identifies the users.")
31
+ password: StrictStr = Field(description="A auto generated password for logging in with the user.")
32
+ username: StrictStr = Field(description="A auto generated username for logging in with the user.")
33
+ write: StrictBool = Field(
34
+ description="Is true if the user has write access to the secrets engine. Is false for a read-only user."
35
+ )
36
+ __properties: ClassVar[List[str]] = ["description", "id", "password", "username", "write"]
37
+
38
+ model_config = ConfigDict(
39
+ populate_by_name=True,
40
+ validate_assignment=True,
41
+ protected_namespaces=(),
42
+ )
43
+
44
+ def to_str(self) -> str:
45
+ """Returns the string representation of the model using alias"""
46
+ return pprint.pformat(self.model_dump(by_alias=True))
47
+
48
+ def to_json(self) -> str:
49
+ """Returns the JSON representation of the model using alias"""
50
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
51
+ return json.dumps(self.to_dict())
52
+
53
+ @classmethod
54
+ def from_json(cls, json_str: str) -> Optional[Self]:
55
+ """Create an instance of User from a JSON string"""
56
+ return cls.from_dict(json.loads(json_str))
57
+
58
+ def to_dict(self) -> Dict[str, Any]:
59
+ """Return the dictionary representation of the model using alias.
60
+
61
+ This has the following differences from calling pydantic's
62
+ `self.model_dump(by_alias=True)`:
63
+
64
+ * `None` is only added to the output dict for nullable fields that
65
+ were set at model initialization. Other fields with value `None`
66
+ are ignored.
67
+ """
68
+ excluded_fields: Set[str] = set([])
69
+
70
+ _dict = self.model_dump(
71
+ by_alias=True,
72
+ exclude=excluded_fields,
73
+ exclude_none=True,
74
+ )
75
+ return _dict
76
+
77
+ @classmethod
78
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
79
+ """Create an instance of User from a dict"""
80
+ if obj is None:
81
+ return None
82
+
83
+ if not isinstance(obj, dict):
84
+ return cls.model_validate(obj)
85
+
86
+ _obj = cls.model_validate(
87
+ {
88
+ "description": obj.get("description"),
89
+ "id": obj.get("id"),
90
+ "password": obj.get("password"),
91
+ "username": obj.get("username"),
92
+ "write": obj.get("write"),
93
+ }
94
+ )
95
+ return _obj
File without changes
@@ -0,0 +1,148 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ STACKIT Secrets Manager API
5
+
6
+ This API provides endpoints for managing the Secrets-Manager.
7
+
8
+ The version of the OpenAPI document: 1.4.0
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501 docstring might be too long
13
+
14
+ import io
15
+ import json
16
+ import re
17
+
18
+ import requests
19
+ from stackit.core.authorization import Authorization
20
+ from stackit.core.configuration import Configuration
21
+
22
+ from stackit.secretsmanager.exceptions import ApiException, ApiValueError
23
+
24
+
25
+ RESTResponseType = requests.Response
26
+
27
+
28
+ class RESTResponse(io.IOBase):
29
+
30
+ def __init__(self, resp) -> None:
31
+ self.response = resp
32
+ self.status = resp.status_code
33
+ self.reason = resp.reason
34
+ self.data = None
35
+
36
+ def read(self):
37
+ if self.data is None:
38
+ self.data = self.response.content
39
+ return self.data
40
+
41
+ def getheaders(self):
42
+ """Returns a dictionary of the response headers."""
43
+ return self.response.headers
44
+
45
+ def getheader(self, name, default=None):
46
+ """Returns a given response header."""
47
+ return self.response.headers.get(name, default)
48
+
49
+
50
+ class RESTClientObject:
51
+ def __init__(self, config: Configuration) -> None:
52
+ self.session = config.custom_http_session if config.custom_http_session else requests.Session()
53
+ authorization = Authorization(config)
54
+ self.session.auth = authorization.auth_method
55
+
56
+ def request(self, method, url, headers=None, body=None, post_params=None, _request_timeout=None):
57
+ """Perform requests.
58
+
59
+ :param method: http request method
60
+ :param url: http request url
61
+ :param headers: http request headers
62
+ :param body: request json body, for `application/json`
63
+ :param post_params: request post parameters,
64
+ `application/x-www-form-urlencoded`
65
+ and `multipart/form-data`
66
+ :param _request_timeout: timeout setting for this request. If one
67
+ number provided, it will be total request
68
+ timeout. It can also be a pair (tuple) of
69
+ (connection, read) timeouts.
70
+ """
71
+ method = method.upper()
72
+ if method not in ["GET", "HEAD", "DELETE", "POST", "PUT", "PATCH", "OPTIONS"]:
73
+ raise ValueError("Method %s not allowed", method)
74
+
75
+ if post_params and body:
76
+ raise ApiValueError("body parameter cannot be used with post_params parameter.")
77
+
78
+ post_params = post_params or {}
79
+ headers = headers or {}
80
+
81
+ try:
82
+ # For `POST`, `PUT`, `PATCH`, `OPTIONS`, `DELETE`
83
+ if method in ["POST", "PUT", "PATCH", "OPTIONS", "DELETE"]:
84
+
85
+ # no content type provided or payload is json
86
+ content_type = headers.get("Content-Type")
87
+ if not content_type or re.search("json", content_type, re.IGNORECASE):
88
+ request_body = None
89
+ if body is not None:
90
+ request_body = json.dumps(body)
91
+ r = self.session.request(
92
+ method,
93
+ url,
94
+ data=request_body,
95
+ headers=headers,
96
+ )
97
+ elif content_type == "application/x-www-form-urlencoded":
98
+ r = self.session.request(
99
+ method,
100
+ url,
101
+ params=post_params,
102
+ headers=headers,
103
+ )
104
+ elif content_type == "multipart/form-data":
105
+ # must del headers['Content-Type'], or the correct
106
+ # Content-Type which generated by urllib3 will be
107
+ # overwritten.
108
+ del headers["Content-Type"]
109
+ # Ensures that dict objects are serialized
110
+ post_params = [(a, json.dumps(b)) if isinstance(b, dict) else (a, b) for a, b in post_params]
111
+ r = self.session.request(
112
+ method,
113
+ url,
114
+ files=post_params,
115
+ headers=headers,
116
+ )
117
+ # Pass a `string` parameter directly in the body to support
118
+ # other content types than JSON when `body` argument is
119
+ # provided in serialized form.
120
+ elif isinstance(body, str) or isinstance(body, bytes):
121
+ r = self.session.request(
122
+ method,
123
+ url,
124
+ data=body,
125
+ headers=headers,
126
+ )
127
+ elif headers["Content-Type"] == "text/plain" and isinstance(body, bool):
128
+ request_body = "true" if body else "false"
129
+ r = self.session.request(method, url, data=request_body, headers=headers)
130
+ else:
131
+ # Cannot generate the request from given parameters
132
+ msg = """Cannot prepare a request message for provided
133
+ arguments. Please check that your arguments match
134
+ declared content type."""
135
+ raise ApiException(status=0, reason=msg)
136
+ # For `GET`, `HEAD`
137
+ else:
138
+ r = self.session.request(
139
+ method,
140
+ url,
141
+ params={},
142
+ headers=headers,
143
+ )
144
+ except requests.exceptions.SSLError as e:
145
+ msg = "\n".join([type(e).__name__, str(e)])
146
+ raise ApiException(status=0, reason=msg)
147
+
148
+ return RESTResponse(r)
@@ -0,0 +1,45 @@
1
+ Metadata-Version: 2.1
2
+ Name: stackit-secretsmanager
3
+ Version: 0.0.1a0
4
+ Summary: STACKIT Secrets Manager API
5
+ Author: STACKIT Developer Tools
6
+ Author-email: developer-tools@stackit.cloud
7
+ Requires-Python: >=3.8,<4.0
8
+ Classifier: License :: OSI Approved :: Apache Software License
9
+ Classifier: Operating System :: OS Independent
10
+ Classifier: Programming Language :: Python :: 3
11
+ Classifier: Programming Language :: Python :: 3.8
12
+ Classifier: Programming Language :: Python :: 3.9
13
+ Classifier: Programming Language :: Python :: 3.10
14
+ Classifier: Programming Language :: Python :: 3.11
15
+ Classifier: Programming Language :: Python :: 3.12
16
+ Classifier: Programming Language :: Python :: 3.13
17
+ Requires-Dist: pydantic (>=2.9.2)
18
+ Requires-Dist: python-dateutil (>=2.9.0.post0)
19
+ Requires-Dist: requests (>=2.32.3)
20
+ Requires-Dist: stackit-core (>=0.0.1a)
21
+ Description-Content-Type: text/markdown
22
+
23
+ # stackit.secretsmanager
24
+ This API provides endpoints for managing the Secrets-Manager.
25
+
26
+
27
+
28
+ This package is part of the STACKIT Python SDK. For additional information, please visit the [GitHub repository](https://github.com/stackitcloud/stackit-sdk-python) of the SDK.
29
+
30
+
31
+ ## Installation & Usage
32
+ ### pip install
33
+
34
+ ```sh
35
+ pip install stackit-secretsmanager
36
+ ```
37
+
38
+ Then import the package:
39
+ ```python
40
+ import stackit.secretsmanager
41
+ ```
42
+
43
+ ## Getting Started
44
+
45
+ [Examples](https://github.com/stackitcloud/stackit-sdk-python/tree/main/examples) for the usage of the package can be found in the [GitHub repository](https://github.com/stackitcloud/stackit-sdk-python) of the SDK.
@@ -0,0 +1,26 @@
1
+ stackit/secretsmanager/__init__.py,sha256=8MaCrkAoVEuSSmUuyLVKIg3wJdAr4kapBkmscVIbDew,1838
2
+ stackit/secretsmanager/api/__init__.py,sha256=SOoTe75p02qFDLzLcnHJK5VroV0OTXESysMPEJpQeGk,109
3
+ stackit/secretsmanager/api/default_api.py,sha256=ikzX9bx53IxfVHvn6ODmsn0yxouKnRvUVDDGp0VEw9Y,190504
4
+ stackit/secretsmanager/api_client.py,sha256=fg8mitPXO0V1XAFN_DNj9s2qYRLsVtJxqVcYSn3Vh-k,22730
5
+ stackit/secretsmanager/api_response.py,sha256=HRYkVqMNIlfODacTQPTbiVj2YdcnutpQrKJdeAoCSpM,642
6
+ stackit/secretsmanager/configuration.py,sha256=vxIfW8-3To7rTZp90ImpYcWvZdqE46jZq65KFmQ5BII,3842
7
+ stackit/secretsmanager/exceptions.py,sha256=vYVR-apDUdiwhxiqX86IOuS8yyowEiYKKECNekl7Af0,5925
8
+ stackit/secretsmanager/models/__init__.py,sha256=iPBsU4LKR5ltPkGB9jkY2SGwW-jDJRPg-h4s4vp-sn4,1352
9
+ stackit/secretsmanager/models/acl.py,sha256=taUofdU4_2zBttV0odAbPbPxFmOoyyOKnHsCSG1CJrg,2547
10
+ stackit/secretsmanager/models/create_acl_payload.py,sha256=TkQ4p4lpkTrYHjtrNEdyTBWgG89h8FnjM0XDRbMzS48,2478
11
+ stackit/secretsmanager/models/create_instance_payload.py,sha256=YIxXf3OT2No2RhaJX3mFCYJIj5qBWYAhjyw3kgocZ5o,2517
12
+ stackit/secretsmanager/models/create_user_payload.py,sha256=CJufh9t1HK6N7oDSEV6UZPCbCY1t2tRWZixlIfasjos,2724
13
+ stackit/secretsmanager/models/instance.py,sha256=r4M8wjHfiZETu7dRk8C3KxIOqYtK4zs3vuZL06llA9A,4501
14
+ stackit/secretsmanager/models/list_acls_response.py,sha256=MT7rglTmIRiprbwsPCd8VFOKTwBTcBMicgZkPbQCVts,2825
15
+ stackit/secretsmanager/models/list_instances_response.py,sha256=NATEIuv7NEwS4gYTt-DZ9ayQPhmWvtBdAWMMosMcI6k,3020
16
+ stackit/secretsmanager/models/list_users_response.py,sha256=Py5mbUGjcXIs20qgsRBnsvpaJQtQh1KdBG_48ZyQZhI,2842
17
+ stackit/secretsmanager/models/update_acl_payload.py,sha256=iQQ0GycvxrKwVRoVKS7F_8BKjGnY4MQ9QMZGrsjz-MA,2478
18
+ stackit/secretsmanager/models/update_acls_payload.py,sha256=lu8vuBVNLc9d9wHmSGOmZ_dxP-Awu48AOKZDqVlUmSg,3019
19
+ stackit/secretsmanager/models/update_instance_payload.py,sha256=ggaL46Dr3JE46ezrdBLehV0L7i0l1coWrZqfs7CZRQU,2517
20
+ stackit/secretsmanager/models/update_user_payload.py,sha256=eLM1abcza86TNWGGWYSZwhk5rjJYo6bFA9uwUkYDsHg,2575
21
+ stackit/secretsmanager/models/user.py,sha256=bUyuA3CqMUQ3FQcV8UwZQSHGR4XTI-c5rF94uMou_ws,3208
22
+ stackit/secretsmanager/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
23
+ stackit/secretsmanager/rest.py,sha256=iOKU2KC6z4MpdzxK6yDaz7bMNTU1y5DttmBcRKk-1PI,5812
24
+ stackit_secretsmanager-0.0.1a0.dist-info/METADATA,sha256=WTIqia-i6MX9o729EgVIkHDV1CCHYQbi3XghtubIxfU,1528
25
+ stackit_secretsmanager-0.0.1a0.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
26
+ stackit_secretsmanager-0.0.1a0.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: poetry-core 1.9.1
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any