restpki-ng-python-client 0.9.0__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.
Files changed (181) hide show
  1. restpki_ng_python_client/__init__.py +200 -0
  2. restpki_ng_python_client/api/__init__.py +17 -0
  3. restpki_ng_python_client/api/authentication_api.py +2041 -0
  4. restpki_ng_python_client/api/cades_signature_api.py +2376 -0
  5. restpki_ng_python_client/api/document_keys_api.py +1199 -0
  6. restpki_ng_python_client/api/documents_api.py +868 -0
  7. restpki_ng_python_client/api/pades_signature_api.py +1797 -0
  8. restpki_ng_python_client/api/pades_visual_positioning_presets_api.py +869 -0
  9. restpki_ng_python_client/api/pdf_api.py +334 -0
  10. restpki_ng_python_client/api/signature_api.py +624 -0
  11. restpki_ng_python_client/api/signature_inspection_api.py +337 -0
  12. restpki_ng_python_client/api/signature_sessions_api.py +891 -0
  13. restpki_ng_python_client/api/timestamp_api.py +654 -0
  14. restpki_ng_python_client/api/upload_api.py +1124 -0
  15. restpki_ng_python_client/api/xml_signature_api.py +1781 -0
  16. restpki_ng_python_client/api_client.py +741 -0
  17. restpki_ng_python_client/api_response.py +21 -0
  18. restpki_ng_python_client/configuration.py +426 -0
  19. restpki_ng_python_client/exceptions.py +166 -0
  20. restpki_ng_python_client/file_utils.py +122 -0
  21. restpki_ng_python_client/models/__init__.py +165 -0
  22. restpki_ng_python_client/models/allocate_document_key_batch_request.py +96 -0
  23. restpki_ng_python_client/models/allocate_document_key_request.py +93 -0
  24. restpki_ng_python_client/models/attribute_certificate_model.py +141 -0
  25. restpki_ng_python_client/models/audit_package_options.py +90 -0
  26. restpki_ng_python_client/models/authentication_failures.py +45 -0
  27. restpki_ng_python_client/models/authentication_get_response.py +92 -0
  28. restpki_ng_python_client/models/authentication_post_request.py +116 -0
  29. restpki_ng_python_client/models/authentication_post_response.py +98 -0
  30. restpki_ng_python_client/models/authentications_post_request.py +95 -0
  31. restpki_ng_python_client/models/authentications_post_response.py +114 -0
  32. restpki_ng_python_client/models/authentications_post_signed_bytes_request.py +99 -0
  33. restpki_ng_python_client/models/authentications_post_signed_bytes_response.py +98 -0
  34. restpki_ng_python_client/models/auto_positioning_horizontal_directions.py +45 -0
  35. restpki_ng_python_client/models/auto_positioning_vertical_directions.py +45 -0
  36. restpki_ng_python_client/models/blockchains.py +45 -0
  37. restpki_ng_python_client/models/cades_signature_model.py +123 -0
  38. restpki_ng_python_client/models/cades_signature_post_request_v1.py +137 -0
  39. restpki_ng_python_client/models/cades_signature_post_request_v2.py +152 -0
  40. restpki_ng_python_client/models/cades_signature_post_request_v3.py +149 -0
  41. restpki_ng_python_client/models/cades_signature_post_response.py +120 -0
  42. restpki_ng_python_client/models/cades_signature_post_signed_bytes_request.py +92 -0
  43. restpki_ng_python_client/models/cades_signature_post_signed_bytes_response.py +106 -0
  44. restpki_ng_python_client/models/cades_signer_model.py +159 -0
  45. restpki_ng_python_client/models/cades_timestamp_model.py +140 -0
  46. restpki_ng_python_client/models/certificate_model.py +197 -0
  47. restpki_ng_python_client/models/certificate_reference_model.py +99 -0
  48. restpki_ng_python_client/models/certificate_requirement.py +95 -0
  49. restpki_ng_python_client/models/certificate_requirement_types.py +45 -0
  50. restpki_ng_python_client/models/certificate_summary.py +142 -0
  51. restpki_ng_python_client/models/certified_attribute_model.py +94 -0
  52. restpki_ng_python_client/models/certified_attribute_types.py +44 -0
  53. restpki_ng_python_client/models/cms_content_types.py +50 -0
  54. restpki_ng_python_client/models/cms_signature_options.py +109 -0
  55. restpki_ng_python_client/models/color_model.py +98 -0
  56. restpki_ng_python_client/models/commitment_type_model.py +99 -0
  57. restpki_ng_python_client/models/complete_authentication_request.py +93 -0
  58. restpki_ng_python_client/models/complete_authentication_response.py +103 -0
  59. restpki_ng_python_client/models/complete_signature_request.py +95 -0
  60. restpki_ng_python_client/models/complete_signature_request_v2.py +91 -0
  61. restpki_ng_python_client/models/create_signature_session_request.py +161 -0
  62. restpki_ng_python_client/models/create_signature_session_response.py +95 -0
  63. restpki_ng_python_client/models/digest_algorithm_and_value_model.py +103 -0
  64. restpki_ng_python_client/models/digest_algorithms.py +49 -0
  65. restpki_ng_python_client/models/document_file_model.py +137 -0
  66. restpki_ng_python_client/models/document_key_model.py +100 -0
  67. restpki_ng_python_client/models/document_key_query_response.py +110 -0
  68. restpki_ng_python_client/models/document_key_summary.py +100 -0
  69. restpki_ng_python_client/models/document_model.py +150 -0
  70. restpki_ng_python_client/models/document_query_response.py +93 -0
  71. restpki_ng_python_client/models/document_status.py +47 -0
  72. restpki_ng_python_client/models/document_summary.py +128 -0
  73. restpki_ng_python_client/models/error_model_v2.py +120 -0
  74. restpki_ng_python_client/models/file_model.py +114 -0
  75. restpki_ng_python_client/models/file_reference_model.py +137 -0
  76. restpki_ng_python_client/models/full_xml_signature_post_request.py +136 -0
  77. restpki_ng_python_client/models/general_name_choices.py +52 -0
  78. restpki_ng_python_client/models/general_name_model.py +108 -0
  79. restpki_ng_python_client/models/holder_types.py +45 -0
  80. restpki_ng_python_client/models/inspect_signature_failures.py +44 -0
  81. restpki_ng_python_client/models/inspect_signature_request.py +127 -0
  82. restpki_ng_python_client/models/inspect_signature_response.py +131 -0
  83. restpki_ng_python_client/models/multipart_upload_begin_response.py +95 -0
  84. restpki_ng_python_client/models/multipart_upload_end_request.py +95 -0
  85. restpki_ng_python_client/models/name_model.py +205 -0
  86. restpki_ng_python_client/models/namespace_model.py +99 -0
  87. restpki_ng_python_client/models/open_cades_signature_request_model.py +147 -0
  88. restpki_ng_python_client/models/open_signature_request_model.py +145 -0
  89. restpki_ng_python_client/models/open_xml_signature_request_model.py +151 -0
  90. restpki_ng_python_client/models/other_name_model.py +107 -0
  91. restpki_ng_python_client/models/pades_certification_level.py +47 -0
  92. restpki_ng_python_client/models/pades_horizontal_align.py +46 -0
  93. restpki_ng_python_client/models/pades_measurement_units.py +45 -0
  94. restpki_ng_python_client/models/pades_page_optimization_model.py +98 -0
  95. restpki_ng_python_client/models/pades_signature_model.py +113 -0
  96. restpki_ng_python_client/models/pades_signature_post_request_v1.py +167 -0
  97. restpki_ng_python_client/models/pades_signature_post_request_v2.py +171 -0
  98. restpki_ng_python_client/models/pades_signature_post_response.py +120 -0
  99. restpki_ng_python_client/models/pades_signature_post_signed_bytes_request.py +92 -0
  100. restpki_ng_python_client/models/pades_signature_post_signed_bytes_response.py +106 -0
  101. restpki_ng_python_client/models/pades_signer_model.py +168 -0
  102. restpki_ng_python_client/models/pades_size_model.py +89 -0
  103. restpki_ng_python_client/models/pades_text_horizontal_align.py +45 -0
  104. restpki_ng_python_client/models/pades_vertical_align.py +46 -0
  105. restpki_ng_python_client/models/pades_visual_auto_positioning_model.py +106 -0
  106. restpki_ng_python_client/models/pades_visual_image_model.py +105 -0
  107. restpki_ng_python_client/models/pades_visual_positioning_model.py +109 -0
  108. restpki_ng_python_client/models/pades_visual_rectangle_model.py +127 -0
  109. restpki_ng_python_client/models/pades_visual_representation_model.py +103 -0
  110. restpki_ng_python_client/models/pades_visual_text_model.py +111 -0
  111. restpki_ng_python_client/models/page_orientations.py +46 -0
  112. restpki_ng_python_client/models/paper_sizes.py +56 -0
  113. restpki_ng_python_client/models/pdf_add_marks_request.py +117 -0
  114. restpki_ng_python_client/models/pdf_add_marks_response.py +91 -0
  115. restpki_ng_python_client/models/pdf_container_definition.py +208 -0
  116. restpki_ng_python_client/models/pdf_helper.py +43 -0
  117. restpki_ng_python_client/models/pdf_mark_element_model.py +230 -0
  118. restpki_ng_python_client/models/pdf_mark_element_type.py +46 -0
  119. restpki_ng_python_client/models/pdf_mark_image_model.py +98 -0
  120. restpki_ng_python_client/models/pdf_mark_model.py +168 -0
  121. restpki_ng_python_client/models/pdf_mark_page_options.py +47 -0
  122. restpki_ng_python_client/models/pdf_signature_options.py +101 -0
  123. restpki_ng_python_client/models/pdf_text_section_model.py +125 -0
  124. restpki_ng_python_client/models/pdf_text_style.py +46 -0
  125. restpki_ng_python_client/models/pki_brazil_certificate_model.py +159 -0
  126. restpki_ng_python_client/models/pki_brazil_certificate_types.py +54 -0
  127. restpki_ng_python_client/models/pki_italy_certificate_model.py +103 -0
  128. restpki_ng_python_client/models/pki_italy_certificate_types.py +46 -0
  129. restpki_ng_python_client/models/prepare_authentication_request.py +100 -0
  130. restpki_ng_python_client/models/prepare_authentication_response.py +99 -0
  131. restpki_ng_python_client/models/prepare_signature_failures.py +46 -0
  132. restpki_ng_python_client/models/prepare_signature_request.py +133 -0
  133. restpki_ng_python_client/models/prepare_signature_response.py +116 -0
  134. restpki_ng_python_client/models/resource_content_or_reference.py +107 -0
  135. restpki_ng_python_client/models/role_attribute_model.py +114 -0
  136. restpki_ng_python_client/models/session_completion_status.py +89 -0
  137. restpki_ng_python_client/models/signature_algorithm_and_value_model.py +106 -0
  138. restpki_ng_python_client/models/signature_algorithm_identifier.py +88 -0
  139. restpki_ng_python_client/models/signature_algorithms.py +48 -0
  140. restpki_ng_python_client/models/signature_b_stamp_model.py +135 -0
  141. restpki_ng_python_client/models/signature_policy_identifier_model.py +105 -0
  142. restpki_ng_python_client/models/signature_result_model.py +105 -0
  143. restpki_ng_python_client/models/signature_session_document_data.py +128 -0
  144. restpki_ng_python_client/models/signature_session_document_summary.py +138 -0
  145. restpki_ng_python_client/models/signature_session_model.py +126 -0
  146. restpki_ng_python_client/models/signature_session_status.py +49 -0
  147. restpki_ng_python_client/models/signature_types.py +46 -0
  148. restpki_ng_python_client/models/signer_b_stamp_model.py +132 -0
  149. restpki_ng_python_client/models/signer_model.py +187 -0
  150. restpki_ng_python_client/models/signer_summary.py +94 -0
  151. restpki_ng_python_client/models/timestamp_issue_response.py +99 -0
  152. restpki_ng_python_client/models/validation_item_model.py +111 -0
  153. restpki_ng_python_client/models/validation_item_types.py +91 -0
  154. restpki_ng_python_client/models/validation_results_model.py +131 -0
  155. restpki_ng_python_client/models/webhook_event_model.py +94 -0
  156. restpki_ng_python_client/models/webhook_event_types.py +44 -0
  157. restpki_ng_python_client/models/xml_attribute_model.py +107 -0
  158. restpki_ng_python_client/models/xml_element_location_model.py +111 -0
  159. restpki_ng_python_client/models/xml_element_model.py +115 -0
  160. restpki_ng_python_client/models/xml_element_signature_post_request.py +145 -0
  161. restpki_ng_python_client/models/xml_id_attribute_model.py +96 -0
  162. restpki_ng_python_client/models/xml_id_resolution_table_model.py +123 -0
  163. restpki_ng_python_client/models/xml_insertion_options.py +47 -0
  164. restpki_ng_python_client/models/xml_node_name_model.py +96 -0
  165. restpki_ng_python_client/models/xml_signature_model.py +154 -0
  166. restpki_ng_python_client/models/xml_signature_options.py +102 -0
  167. restpki_ng_python_client/models/xml_signature_post_response.py +120 -0
  168. restpki_ng_python_client/models/xml_signature_post_signed_bytes_request.py +92 -0
  169. restpki_ng_python_client/models/xml_signature_post_signed_bytes_response.py +106 -0
  170. restpki_ng_python_client/models/xml_signature_response_model.py +113 -0
  171. restpki_ng_python_client/models/xml_signature_types.py +47 -0
  172. restpki_ng_python_client/models/xml_signed_entity_types.py +46 -0
  173. restpki_ng_python_client/py.typed +0 -0
  174. restpki_ng_python_client/rest.py +231 -0
  175. restpki_ng_python_client/restpki_ng_client.py +458 -0
  176. restpki_ng_python_client/standard_signature_policies.py +24 -0
  177. restpki_ng_python_client/utils.py +80 -0
  178. restpki_ng_python_client-0.9.0.dist-info/METADATA +16 -0
  179. restpki_ng_python_client-0.9.0.dist-info/RECORD +181 -0
  180. restpki_ng_python_client-0.9.0.dist-info/WHEEL +5 -0
  181. restpki_ng_python_client-0.9.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,98 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Rest PKI Core API
