data-syncmaster 0.1.1__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 (110) hide show
  1. data_syncmaster-0.1.1.dist-info/LICENSE.txt +203 -0
  2. data_syncmaster-0.1.1.dist-info/METADATA +115 -0
  3. data_syncmaster-0.1.1.dist-info/RECORD +110 -0
  4. data_syncmaster-0.1.1.dist-info/WHEEL +4 -0
  5. syncmaster/__init__.py +6 -0
  6. syncmaster/backend/__init__.py +2 -0
  7. syncmaster/backend/api/__init__.py +2 -0
  8. syncmaster/backend/api/deps.py +20 -0
  9. syncmaster/backend/api/monitoring.py +10 -0
  10. syncmaster/backend/api/router.py +10 -0
  11. syncmaster/backend/api/v1/__init__.py +2 -0
  12. syncmaster/backend/api/v1/auth/__init__.py +2 -0
  13. syncmaster/backend/api/v1/auth/router.py +32 -0
  14. syncmaster/backend/api/v1/auth/utils.py +26 -0
  15. syncmaster/backend/api/v1/connections.py +300 -0
  16. syncmaster/backend/api/v1/groups.py +225 -0
  17. syncmaster/backend/api/v1/queue.py +148 -0
  18. syncmaster/backend/api/v1/router.py +18 -0
  19. syncmaster/backend/api/v1/transfers/__init__.py +2 -0
  20. syncmaster/backend/api/v1/transfers/router.py +469 -0
  21. syncmaster/backend/api/v1/transfers/utils.py +17 -0
  22. syncmaster/backend/api/v1/users.py +75 -0
  23. syncmaster/backend/export_openapi_schema.py +26 -0
  24. syncmaster/backend/handler.py +203 -0
  25. syncmaster/backend/logger.py +2 -0
  26. syncmaster/backend/main.py +63 -0
  27. syncmaster/backend/pre_start.py +94 -0
  28. syncmaster/backend/services/__init__.py +4 -0
  29. syncmaster/backend/services/auth.py +58 -0
  30. syncmaster/backend/services/unit_of_work.py +44 -0
  31. syncmaster/config.py +110 -0
  32. syncmaster/db/__init__.py +2 -0
  33. syncmaster/db/alembic.ini +41 -0
  34. syncmaster/db/base.py +28 -0
  35. syncmaster/db/factory.py +37 -0
  36. syncmaster/db/migrations/README +1 -0
  37. syncmaster/db/migrations/__init__.py +2 -0
  38. syncmaster/db/migrations/env.py +87 -0
  39. syncmaster/db/migrations/script.py.mako +24 -0
  40. syncmaster/db/migrations/versions/2023-11-23_478240cdad4b_init.py +242 -0
  41. syncmaster/db/migrations/versions/__init__.py +2 -0
  42. syncmaster/db/mixins.py +33 -0
  43. syncmaster/db/models.py +194 -0
  44. syncmaster/db/repositories/__init__.py +22 -0
  45. syncmaster/db/repositories/base.py +109 -0
  46. syncmaster/db/repositories/connection.py +138 -0
  47. syncmaster/db/repositories/credentials_repository.py +87 -0
  48. syncmaster/db/repositories/group.py +264 -0
  49. syncmaster/db/repositories/queue.py +195 -0
  50. syncmaster/db/repositories/repository_with_owner.py +115 -0
  51. syncmaster/db/repositories/run.py +78 -0
  52. syncmaster/db/repositories/transfer.py +202 -0
  53. syncmaster/db/repositories/user.py +72 -0
  54. syncmaster/db/repositories/utils.py +25 -0
  55. syncmaster/db/utils.py +31 -0
  56. syncmaster/dto/__init__.py +2 -0
  57. syncmaster/dto/connections.py +60 -0
  58. syncmaster/dto/transfers.py +46 -0
  59. syncmaster/exceptions/__init__.py +13 -0
  60. syncmaster/exceptions/base.py +12 -0
  61. syncmaster/exceptions/connection.py +28 -0
  62. syncmaster/exceptions/credentials.py +8 -0
  63. syncmaster/exceptions/group.py +27 -0
  64. syncmaster/exceptions/queue.py +16 -0
  65. syncmaster/exceptions/run.py +19 -0
  66. syncmaster/exceptions/transfer.py +39 -0
  67. syncmaster/exceptions/user.py +11 -0
  68. syncmaster/schemas/__init__.py +2 -0
  69. syncmaster/schemas/v1/__init__.py +54 -0
  70. syncmaster/schemas/v1/auth.py +12 -0
  71. syncmaster/schemas/v1/connection_types.py +9 -0
  72. syncmaster/schemas/v1/connections/__init__.py +2 -0
  73. syncmaster/schemas/v1/connections/connection.py +146 -0
  74. syncmaster/schemas/v1/connections/hdfs.py +40 -0
  75. syncmaster/schemas/v1/connections/hive.py +40 -0
  76. syncmaster/schemas/v1/connections/oracle.py +58 -0
  77. syncmaster/schemas/v1/connections/postgres.py +48 -0
  78. syncmaster/schemas/v1/connections/s3.py +66 -0
  79. syncmaster/schemas/v1/file_formats.py +7 -0
  80. syncmaster/schemas/v1/groups.py +39 -0
  81. syncmaster/schemas/v1/page.py +40 -0
  82. syncmaster/schemas/v1/queue.py +32 -0
  83. syncmaster/schemas/v1/status.py +16 -0
  84. syncmaster/schemas/v1/transfer_types.py +6 -0
  85. syncmaster/schemas/v1/transfers/__init__.py +172 -0
  86. syncmaster/schemas/v1/transfers/db.py +23 -0
  87. syncmaster/schemas/v1/transfers/file/__init__.py +2 -0
  88. syncmaster/schemas/v1/transfers/file/base.py +47 -0
  89. syncmaster/schemas/v1/transfers/file/hdfs.py +27 -0
  90. syncmaster/schemas/v1/transfers/file/s3.py +27 -0
  91. syncmaster/schemas/v1/transfers/file_format.py +29 -0
  92. syncmaster/schemas/v1/transfers/run.py +37 -0
  93. syncmaster/schemas/v1/transfers/strategy.py +15 -0
  94. syncmaster/schemas/v1/types.py +5 -0
  95. syncmaster/schemas/v1/users.py +83 -0
  96. syncmaster/worker/__init__.py +2 -0
  97. syncmaster/worker/base.py +14 -0
  98. syncmaster/worker/config.py +18 -0
  99. syncmaster/worker/controller.py +127 -0
  100. syncmaster/worker/handlers/__init__.py +2 -0
  101. syncmaster/worker/handlers/base.py +49 -0
  102. syncmaster/worker/handlers/file/__init__.py +2 -0
  103. syncmaster/worker/handlers/file/base.py +56 -0
  104. syncmaster/worker/handlers/file/hdfs.py +14 -0
  105. syncmaster/worker/handlers/file/s3.py +20 -0
  106. syncmaster/worker/handlers/hive.py +41 -0
  107. syncmaster/worker/handlers/oracle.py +48 -0
  108. syncmaster/worker/handlers/postgres.py +47 -0
  109. syncmaster/worker/spark.py +93 -0
  110. syncmaster/worker/transfer.py +85 -0
