src-auth-perms-sync 0.2.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 (34) hide show
  1. src_auth_perms_sync/__init__.py +1 -0
  2. src_auth_perms_sync/__main__.py +6 -0
  3. src_auth_perms_sync/cli.py +646 -0
  4. src_auth_perms_sync/orgs/__init__.py +1 -0
  5. src_auth_perms_sync/orgs/command.py +7 -0
  6. src_auth_perms_sync/orgs/queries.py +44 -0
  7. src_auth_perms_sync/orgs/sync.py +1167 -0
  8. src_auth_perms_sync/orgs/types.py +103 -0
  9. src_auth_perms_sync/permissions/__init__.py +1 -0
  10. src_auth_perms_sync/permissions/apply.py +420 -0
  11. src_auth_perms_sync/permissions/command.py +918 -0
  12. src_auth_perms_sync/permissions/full_set.py +880 -0
  13. src_auth_perms_sync/permissions/mapping.py +627 -0
  14. src_auth_perms_sync/permissions/maps.py +291 -0
  15. src_auth_perms_sync/permissions/queries.py +180 -0
  16. src_auth_perms_sync/permissions/restore.py +913 -0
  17. src_auth_perms_sync/permissions/snapshot.py +1502 -0
  18. src_auth_perms_sync/permissions/sourcegraph.py +392 -0
  19. src_auth_perms_sync/permissions/types.py +116 -0
  20. src_auth_perms_sync/permissions/workflow.py +526 -0
  21. src_auth_perms_sync/shared/__init__.py +1 -0
  22. src_auth_perms_sync/shared/backups.py +119 -0
  23. src_auth_perms_sync/shared/id_codec.py +67 -0
  24. src_auth_perms_sync/shared/queries.py +65 -0
  25. src_auth_perms_sync/shared/run_context.py +34 -0
  26. src_auth_perms_sync/shared/saml_groups.py +267 -0
  27. src_auth_perms_sync/shared/site_config.py +366 -0
  28. src_auth_perms_sync/shared/sourcegraph.py +69 -0
  29. src_auth_perms_sync/shared/types.py +69 -0
  30. src_auth_perms_sync-0.2.1.dist-info/METADATA +256 -0
  31. src_auth_perms_sync-0.2.1.dist-info/RECORD +34 -0
  32. src_auth_perms_sync-0.2.1.dist-info/WHEEL +4 -0
  33. src_auth_perms_sync-0.2.1.dist-info/entry_points.txt +2 -0
  34. src_auth_perms_sync-0.2.1.dist-info/licenses/LICENSE +21 -0
@@ -0,0 +1,44 @@
1
+ """GraphQL operations for Sourcegraph organization sync."""
2
+
3
+ from __future__ import annotations
4
+
5
+ QUERY_ORGANIZATION_MEMBERS_PAGE = """
6
+ query OrganizationMembersPage($id: ID!, $first: Int!, $after: String) {
7
+ node(id: $id) {
8
+ ... on Org {
9
+ id
10
+ name
11
+ members(first: $first, after: $after) {
12
+ totalCount
13
+ nodes { id username }
14
+ pageInfo { hasNextPage endCursor }
15
+ }
16
+ }
17
+ }
18
+ }
19
+ """
20
+
21
+ MUTATION_CREATE_ORGANIZATION = """
22
+ mutation CreateOrganization($name: String!, $displayName: String) {
23
+ createOrganization(name: $name, displayName: $displayName) {
24
+ id
25
+ name
26
+ }
27
+ }
28
+ """
29
+
30
+ MUTATION_ADD_USER_TO_ORGANIZATION = """
31
+ mutation AddUserToOrganization($organization: ID!, $username: String!) {
32
+ addUserToOrganization(organization: $organization, username: $username) {
33
+ alwaysNil
34
+ }
35
+ }
36
+ """
37
+
38
+ MUTATION_REMOVE_USER_FROM_ORGANIZATION = """
39
+ mutation RemoveUserFromOrganization($organization: ID!, $user: ID!) {
40
+ removeUserFromOrganization(organization: $organization, user: $user) {
41
+ alwaysNil
42
+ }
43
+ }
44
+ """