5
+
6
+ <b><i>Para Português, <a href=\"https://docs.lacunasoftware.com/pt-br/articles/rest-pki/core/integration/get-started\">clique aqui</a></i></b> <p> <a href=\"https://docs.lacunasoftware.com/en-us/articles/rest-pki/core/\">Rest PKI Core</a> is an upcoming version of <a href=\"https://docs.lacunasoftware.com/en-us/articles/rest-pki/\">Rest PKI</a> that will have extended compatibility with environments and databases. </p> <p> In addition to Windows Server (which is already supported by Rest PKI), Rest PKI Core will also run on <b>Linux</b> (Debian- and RedHat-based distributions) and on <b>Docker</b>. As for database servers, in addition to SQL Server, <b>PostgreSQL</b> will also be supported. </p> <p> <b>Before getting started, see the integration overview on the <a href=\"https://docs.lacunasoftware.com/en-us/articles/rest-pki/core/integration/\">Integration Guide</a></b> </p> <p> For questions regarding the usage of this API, please reach us at <a href=\"https://lacuna.help/\">lacuna.help</a> </p> <h2>Parameters</h2> <p> You will need the following parameters: </p> <ul> <li><b>Endpoint</b>: address of the Rest PKI Core instance that will be used</li> <li><b>API Key</b>: authorization key for using the API</li> </ul> <p> The <span class=\"model\">endpoint</span> must be prefixed to all relative URLs mentioned here. As for the <span class=\"model\">API Key</span>, see how to use it below. </p> <h2>Authentication</h2> <p> The API key must be sent on the <span class=\"model\">X-Api-Key</span> header on each request: </p> <!-- unfortunately, class \"example microlight\" doesn't seem to work here --> <pre style=\"font-size: 12px; padding: 10px; border-radius: 4px; background: #41444e; font-weight: 600; color: #fff;\"> X-Api-Key: yourapp|xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx </pre> <h2>HTTP Codes</h2> <p> The APIs will return the following HTTP codes: </p> <table> <thead> <tr> <th>Code</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td><strong class=\"model-title\">200 (OK)</strong></td> <td>Request processed successfully. The response is different for each API, please refer to the operation's documentation</td> </tr> <tr> <td><strong class=\"model-title\">400 (Bad Request)</strong></td> <td>Syntax error. For instance, when a required field was not provided</td> </tr> <tr> <td><strong class=\"model-title\">401 (Unauthorized)</strong></td> <td>API key not provided or invalid</td> </tr> <tr> <td><strong class=\"model-title\">403 (Forbidden)</strong></td> <td>API key is valid, but the application has insufficient permissions to complete the requested operation</td> </tr> <tr> <td><strong class=\"model-title\">422 (Unprocessable Entity)</strong></td> <td>API error. The response body is an <a href=\"#model-ErrorModelV2\" class=\"model\">ErrorModelV2</a> </tr> <tr> <td><strong class=\"model-title\">500 (Internal Server Error)</strong></td> <td>An unexpected error occurred. The <span class=\"model\">exceptionCode</span> contained on the response body may be of help for our support team during diagnostic.</td> </tr> </tbody> </table> <h3>Error Codes</h3> <p> Some of the error codes returned in the <span class=\"model\">code</span> field of an <a href=\"#model-ErrorModelV2\" class=\"model\">ErrorModelV2</a> (body of responses with HTTP status code 422) are provided below*: </p> <table> <thead> <tr> <th>Code</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td class=\"model\">DocumentNotFound</td> <td>A referenced document was not found (check the document ID)</td> </tr> <tr> <td class=\"model\">SecurityContextNotFound</td> <td>A referenced security context was not found (check the security context ID)</td> </tr> <tr> <td class=\"model\">SignatureSessionNotFound</td> <td>A referenced signature session was not found (check the signature session ID)</td> </tr> <tr> <td class=\"model\">BadSignatureSessionOperation</td> <td>The operation is invalid for the current signature session or document status. For instance, trying to await the session's completion if it is still <span class=\"model\">Pending</span> results in this error</td> </tr> <tr> <td class=\"model\">BackgroundProcessing</td> <td>The operation cannot be completed at this time because the resource is being processed in background</td> </tr> <tr> <td class=\"model\">SignatureSessionTokenRequired</td> <td>The signature session token was not passed on the <span class=\"model\">X-Signature-Session-Token</span> request header</td> </tr> <tr> <td class=\"model\">BadSignatureSessionToken</td> <td>An invalid signature session token was passed on the <span class=\"model\">X-Signature-Session-Token</span> request header. Check your application for possible corruption of the session token, which may contain characters <span class=\"code\">-</span> (hyphen) and <span class=\"code\">_</span> (underscore)</td> </tr> <tr> <td class=\"model\">ExpiredSignatureSessionToken</td> <td>An expired signature session token was passed on the <span class=\"model\">X-Signature-Session-Token</span> request header. Signature session tokens are normally valid for 4 hours.</td> </tr> </tbody> </table> <p style=\"font-size: 0.9em\"> *The codes shown above are the most common error codes. Nonetheless, this list is not comprehensive. New codes may be added anytime without previous warning. </p> <h2>Culture / Internationalization (i18n)</h2> <p>The <span class=\"model\">Accept-Language</span> request header is observed by this API. The following cultures are supported:</p> <ul> <li><span class=\"code\">en-US</span> (or simply <span class=\"code\">en</span>)</li> <li><span class=\"code\">pt-BR</span> (or simply <span class=\"code\">pt</span>)</li> </ul> <p><i>Notice: error messages are not affected by this header and therefore should not be displayed to users, being better suited for logging.</i></p>
7
+
8
+ The version of the OpenAPI document: 2.1.2
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+
15
+ from __future__ import annotations
16
+ import pprint
17
+ import re # noqa: F401
18
+ import json
19
+
20
+
21
+ from typing import Any, ClassVar, Dict, List, Optional
22
+ from pydantic import BaseModel
23
+ from pydantic import Field
24
+ from restpki_ng_python_client.models.certificate_model import CertificateModel
25
+ from restpki_ng_python_client.models.validation_results_model import ValidationResultsModel
26
+ try:
27
+ from typing import Self
28
+ except ImportError:
29
+ from typing_extensions import Self
30
+
31
+ class AuthenticationPostResponse(BaseModel):
32
+ """
33
+ AuthenticationPostResponse
34
+ """ # noqa: E501
35
+ certificate: Optional[CertificateModel] = None
36
+ validation_results: Optional[ValidationResultsModel] = Field(default=None, alias="validationResults")
37
+ __properties: ClassVar[List[str]] = ["certificate", "validationResults"]
38
+
39
+ model_config = {
40
+ "populate_by_name": True,
41
+ "validate_assignment": True
42
+ }
43
+
44
+
45
+ def to_str(self) -> str:
46
+ """Returns the string representation of the model using alias"""
47
+ return pprint.pformat(self.model_dump(by_alias=True))
48
+
49
+ def to_json(self) -> str:
50
+ """Returns the JSON representation of the model using alias"""
51
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
52
+ return json.dumps(self.to_dict())
53
+
54
+ @classmethod
55
+ def from_json(cls, json_str: str) -> Self:
56
+ """Create an instance of AuthenticationPostResponse from a JSON string"""
57
+ return cls.from_dict(json.loads(json_str))
58
+
59
+ def to_dict(self) -> Dict[str, Any]:
60
+ """Return the dictionary representation of the model using alias.
61
+
62
+ This has the following differences from calling pydantic's
63
+ `self.model_dump(by_alias=True)`:
64
+
65
+ * `None` is only added to the output dict for nullable fields that
66
+ were set at model initialization. Other fields with value `None`
67
+ are ignored.
68
+ """
69
+ _dict = self.model_dump(
70
+ by_alias=True,
71
+ exclude={
72
+ },
73
+ exclude_none=True,
74
+ )
75
+ # override the default output from pydantic by calling `to_dict()` of certificate
76
+ if self.certificate:
77
+ _dict['certificate'] = self.certificate.to_dict()
78
+ # override the default output from pydantic by calling `to_dict()` of validation_results
79
+ if self.validation_results:
80
+ _dict['validationResults'] = self.validation_results.to_dict()
81
+ return _dict
82
+
83
+ @classmethod
84
+ def from_dict(cls, obj: Dict) -> Self:
85
+ """Create an instance of AuthenticationPostResponse from a dict"""
86
+ if obj is None:
87
+ return None
88
+
89
+ if not isinstance(obj, dict):
90
+ return cls.model_validate(obj)
91
+
92
+ _obj = cls.model_validate({
93
+ "certificate": CertificateModel.from_dict(obj.get("certificate")) if obj.get("certificate") is not None else None,
94
+ "validationResults": ValidationResultsModel.from_dict(obj.get("validationResults")) if obj.get("validationResults") is not None else None
95
+ })
96
+ return _obj
97
+
98
+
@@ -0,0 +1,95 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Rest PKI Core API
5
+
6
+ <b><i>Para Português, <a href=\"https://docs.lacunasoftware.com/pt-br/articles/rest-pki/core/integration/get-started\">clique aqui</a></i></b> <p> <a href=\"https://docs.lacunasoftware.com/en-us/articles/rest-pki/core/\">Rest PKI Core</a> is an upcoming version of <a href=\"https://docs.lacunasoftware.com/en-us/articles/rest-pki/\">Rest PKI</a> that will have extended compatibility with environments and databases. </p> <p> In addition to Windows Server (which is already supported by Rest PKI), Rest PKI Core will also run on <b>Linux</b> (Debian- and RedHat-based distributions) and on <b>Docker</b>. As for database servers, in addition to SQL Server, <b>PostgreSQL</b> will also be supported. </p> <p> <b>Before getting started, see the integration overview on the <a href=\"https://docs.lacunasoftware.com/en-us/articles/rest-pki/core/integration/\">Integration Guide</a></b> </p> <p> For questions regarding the usage of this API, please reach us at <a href=\"https://lacuna.help/\">lacuna.help</a> </p> <h2>Parameters</h2> <p> You will need the following parameters: </p> <ul> <li><b>Endpoint</b>: address of the Rest PKI Core instance that will be used</li> <li><b>API Key</b>: authorization key for using the API</li> </ul> <p> The <span class=\"model\">endpoint</span> must be prefixed to all relative URLs mentioned here. As for the <span class=\"model\">API Key</span>, see how to use it below. </p> <h2>Authentication</h2> <p> The API key must be sent on the <span class=\"model\">X-Api-Key</span> header on each request: </p> <!-- unfortunately, class \"example microlight\" doesn't seem to work here --> <pre style=\"font-size: 12px; padding: 10px; border-radius: 4px; background: #41444e; font-weight: 600; color: #fff;\"> X-Api-Key: yourapp|xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx </pre> <h2>HTTP Codes</h2> <p> The APIs will return the following HTTP codes: </p> <table> <thead> <tr> <th>Code</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td><strong class=\"model-title\">200 (OK)</strong></td> <td>Request processed successfully. The response is different for each API, please refer to the operation's documentation</td> </tr> <tr> <td><strong class=\"model-title\">400 (Bad Request)</strong></td> <td>Syntax error. For instance, when a required field was not provided</td> </tr> <tr> <td><strong class=\"model-title\">401 (Unauthorized)</strong></td> <td>API key not provided or invalid</td> </tr> <tr> <td><strong class=\"model-title\">403 (Forbidden)</strong></td> <td>API key is valid, but the application has insufficient permissions to complete the requested operation</td> </tr> <tr> <td><strong class=\"model-title\">422 (Unprocessable Entity)</strong></td> <td>API error. The response body is an <a href=\"#model-ErrorModelV2\" class=\"model\">ErrorModelV2</a> </tr> <tr> <td><strong class=\"model-title\">500 (Internal Server Error)</strong></td> <td>An unexpected error occurred. The <span class=\"model\">exceptionCode</span> contained on the response body may be of help for our support team during diagnostic.</td> </tr> </tbody> </table> <h3>Error Codes</h3> <p> Some of the error codes returned in the <span class=\"model\">code</span> field of an <a href=\"#model-ErrorModelV2\" class=\"model\">ErrorModelV2</a> (body of responses with HTTP status code 422) are provided below*: </p> <table> <thead> <tr> <th>Code</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td class=\"model\">DocumentNotFound</td> <td>A referenced document was not found (check the document ID)</td> </tr> <tr> <td class=\"model\">SecurityContextNotFound</td> <td>A referenced security context was not found (check the security context ID)</td> </tr> <tr> <td class=\"model\">SignatureSessionNotFound</td> <td>A referenced signature session was not found (check the signature session ID)</td> </tr> <tr> <td class=\"model\">BadSignatureSessionOperation</td> <td>The operation is invalid for the current signature session or document status. For instance, trying to await the session's completion if it is still <span class=\"model\">Pending</span> results in this error</td> </tr> <tr> <td class=\"model\">BackgroundProcessing</td> <td>The operation cannot be completed at this time because the resource is being processed in background</td> </tr> <tr> <td class=\"model\">SignatureSessionTokenRequired</td> <td>The signature session token was not passed on the <span class=\"model\">X-Signature-Session-Token</span> request header</td> </tr> <tr> <td class=\"model\">BadSignatureSessionToken</td> <td>An invalid signature session token was passed on the <span class=\"model\">X-Signature-Session-Token</span> request header. Check your application for possible corruption of the session token, which may contain characters <span class=\"code\">-</span> (hyphen) and <span class=\"code\">_</span> (underscore)</td> </tr> <tr> <td class=\"model\">ExpiredSignatureSessionToken</td> <td>An expired signature session token was passed on the <span class=\"model\">X-Signature-Session-Token</span> request header. Signature session tokens are normally valid for 4 hours.</td> </tr> </tbody> </table> <p style=\"font-size: 0.9em\"> *The codes shown above are the most common error codes. Nonetheless, this list is not comprehensive. New codes may be added anytime without previous warning. </p> <h2>Culture / Internationalization (i18n)</h2> <p>The <span class=\"model\">Accept-Language</span> request header is observed by this API. The following cultures are supported:</p> <ul> <li><span class=\"code\">en-US</span> (or simply <span class=\"code\">en</span>)</li> <li><span class=\"code\">pt-BR</span> (or simply <span class=\"code\">pt</span>)</li> </ul> <p><i>Notice: error messages are not affected by this header and therefore should not be displayed to users, being better suited for logging.</i></p>
7
+
8
+ The version of the OpenAPI document: 2.1.2
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+
15
+ from __future__ import annotations
16
+ import pprint
17
+ import re # noqa: F401
18
+ import json
19
+
20
+
21
+ from typing import Any, ClassVar, Dict, List, Optional
22
+ from pydantic import BaseModel, StrictBool, StrictStr
23
+ from pydantic import Field
24
+ try:
25
+ from typing import Self
26
+ except ImportError:
27
+ from typing_extensions import Self
28
+
29
+ class AuthenticationsPostRequest(BaseModel):
30
+ """
31
+ AuthenticationsPostRequest
32
+ """ # noqa: E501
33
+ security_context_id: Optional[StrictStr] = Field(default=None, alias="securityContextId")
34
+ ignore_revocation_status_unknown: Optional[StrictBool] = Field(default=None, alias="ignoreRevocationStatusUnknown")
35
+ __properties: ClassVar[List[str]] = ["securityContextId", "ignoreRevocationStatusUnknown"]
36
+
37
+ model_config = {
38
+ "populate_by_name": True,
39
+ "validate_assignment": True
40
+ }
41
+
42
+
43
+ def to_str(self) -> str:
44
+ """Returns the string representation of the model using alias"""
45
+ return pprint.pformat(self.model_dump(by_alias=True))
46
+
47
+ def to_json(self) -> str:
48
+ """Returns the JSON representation of the model using alias"""
49
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
50
+ return json.dumps(self.to_dict())
51
+
52
+ @classmethod
53
+ def from_json(cls, json_str: str) -> Self:
54
+ """Create an instance of AuthenticationsPostRequest from a JSON string"""
55
+ return cls.from_dict(json.loads(json_str))
56
+
57
+ def to_dict(self) -> Dict[str, Any]:
58
+ """Return the dictionary representation of the model using alias.
59
+
60
+ This has the following differences from calling pydantic's
61
+ `self.model_dump(by_alias=True)`:
62
+
63
+ * `None` is only added to the output dict for nullable fields that
64
+ were set at model initialization. Other fields with value `None`
65
+ are ignored.
66
+ """
67
+ _dict = self.model_dump(
68
+ by_alias=True,
69
+ exclude={
70
+ },
71
+ exclude_none=True,
72
+ )
73
+ # set to None if ignore_revocation_status_unknown (nullable) is None
74
+ # and model_fields_set contains the field
75
+ if self.ignore_revocation_status_unknown is None and "ignore_revocation_status_unknown" in self.model_fields_set:
76
+ _dict['ignoreRevocationStatusUnknown'] = None
77
+
78
+ return _dict
79
+
80
+ @classmethod
81
+ def from_dict(cls, obj: Dict) -> Self:
82
+ """Create an instance of AuthenticationsPostRequest from a dict"""
83
+ if obj is None:
84
+ return None
85
+
86
+ if not isinstance(obj, dict):
87
+ return cls.model_validate(obj)
88
+
89
+ _obj = cls.model_validate({
90
+ "securityContextId": obj.get("securityContextId"),
91
+ "ignoreRevocationStatusUnknown": obj.get("ignoreRevocationStatusUnknown")
92
+ })
93
+ return _obj
94
+
95
+
@@ -0,0 +1,114 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Rest PKI Core API
5
+
6
+ <b><i>Para Português, <a href=\"https://docs.lacunasoftware.com/pt-br/articles/rest-pki/core/integration/get-started\">clique aqui</a></i></b> <p> <a href=\"https://docs.lacunasoftware.com/en-us/articles/rest-pki/core/\">Rest PKI Core</a> is an upcoming version of <a href=\"https://docs.lacunasoftware.com/en-us/articles/rest-pki/\">Rest PKI</a> that will have extended compatibility with environments and databases. </p> <p> In addition to Windows Server (which is already supported by Rest PKI), Rest PKI Core will also run on <b>Linux</b> (Debian- and RedHat-based distributions) and on <b>Docker</b>. As for database servers, in addition to SQL Server, <b>PostgreSQL</b> will also be supported. </p> <p> <b>Before getting started, see the integration overview on the <a href=\"https://docs.lacunasoftware.com/en-us/articles/rest-pki/core/integration/\">Integration Guide</a></b> </p> <p> For questions regarding the usage of this API, please reach us at <a href=\"https://lacuna.help/\">lacuna.help</a> </p> <h2>Parameters</h2> <p> You will need the following parameters: </p> <ul> <li><b>Endpoint</b>: address of the Rest PKI Core instance that will be used</li> <li><b>API Key</b>: authorization key for using the API</li> </ul> <p> The <span class=\"model\">endpoint</span> must be prefixed to all relative URLs mentioned here. As for the <span class=\"model\">API Key</span>, see how to use it below. </p> <h2>Authentication</h2> <p> The API key must be sent on the <span class=\"model\">X-Api-Key</span> header on each request: </p> <!-- unfortunately, class \"example microlight\" doesn't seem to work here --> <pre style=\"font-size: 12px; padding: 10px; border-radius: 4px; background: #41444e; font-weight: 600; color: #fff;\"> X-Api-Key: yourapp|xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx </pre> <h2>HTTP Codes</h2> <p> The APIs will return the following HTTP codes: </p> <table> <thead> <tr> <th>Code</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td><strong class=\"model-title\">200 (OK)</strong></td> <td>Request processed successfully. The response is different for each API, please refer to the operation's documentation</td> </tr> <tr> <td><strong class=\"model-title\">400 (Bad Request)</strong></td> <td>Syntax error. For instance, when a required field was not provided</td> </tr> <tr> <td><strong class=\"model-title\">401 (Unauthorized)</strong></td> <td>API key not provided or invalid</td> </tr> <tr> <td><strong class=\"model-title\">403 (Forbidden)</strong></td> <td>API key is valid, but the application has insufficient permissions to complete the requested operation</td> </tr> <tr> <td><strong class=\"model-title\">422 (Unprocessable Entity)</strong></td> <td>API error. The response body is an <a href=\"#model-ErrorModelV2\" class=\"model\">ErrorModelV2</a> </tr> <tr> <td><strong class=\"model-title\">500 (Internal Server Error)</strong></td> <td>An unexpected error occurred. The <span class=\"model\">exceptionCode</span> contained on the response body may be of help for our support team during diagnostic.</td> </tr> </tbody> </table> <h3>Error Codes</h3> <p> Some of the error codes returned in the <span class=\"model\">code</span> field of an <a href=\"#model-ErrorModelV2\" class=\"model\">ErrorModelV2</a> (body of responses with HTTP status code 422) are provided below*: </p> <table> <thead> <tr> <th>Code</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td class=\"model\">DocumentNotFound</td> <td>A referenced document was not found (check the document ID)</td> </tr> <tr> <td class=\"model\">SecurityContextNotFound</td> <td>A referenced security context was not found (check the security context ID)</td> </tr> <tr> <td class=\"model\">SignatureSessionNotFound</td> <td>A referenced signature session was not found (check the signature session ID)</td> </tr> <tr> <td class=\"model\">BadSignatureSessionOperation</td> <td>The operation is invalid for the current signature session or document status. For instance, trying to await the session's completion if it is still <span class=\"model\">Pending</span> results in this error</td> </tr> <tr> <td class=\"model\">BackgroundProcessing</td> <td>The operation cannot be completed at this time because the resource is being processed in background</td> </tr> <tr> <td class=\"model\">SignatureSessionTokenRequired</td> <td>The signature session token was not passed on the <span class=\"model\">X-Signature-Session-Token</span> request header</td> </tr> <tr> <td class=\"model\">BadSignatureSessionToken</td> <td>An invalid signature session token was passed on the <span class=\"model\">X-Signature-Session-Token</span> request header. Check your application for possible corruption of the session token, which may contain characters <span class=\"code\">-</span> (hyphen) and <span class=\"code\">_</span> (underscore)</td> </tr> <tr> <td class=\"model\">ExpiredSignatureSessionToken</td> <td>An expired signature session token was passed on the <span class=\"model\">X-Signature-Session-Token</span> request header. Signature session tokens are normally valid for 4 hours.</td> </tr> </tbody> </table> <p style=\"font-size: 0.9em\"> *The codes shown above are the most common error codes. Nonetheless, this list is not comprehensive. New codes may be added anytime without previous warning. </p> <h2>Culture / Internationalization (i18n)</h2> <p>The <span class=\"model\">Accept-Language</span> request header is observed by this API. The following cultures are supported:</p> <ul> <li><span class=\"code\">en-US</span> (or simply <span class=\"code\">en</span>)</li> <li><span class=\"code\">pt-BR</span> (or simply <span class=\"code\">pt</span>)</li> </ul> <p><i>Notice: error messages are not affected by this header and therefore should not be displayed to users, being better suited for logging.</i></p>
7
+
8
+ The version of the OpenAPI document: 2.1.2
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+
15
+ from __future__ import annotations
16
+ import pprint
17
+ import re # noqa: F401
18
+ import json
19
+
20
+
21
+ from typing import Any, ClassVar, Dict, List, Optional, Union
22
+ from pydantic import BaseModel, StrictBytes, StrictStr
23
+ from pydantic import Field
24
+ try:
25
+ from typing import Self
26
+ except ImportError:
27
+ from typing_extensions import Self
28
+
29
+ class AuthenticationsPostResponse(BaseModel):
30
+ """
31
+ AuthenticationsPostResponse
32
+ """ # noqa: E501
33
+ token: Optional[StrictStr] = None
34
+ to_sign_data: Optional[Union[StrictBytes, StrictStr]] = Field(default=None, alias="toSignData")
35
+ to_sign_hash: Optional[Union[StrictBytes, StrictStr]] = Field(default=None, alias="toSignHash")
36
+ digest_algorithm_oid: Optional[StrictStr] = Field(default=None, alias="digestAlgorithmOid")
37
+ __properties: ClassVar[List[str]] = ["token", "toSignData", "toSignHash", "digestAlgorithmOid"]
38
+
39
+ model_config = {
40
+ "populate_by_name": True,
41
+ "validate_assignment": True
42
+ }
43
+
44
+
45
+ def to_str(self) -> str:
46
+ """Returns the string representation of the model using alias"""
47
+ return pprint.pformat(self.model_dump(by_alias=True))
48
+
49
+ def to_json(self) -> str:
50
+ """Returns the JSON representation of the model using alias"""
51
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
52
+ return json.dumps(self.to_dict())
53
+
54
+ @classmethod
55
+ def from_json(cls, json_str: str) -> Self:
56
+ """Create an instance of AuthenticationsPostResponse from a JSON string"""
57
+ return cls.from_dict(json.loads(json_str))
58
+
59
+ def to_dict(self) -> Dict[str, Any]:
60
+ """Return the dictionary representation of the model using alias.
61
+
62
+ This has the following differences from calling pydantic's
63
+ `self.model_dump(by_alias=True)`:
64
+
65
+ * `None` is only added to the output dict for nullable fields that
66
+ were set at model initialization. Other fields with value `None`
67
+ are ignored.
68
+ """
69
+ _dict = self.model_dump(
70
+ by_alias=True,
71
+ exclude={
72
+ },
73
+ exclude_none=True,
74
+ )
75
+ # set to None if token (nullable) is None
76
+ # and model_fields_set contains the field
77
+ if self.token is None and "token" in self.model_fields_set:
78
+ _dict['token'] = None
79
+
80
+ # set to None if to_sign_data (nullable) is None
81
+ # and model_fields_set contains the field
82
+ if self.to_sign_data is None and "to_sign_data" in self.model_fields_set:
83
+ _dict['toSignData'] = None
84
+
85
+ # set to None if to_sign_hash (nullable) is None
86
+ # and model_fields_set contains the field
87
+ if self.to_sign_hash is None and "to_sign_hash" in self.model_fields_set:
88
+ _dict['toSignHash'] = None
89
+
90
+ # set to None if digest_algorithm_oid (nullable) is None
91
+ # and model_fields_set contains the field
92
+ if self.digest_algorithm_oid is None and "digest_algorithm_oid" in self.model_fields_set:
93
+ _dict['digestAlgorithmOid'] = None
94
+
95
+ return _dict
96
+
97
+ @classmethod
98
+ def from_dict(cls, obj: Dict) -> Self:
99
+ """Create an instance of AuthenticationsPostResponse from a dict"""
100
+ if obj is None:
101
+ return None
102
+
103
+ if not isinstance(obj, dict):
104
+ return cls.model_validate(obj)
105
+
106
+ _obj = cls.model_validate({
107
+ "token": obj.get("token"),
108
+ "toSignData": obj.get("toSignData"),
109
+ "toSignHash": obj.get("toSignHash"),
110
+ "digestAlgorithmOid": obj.get("digestAlgorithmOid")
111
+ })
112
+ return _obj
113
+
114
+
@@ -0,0 +1,99 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Rest PKI Core API
5
+
6
+ <b><i>Para Português, <a href=\"https://docs.lacunasoftware.com/pt-br/articles/rest-pki/core/integration/get-started\">clique aqui</a></i></b> <p> <a href=\"https://docs.lacunasoftware.com/en-us/articles/rest-pki/core/\">Rest PKI Core</a> is an upcoming version of <a href=\"https://docs.lacunasoftware.com/en-us/articles/rest-pki/\">Rest PKI</a> that will have extended compatibility with environments and databases. </p> <p> In addition to Windows Server (which is already supported by Rest PKI), Rest PKI Core will also run on <b>Linux</b> (Debian- and RedHat-based distributions) and on <b>Docker</b>. As for database servers, in addition to SQL Server, <b>PostgreSQL</b> will also be supported. </p> <p> <b>Before getting started, see the integration overview on the <a href=\"https://docs.lacunasoftware.com/en-us/articles/rest-pki/core/integration/\">Integration Guide</a></b> </p> <p> For questions regarding the usage of this API, please reach us at <a href=\"https://lacuna.help/\">lacuna.help</a> </p> <h2>Parameters</h2> <p> You will need the following parameters: </p> <ul> <li><b>Endpoint</b>: address of the Rest PKI Core instance that will be used</li> <li><b>API Key</b>: authorization key for using the API</li> </ul> <p> The <span class=\"model\">endpoint</span> must be prefixed to all relative URLs mentioned here. As for the <span class=\"model\">API Key</span>, see how to use it below. </p> <h2>Authentication</h2> <p> The API key must be sent on the <span class=\"model\">X-Api-Key</span> header on each request: </p> <!-- unfortunately, class \"example microlight\" doesn't seem to work here --> <pre style=\"font-size: 12px; padding: 10px; border-radius: 4px; background: #41444e; font-weight: 600; color: #fff;\"> X-Api-Key: yourapp|xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx </pre> <h2>HTTP Codes</h2> <p> The APIs will return the following HTTP codes: </p> <table> <thead> <tr> <th>Code</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td><strong class=\"model-title\">200 (OK)</strong></td> <td>Request processed successfully. The response is different for each API, please refer to the operation's documentation</td> </tr> <tr> <td><strong class=\"model-title\">400 (Bad Request)</strong></td> <td>Syntax error. For instance, when a required field was not provided</td> </tr> <tr> <td><strong class=\"model-title\">401 (Unauthorized)</strong></td> <td>API key not provided or invalid</td> </tr> <tr> <td><strong class=\"model-title\">403 (Forbidden)</strong></td> <td>API key is valid, but the application has insufficient permissions to complete the requested operation</td> </tr> <tr> <td><strong class=\"model-title\">422 (Unprocessable Entity)</strong></td> <td>API error. The response body is an <a href=\"#model-ErrorModelV2\" class=\"model\">ErrorModelV2</a> </tr> <tr> <td><strong class=\"model-title\">500 (Internal Server Error)</strong></td> <td>An unexpected error occurred. The <span class=\"model\">exceptionCode</span> contained on the response body may be of help for our support team during diagnostic.</td> </tr> </tbody> </table> <h3>Error Codes</h3> <p> Some of the error codes returned in the <span class=\"model\">code</span> field of an <a href=\"#model-ErrorModelV2\" class=\"model\">ErrorModelV2</a> (body of responses with HTTP status code 422) are provided below*: </p> <table> <thead> <tr> <th>Code</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td class=\"model\">DocumentNotFound</td> <td>A referenced document was not found (check the document ID)</td> </tr> <tr> <td class=\"model\">SecurityContextNotFound</td> <td>A referenced security context was not found (check the security context ID)</td> </tr> <tr> <td class=\"model\">SignatureSessionNotFound</td> <td>A referenced signature session was not found (check the signature session ID)</td> </tr> <tr> <td class=\"model\">BadSignatureSessionOperation</td> <td>The operation is invalid for the current signature session or document status. For instance, trying to await the session's completion if it is still <span class=\"model\">Pending</span> results in this error</td> </tr> <tr> <td class=\"model\">BackgroundProcessing</td> <td>The operation cannot be completed at this time because the resource is being processed in background</td> </tr> <tr> <td class=\"model\">SignatureSessionTokenRequired</td> <td>The signature session token was not passed on the <span class=\"model\">X-Signature-Session-Token</span> request header</td> </tr> <tr> <td class=\"model\">BadSignatureSessionToken</td> <td>An invalid signature session token was passed on the <span class=\"model\">X-Signature-Session-Token</span> request header. Check your application for possible corruption of the session token, which may contain characters <span class=\"code\">-</span> (hyphen) and <span class=\"code\">_</span> (underscore)</td> </tr> <tr> <td class=\"model\">ExpiredSignatureSessionToken</td> <td>An expired signature session token was passed on the <span class=\"model\">X-Signature-Session-Token</span> request header. Signature session tokens are normally valid for 4 hours.</td> </tr> </tbody> </table> <p style=\"font-size: 0.9em\"> *The codes shown above are the most common error codes. Nonetheless, this list is not comprehensive. New codes may be added anytime without previous warning. </p> <h2>Culture / Internationalization (i18n)</h2> <p>The <span class=\"model\">Accept-Language</span> request header is observed by this API. The following cultures are supported:</p> <ul> <li><span class=\"code\">en-US</span> (or simply <span class=\"code\">en</span>)</li> <li><span class=\"code\">pt-BR</span> (or simply <span class=\"code\">pt</span>)</li> </ul> <p><i>Notice: error messages are not affected by this header and therefore should not be displayed to users, being better suited for logging.</i></p>
7
+
8
+ The version of the OpenAPI document: 2.1.2
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+
15
+ from __future__ import annotations
16
+ import pprint
17
+ import re # noqa: F401
18
+ import json
19
+
20
+
21
+ from typing import Any, ClassVar, Dict, List, Optional, Union
22
+ from pydantic import BaseModel, StrictBytes, StrictStr
23
+ try:
24
+ from typing import Self
25
+ except ImportError:
26
+ from typing_extensions import Self
27
+
28
+ class AuthenticationsPostSignedBytesRequest(BaseModel):
29
+ """
30
+ AuthenticationsPostSignedBytesRequest
31
+ """ # noqa: E501
32
+ signature: Optional[Union[StrictBytes, StrictStr]] = None
33
+ certificate: Optional[Union[StrictBytes, StrictStr]] = None
34
+ __properties: ClassVar[List[str]] = ["signature", "certificate"]
35
+
36
+ model_config = {
37
+ "populate_by_name": True,
38
+ "validate_assignment": True
39
+ }
40
+
41
+
42
+ def to_str(self) -> str:
43
+ """Returns the string representation of the model using alias"""
44
+ return pprint.pformat(self.model_dump(by_alias=True))
45
+
46
+ def to_json(self) -> str:
47
+ """Returns the JSON representation of the model using alias"""
48
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
49
+ return json.dumps(self.to_dict())
50
+
51
+ @classmethod
52
+ def from_json(cls, json_str: str) -> Self:
53
+ """Create an instance of AuthenticationsPostSignedBytesRequest from a JSON string"""
54
+ return cls.from_dict(json.loads(json_str))
55
+
56
+ def to_dict(self) -> Dict[str, Any]:
57
+ """Return the dictionary representation of the model using alias.
58
+
59
+ This has the following differences from calling pydantic's
60
+ `self.model_dump(by_alias=True)`:
61
+
62
+ * `None` is only added to the output dict for nullable fields that
63
+ were set at model initialization. Other fields with value `None`
64
+ are ignored.
65
+ """
66
+ _dict = self.model_dump(
67
+ by_alias=True,
68
+ exclude={
69
+ },
70
+ exclude_none=True,
71
+ )
72
+ # set to None if signature (nullable) is None
73
+ # and model_fields_set contains the field
74
+ if self.signature is None and "signature" in self.model_fields_set:
75
+ _dict['signature'] = None
76
+
77
+ # set to None if certificate (nullable) is None
78
+ # and model_fields_set contains the field
79
+ if self.certificate is None and "certificate" in self.model_fields_set:
80
+ _dict['certificate'] = None
81
+
82
+ return _dict
83
+
84
+ @classmethod
85
+ def from_dict(cls, obj: Dict) -> Self:
86
+ """Create an instance of AuthenticationsPostSignedBytesRequest from a dict"""
87
+ if obj is None:
88
+ return None
89
+
90
+ if not isinstance(obj, dict):
91
+ return cls.model_validate(obj)
92
+
93
+ _obj = cls.model_validate({
94
+ "signature": obj.get("signature"),
95
+ "certificate": obj.get("certificate")
96
+ })
97
+ return _obj
98
+
99
+
@@ -0,0 +1,98 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Rest PKI Core API
5
+
6
+ <b><i>Para Português, <a href=\"https://docs.lacunasoftware.com/pt-br/articles/rest-pki/core/integration/get-started\">clique aqui</a></i></b> <p> <a href=\"https://docs.lacunasoftware.com/en-us/articles/rest-pki/core/\">Rest PKI Core</a> is an upcoming version of <a href=\"https://docs.lacunasoftware.com/en-us/articles/rest-pki/\">Rest PKI</a> that will have extended compatibility with environments and databases. </p> <p> In addition to Windows Server (which is already supported by Rest PKI), Rest PKI Core will also run on <b>Linux</b> (Debian- and RedHat-based distributions) and on <b>Docker</b>. As for database servers, in addition to SQL Server, <b>PostgreSQL</b> will also be supported. </p> <p> <b>Before getting started, see the integration overview on the <a href=\"https://docs.lacunasoftware.com/en-us/articles/rest-pki/core/integration/\">Integration Guide</a></b> </p> <p> For questions regarding the usage of this API, please reach us at <a href=\"https://lacuna.help/\">lacuna.help</a> </p> <h2>Parameters</h2> <p> You will need the following parameters: </p> <ul> <li><b>Endpoint</b>: address of the Rest PKI Core instance that will be used</li> <li><b>API Key</b>: authorization key for using the API</li> </ul> <p> The <span class=\"model\">endpoint</span> must be prefixed to all relative URLs mentioned here. As for the <span class=\"model\">API Key</span>, see how to use it below. </p> <h2>Authentication</h2> <p> The API key must be sent on the <span class=\"model\">X-Api-Key</span> header on each request: </p> <!-- unfortunately, class \"example microlight\" doesn't seem to work here --> <pre style=\"font-size: 12px; padding: 10px; border-radius: 4px; background: #41444e; font-weight: 600; color: #fff;\"> X-Api-Key: yourapp|xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx </pre> <h2>HTTP Codes</h2> <p> The APIs will return the following HTTP codes: </p> <table> <thead> <tr> <th>Code</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td><strong class=\"model-title\">200 (OK)</strong></td> <td>Request processed successfully. The response is different for each API, please refer to the operation's documentation</td> </tr> <tr> <td><strong class=\"model-title\">400 (Bad Request)</strong></td> <td>Syntax error. For instance, when a required field was not provided</td> </tr> <tr> <td><strong class=\"model-title\">401 (Unauthorized)</strong></td> <td>API key not provided or invalid</td> </tr> <tr> <td><strong class=\"model-title\">403 (Forbidden)</strong></td> <td>API key is valid, but the application has insufficient permissions to complete the requested operation</td> </tr> <tr> <td><strong class=\"model-title\">422 (Unprocessable Entity)</strong></td> <td>API error. The response body is an <a href=\"#model-ErrorModelV2\" class=\"model\">ErrorModelV2</a> </tr> <tr> <td><strong class=\"model-title\">500 (Internal Server Error)</strong></td> <td>An unexpected error occurred. The <span class=\"model\">exceptionCode</span> contained on the response body may be of help for our support team during diagnostic.</td> </tr> </tbody> </table> <h3>Error Codes</h3> <p> Some of the error codes returned in the <span class=\"model\">code</span> field of an <a href=\"#model-ErrorModelV2\" class=\"model\">ErrorModelV2</a> (body of responses with HTTP status code 422) are provided below*: </p> <table> <thead> <tr> <th>Code</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td class=\"model\">DocumentNotFound</td> <td>A referenced document was not found (check the document ID)</td> </tr> <tr> <td class=\"model\">SecurityContextNotFound</td> <td>A referenced security context was not found (check the security context ID)</td> </tr> <tr> <td class=\"model\">SignatureSessionNotFound</td> <td>A referenced signature session was not found (check the signature session ID)</td> </tr> <tr> <td class=\"model\">BadSignatureSessionOperation</td> <td>The operation is invalid for the current signature session or document status. For instance, trying to await the session's completion if it is still <span class=\"model\">Pending</span> results in this error</td> </tr> <tr> <td class=\"model\">BackgroundProcessing</td> <td>The operation cannot be completed at this time because the resource is being processed in background</td> </tr> <tr> <td class=\"model\">SignatureSessionTokenRequired</td> <td>The signature session token was not passed on the <span class=\"model\">X-Signature-Session-Token</span> request header</td> </tr> <tr> <td class=\"model\">BadSignatureSessionToken</td> <td>An invalid signature session token was passed on the <span class=\"model\">X-Signature-Session-Token</span> request header. Check your application for possible corruption of the session token, which may contain characters <span class=\"code\">-</span> (hyphen) and <span class=\"code\">_</span> (underscore)</td> </tr> <tr> <td class=\"model\">ExpiredSignatureSessionToken</td> <td>An expired signature session token was passed on the <span class=\"model\">X-Signature-Session-Token</span> request header. Signature session tokens are normally valid for 4 hours.</td> </tr> </tbody> </table> <p style=\"font-size: 0.9em\"> *The codes shown above are the most common error codes. Nonetheless, this list is not comprehensive. New codes may be added anytime without previous warning. </p> <h2>Culture / Internationalization (i18n)</h2> <p>The <span class=\"model\">Accept-Language</span> request header is observed by this API. The following cultures are supported:</p> <ul> <li><span class=\"code\">en-US</span> (or simply <span class=\"code\">en</span>)</li> <li><span class=\"code\">pt-BR</span> (or simply <span class=\"code\">pt</span>)</li> </ul> <p><i>Notice: error messages are not affected by this header and therefore should not be displayed to users, being better suited for logging.</i></p>
7
+
8
+ The version of the OpenAPI document: 2.1.2
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+
15
+ from __future__ import annotations
16
+ import pprint
17
+ import re # noqa: F401
18
+ import json
19
+
20
+
21
+ from typing import Any, ClassVar, Dict, List, Optional
22
+ from pydantic import BaseModel
23
+ from pydantic import Field
24
+ from restpki_ng_python_client.models.certificate_model import CertificateModel
25
+ from restpki_ng_python_client.models.validation_results_model import ValidationResultsModel
26
+ try:
27
+ from typing import Self
28
+ except ImportError:
29
+ from typing_extensions import Self
30
+
31
+ class AuthenticationsPostSignedBytesResponse(BaseModel):
32
+ """
33
+ AuthenticationsPostSignedBytesResponse
34
+ """ # noqa: E501
35
+ validation_results: Optional[ValidationResultsModel] = Field(default=None, alias="validationResults")
36
+ certificate: Optional[CertificateModel] = None
37
+ __properties: ClassVar[List[str]] = ["validationResults", "certificate"]
38
+
39
+ model_config = {
40
+ "populate_by_name": True,
41
+ "validate_assignment": True
42
+ }
43
+
44
+
45
+ def to_str(self) -> str:
46
+ """Returns the string representation of the model using alias"""
47
+ return pprint.pformat(self.model_dump(by_alias=True))
48
+
49
+ def to_json(self) -> str:
50
+ """Returns the JSON representation of the model using alias"""
51
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
52
+ return json.dumps(self.to_dict())
53
+
54
+ @classmethod
55
+ def from_json(cls, json_str: str) -> Self:
56
+ """Create an instance of AuthenticationsPostSignedBytesResponse from a JSON string"""
57
+ return cls.from_dict(json.loads(json_str))
58
+
59
+ def to_dict(self) -> Dict[str, Any]:
60
+ """Return the dictionary representation of the model using alias.
61
+
62
+ This has the following differences from calling pydantic's
63
+ `self.model_dump(by_alias=True)`:
64
+
65
+ * `None` is only added to the output dict for nullable fields that
66
+ were set at model initialization. Other fields with value `None`
67
+ are ignored.
68
+ """
69
+ _dict = self.model_dump(
70
+ by_alias=True,
71
+ exclude={
72
+ },
73
+ exclude_none=True,
74
+ )
75
+ # override the default output from pydantic by calling `to_dict()` of validation_results
76
+ if self.validation_results:
77
+ _dict['validationResults'] = self.validation_results.to_dict()
78
+ # override the default output from pydantic by calling `to_dict()` of certificate
79
+ if self.certificate:
80
+ _dict['certificate'] = self.certificate.to_dict()
81
+ return _dict
82
+
83
+ @classmethod
84
+ def from_dict(cls, obj: Dict) -> Self:
85
+ """Create an instance of AuthenticationsPostSignedBytesResponse from a dict"""
86
+ if obj is None:
87
+ return None
88
+
89
+ if not isinstance(obj, dict):
90
+ return cls.model_validate(obj)
91
+
92
+ _obj = cls.model_validate({
93
+ "validationResults": ValidationResultsModel.from_dict(obj.get("validationResults")) if obj.get("validationResults") is not None else None,
94
+ "certificate": CertificateModel.from_dict(obj.get("certificate")) if obj.get("certificate") is not None else None
95
+ })
96
+ return _obj
97
+
98
+
@@ -0,0 +1,45 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Rest PKI Core API
5
+
6
+ <b><i>Para Português, <a href=\"https://docs.lacunasoftware.com/pt-br/articles/rest-pki/core/integration/get-started\">clique aqui</a></i></b> <p> <a href=\"https://docs.lacunasoftware.com/en-us/articles/rest-pki/core/\">Rest PKI Core</a> is an upcoming version of <a href=\"https://docs.lacunasoftware.com/en-us/articles/rest-pki/\">Rest PKI</a> that will have extended compatibility with environments and databases. </p> <p> In addition to Windows Server (which is already supported by Rest PKI), Rest PKI Core will also run on <b>Linux</b> (Debian- and RedHat-based distributions) and on <b>Docker</b>. As for database servers, in addition to SQL Server, <b>PostgreSQL</b> will also be supported. </p> <p> <b>Before getting started, see the integration overview on the <a href=\"https://docs.lacunasoftware.com/en-us/articles/rest-pki/core/integration/\">Integration Guide</a></b> </p> <p> For questions regarding the usage of this API, please reach us at <a href=\"https://lacuna.help/\">lacuna.help</a> </p> <h2>Parameters</h2> <p> You will need the following parameters: </p> <ul> <li><b>Endpoint</b>: address of the Rest PKI Core instance that will be used</li> <li><b>API Key</b>: authorization key for using the API</li> </ul> <p> The <span class=\"model\">endpoint</span> must be prefixed to all relative URLs mentioned here. As for the <span class=\"model\">API Key</span>, see how to use it below. </p> <h2>Authentication</h2> <p> The API key must be sent on the <span class=\"model\">X-Api-Key</span> header on each request: </p> <!-- unfortunately, class \"example microlight\" doesn't seem to work here --> <pre style=\"font-size: 12px; padding: 10px; border-radius: 4px; background: #41444e; font-weight: 600; color: #fff;\"> X-Api-Key: yourapp|xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx </pre> <h2>HTTP Codes</h2> <p> The APIs will return the following HTTP codes: </p> <table> <thead> <tr> <th>Code</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td><strong class=\"model-title\">200 (OK)</strong></td> <td>Request processed successfully. The response is different for each API, please refer to the operation's documentation</td> </tr> <tr> <td><strong class=\"model-title\">400 (Bad Request)</strong></td> <td>Syntax error. For instance, when a required field was not provided</td> </tr> <tr> <td><strong class=\"model-title\">401 (Unauthorized)</strong></td> <td>API key not provided or invalid</td> </tr> <tr> <td><strong class=\"model-title\">403 (Forbidden)</strong></td> <td>API key is valid, but the application has insufficient permissions to complete the requested operation</td> </tr> <tr> <td><strong class=\"model-title\">422 (Unprocessable Entity)</strong></td> <td>API error. The response body is an <a href=\"#model-ErrorModelV2\" class=\"model\">ErrorModelV2</a> </tr> <tr> <td><strong class=\"model-title\">500 (Internal Server Error)</strong></td> <td>An unexpected error occurred. The <span class=\"model\">exceptionCode</span> contained on the response body may be of help for our support team during diagnostic.</td> </tr> </tbody> </table> <h3>Error Codes</h3> <p> Some of the error codes returned in the <span class=\"model\">code</span> field of an <a href=\"#model-ErrorModelV2\" class=\"model\">ErrorModelV2</a> (body of responses with HTTP status code 422) are provided below*: </p> <table> <thead> <tr> <th>Code</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td class=\"model\">DocumentNotFound</td> <td>A referenced document was not found (check the document ID)</td> </tr> <tr> <td class=\"model\">SecurityContextNotFound</td> <td>A referenced security context was not found (check the security context ID)</td> </tr> <tr> <td class=\"model\">SignatureSessionNotFound</td> <td>A referenced signature session was not found (check the signature session ID)</td> </tr> <tr> <td class=\"model\">BadSignatureSessionOperation</td> <td>The operation is invalid for the current signature session or document status. For instance, trying to await the session's completion if it is still <span class=\"model\">Pending</span> results in this error</td> </tr> <tr> <td class=\"model\">BackgroundProcessing</td> <td>The operation cannot be completed at this time because the resource is being processed in background</td> </tr> <tr> <td class=\"model\">SignatureSessionTokenRequired</td> <td>The signature session token was not passed on the <span class=\"model\">X-Signature-Session-Token</span> request header</td> </tr> <tr> <td class=\"model\">BadSignatureSessionToken</td> <td>An invalid signature session token was passed on the <span class=\"model\">X-Signature-Session-Token</span> request header. Check your application for possible corruption of the session token, which may contain characters <span class=\"code\">-</span> (hyphen) and <span class=\"code\">_</span> (underscore)</td> </tr> <tr> <td class=\"model\">ExpiredSignatureSessionToken</td> <td>An expired signature session token was passed on the <span class=\"model\">X-Signature-Session-Token</span> request header. Signature session tokens are normally valid for 4 hours.</td> </tr> </tbody> </table> <p style=\"font-size: 0.9em\"> *The codes shown above are the most common error codes. Nonetheless, this list is not comprehensive. New codes may be added anytime without previous warning. </p> <h2>Culture / Internationalization (i18n)</h2> <p>The <span class=\"model\">Accept-Language</span> request header is observed by this API. The following cultures are supported:</p> <ul> <li><span class=\"code\">en-US</span> (or simply <span class=\"code\">en</span>)</li> <li><span class=\"code\">pt-BR</span> (or simply <span class=\"code\">pt</span>)</li> </ul> <p><i>Notice: error messages are not affected by this header and therefore should not be displayed to users, being better suited for logging.</i></p>
7
+
8
+ The version of the OpenAPI document: 2.1.2
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+
15
+ from __future__ import annotations
16
+ import json
17
+ import pprint
18
+ import re # noqa: F401
19
+ from enum import Enum
20
+
21
+
22
+
23
+ try:
24
+ from typing import Self
25
+ except ImportError:
26
+ from typing_extensions import Self
27
+
28
+
29
+ class AutoPositioningHorizontalDirections(str, Enum):
30
+ """
31
+ AutoPositioningHorizontalDirections
32
+ """
33
+
34
+ """
35
+ allowed enum values
36
+ """
37
+ LEFTTORIGHT = 'LeftToRight'
38
+ RIGHTTOLEFT = 'RightToLeft'
39
+
40
+ @classmethod
41
+ def from_json(cls, json_str: str) -> Self:
42
+ """Create an instance of AutoPositioningHorizontalDirections from a JSON string"""
43
+ return cls(json.loads(json_str))
44
+
45
+