@@ -0,0 +1,203 @@
1
+ Copyright 2023-2024 MTS (Mobile Telesystems). All rights reserved.
2
+
3
+ Apache License
4
+ Version 2.0, January 2004
5
+ http://www.apache.org/licenses/
6
+
7
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
8
+
9
+ 1. Definitions.
10
+
11
+ "License" shall mean the terms and conditions for use, reproduction,
12
+ and distribution as defined by Sections 1 through 9 of this document.
13
+
14
+ "Licensor" shall mean the copyright owner or entity authorized by
15
+ the copyright owner that is granting the License.
16
+
17
+ "Legal Entity" shall mean the union of the acting entity and all
18
+ other entities that control, are controlled by, or are under common
19
+ control with that entity. For the purposes of this definition,
20
+ "control" means (i) the power, direct or indirect, to cause the
21
+ direction or management of such entity, whether by contract or
22
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
23
+ outstanding shares, or (iii) beneficial ownership of such entity.
24
+
25
+ "You" (or "Your") shall mean an individual or Legal Entity
26
+ exercising permissions granted by this License.
27
+
28
+ "Source" form shall mean the preferred form for making modifications,
29
+ including but not limited to software source code, documentation
30
+ source, and configuration files.
31
+
32
+ "Object" form shall mean any form resulting from mechanical
33
+ transformation or translation of a Source form, including but
34
+ not limited to compiled object code, generated documentation,
35
+ and conversions to other media types.
36
+
37
+ "Work" shall mean the work of authorship, whether in Source or
38
+ Object form, made available under the License, as indicated by a
39
+ copyright notice that is included in or attached to the work
40
+ (an example is provided in the Appendix below).
41
+
42
+ "Derivative Works" shall mean any work, whether in Source or Object
43
+ form, that is based on (or derived from) the Work and for which the
44
+ editorial revisions, annotations, elaborations, or other modifications
45
+ represent, as a whole, an original work of authorship. For the purposes
46
+ of this License, Derivative Works shall not include works that remain
47
+ separable from, or merely link (or bind by name) to the interfaces of,
48
+ the Work and Derivative Works thereof.
49
+
50
+ "Contribution" shall mean any work of authorship, including
51
+ the original version of the Work and any modifications or additions
52
+ to that Work or Derivative Works thereof, that is intentionally
53
+ submitted to Licensor for inclusion in the Work by the copyright owner
54
+ or by an individual or Legal Entity authorized to submit on behalf of
55
+ the copyright owner. For the purposes of this definition, "submitted"
56
+ means any form of electronic, verbal, or written communication sent
57
+ to the Licensor or its representatives, including but not limited to
58
+ communication on electronic mailing lists, source code control systems,
59
+ and issue tracking systems that are managed by, or on behalf of, the
60
+ Licensor for the purpose of discussing and improving the Work, but
61
+ excluding communication that is conspicuously marked or otherwise
62
+ designated in writing by the copyright owner as "Not a Contribution."
63
+
64
+ "Contributor" shall mean Licensor and any individual or Legal Entity
65
+ on behalf of whom a Contribution has been received by Licensor and
66
+ subsequently incorporated within the Work.
67
+
68
+ 2. Grant of Copyright License. Subject to the terms and conditions of
69
+ this License, each Contributor hereby grants to You a perpetual,
70
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
71
+ copyright license to reproduce, prepare Derivative Works of,
72
+ publicly display, publicly perform, sublicense, and distribute the
73
+ Work and such Derivative Works in Source or Object form.
74
+
75
+ 3. Grant of Patent License. Subject to the terms and conditions of
76
+ this License, each Contributor hereby grants to You a perpetual,
77
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
78
+ (except as stated in this section) patent license to make, have made,
79
+ use, offer to sell, sell, import, and otherwise transfer the Work,
80
+ where such license applies only to those patent claims licensable
81
+ by such Contributor that are necessarily infringed by their
82
+ Contribution(s) alone or by combination of their Contribution(s)
83
+ with the Work to which such Contribution(s) was submitted. If You
84
+ institute patent litigation against any entity (including a
85
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
86
+ or a Contribution incorporated within the Work constitutes direct
87
+ or contributory patent infringement, then any patent licenses
88
+ granted to You under this License for that Work shall terminate
89
+ as of the date such litigation is filed.
90
+
91
+ 4. Redistribution. You may reproduce and distribute copies of the
92
+ Work or Derivative Works thereof in any medium, with or without
93
+ modifications, and in Source or Object form, provided that You
94
+ meet the following conditions:
95
+
96
+ (a) You must give any other recipients of the Work or
97
+ Derivative Works a copy of this License; and
98
+
99
+ (b) You must cause any modified files to carry prominent notices
100
+ stating that You changed the files; and
101
+
102
+ (c) You must retain, in the Source form of any Derivative Works
103
+ that You distribute, all copyright, patent, trademark, and
104
+ attribution notices from the Source form of the Work,
105
+ excluding those notices that do not pertain to any part of
106
+ the Derivative Works; and
107
+
108
+ (d) If the Work includes a "NOTICE" text file as part of its
109
+ distribution, then any Derivative Works that You distribute must
110
+ include a readable copy of the attribution notices contained
111
+ within such NOTICE file, excluding those notices that do not
112
+ pertain to any part of the Derivative Works, in at least one
113
+ of the following places: within a NOTICE text file distributed
114
+ as part of the Derivative Works; within the Source form or
115
+ documentation, if provided along with the Derivative Works; or,
116
+ within a display generated by the Derivative Works, if and
117
+ wherever such third-party notices normally appear. The contents
118
+ of the NOTICE file are for informational purposes only and
119
+ do not modify the License. You may add Your own attribution
120
+ notices within Derivative Works that You distribute, alongside
121
+ or as an addendum to the NOTICE text from the Work, provided
122
+ that such additional attribution notices cannot be construed
123
+ as modifying the License.
124
+
125
+ You may add Your own copyright statement to Your modifications and
126
+ may provide additional or different license terms and conditions
127
+ for use, reproduction, or distribution of Your modifications, or
128
+ for any such Derivative Works as a whole, provided Your use,
129
+ reproduction, and distribution of the Work otherwise complies with
130
+ the conditions stated in this License.
131
+
132
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
133
+ any Contribution intentionally submitted for inclusion in the Work
134
+ by You to the Licensor shall be under the terms and conditions of
135
+ this License, without any additional terms or conditions.
136
+ Notwithstanding the above, nothing herein shall supersede or modify
137
+ the terms of any separate license agreement you may have executed
138
+ with Licensor regarding such Contributions.
139
+
140
+ 6. Trademarks. This License does not grant permission to use the trade
141
+ names, trademarks, service marks, or product names of the Licensor,
142
+ except as required for reasonable and customary use in describing the
143
+ origin of the Work and reproducing the content of the NOTICE file.
144
+
145
+ 7. Disclaimer of Warranty. Unless required by applicable law or
146
+ agreed to in writing, Licensor provides the Work (and each
147
+ Contributor provides its Contributions) on an "AS IS" BASIS,
148
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
149
+ implied, including, without limitation, any warranties or conditions
150
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
151
+ PARTICULAR PURPOSE. You are solely responsible for determining the
152
+ appropriateness of using or redistributing the Work and assume any
153
+ risks associated with Your exercise of permissions under this License.
154
+
155
+ 8. Limitation of Liability. In no event and under no legal theory,
156
+ whether in tort (including negligence), contract, or otherwise,
157
+ unless required by applicable law (such as deliberate and grossly
158
+ negligent acts) or agreed to in writing, shall any Contributor be
159
+ liable to You for damages, including any direct, indirect, special,
160
+ incidental, or consequential damages of any character arising as a
161
+ result of this License or out of the use or inability to use the
162
+ Work (including but not limited to damages for loss of goodwill,
163
+ work stoppage, computer failure or malfunction, or any and all
164
+ other commercial damages or losses), even if such Contributor
165
+ has been advised of the possibility of such damages.
166
+
167
+ 9. Accepting Warranty or Additional Liability. While redistributing
168
+ the Work or Derivative Works thereof, You may choose to offer,
169
+ and charge a fee for, acceptance of support, warranty, indemnity,
170
+ or other liability obligations and/or rights consistent with this
171
+ License. However, in accepting such obligations, You may act only
172
+ on Your own behalf and on Your sole responsibility, not on behalf
173
+ of any other Contributor, and only if You agree to indemnify,
174
+ defend, and hold each Contributor harmless for any liability
175
+ incurred by, or claims asserted against, such Contributor by reason
176
+ of your accepting any such warranty or additional liability.
177
+
178
+ END OF TERMS AND CONDITIONS
179
+
180
+ APPENDIX: How to apply the Apache License to your work.
181
+
182
+ To apply the Apache License to your work, attach the following
183
+ boilerplate notice, with the fields enclosed by brackets "[]"
184
+ replaced with your own identifying information. (Don't include
185
+ the brackets!) The text should be enclosed in the appropriate
186
+ comment syntax for the file format. We also recommend that a
187
+ file or class name and description of purpose be included on the
188
+ same "printed page" as the copyright notice for easier
189
+ identification within third-party archives.
190
+
191
+ Copyright [yyyy] [name of copyright owner]
192
+
193
+ Licensed under the Apache License, Version 2.0 (the "License");
194
+ you may not use this file except in compliance with the License.
195
+ You may obtain a copy of the License at
196
+
197
+ http://www.apache.org/licenses/LICENSE-2.0
198
+
199
+ Unless required by applicable law or agreed to in writing, software
200
+ distributed under the License is distributed on an "AS IS" BASIS,
201
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
202
+ See the License for the specific language governing permissions and
203
+ limitations under the License.
@@ -0,0 +1,115 @@
1
+ Metadata-Version: 2.1
2
+ Name: data-syncmaster
3
+ Version: 0.1.1
4
+ Summary: Syncmaster REST API + Worker
5
+ License: Apache-2.0
6
+ Keywords: Syncmaster,REST,API,Worker,Replication
7
+ Author: DataOps.ETL
8
+ Author-email: onetools@mts.ru
9
+ Requires-Python: >=3.11,<4.0
10
+ Classifier: Development Status :: 3 - Alpha
11
+ Classifier: Framework :: FastAPI
12
+ Classifier: Framework :: Pydantic
13
+ Classifier: Framework :: Pydantic :: 2
14
+ Classifier: Intended Audience :: Developers
15
+ Classifier: License :: OSI Approved :: Apache Software License
16
+ Classifier: Operating System :: OS Independent
17
+ Classifier: Programming Language :: Python :: 3
18
+ Classifier: Programming Language :: Python :: 3.11
19
+ Classifier: Programming Language :: Python :: 3.12
20
+ Classifier: Programming Language :: Python :: 3 :: Only
21
+ Classifier: Programming Language :: Python :: 3.10
22
+ Classifier: Programming Language :: Python :: 3.7
23
+ Classifier: Programming Language :: Python :: 3.8
24
+ Classifier: Programming Language :: Python :: 3.9
25
+ Classifier: Topic :: Software Development :: Libraries
26
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
27
+ Classifier: Typing :: Typed
28
+ Provides-Extra: backend
29
+ Provides-Extra: worker
30
+ Requires-Dist: alembic (>=1.11.1,<2.0.0) ; extra == "backend"
31
+ Requires-Dist: asyncpg (>=0.29.0,<0.30.0) ; extra == "backend"
32
+ Requires-Dist: celery (>=5.3.3,<6.0.0)
33
+ Requires-Dist: fastapi (>=0.110.0,<0.111.0) ; extra == "backend"
34
+ Requires-Dist: onetl[spark] (>=0.10.2,<0.11.0) ; extra == "worker"
35
+ Requires-Dist: psycopg2-binary (>=2.9.7,<3.0.0) ; extra == "worker"
36
+ Requires-Dist: pydantic (>=2.6.4,<3.0.0)
37
+ Requires-Dist: pydantic-settings (>=2.2.1,<3.0.0)
38
+ Requires-Dist: python-jose[cryptography] (>=3.3.0,<4.0.0)
39
+ Requires-Dist: python-multipart (>=0.0.9,<0.0.10)
40
+ Requires-Dist: sqlalchemy (>=2.0.18,<3.0.0)
41
+ Requires-Dist: sqlalchemy-utils (>=0.41.1,<0.42.0)
42
+ Requires-Dist: uvicorn (>=0.29.0,<0.30.0) ; extra == "backend"
43
+ Project-URL: CI/CD, https://github.com/MobileTeleSystems/syncmaster/actions
44
+ Project-URL: Documentation, https://syncmaster.readthedocs.io
45
+ Project-URL: Homepage, https://github.com/MobileTeleSystems/syncmaster
46
+ Project-URL: Source, https://github.com/MobileTeleSystems/syncmaster
47
+ Project-URL: Tracker, https://github.com/MobileTeleSystems/syncmaster/issues
48
+ Description-Content-Type: text/x-rst
49
+
50
+ .. title
51
+
52
+ ==========
53
+ SyncMaster
54
+ ==========
55
+
56
+ |Repo Status| |PyPI| |PyPI License| |PyPI Python Version| |Docker image| |Documentation|
57
+ |Build Status| |Coverage| |pre-commit.ci|
58
+
59
+ .. |Repo Status| image:: https://www.repostatus.org/badges/latest/active.svg
60
+ :target: https://github.com/MobileTeleSystems/syncmaster
61
+ .. |PyPI| image:: https://img.shields.io/pypi/v/data-syncmaster
62
+ :target: https://pypi.org/project/data-syncmaster/
63
+ .. |PyPI License| image:: https://img.shields.io/pypi/l/data-syncmaster.svg
64
+ :target: https://github.com/MobileTeleSystems/syncmaster/blob/develop/LICENSE.txt
65
+ .. |PyPI Python Version| image:: https://img.shields.io/pypi/pyversions/data-syncmaster.svg
66
+ :target: https://badge.fury.io/py/data-syncmaster
67
+ .. |Docker image| image:: https://img.shields.io/docker/v/mtsrus/syncmaster-backend?sort=semver&label=docker
68
+ :target: https://hub.docker.com/r/mtsrus/syncmaster-backend
69
+ .. |Documentation| image:: https://readthedocs.org/projects/data-syncmaster/badge/?version=stable
70
+ :target: https://syncmaster.readthedocs.io
71
+ .. |Build Status| image:: https://github.com/MobileTeleSystems/syncmaster/workflows/Tests/badge.svg
72
+ :target: https://github.com/MobileTeleSystems/syncmaster/actions
73
+ .. |Coverage| image:: https://codecov.io/gh/MobileTeleSystems/syncmaster/graph/badge.svg?token=ky7UyUxolB
74
+ :target: https://codecov.io/gh/MobileTeleSystems/syncmaster
75
+ .. |pre-commit.ci| image:: https://results.pre-commit.ci/badge/github/MobileTeleSystems/syncmaster/develop.svg
76
+ :target: https://results.pre-commit.ci/latest/github/MobileTeleSystems/syncmaster/develop
77
+
78
+
79
+ What is Syncmaster?
80
+ -------------------
81
+
82
+ Syncmaster is as low-code ETL tool for transfering data between databases and file systems.
83
+ List of currently supported connections:
84
+
85
+ * Apache Hive
86
+ * Postgres
87
+ * Oracle
88
+ * HDFS
89
+ * S3
90
+
91
+ Current SyncMaster implementation provides following components:
92
+
93
+ * REST API
94
+ * Celery Worker
95
+
96
+ Goals
97
+ -----
98
+
99
+ * Make transfering data between databases and file systems as simple as possible
100
+ * Provide a lot of builtin connectors to transfer data in heterogeneous environment
101
+ * RBAC and multitenancy support
102
+
103
+ Non-goals
104
+ ---------
105
+
106
+ * This is not a backup system
107
+ * This is not a CDC solution
108
+ * Only batch, no streaming
109
+
110
+ .. documentation
111
+
112
+ Documentation
113
+ -------------
114
+
115
+ See https://syncmaster.readthedocs.io
@@ -0,0 +1,110 @@
1
+ syncmaster/__init__.py,sha256=G3iRuS9tz2yIJKesx7I9mpdmh7nUvCV3r9by9stjvrg,247
2
+ syncmaster/backend/__init__.py,sha256=ZAqkqOvcrkAAOMN9ojtl2ILiGZ5ZHJLSrGYZz75B1AI,99
3
+ syncmaster/backend/api/__init__.py,sha256=ZAqkqOvcrkAAOMN9ojtl2ILiGZ5ZHJLSrGYZz75B1AI,99
4
+ syncmaster/backend/api/deps.py,sha256=H2JnyMi9QkAjMXseKLvLw9l8yQV0Y7NSjMIY8D23NHg,273
5
+ syncmaster/backend/api/monitoring.py,sha256=MjhwGD46h1yCFn787DRQDAnCUT2XDmtig28UsVYb3S0,261
6
+ syncmaster/backend/api/router.py,sha256=YQWDkbKf5WsbR0zNHyuutdN3iEYcoj2kmGPIr8CwHTM,349
7
+ syncmaster/backend/api/v1/__init__.py,sha256=ZAqkqOvcrkAAOMN9ojtl2ILiGZ5ZHJLSrGYZz75B1AI,99
8
+ syncmaster/backend/api/v1/auth/__init__.py,sha256=ZAqkqOvcrkAAOMN9ojtl2ILiGZ5ZHJLSrGYZz75B1AI,99
9
+ syncmaster/backend/api/v1/auth/router.py,sha256=bkcSeIKbHaX0yicmaFh-BFteJrGV-_5JQTQuUrv6CJg,1302
10
+ syncmaster/backend/api/v1/auth/utils.py,sha256=B4vXPVmt-oHEEVydAV3Bvygx9FZ6wfdphWYPdhxQzgg,900
11
+ syncmaster/backend/api/v1/connections.py,sha256=ZM7PgJy26ow1Z75KYgsnNT0KG-mihr0VJMtJMkrbUxo,9815
12
+ syncmaster/backend/api/v1/groups.py,sha256=CxHkHkTgFN-zY4Mhnd8ejIjlVrLUcmFyU3fKQAIWrFY,7086
13
+ syncmaster/backend/api/v1/queue.py,sha256=hY3htcjLmGnSFNfnfHAaVZyXUC2-jZM_Tk6KoHj4pqs,4620
14
+ syncmaster/backend/api/v1/router.py,sha256=mPHs3Xsz8KTQsPTz6kgZlHeFLsHM-YdBE8xAjbT2juE,818
15
+ syncmaster/backend/api/v1/transfers/__init__.py,sha256=ZAqkqOvcrkAAOMN9ojtl2ILiGZ5ZHJLSrGYZz75B1AI,99
16
+ syncmaster/backend/api/v1/transfers/router.py,sha256=S2eODjjhFOxVlqu5lFJ8bX8PeiD1BTvx7ftENt-nKkw,16672
17
+ syncmaster/backend/api/v1/transfers/utils.py,sha256=lIq9JYPFtr66JtmcvvnKU3WrOA-DkiRefSIb3Iq9AmM,877
18
+ syncmaster/backend/api/v1/users.py,sha256=tc3ZfltY1d_SOuSiz_SzZw9L92mFEacsfdSlBvsdt40,2907
19
+ syncmaster/backend/export_openapi_schema.py,sha256=eVLKmlH6A4KbOCp7-3xul5Tnr9fcbmnCZdBMVpiQ5ww,632
20
+ syncmaster/backend/handler.py,sha256=jNIUu6VOyFcXVXw2xI9uc5AvOMlkNsDIOh-sxs3vMws,7042
21
+ syncmaster/backend/logger.py,sha256=ZAqkqOvcrkAAOMN9ojtl2ILiGZ5ZHJLSrGYZz75B1AI,99
22
+ syncmaster/backend/main.py,sha256=NQ3HtgXHEDZNdUirgcwmgUKkMEvnY-m0Rg7r3Kma_AE,1970
23
+ syncmaster/backend/pre_start.py,sha256=1WUhWluwmxVeE4cYyVAA7g6D_bK4h-hYaG7zCz8S6-I,2660
24
+ syncmaster/backend/services/__init__.py,sha256=0qsOZQ788rEAxIx9xN7dsIU_MQKs2f5xR_dEy3BlbeU,234
25
+ syncmaster/backend/services/auth.py,sha256=qSipbjXlivWUn-GhrCQasqLJ9D_YZTiA0o__Fbz0ZWA,2193
26
+ syncmaster/backend/services/unit_of_work.py,sha256=Fa1Y1k0rIJbvcWEjhuR7Gea1Ga4tHScMXgmUE_ICFQc,1285
27
+ syncmaster/config.py,sha256=GUPvY778cLbEzlOkUgPjAVeF9Je4E1MRFVHo7cfWwPU,3066
28
+ syncmaster/db/__init__.py,sha256=ZAqkqOvcrkAAOMN9ojtl2ILiGZ5ZHJLSrGYZz75B1AI,99
29
+ syncmaster/db/alembic.ini,sha256=hhx6RhC2u0NHjeZTUPWv6gXDFCWMXq_Ap5lPaJyTW04,664
30
+ syncmaster/db/base.py,sha256=l22FL-KzMP_btbXAYj08HwaXWV0pCgTTLN49VJJQfr0,975
31
+ syncmaster/db/factory.py,sha256=Q_ZeIKJn17ft9Xpe5ndIAPIHPpOj5643UFRSPGRjwU4,1049
32
+ syncmaster/db/migrations/README,sha256=ISVtAOvqvKk_5ThM5ioJE-lMkvf9IbknFUFVU_vPma4,58
33
+ syncmaster/db/migrations/__init__.py,sha256=ZAqkqOvcrkAAOMN9ojtl2ILiGZ5ZHJLSrGYZz75B1AI,99
34
+ syncmaster/db/migrations/env.py,sha256=YDe9jHEhRfI7wpRzrRkgo-3IhaK0AsTUrCKPFLStssE,2258
35
+ syncmaster/db/migrations/script.py.mako,sha256=HNlf26BI1xvQKjiUojnj15BPrVUfVVr81IOgliJf83c,510
36
+ syncmaster/db/migrations/versions/2023-11-23_478240cdad4b_init.py,sha256=TYjPJzSS0f1pqzejd90bdFxDaU26TXIdjToOnx226Zc,12132
37
+ syncmaster/db/migrations/versions/__init__.py,sha256=ZAqkqOvcrkAAOMN9ojtl2ILiGZ5ZHJLSrGYZz75B1AI,99
38
+ syncmaster/db/mixins.py,sha256=rWsFDpHQqQ9Aw7mT01jN0FAkxGTeLrrYIvzDeKGKdV4,1112
39
+ syncmaster/db/models.py,sha256=wjZ5zZgQvdGqKVhdl259kCKUAu7-lpYCA8cswIFUPG0,6349
40
+ syncmaster/db/repositories/__init__.py,sha256=eSnK50dZ9SZ4VIoRWq2V35dpLIf26yBuSadgka9tGZo,855
41
+ syncmaster/db/repositories/base.py,sha256=Zmw7sLSoDOc1jCKG1OjbcaPjw62YvtEPJSY_VV6FfwM,4216
42
+ syncmaster/db/repositories/connection.py,sha256=PevbMdUGKpxzglx-D_HtT5k2NaKps7mdKmTcXJ779dM,4640
43
+ syncmaster/db/repositories/credentials_repository.py,sha256=zd7bLVNuUOgu9zzIIpI1oa4E2IrOIo7QKxqhcBuEDlQ,3138
44
+ syncmaster/db/repositories/group.py,sha256=Lg_TMidCuWuC3jZ8ZOsGnLedGNVX3gy3gh48w0p94U0,8131
45
+ syncmaster/db/repositories/queue.py,sha256=9p3CfSFqZwZwxFK1zffY8y6Vq1UBJ1YVW7A_INhMo8U,6124
46
+ syncmaster/db/repositories/repository_with_owner.py,sha256=QjpDj6UkDfxBnnlRLYUFzujO5eLliFiYgXr3clWwSGE,3476
47
+ syncmaster/db/repositories/run.py,sha256=1FJJVGDfbf6j0qPDRLOxs5DiIJ0VjzoSjsA1aBope0M,3001
48
+ syncmaster/db/repositories/transfer.py,sha256=McjC9PbumewMZWrnFatIK6B6Wl5GJzIYOmDreI5Mrf8,7320
49
+ syncmaster/db/repositories/user.py,sha256=vG2r3vu-mK1NWbjeGJsOIQYT_0yb3H2Lp9VlKGXGWHI,2799
50
+ syncmaster/db/repositories/utils.py,sha256=O2qDKRZVnrUMf_9LgUV5ReEqtfgZqkRW336VmSRU2n8,576
51
+ syncmaster/db/utils.py,sha256=8xzFaJxuOD1CzB0Q36EgvKi5JB9s6owLPKrS7jxyCkg,958
52
+ syncmaster/dto/__init__.py,sha256=ZAqkqOvcrkAAOMN9ojtl2ILiGZ5ZHJLSrGYZz75B1AI,99
53
+ syncmaster/dto/connections.py,sha256=ncsOBGfj4PUU8-vq8_erKXrxI0yJ07V70jSs20evXgU,1094
54
+ syncmaster/dto/transfers.py,sha256=rl8PqSbcUxS426o_iy5iz0hUNeBqG3XLowQcoNuu2mE,909
55
+ syncmaster/exceptions/__init__.py,sha256=na1ZyoHPz7XgOncBO0pHs6L12n_czSoAvU2AGFQERr0,309
56
+ syncmaster/exceptions/base.py,sha256=AREQta6-tXV7nX9fu5HtFL-y39oV1UtaSa7y7EOapIY,254
57
+ syncmaster/exceptions/connection.py,sha256=idTrToX66gGsC4kHMFRg97pOKbhBYAQ_KwcmPRvmnoQ,628
58
+ syncmaster/exceptions/credentials.py,sha256=FvLjbrKMNFEtrn8jSDFgoKXrwIg-cQGqNF3iseyJY0A,274
59
+ syncmaster/exceptions/group.py,sha256=J5Dyit9ZTjo6eTxIMwZ5DCZYyErq_rkpGOtZoocuDmA,514
60
+ syncmaster/exceptions/queue.py,sha256=-zsXO21IHojwedqCydcUAHhG5-Ts_Nm68mwFNFGMhfg,424
61
+ syncmaster/exceptions/run.py,sha256=p4sNQtHaZJi02YVEA_F2fHqFoMGGA3N5XisTCABvOFQ,573
62
+ syncmaster/exceptions/transfer.py,sha256=OiMWkYlSv1FqFweDn2skTcVIfHvvwXeC_nOEsXd8V2s,954
63
+ syncmaster/exceptions/user.py,sha256=nSmwQW4s_YVSXx-rxUxIaCO17e9ZkQWSfACc1wCk3xo,269
64
+ syncmaster/schemas/__init__.py,sha256=ZAqkqOvcrkAAOMN9ojtl2ILiGZ5ZHJLSrGYZz75B1AI,99
65
+ syncmaster/schemas/v1/__init__.py,sha256=dlx-h6n4QhwkBwWF0b28UMpKuxtA26uIQGl0m4Z1RU0,1516
66
+ syncmaster/schemas/v1/auth.py,sha256=swZFHO_IpTeG60fv6_T0TZtGHrWhqrbiOp8fHHRotbU,267
67
+ syncmaster/schemas/v1/connection_types.py,sha256=mbWGi7VpczFYPzSTqwJFmt5oLisI3T-E16C_9NJEQ5A,275
68
+ syncmaster/schemas/v1/connections/__init__.py,sha256=ZAqkqOvcrkAAOMN9ojtl2ILiGZ5ZHJLSrGYZz75B1AI,99
69
+ syncmaster/schemas/v1/connections/connection.py,sha256=q_AvRs7b0vHk4St1jmP8oxFxiIkT1OKvihTJ1_V6Yuc,4760
70
+ syncmaster/schemas/v1/connections/hdfs.py,sha256=Yf4vPoe1chcwaCPsySRgi09aKHvxedQg2izioWT9Vac,908
71
+ syncmaster/schemas/v1/connections/hive.py,sha256=AmpT84mRn6NxfJo6tuh9adqvr-U4lpQw5nydSPJjo9k,852
72
+ syncmaster/schemas/v1/connections/oracle.py,sha256=0TJOMlua-KY9uc6qEw6tHf9xP2JBkSVdKbUMPN4uKZk,1589
73
+ syncmaster/schemas/v1/connections/postgres.py,sha256=xifGXsjPZvYIJRlVPbf02gHkfaTO_JJH2OkUVOuPMRE,1184
74
+ syncmaster/schemas/v1/connections/s3.py,sha256=y72_14vrEBr8XyHX-LHOy7Hwe9JOgF-OMMcHbaR2lbA,1664
75
+ syncmaster/schemas/v1/file_formats.py,sha256=k0tglElQILdycHc2ANWC4ewSM7cVHh1dvxcew0tLJIE,223
76
+ syncmaster/schemas/v1/groups.py,sha256=CrDaQ_JVEEkXHuqrP-AleeUiQLtgHJFF745aVMUqIjw,839
77
+ syncmaster/schemas/v1/page.py,sha256=ZtQz63o1xZY4PzuhK_dhygDG6OvBfaelbESgrfg2Fsk,1061
78
+ syncmaster/schemas/v1/queue.py,sha256=f9jKtbt-Q1DU74G7pn7LGxR0Xsj41SnhuwrDItiRGek,826
79
+ syncmaster/schemas/v1/status.py,sha256=Hv4Q37SgeXPMZ1fnOcZb3rGkVk83NzOBiGCHd5ApKRM,375
80
+ syncmaster/schemas/v1/transfer_types.py,sha256=rwY6ky4QjNC5_HJkD9023boIm5j70MIk6CixQNcKtE8,197
81
+ syncmaster/schemas/v1/transfers/__init__.py,sha256=5AwvJDMxPws0L8J9Hen8oVUDRlC3N4T6jMWxnD1hPKw,5596
82
+ syncmaster/schemas/v1/transfers/db.py,sha256=p0drBOnkdFvQbFBD-RW0aaa8mu1YHzyEzM0yUk1uYv0,554
83
+ syncmaster/schemas/v1/transfers/file/__init__.py,sha256=ZAqkqOvcrkAAOMN9ojtl2ILiGZ5ZHJLSrGYZz75B1AI,99
84
+ syncmaster/schemas/v1/transfers/file/base.py,sha256=3asEIEDGSjapd33vBbW-IQjhzOnKjYHBzvc9Jz2D5kg,1638
85
+ syncmaster/schemas/v1/transfers/file/hdfs.py,sha256=b-ifRIqSQjIhk3zKM89aVPQm0U1hGhNrpoVK_WpflKo,682
86
+ syncmaster/schemas/v1/transfers/file/s3.py,sha256=tNYWpzpVr69q1-sYt1XFPDNiApTOi4lf5Z4ukpaic_A,664
87
+ syncmaster/schemas/v1/transfers/file_format.py,sha256=DO0ZAss3yDo1sA2uMSIeHLEc7V1i1rzvHcNY5yU4F6s,655
88
+ syncmaster/schemas/v1/transfers/run.py,sha256=_rErQ4ulfQpx3bTVBpVx9R_QpKMMC63zTvLeI_320EU,769
89
+ syncmaster/schemas/v1/transfers/strategy.py,sha256=Pziby3HrbJGIX76LZ6HzRk1Ef9lKYQwU47UYa46jYGc,364
90
+ syncmaster/schemas/v1/types.py,sha256=PzF5a65ES-Sq0sPe_1zLfBdRQ2LvFL9IdD1perrv3Zo,162
91
+ syncmaster/schemas/v1/users.py,sha256=77RTOUdqU9wM7QoWzFML1NRj3DAERH77ihuySxeCFI4,2255
92
+ syncmaster/worker/__init__.py,sha256=ZAqkqOvcrkAAOMN9ojtl2ILiGZ5ZHJLSrGYZz75B1AI,99
93
+ syncmaster/worker/base.py,sha256=SSfPDqu1_w8g0k94p7kOA2aMhkXGcVDReFdTVGiHzZY,414
94
+ syncmaster/worker/config.py,sha256=eUsa0u5akY2vqm1JyfKuIyroESlwC-DLKw-R83oxeHA,476
95
+ syncmaster/worker/controller.py,sha256=7EE7SeJqYkGmQI2k0EnjHmn_WzDnQCBN0FNZOSNl9y4,3820
96
+ syncmaster/worker/handlers/__init__.py,sha256=ZAqkqOvcrkAAOMN9ojtl2ILiGZ5ZHJLSrGYZz75B1AI,99
97
+ syncmaster/worker/handlers/base.py,sha256=pqv0XDhyeDzPOMn7YW-NkvxO1soCyPg6FSd0Dyj38WU,1571
98
+ syncmaster/worker/handlers/file/__init__.py,sha256=ZAqkqOvcrkAAOMN9ojtl2ILiGZ5ZHJLSrGYZz75B1AI,99
99
+ syncmaster/worker/handlers/file/base.py,sha256=8mVAJbKxfkprsv2ef8wGRFoTpBtOnZjJIbNmizMpQRc,1884
100
+ syncmaster/worker/handlers/file/hdfs.py,sha256=rRO0BR7SBrtq9DJz6JuZAv31MMBX6IfSEROqvLlZMYg,400
101
+ syncmaster/worker/handlers/file/s3.py,sha256=qtMCxqhytPgvMZ9FJGT8-S-kt76Pwmk9SQClPIYjZuA,742
102
+ syncmaster/worker/handlers/hive.py,sha256=2ytUQxgb7yby71jfUQ3fGL7xNxZrAYh65oFChMJTo20,1305
103
+ syncmaster/worker/handlers/oracle.py,sha256=dZxph3i9WJ-JZltHIUwqriEW-41z4xC6FRxP1H6juTA,1669
104
+ syncmaster/worker/handlers/postgres.py,sha256=3M5n8p0Su8QUc3lEtBd1k9SDYmokPVWSoPkUclDLU2M,1641
105
+ syncmaster/worker/spark.py,sha256=1NbBfjYMTg-hRx1furl7-94SO8pyV6pTk1eOtmqTHNs,3127
106
+ syncmaster/worker/transfer.py,sha256=EDO2XihOHqJDDx8h157OxghCvLTPctQYttARwsnP-L0,3102
107
+ data_syncmaster-0.1.1.dist-info/LICENSE.txt,sha256=IUuFSRyConhe-ku6gWb9eWSqwcNBZ3JD4z7r4cTRRaY,11426
108
+ data_syncmaster-0.1.1.dist-info/METADATA,sha256=wyebn37NqIczq_GZQP1qQkqumFy8gmODHbriRlQf2_0,4599
109
+ data_syncmaster-0.1.1.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
110
+ data_syncmaster-0.1.1.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: poetry-core 1.9.0
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
syncmaster/__init__.py ADDED
@@ -0,0 +1,6 @@
1
+ # SPDX-FileCopyrightText: 2023-2024 MTS (Mobile Telesystems)
2
+ # SPDX-License-Identifier: Apache-2.0
3
+
4
+ _raw_version = "0.1.1"
5
+ # version always contain only release number like 0.0.1
6
+ __version__ = ".".join(_raw_version.split(".")[:3]) # noqa: WPS410
@@ -0,0 +1,2 @@
1
+ # SPDX-FileCopyrightText: 2023-2024 MTS (Mobile Telesystems)
2
+ # SPDX-License-Identifier: Apache-2.0
@@ -0,0 +1,2 @@
1
+ # SPDX-FileCopyrightText: 2023-2024 MTS (Mobile Telesystems)
2
+ # SPDX-License-Identifier: Apache-2.0
@@ -0,0 +1,20 @@
1
+ # SPDX-FileCopyrightText: 2023-2024 MTS (Mobile Telesystems)
2
+ # SPDX-License-Identifier: Apache-2.0
3
+ class AuthMarker:
4
+ pass
5
+
6
+
7
+ class SettingsMarker:
8
+ pass
9
+
10
+
11
+ class DatabaseEngineMarker:
12
+ pass
13
+
14
+
15
+ class DatabaseSessionMarker:
16
+ pass
17
+
18
+
19
+ class UnitOfWorkMarker:
20
+ pass
@@ -0,0 +1,10 @@
1
+ # SPDX-FileCopyrightText: 2023-2024 MTS (Mobile Telesystems)
2
+ # SPDX-License-Identifier: Apache-2.0
3
+ from fastapi import APIRouter
4
+
5
+ router = APIRouter(tags=["monitoring"], prefix="/monitoring")
6
+
7
+
8
+ @router.get("/ping")
9
+ async def ping():
10
+ return {"status": "ok"}
@@ -0,0 +1,10 @@
1
+ # SPDX-FileCopyrightText: 2023-2024 MTS (Mobile Telesystems)
2
+ # SPDX-License-Identifier: Apache-2.0
3
+ from fastapi import APIRouter
4
+
5
+ from syncmaster.backend.api import monitoring
6
+ from syncmaster.backend.api.v1.router import router as v1_router
7
+
8
+ api_router = APIRouter()
9
+ api_router.include_router(monitoring.router)
10
+ api_router.include_router(v1_router)
@@ -0,0 +1,2 @@
1
+ # SPDX-FileCopyrightText: 2023-2024 MTS (Mobile Telesystems)
2
+ # SPDX-License-Identifier: Apache-2.0
@@ -0,0 +1,2 @@
1
+ # SPDX-FileCopyrightText: 2023-2024 MTS (Mobile Telesystems)
2
+ # SPDX-License-Identifier: Apache-2.0
@@ -0,0 +1,32 @@
1
+ # SPDX-FileCopyrightText: 2023-2024 MTS (Mobile Telesystems)
2
+ # SPDX-License-Identifier: Apache-2.0
3
+ from fastapi import APIRouter, Depends
4
+ from fastapi.security import OAuth2PasswordRequestForm
5
+
6
+ from syncmaster.backend.api.deps import SettingsMarker, UnitOfWorkMarker
7
+ from syncmaster.backend.api.v1.auth.utils import sign_jwt
8
+ from syncmaster.backend.services import UnitOfWork
9
+ from syncmaster.config import Settings
10
+ from syncmaster.exceptions import EntityNotFoundError
11
+ from syncmaster.schemas.v1.auth import AuthTokenSchema
12
+
13
+ router = APIRouter(prefix="/auth", tags=["Auth"])
14
+
15
+
16
+ @router.post("/token")
17
+ async def login(
18
+ form_data: OAuth2PasswordRequestForm = Depends(),
19
+ unit_of_work: UnitOfWork = Depends(UnitOfWorkMarker),
20
+ settings: Settings = Depends(SettingsMarker),
21
+ ) -> AuthTokenSchema:
22
+ """This is the test auth method!!! Not for production!!!!"""
23
+ try:
24
+ user = await unit_of_work.user.read_by_username(username=form_data.username)
25
+ except EntityNotFoundError:
26
+ async with unit_of_work:
27
+ user = await unit_of_work.user.create(
28
+ username=form_data.username,
29
+ is_active=True,
30
+ )
31
+ token = sign_jwt(user_id=user.id, settings=settings)
32
+ return AuthTokenSchema(access_token=token, refresh_token="refresh_token")
@@ -0,0 +1,26 @@
1
+ # SPDX-FileCopyrightText: 2023-2024 MTS (Mobile Telesystems)
2
+ # SPDX-License-Identifier: Apache-2.0
3
+ import time
4
+
5
+ from jose import JWTError, jwt
6
+ from pydantic import ValidationError
7
+
8
+ from syncmaster.config import Settings
9
+ from syncmaster.schemas.v1.auth import TokenPayloadSchema
10
+
11
+
12
+ def sign_jwt(user_id: int, settings: Settings) -> str:
13
+ """This method authentication for dev version without keycloak"""
14
+ payload = {
15
+ "user_id": user_id,
16
+ "expires": time.time() + settings.TOKEN_EXPIRED_TIME,
17
+ }
18
+ return jwt.encode(payload, settings.SECRET_KEY, algorithm=settings.SECURITY_ALGORITHM)
19
+
20
+
21
+ def decode_jwt(token: str, settings: Settings) -> TokenPayloadSchema | None:
22
+ try:
23
+ payload = jwt.decode(token, settings.SECRET_KEY, algorithms=[settings.SECURITY_ALGORITHM])
24
+ return TokenPayloadSchema(**payload)
25
+ except (JWTError, ValidationError):
26
+ return None