catocli 2.0.5__py3-none-any.whl → 2.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.
Potentially problematic release.
This version of catocli might be problematic. Click here for more details.
- catocli/Utils/clidriver.py +32 -4
- catocli/Utils/version_checker.py +1 -1
- catocli/__init__.py +1 -1
- catocli/parsers/custom/export_sites/export_sites.py +18 -1
- catocli/parsers/custom/import_rules_to_tf/import_rules_to_tf.py +13 -2
- catocli/parsers/custom/import_sites_to_tf/__init__.py +3 -1
- catocli/parsers/custom/import_sites_to_tf/import_sites_to_tf.py +79 -6
- catocli/parsers/custom_private/__init__.py +134 -0
- catocli/parsers/mutation_accountManagement/__init__.py +13 -0
- catocli/parsers/mutation_accountManagement_disableAccount/README.md +16 -0
- catocli/parsers/mutation_groups/README.md +7 -0
- catocli/parsers/mutation_groups/__init__.py +48 -0
- catocli/parsers/mutation_groups_createGroup/README.md +18 -0
- catocli/parsers/mutation_groups_deleteGroup/README.md +18 -0
- catocli/parsers/mutation_groups_updateGroup/README.md +18 -0
- catocli/parsers/mutation_site/__init__.py +104 -0
- catocli/parsers/mutation_site_assignSiteBwLicense/README.md +17 -0
- catocli/parsers/mutation_site_removeSecondaryAwsVSocket/README.md +17 -0
- catocli/parsers/mutation_site_removeSecondaryAzureVSocket/README.md +17 -0
- catocli/parsers/mutation_site_removeSiteBwLicense/README.md +17 -0
- catocli/parsers/mutation_site_replaceSiteBwLicense/README.md +17 -0
- catocli/parsers/mutation_site_updateSecondaryAwsVSocket/README.md +17 -0
- catocli/parsers/mutation_site_updateSecondaryAzureVSocket/README.md +17 -0
- catocli/parsers/mutation_site_updateSiteBwLicense/README.md +17 -0
- catocli/parsers/mutation_site_updateSiteGeneralDetails/README.md +1 -1
- catocli/parsers/mutation_sites/__init__.py +104 -0
- catocli/parsers/mutation_sites_assignSiteBwLicense/README.md +17 -0
- catocli/parsers/mutation_sites_removeSecondaryAwsVSocket/README.md +17 -0
- catocli/parsers/mutation_sites_removeSecondaryAzureVSocket/README.md +17 -0
- catocli/parsers/mutation_sites_removeSiteBwLicense/README.md +17 -0
- catocli/parsers/mutation_sites_replaceSiteBwLicense/README.md +17 -0
- catocli/parsers/mutation_sites_updateSecondaryAwsVSocket/README.md +17 -0
- catocli/parsers/mutation_sites_updateSecondaryAzureVSocket/README.md +17 -0
- catocli/parsers/mutation_sites_updateSiteBwLicense/README.md +17 -0
- catocli/parsers/mutation_sites_updateSiteGeneralDetails/README.md +1 -1
- catocli/parsers/parserApiClient.py +444 -9
- catocli/parsers/query_eventsFeed/README.md +1 -1
- catocli/parsers/query_groups/README.md +7 -0
- catocli/parsers/query_groups/__init__.py +54 -0
- catocli/parsers/query_groups_group/README.md +7 -0
- catocli/parsers/query_groups_groupList/README.md +18 -0
- catocli/parsers/query_groups_group_members/README.md +18 -0
- catocli/parsers/query_groups_whereUsed/README.md +17 -0
- catocli/parsers/query_popLocations/README.md +17 -0
- catocli/parsers/query_popLocations/__init__.py +16 -0
- catocli/parsers/query_site/__init__.py +26 -0
- catocli/parsers/query_site_secondaryAwsVSocket/README.md +17 -0
- catocli/parsers/query_site_secondaryAzureVSocket/README.md +17 -0
- catocli/parsers/query_socketPortMetrics/README.md +23 -0
- catocli/parsers/query_socketPortMetrics/__init__.py +16 -0
- catocli/parsers/query_socketPortMetricsTimeSeries/README.md +24 -0
- catocli/parsers/query_socketPortMetricsTimeSeries/__init__.py +16 -0
- {catocli-2.0.5.dist-info → catocli-2.1.1.dist-info}/METADATA +3 -2
- {catocli-2.0.5.dist-info → catocli-2.1.1.dist-info}/RECORD +253 -300
- {catocli-2.0.5.dist-info → catocli-2.1.1.dist-info}/WHEEL +1 -1
- {catocli-2.0.5.dist-info → catocli-2.1.1.dist-info}/top_level.txt +0 -2
- graphql_client/api/call_api.py +20 -2
- models/mutation.accountManagement.addAccount.json +97 -0
- models/mutation.accountManagement.disableAccount.json +545 -0
- models/mutation.accountManagement.removeAccount.json +102 -3
- models/mutation.accountManagement.updateAccount.json +97 -0
- models/mutation.admin.addAdmin.json +6 -9
- models/mutation.container.delete.json +2 -2
- models/mutation.container.fqdn.addValues.json +3 -3
- models/mutation.container.fqdn.createFromFile.json +3 -3
- models/mutation.container.fqdn.removeValues.json +3 -3
- models/mutation.container.fqdn.updateFromFile.json +3 -3
- models/mutation.container.ipAddressRange.addValues.json +3 -3
- models/mutation.container.ipAddressRange.createFromFile.json +3 -3
- models/mutation.container.ipAddressRange.removeValues.json +3 -3
- models/mutation.container.ipAddressRange.updateFromFile.json +3 -3
- models/mutation.groups.createGroup.json +3178 -0
- models/mutation.groups.deleteGroup.json +2758 -0
- models/mutation.groups.updateGroup.json +4429 -0
- models/mutation.hardware.updateHardwareShipping.json +30 -10
- models/mutation.policy.appTenantRestriction.addRule.json +33 -33
- models/mutation.policy.appTenantRestriction.addSection.json +4 -4
- models/mutation.policy.appTenantRestriction.createPolicyRevision.json +33 -33
- models/mutation.policy.appTenantRestriction.discardPolicyRevision.json +33 -33
- models/mutation.policy.appTenantRestriction.moveRule.json +27 -27
- models/mutation.policy.appTenantRestriction.moveSection.json +4 -4
- models/mutation.policy.appTenantRestriction.publishPolicyRevision.json +33 -33
- models/mutation.policy.appTenantRestriction.removeRule.json +27 -27
- models/mutation.policy.appTenantRestriction.removeSection.json +4 -4
- models/mutation.policy.appTenantRestriction.updatePolicy.json +33 -33
- models/mutation.policy.appTenantRestriction.updateRule.json +33 -33
- models/mutation.policy.appTenantRestriction.updateSection.json +4 -4
- models/mutation.policy.dynamicIpAllocation.addRule.json +12 -12
- models/mutation.policy.dynamicIpAllocation.addSection.json +4 -4
- models/mutation.policy.dynamicIpAllocation.createPolicyRevision.json +18 -18
- models/mutation.policy.dynamicIpAllocation.discardPolicyRevision.json +18 -18
- models/mutation.policy.dynamicIpAllocation.moveRule.json +12 -12
- models/mutation.policy.dynamicIpAllocation.moveSection.json +4 -4
- models/mutation.policy.dynamicIpAllocation.publishPolicyRevision.json +18 -18
- models/mutation.policy.dynamicIpAllocation.removeRule.json +12 -12
- models/mutation.policy.dynamicIpAllocation.removeSection.json +4 -4
- models/mutation.policy.dynamicIpAllocation.updatePolicy.json +18 -18
- models/mutation.policy.dynamicIpAllocation.updateRule.json +12 -12
- models/mutation.policy.dynamicIpAllocation.updateSection.json +4 -4
- models/mutation.policy.internetFirewall.addRule.json +141 -141
- models/mutation.policy.internetFirewall.addSection.json +4 -4
- models/mutation.policy.internetFirewall.createPolicyRevision.json +102 -102
- models/mutation.policy.internetFirewall.discardPolicyRevision.json +102 -102
- models/mutation.policy.internetFirewall.moveRule.json +96 -96
- models/mutation.policy.internetFirewall.moveSection.json +4 -4
- models/mutation.policy.internetFirewall.publishPolicyRevision.json +102 -102
- models/mutation.policy.internetFirewall.removeRule.json +96 -96
- models/mutation.policy.internetFirewall.removeSection.json +4 -4
- models/mutation.policy.internetFirewall.updatePolicy.json +102 -102
- models/mutation.policy.internetFirewall.updateRule.json +141 -141
- models/mutation.policy.internetFirewall.updateSection.json +4 -4
- models/mutation.policy.remotePortFwd.addRule.json +21 -21
- models/mutation.policy.remotePortFwd.addSection.json +4 -4
- models/mutation.policy.remotePortFwd.createPolicyRevision.json +24 -24
- models/mutation.policy.remotePortFwd.discardPolicyRevision.json +24 -24
- models/mutation.policy.remotePortFwd.moveRule.json +18 -18
- models/mutation.policy.remotePortFwd.moveSection.json +4 -4
- models/mutation.policy.remotePortFwd.publishPolicyRevision.json +24 -24
- models/mutation.policy.remotePortFwd.removeRule.json +18 -18
- models/mutation.policy.remotePortFwd.removeSection.json +4 -4
- models/mutation.policy.remotePortFwd.updatePolicy.json +24 -24
- models/mutation.policy.remotePortFwd.updateRule.json +21 -21
- models/mutation.policy.remotePortFwd.updateSection.json +4 -4
- models/mutation.policy.socketLan.addRule.json +97 -97
- models/mutation.policy.socketLan.addSection.json +4 -4
- models/mutation.policy.socketLan.createPolicyRevision.json +91 -91
- models/mutation.policy.socketLan.discardPolicyRevision.json +91 -91
- models/mutation.policy.socketLan.moveRule.json +85 -85
- models/mutation.policy.socketLan.moveSection.json +4 -4
- models/mutation.policy.socketLan.publishPolicyRevision.json +91 -91
- models/mutation.policy.socketLan.removeRule.json +85 -85
- models/mutation.policy.socketLan.removeSection.json +4 -4
- models/mutation.policy.socketLan.updatePolicy.json +91 -91
- models/mutation.policy.socketLan.updateRule.json +97 -97
- models/mutation.policy.socketLan.updateSection.json +4 -4
- models/mutation.policy.terminalServer.addRule.json +7 -7
- models/mutation.policy.terminalServer.addSection.json +4 -4
- models/mutation.policy.terminalServer.createPolicyRevision.json +13 -13
- models/mutation.policy.terminalServer.discardPolicyRevision.json +13 -13
- models/mutation.policy.terminalServer.moveRule.json +7 -7
- models/mutation.policy.terminalServer.moveSection.json +4 -4
- models/mutation.policy.terminalServer.publishPolicyRevision.json +13 -13
- models/mutation.policy.terminalServer.removeRule.json +7 -7
- models/mutation.policy.terminalServer.removeSection.json +4 -4
- models/mutation.policy.terminalServer.updatePolicy.json +13 -13
- models/mutation.policy.terminalServer.updateRule.json +7 -7
- models/mutation.policy.terminalServer.updateSection.json +4 -4
- models/mutation.policy.wanFirewall.addRule.json +157 -157
- models/mutation.policy.wanFirewall.addSection.json +4 -4
- models/mutation.policy.wanFirewall.createPolicyRevision.json +121 -121
- models/mutation.policy.wanFirewall.discardPolicyRevision.json +121 -121
- models/mutation.policy.wanFirewall.moveRule.json +115 -115
- models/mutation.policy.wanFirewall.moveSection.json +4 -4
- models/mutation.policy.wanFirewall.publishPolicyRevision.json +121 -121
- models/mutation.policy.wanFirewall.removeRule.json +115 -115
- models/mutation.policy.wanFirewall.removeSection.json +4 -4
- models/mutation.policy.wanFirewall.updatePolicy.json +121 -121
- models/mutation.policy.wanFirewall.updateRule.json +157 -157
- models/mutation.policy.wanFirewall.updateSection.json +4 -4
- models/mutation.policy.wanNetwork.addRule.json +103 -103
- models/mutation.policy.wanNetwork.addSection.json +4 -4
- models/mutation.policy.wanNetwork.createPolicyRevision.json +97 -97
- models/mutation.policy.wanNetwork.discardPolicyRevision.json +97 -97
- models/mutation.policy.wanNetwork.moveRule.json +91 -91
- models/mutation.policy.wanNetwork.moveSection.json +4 -4
- models/mutation.policy.wanNetwork.publishPolicyRevision.json +97 -97
- models/mutation.policy.wanNetwork.removeRule.json +91 -91
- models/mutation.policy.wanNetwork.removeSection.json +4 -4
- models/mutation.policy.wanNetwork.updatePolicy.json +97 -97
- models/mutation.policy.wanNetwork.updateRule.json +103 -103
- models/mutation.policy.wanNetwork.updateSection.json +4 -4
- models/mutation.site.addBgpPeer.json +10 -10
- models/mutation.site.addIpsecIkeV2SiteTunnels.json +2 -2
- models/mutation.site.addSocketAddOnCard.json +2 -2
- models/mutation.site.assignSiteBwLicense.json +12879 -0
- models/mutation.site.removeBgpPeer.json +10 -10
- models/mutation.site.removeIpsecIkeV2SiteTunnels.json +2 -2
- models/mutation.site.removeSecondaryAwsVSocket.json +375 -0
- models/mutation.site.removeSecondaryAzureVSocket.json +354 -0
- models/mutation.site.removeSiteBwLicense.json +12822 -0
- models/mutation.site.removeSocketAddOnCard.json +2 -2
- models/mutation.site.replaceSiteBwLicense.json +12939 -0
- models/mutation.site.startSiteUpgrade.json +36 -15
- models/mutation.site.updateBgpPeer.json +10 -10
- models/mutation.site.updateIpsecIkeV2SiteTunnels.json +2 -2
- models/mutation.site.updateSecondaryAwsVSocket.json +643 -0
- models/mutation.site.updateSecondaryAzureVSocket.json +565 -0
- models/mutation.site.updateSiteBwLicense.json +12882 -0
- models/mutation.site.updateSiteGeneralDetails.json +724 -1
- models/mutation.sites.addBgpPeer.json +10 -10
- models/mutation.sites.addIpsecIkeV2SiteTunnels.json +2 -2
- models/mutation.sites.addSocketAddOnCard.json +2 -2
- models/mutation.sites.assignSiteBwLicense.json +12879 -0
- models/mutation.sites.removeBgpPeer.json +10 -10
- models/mutation.sites.removeIpsecIkeV2SiteTunnels.json +2 -2
- models/mutation.sites.removeSecondaryAwsVSocket.json +375 -0
- models/mutation.sites.removeSecondaryAzureVSocket.json +354 -0
- models/mutation.sites.removeSiteBwLicense.json +12822 -0
- models/mutation.sites.removeSocketAddOnCard.json +2 -2
- models/mutation.sites.replaceSiteBwLicense.json +12939 -0
- models/mutation.sites.startSiteUpgrade.json +36 -15
- models/mutation.sites.updateBgpPeer.json +10 -10
- models/mutation.sites.updateIpsecIkeV2SiteTunnels.json +2 -2
- models/mutation.sites.updateSecondaryAwsVSocket.json +643 -0
- models/mutation.sites.updateSecondaryAzureVSocket.json +565 -0
- models/mutation.sites.updateSiteBwLicense.json +12882 -0
- models/mutation.sites.updateSiteGeneralDetails.json +724 -1
- models/mutation.xdr.addStoryComment.json +1 -1
- models/mutation.xdr.analystFeedback.json +84 -84
- models/mutation.xdr.deleteStoryComment.json +1 -1
- models/query.accountManagement.json +97 -0
- models/query.accountMetrics.json +45 -45
- models/query.accountSnapshot.json +30 -30
- models/query.admin.json +6 -6
- models/query.admins.json +13 -13
- models/query.appStats.json +915 -867
- models/query.appStatsTimeSeries.json +692 -656
- models/query.auditFeed.json +6 -6
- models/query.catalogs.json +52 -52
- models/query.container.json +16 -16
- models/query.devices.json +20 -93
- models/query.entityLookup.json +2 -2
- models/query.events.json +288 -384
- models/query.eventsFeed.json +73 -97
- models/query.eventsTimeSeries.json +219 -291
- models/query.groups.group.members.json +3058 -0
- models/query.groups.groupList.json +6474 -0
- models/query.groups.whereUsed.json +697 -0
- models/query.hardware.json +27 -7
- models/query.hardwareManagement.json +8 -8
- models/query.licensing.json +3487 -1324
- models/query.policy.appTenantRestriction.policy.json +32 -32
- models/query.policy.dynamicIpAllocation.policy.json +18 -18
- models/query.policy.internetFirewall.policy.json +93 -93
- models/query.policy.remotePortFwd.policy.json +23 -23
- models/query.policy.socketLan.policy.json +88 -88
- models/query.policy.terminalServer.policy.json +13 -13
- models/query.policy.wanFirewall.policy.json +111 -111
- models/query.policy.wanNetwork.policy.json +97 -97
- models/query.popLocations.json +2878 -0
- models/query.sandbox.json +5 -5
- models/query.site.bgpPeer.json +4 -4
- models/query.site.bgpPeerList.json +10 -10
- models/query.site.secondaryAwsVSocket.json +340 -0
- models/query.site.secondaryAzureVSocket.json +319 -0
- models/query.site.siteBgpStatus.json +2 -2
- models/query.socketPortMetrics.json +2410 -0
- models/query.socketPortMetricsTimeSeries.json +2361 -0
- models/query.xdr.stories.json +104 -104
- models/query.xdr.story.json +93 -93
- schema/catolib.py +43 -16
- build/lib/catocli/Utils/clidriver.py +0 -268
- build/lib/catocli/Utils/profile_manager.py +0 -188
- build/lib/catocli/Utils/version_checker.py +0 -192
- build/lib/catocli/__init__.py +0 -2
- build/lib/catocli/__main__.py +0 -12
- build/lib/catocli/parsers/configure/__init__.py +0 -115
- build/lib/catocli/parsers/configure/configure.py +0 -307
- build/lib/catocli/parsers/custom/__init__.py +0 -57
- build/lib/catocli/parsers/custom/customLib.py +0 -561
- build/lib/catocli/parsers/custom/export_rules/__init__.py +0 -42
- build/lib/catocli/parsers/custom/export_rules/export_rules.py +0 -234
- build/lib/catocli/parsers/custom/export_sites/__init__.py +0 -21
- build/lib/catocli/parsers/custom/export_sites/export_sites.py +0 -372
- build/lib/catocli/parsers/custom/import_rules_to_tf/__init__.py +0 -58
- build/lib/catocli/parsers/custom/import_rules_to_tf/import_rules_to_tf.py +0 -451
- build/lib/catocli/parsers/custom/import_sites_to_tf/__init__.py +0 -45
- build/lib/catocli/parsers/custom/import_sites_to_tf/import_sites_to_tf.py +0 -891
- build/lib/catocli/parsers/mutation_accountManagement/__init__.py +0 -48
- build/lib/catocli/parsers/mutation_admin/__init__.py +0 -48
- build/lib/catocli/parsers/mutation_container/__init__.py +0 -138
- build/lib/catocli/parsers/mutation_hardware/__init__.py +0 -22
- build/lib/catocli/parsers/mutation_policy/__init__.py +0 -1305
- build/lib/catocli/parsers/mutation_sandbox/__init__.py +0 -35
- build/lib/catocli/parsers/mutation_site/__init__.py +0 -373
- build/lib/catocli/parsers/mutation_sites/__init__.py +0 -373
- build/lib/catocli/parsers/mutation_xdr/__init__.py +0 -48
- build/lib/catocli/parsers/parserApiClient.py +0 -513
- build/lib/catocli/parsers/query_accountBySubdomain/__init__.py +0 -16
- build/lib/catocli/parsers/query_accountManagement/__init__.py +0 -16
- build/lib/catocli/parsers/query_accountMetrics/__init__.py +0 -16
- build/lib/catocli/parsers/query_accountRoles/__init__.py +0 -16
- build/lib/catocli/parsers/query_accountSnapshot/__init__.py +0 -16
- build/lib/catocli/parsers/query_admin/__init__.py +0 -16
- build/lib/catocli/parsers/query_admins/__init__.py +0 -16
- build/lib/catocli/parsers/query_appStats/__init__.py +0 -16
- build/lib/catocli/parsers/query_appStatsTimeSeries/__init__.py +0 -16
- build/lib/catocli/parsers/query_auditFeed/__init__.py +0 -16
- build/lib/catocli/parsers/query_catalogs/__init__.py +0 -16
- build/lib/catocli/parsers/query_container/__init__.py +0 -16
- build/lib/catocli/parsers/query_devices/__init__.py +0 -16
- build/lib/catocli/parsers/query_entityLookup/__init__.py +0 -16
- build/lib/catocli/parsers/query_events/__init__.py +0 -16
- build/lib/catocli/parsers/query_eventsFeed/__init__.py +0 -16
- build/lib/catocli/parsers/query_eventsTimeSeries/__init__.py +0 -16
- build/lib/catocli/parsers/query_hardware/__init__.py +0 -16
- build/lib/catocli/parsers/query_hardwareManagement/__init__.py +0 -16
- build/lib/catocli/parsers/query_licensing/__init__.py +0 -16
- build/lib/catocli/parsers/query_policy/__init__.py +0 -161
- build/lib/catocli/parsers/query_sandbox/__init__.py +0 -16
- build/lib/catocli/parsers/query_site/__init__.py +0 -100
- build/lib/catocli/parsers/query_siteLocation/__init__.py +0 -13
- build/lib/catocli/parsers/query_subDomains/__init__.py +0 -16
- build/lib/catocli/parsers/query_xdr/__init__.py +0 -35
- build/lib/catocli/parsers/raw/__init__.py +0 -12
- build/lib/graphql_client/__init__.py +0 -11
- build/lib/graphql_client/api/__init__.py +0 -3
- build/lib/graphql_client/api/call_api.py +0 -84
- build/lib/graphql_client/api_client.py +0 -192
- build/lib/graphql_client/api_client_types.py +0 -409
- build/lib/graphql_client/configuration.py +0 -232
- build/lib/graphql_client/models/__init__.py +0 -13
- build/lib/graphql_client/models/no_schema.py +0 -71
- build/lib/schema/catolib.py +0 -1141
- build/lib/schema/importSchema.py +0 -60
- build/lib/schema/remove_policyid.py +0 -89
- build/lib/schema/remove_policyid_mutations.py +0 -89
- build/lib/scripts/catolib.py +0 -62
- build/lib/scripts/export_if_rules_to_json.py +0 -188
- build/lib/scripts/export_wf_rules_to_json.py +0 -111
- build/lib/scripts/import_wf_rules_to_tfstate.py +0 -331
- build/lib/vendor/certifi/__init__.py +0 -4
- build/lib/vendor/certifi/__main__.py +0 -12
- build/lib/vendor/certifi/core.py +0 -114
- build/lib/vendor/certifi/py.typed +0 -0
- build/lib/vendor/six.py +0 -998
- build/lib/vendor/urllib3/__init__.py +0 -211
- build/lib/vendor/urllib3/_base_connection.py +0 -172
- build/lib/vendor/urllib3/_collections.py +0 -483
- build/lib/vendor/urllib3/_request_methods.py +0 -278
- build/lib/vendor/urllib3/_version.py +0 -16
- build/lib/vendor/urllib3/connection.py +0 -1033
- build/lib/vendor/urllib3/connectionpool.py +0 -1182
- build/lib/vendor/urllib3/contrib/__init__.py +0 -0
- build/lib/vendor/urllib3/contrib/emscripten/__init__.py +0 -18
- build/lib/vendor/urllib3/contrib/emscripten/connection.py +0 -254
- build/lib/vendor/urllib3/contrib/emscripten/fetch.py +0 -418
- build/lib/vendor/urllib3/contrib/emscripten/request.py +0 -22
- build/lib/vendor/urllib3/contrib/emscripten/response.py +0 -285
- build/lib/vendor/urllib3/contrib/pyopenssl.py +0 -552
- build/lib/vendor/urllib3/contrib/socks.py +0 -228
- build/lib/vendor/urllib3/exceptions.py +0 -321
- build/lib/vendor/urllib3/fields.py +0 -341
- build/lib/vendor/urllib3/filepost.py +0 -89
- build/lib/vendor/urllib3/http2/__init__.py +0 -53
- build/lib/vendor/urllib3/http2/connection.py +0 -356
- build/lib/vendor/urllib3/http2/probe.py +0 -87
- build/lib/vendor/urllib3/poolmanager.py +0 -637
- build/lib/vendor/urllib3/py.typed +0 -2
- build/lib/vendor/urllib3/response.py +0 -1265
- build/lib/vendor/urllib3/util/__init__.py +0 -42
- build/lib/vendor/urllib3/util/connection.py +0 -137
- build/lib/vendor/urllib3/util/proxy.py +0 -43
- build/lib/vendor/urllib3/util/request.py +0 -256
- build/lib/vendor/urllib3/util/response.py +0 -101
- build/lib/vendor/urllib3/util/retry.py +0 -533
- build/lib/vendor/urllib3/util/ssl_.py +0 -513
- build/lib/vendor/urllib3/util/ssl_match_hostname.py +0 -159
- build/lib/vendor/urllib3/util/ssltransport.py +0 -276
- build/lib/vendor/urllib3/util/timeout.py +0 -275
- build/lib/vendor/urllib3/util/url.py +0 -471
- build/lib/vendor/urllib3/util/util.py +0 -42
- build/lib/vendor/urllib3/util/wait.py +0 -124
- {catocli-2.0.5.dist-info → catocli-2.1.1.dist-info}/entry_points.txt +0 -0
- {catocli-2.0.5.dist-info → catocli-2.1.1.dist-info/licenses}/LICENSE +0 -0
|
@@ -1,356 +0,0 @@
|
|
|
1
|
-
from __future__ import annotations
|
|
2
|
-
|
|
3
|
-
import logging
|
|
4
|
-
import re
|
|
5
|
-
import threading
|
|
6
|
-
import types
|
|
7
|
-
import typing
|
|
8
|
-
|
|
9
|
-
import h2.config # type: ignore[import-untyped]
|
|
10
|
-
import h2.connection # type: ignore[import-untyped]
|
|
11
|
-
import h2.events # type: ignore[import-untyped]
|
|
12
|
-
|
|
13
|
-
from .._base_connection import _TYPE_BODY
|
|
14
|
-
from .._collections import HTTPHeaderDict
|
|
15
|
-
from ..connection import HTTPSConnection, _get_default_user_agent
|
|
16
|
-
from ..exceptions import ConnectionError
|
|
17
|
-
from ..response import BaseHTTPResponse
|
|
18
|
-
|
|
19
|
-
orig_HTTPSConnection = HTTPSConnection
|
|
20
|
-
|
|
21
|
-
T = typing.TypeVar("T")
|
|
22
|
-
|
|
23
|
-
log = logging.getLogger(__name__)
|
|
24
|
-
|
|
25
|
-
RE_IS_LEGAL_HEADER_NAME = re.compile(rb"^[!#$%&'*+\-.^_`|~0-9a-z]+$")
|
|
26
|
-
RE_IS_ILLEGAL_HEADER_VALUE = re.compile(rb"[\0\x00\x0a\x0d\r\n]|^[ \r\n\t]|[ \r\n\t]$")
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
def _is_legal_header_name(name: bytes) -> bool:
|
|
30
|
-
"""
|
|
31
|
-
"An implementation that validates fields according to the definitions in Sections
|
|
32
|
-
5.1 and 5.5 of [HTTP] only needs an additional check that field names do not
|
|
33
|
-
include uppercase characters." (https://httpwg.org/specs/rfc9113.html#n-field-validity)
|
|
34
|
-
|
|
35
|
-
`http.client._is_legal_header_name` does not validate the field name according to the
|
|
36
|
-
HTTP 1.1 spec, so we do that here, in addition to checking for uppercase characters.
|
|
37
|
-
|
|
38
|
-
This does not allow for the `:` character in the header name, so should not
|
|
39
|
-
be used to validate pseudo-headers.
|
|
40
|
-
"""
|
|
41
|
-
return bool(RE_IS_LEGAL_HEADER_NAME.match(name))
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
def _is_illegal_header_value(value: bytes) -> bool:
|
|
45
|
-
"""
|
|
46
|
-
"A field value MUST NOT contain the zero value (ASCII NUL, 0x00), line feed
|
|
47
|
-
(ASCII LF, 0x0a), or carriage return (ASCII CR, 0x0d) at any position. A field
|
|
48
|
-
value MUST NOT start or end with an ASCII whitespace character (ASCII SP or HTAB,
|
|
49
|
-
0x20 or 0x09)." (https://httpwg.org/specs/rfc9113.html#n-field-validity)
|
|
50
|
-
"""
|
|
51
|
-
return bool(RE_IS_ILLEGAL_HEADER_VALUE.search(value))
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
class _LockedObject(typing.Generic[T]):
|
|
55
|
-
"""
|
|
56
|
-
A wrapper class that hides a specific object behind a lock.
|
|
57
|
-
The goal here is to provide a simple way to protect access to an object
|
|
58
|
-
that cannot safely be simultaneously accessed from multiple threads. The
|
|
59
|
-
intended use of this class is simple: take hold of it with a context
|
|
60
|
-
manager, which returns the protected object.
|
|
61
|
-
"""
|
|
62
|
-
|
|
63
|
-
__slots__ = (
|
|
64
|
-
"lock",
|
|
65
|
-
"_obj",
|
|
66
|
-
)
|
|
67
|
-
|
|
68
|
-
def __init__(self, obj: T):
|
|
69
|
-
self.lock = threading.RLock()
|
|
70
|
-
self._obj = obj
|
|
71
|
-
|
|
72
|
-
def __enter__(self) -> T:
|
|
73
|
-
self.lock.acquire()
|
|
74
|
-
return self._obj
|
|
75
|
-
|
|
76
|
-
def __exit__(
|
|
77
|
-
self,
|
|
78
|
-
exc_type: type[BaseException] | None,
|
|
79
|
-
exc_val: BaseException | None,
|
|
80
|
-
exc_tb: types.TracebackType | None,
|
|
81
|
-
) -> None:
|
|
82
|
-
self.lock.release()
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
class HTTP2Connection(HTTPSConnection):
|
|
86
|
-
def __init__(
|
|
87
|
-
self, host: str, port: int | None = None, **kwargs: typing.Any
|
|
88
|
-
) -> None:
|
|
89
|
-
self._h2_conn = self._new_h2_conn()
|
|
90
|
-
self._h2_stream: int | None = None
|
|
91
|
-
self._headers: list[tuple[bytes, bytes]] = []
|
|
92
|
-
|
|
93
|
-
if "proxy" in kwargs or "proxy_config" in kwargs: # Defensive:
|
|
94
|
-
raise NotImplementedError("Proxies aren't supported with HTTP/2")
|
|
95
|
-
|
|
96
|
-
super().__init__(host, port, **kwargs)
|
|
97
|
-
|
|
98
|
-
if self._tunnel_host is not None:
|
|
99
|
-
raise NotImplementedError("Tunneling isn't supported with HTTP/2")
|
|
100
|
-
|
|
101
|
-
def _new_h2_conn(self) -> _LockedObject[h2.connection.H2Connection]:
|
|
102
|
-
config = h2.config.H2Configuration(client_side=True)
|
|
103
|
-
return _LockedObject(h2.connection.H2Connection(config=config))
|
|
104
|
-
|
|
105
|
-
def connect(self) -> None:
|
|
106
|
-
super().connect()
|
|
107
|
-
with self._h2_conn as conn:
|
|
108
|
-
conn.initiate_connection()
|
|
109
|
-
if data_to_send := conn.data_to_send():
|
|
110
|
-
self.sock.sendall(data_to_send)
|
|
111
|
-
|
|
112
|
-
def putrequest( # type: ignore[override]
|
|
113
|
-
self,
|
|
114
|
-
method: str,
|
|
115
|
-
url: str,
|
|
116
|
-
**kwargs: typing.Any,
|
|
117
|
-
) -> None:
|
|
118
|
-
"""putrequest
|
|
119
|
-
This deviates from the HTTPConnection method signature since we never need to override
|
|
120
|
-
sending accept-encoding headers or the host header.
|
|
121
|
-
"""
|
|
122
|
-
if "skip_host" in kwargs:
|
|
123
|
-
raise NotImplementedError("`skip_host` isn't supported")
|
|
124
|
-
if "skip_accept_encoding" in kwargs:
|
|
125
|
-
raise NotImplementedError("`skip_accept_encoding` isn't supported")
|
|
126
|
-
|
|
127
|
-
self._request_url = url or "/"
|
|
128
|
-
self._validate_path(url) # type: ignore[attr-defined]
|
|
129
|
-
|
|
130
|
-
if ":" in self.host:
|
|
131
|
-
authority = f"[{self.host}]:{self.port or 443}"
|
|
132
|
-
else:
|
|
133
|
-
authority = f"{self.host}:{self.port or 443}"
|
|
134
|
-
|
|
135
|
-
self._headers.append((b":scheme", b"https"))
|
|
136
|
-
self._headers.append((b":method", method.encode()))
|
|
137
|
-
self._headers.append((b":authority", authority.encode()))
|
|
138
|
-
self._headers.append((b":path", url.encode()))
|
|
139
|
-
|
|
140
|
-
with self._h2_conn as conn:
|
|
141
|
-
self._h2_stream = conn.get_next_available_stream_id()
|
|
142
|
-
|
|
143
|
-
def putheader(self, header: str | bytes, *values: str | bytes) -> None:
|
|
144
|
-
# TODO SKIPPABLE_HEADERS from urllib3 are ignored.
|
|
145
|
-
header = header.encode() if isinstance(header, str) else header
|
|
146
|
-
header = header.lower() # A lot of upstream code uses capitalized headers.
|
|
147
|
-
if not _is_legal_header_name(header):
|
|
148
|
-
raise ValueError(f"Illegal header name {str(header)}")
|
|
149
|
-
|
|
150
|
-
for value in values:
|
|
151
|
-
value = value.encode() if isinstance(value, str) else value
|
|
152
|
-
if _is_illegal_header_value(value):
|
|
153
|
-
raise ValueError(f"Illegal header value {str(value)}")
|
|
154
|
-
self._headers.append((header, value))
|
|
155
|
-
|
|
156
|
-
def endheaders(self, message_body: typing.Any = None) -> None: # type: ignore[override]
|
|
157
|
-
if self._h2_stream is None:
|
|
158
|
-
raise ConnectionError("Must call `putrequest` first.")
|
|
159
|
-
|
|
160
|
-
with self._h2_conn as conn:
|
|
161
|
-
conn.send_headers(
|
|
162
|
-
stream_id=self._h2_stream,
|
|
163
|
-
headers=self._headers,
|
|
164
|
-
end_stream=(message_body is None),
|
|
165
|
-
)
|
|
166
|
-
if data_to_send := conn.data_to_send():
|
|
167
|
-
self.sock.sendall(data_to_send)
|
|
168
|
-
self._headers = [] # Reset headers for the next request.
|
|
169
|
-
|
|
170
|
-
def send(self, data: typing.Any) -> None:
|
|
171
|
-
"""Send data to the server.
|
|
172
|
-
`data` can be: `str`, `bytes`, an iterable, or file-like objects
|
|
173
|
-
that support a .read() method.
|
|
174
|
-
"""
|
|
175
|
-
if self._h2_stream is None:
|
|
176
|
-
raise ConnectionError("Must call `putrequest` first.")
|
|
177
|
-
|
|
178
|
-
with self._h2_conn as conn:
|
|
179
|
-
if data_to_send := conn.data_to_send():
|
|
180
|
-
self.sock.sendall(data_to_send)
|
|
181
|
-
|
|
182
|
-
if hasattr(data, "read"): # file-like objects
|
|
183
|
-
while True:
|
|
184
|
-
chunk = data.read(self.blocksize)
|
|
185
|
-
if not chunk:
|
|
186
|
-
break
|
|
187
|
-
if isinstance(chunk, str):
|
|
188
|
-
chunk = chunk.encode() # pragma: no cover
|
|
189
|
-
conn.send_data(self._h2_stream, chunk, end_stream=False)
|
|
190
|
-
if data_to_send := conn.data_to_send():
|
|
191
|
-
self.sock.sendall(data_to_send)
|
|
192
|
-
conn.end_stream(self._h2_stream)
|
|
193
|
-
return
|
|
194
|
-
|
|
195
|
-
if isinstance(data, str): # str -> bytes
|
|
196
|
-
data = data.encode()
|
|
197
|
-
|
|
198
|
-
try:
|
|
199
|
-
if isinstance(data, bytes):
|
|
200
|
-
conn.send_data(self._h2_stream, data, end_stream=True)
|
|
201
|
-
if data_to_send := conn.data_to_send():
|
|
202
|
-
self.sock.sendall(data_to_send)
|
|
203
|
-
else:
|
|
204
|
-
for chunk in data:
|
|
205
|
-
conn.send_data(self._h2_stream, chunk, end_stream=False)
|
|
206
|
-
if data_to_send := conn.data_to_send():
|
|
207
|
-
self.sock.sendall(data_to_send)
|
|
208
|
-
conn.end_stream(self._h2_stream)
|
|
209
|
-
except TypeError:
|
|
210
|
-
raise TypeError(
|
|
211
|
-
"`data` should be str, bytes, iterable, or file. got %r"
|
|
212
|
-
% type(data)
|
|
213
|
-
)
|
|
214
|
-
|
|
215
|
-
def set_tunnel(
|
|
216
|
-
self,
|
|
217
|
-
host: str,
|
|
218
|
-
port: int | None = None,
|
|
219
|
-
headers: typing.Mapping[str, str] | None = None,
|
|
220
|
-
scheme: str = "http",
|
|
221
|
-
) -> None:
|
|
222
|
-
raise NotImplementedError(
|
|
223
|
-
"HTTP/2 does not support setting up a tunnel through a proxy"
|
|
224
|
-
)
|
|
225
|
-
|
|
226
|
-
def getresponse( # type: ignore[override]
|
|
227
|
-
self,
|
|
228
|
-
) -> HTTP2Response:
|
|
229
|
-
status = None
|
|
230
|
-
data = bytearray()
|
|
231
|
-
with self._h2_conn as conn:
|
|
232
|
-
end_stream = False
|
|
233
|
-
while not end_stream:
|
|
234
|
-
# TODO: Arbitrary read value.
|
|
235
|
-
if received_data := self.sock.recv(65535):
|
|
236
|
-
events = conn.receive_data(received_data)
|
|
237
|
-
for event in events:
|
|
238
|
-
if isinstance(event, h2.events.ResponseReceived):
|
|
239
|
-
headers = HTTPHeaderDict()
|
|
240
|
-
for header, value in event.headers:
|
|
241
|
-
if header == b":status":
|
|
242
|
-
status = int(value.decode())
|
|
243
|
-
else:
|
|
244
|
-
headers.add(
|
|
245
|
-
header.decode("ascii"), value.decode("ascii")
|
|
246
|
-
)
|
|
247
|
-
|
|
248
|
-
elif isinstance(event, h2.events.DataReceived):
|
|
249
|
-
data += event.data
|
|
250
|
-
conn.acknowledge_received_data(
|
|
251
|
-
event.flow_controlled_length, event.stream_id
|
|
252
|
-
)
|
|
253
|
-
|
|
254
|
-
elif isinstance(event, h2.events.StreamEnded):
|
|
255
|
-
end_stream = True
|
|
256
|
-
|
|
257
|
-
if data_to_send := conn.data_to_send():
|
|
258
|
-
self.sock.sendall(data_to_send)
|
|
259
|
-
|
|
260
|
-
assert status is not None
|
|
261
|
-
return HTTP2Response(
|
|
262
|
-
status=status,
|
|
263
|
-
headers=headers,
|
|
264
|
-
request_url=self._request_url,
|
|
265
|
-
data=bytes(data),
|
|
266
|
-
)
|
|
267
|
-
|
|
268
|
-
def request( # type: ignore[override]
|
|
269
|
-
self,
|
|
270
|
-
method: str,
|
|
271
|
-
url: str,
|
|
272
|
-
body: _TYPE_BODY | None = None,
|
|
273
|
-
headers: typing.Mapping[str, str] | None = None,
|
|
274
|
-
*,
|
|
275
|
-
preload_content: bool = True,
|
|
276
|
-
decode_content: bool = True,
|
|
277
|
-
enforce_content_length: bool = True,
|
|
278
|
-
**kwargs: typing.Any,
|
|
279
|
-
) -> None:
|
|
280
|
-
"""Send an HTTP/2 request"""
|
|
281
|
-
if "chunked" in kwargs:
|
|
282
|
-
# TODO this is often present from upstream.
|
|
283
|
-
# raise NotImplementedError("`chunked` isn't supported with HTTP/2")
|
|
284
|
-
pass
|
|
285
|
-
|
|
286
|
-
if self.sock is not None:
|
|
287
|
-
self.sock.settimeout(self.timeout)
|
|
288
|
-
|
|
289
|
-
self.putrequest(method, url)
|
|
290
|
-
|
|
291
|
-
headers = headers or {}
|
|
292
|
-
for k, v in headers.items():
|
|
293
|
-
if k.lower() == "transfer-encoding" and v == "chunked":
|
|
294
|
-
continue
|
|
295
|
-
else:
|
|
296
|
-
self.putheader(k, v)
|
|
297
|
-
|
|
298
|
-
if b"user-agent" not in dict(self._headers):
|
|
299
|
-
self.putheader(b"user-agent", _get_default_user_agent())
|
|
300
|
-
|
|
301
|
-
if body:
|
|
302
|
-
self.endheaders(message_body=body)
|
|
303
|
-
self.send(body)
|
|
304
|
-
else:
|
|
305
|
-
self.endheaders()
|
|
306
|
-
|
|
307
|
-
def close(self) -> None:
|
|
308
|
-
with self._h2_conn as conn:
|
|
309
|
-
try:
|
|
310
|
-
conn.close_connection()
|
|
311
|
-
if data := conn.data_to_send():
|
|
312
|
-
self.sock.sendall(data)
|
|
313
|
-
except Exception:
|
|
314
|
-
pass
|
|
315
|
-
|
|
316
|
-
# Reset all our HTTP/2 connection state.
|
|
317
|
-
self._h2_conn = self._new_h2_conn()
|
|
318
|
-
self._h2_stream = None
|
|
319
|
-
self._headers = []
|
|
320
|
-
|
|
321
|
-
super().close()
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
class HTTP2Response(BaseHTTPResponse):
|
|
325
|
-
# TODO: This is a woefully incomplete response object, but works for non-streaming.
|
|
326
|
-
def __init__(
|
|
327
|
-
self,
|
|
328
|
-
status: int,
|
|
329
|
-
headers: HTTPHeaderDict,
|
|
330
|
-
request_url: str,
|
|
331
|
-
data: bytes,
|
|
332
|
-
decode_content: bool = False, # TODO: support decoding
|
|
333
|
-
) -> None:
|
|
334
|
-
super().__init__(
|
|
335
|
-
status=status,
|
|
336
|
-
headers=headers,
|
|
337
|
-
# Following CPython, we map HTTP versions to major * 10 + minor integers
|
|
338
|
-
version=20,
|
|
339
|
-
version_string="HTTP/2",
|
|
340
|
-
# No reason phrase in HTTP/2
|
|
341
|
-
reason=None,
|
|
342
|
-
decode_content=decode_content,
|
|
343
|
-
request_url=request_url,
|
|
344
|
-
)
|
|
345
|
-
self._data = data
|
|
346
|
-
self.length_remaining = 0
|
|
347
|
-
|
|
348
|
-
@property
|
|
349
|
-
def data(self) -> bytes:
|
|
350
|
-
return self._data
|
|
351
|
-
|
|
352
|
-
def get_redirect_location(self) -> None:
|
|
353
|
-
return None
|
|
354
|
-
|
|
355
|
-
def close(self) -> None:
|
|
356
|
-
pass
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
from __future__ import annotations
|
|
2
|
-
|
|
3
|
-
import threading
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
class _HTTP2ProbeCache:
|
|
7
|
-
__slots__ = (
|
|
8
|
-
"_lock",
|
|
9
|
-
"_cache_locks",
|
|
10
|
-
"_cache_values",
|
|
11
|
-
)
|
|
12
|
-
|
|
13
|
-
def __init__(self) -> None:
|
|
14
|
-
self._lock = threading.Lock()
|
|
15
|
-
self._cache_locks: dict[tuple[str, int], threading.RLock] = {}
|
|
16
|
-
self._cache_values: dict[tuple[str, int], bool | None] = {}
|
|
17
|
-
|
|
18
|
-
def acquire_and_get(self, host: str, port: int) -> bool | None:
|
|
19
|
-
# By the end of this block we know that
|
|
20
|
-
# _cache_[values,locks] is available.
|
|
21
|
-
value = None
|
|
22
|
-
with self._lock:
|
|
23
|
-
key = (host, port)
|
|
24
|
-
try:
|
|
25
|
-
value = self._cache_values[key]
|
|
26
|
-
# If it's a known value we return right away.
|
|
27
|
-
if value is not None:
|
|
28
|
-
return value
|
|
29
|
-
except KeyError:
|
|
30
|
-
self._cache_locks[key] = threading.RLock()
|
|
31
|
-
self._cache_values[key] = None
|
|
32
|
-
|
|
33
|
-
# If the value is unknown, we acquire the lock to signal
|
|
34
|
-
# to the requesting thread that the probe is in progress
|
|
35
|
-
# or that the current thread needs to return their findings.
|
|
36
|
-
key_lock = self._cache_locks[key]
|
|
37
|
-
key_lock.acquire()
|
|
38
|
-
try:
|
|
39
|
-
# If the by the time we get the lock the value has been
|
|
40
|
-
# updated we want to return the updated value.
|
|
41
|
-
value = self._cache_values[key]
|
|
42
|
-
|
|
43
|
-
# In case an exception like KeyboardInterrupt is raised here.
|
|
44
|
-
except BaseException as e: # Defensive:
|
|
45
|
-
assert not isinstance(e, KeyError) # KeyError shouldn't be possible.
|
|
46
|
-
key_lock.release()
|
|
47
|
-
raise
|
|
48
|
-
|
|
49
|
-
return value
|
|
50
|
-
|
|
51
|
-
def set_and_release(
|
|
52
|
-
self, host: str, port: int, supports_http2: bool | None
|
|
53
|
-
) -> None:
|
|
54
|
-
key = (host, port)
|
|
55
|
-
key_lock = self._cache_locks[key]
|
|
56
|
-
with key_lock: # Uses an RLock, so can be locked again from same thread.
|
|
57
|
-
if supports_http2 is None and self._cache_values[key] is not None:
|
|
58
|
-
raise ValueError(
|
|
59
|
-
"Cannot reset HTTP/2 support for origin after value has been set."
|
|
60
|
-
) # Defensive: not expected in normal usage
|
|
61
|
-
|
|
62
|
-
self._cache_values[key] = supports_http2
|
|
63
|
-
key_lock.release()
|
|
64
|
-
|
|
65
|
-
def _values(self) -> dict[tuple[str, int], bool | None]:
|
|
66
|
-
"""This function is for testing purposes only. Gets the current state of the probe cache"""
|
|
67
|
-
with self._lock:
|
|
68
|
-
return {k: v for k, v in self._cache_values.items()}
|
|
69
|
-
|
|
70
|
-
def _reset(self) -> None:
|
|
71
|
-
"""This function is for testing purposes only. Reset the cache values"""
|
|
72
|
-
with self._lock:
|
|
73
|
-
self._cache_locks = {}
|
|
74
|
-
self._cache_values = {}
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
_HTTP2_PROBE_CACHE = _HTTP2ProbeCache()
|
|
78
|
-
|
|
79
|
-
set_and_release = _HTTP2_PROBE_CACHE.set_and_release
|
|
80
|
-
acquire_and_get = _HTTP2_PROBE_CACHE.acquire_and_get
|
|
81
|
-
_values = _HTTP2_PROBE_CACHE._values
|
|
82
|
-
_reset = _HTTP2_PROBE_CACHE._reset
|
|
83
|
-
|
|
84
|
-
__all__ = [
|
|
85
|
-
"set_and_release",
|
|
86
|
-
"acquire_and_get",
|
|
87
|
-
]
|