{"id":18991042,"url":"https://github.com/pythongssapi/httpx-gssapi","last_synced_at":"2025-09-06T11:40:23.002Z","repository":{"id":39865964,"uuid":"248119023","full_name":"pythongssapi/httpx-gssapi","owner":"pythongssapi","description":"A GSSAPI authentication handler for Python's HTTPX","archived":false,"fork":false,"pushed_at":"2025-08-10T19:58:57.000Z","size":265,"stargazers_count":12,"open_issues_count":4,"forks_count":3,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-08-28T03:55:25.719Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pythongssapi.png","metadata":{"files":{"readme":"README.rst","changelog":"HISTORY.rst","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":"AUTHORS","dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2020-03-18T02:22:23.000Z","updated_at":"2024-11-28T20:24:41.000Z","dependencies_parsed_at":"2023-12-20T19:24:55.282Z","dependency_job_id":"23711acb-4226-4c92-9022-2f82d6bc123f","html_url":"https://github.com/pythongssapi/httpx-gssapi","commit_stats":{"total_commits":175,"total_committers":34,"mean_commits":5.147058823529412,"dds":0.7657142857142857,"last_synced_commit":"d88de2d63cc0504428bf3b7befedc636d1239bfc"},"previous_names":[],"tags_count":20,"template":false,"template_full_name":null,"purl":"pkg:github/pythongssapi/httpx-gssapi","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pythongssapi%2Fhttpx-gssapi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pythongssapi%2Fhttpx-gssapi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pythongssapi%2Fhttpx-gssapi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pythongssapi%2Fhttpx-gssapi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pythongssapi","download_url":"https://codeload.github.com/pythongssapi/httpx-gssapi/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pythongssapi%2Fhttpx-gssapi/sbom","scorecard":{"id":752353,"data":{"date":"2025-08-11","repo":{"name":"github.com/pythongssapi/httpx-gssapi","commit":"462d1f50246e8a151d56b3e07c234b42e4969afa"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.8,"checks":[{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Code-Review","score":0,"reason":"Found 1/21 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/ci.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 1 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:37: update your workflow using https://app.stepsecurity.io/secureworkflow/pythongssapi/httpx-gssapi/ci.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:41: update your workflow using https://app.stepsecurity.io/secureworkflow/pythongssapi/httpx-gssapi/ci.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:61: update your workflow using https://app.stepsecurity.io/secureworkflow/pythongssapi/httpx-gssapi/ci.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:65: update your workflow using https://app.stepsecurity.io/secureworkflow/pythongssapi/httpx-gssapi/ci.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:83: update your workflow using https://app.stepsecurity.io/secureworkflow/pythongssapi/httpx-gssapi/ci.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:94: update your workflow using https://app.stepsecurity.io/secureworkflow/pythongssapi/httpx-gssapi/ci.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:17: update your workflow using https://app.stepsecurity.io/secureworkflow/pythongssapi/httpx-gssapi/ci.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:19: update your workflow using https://app.stepsecurity.io/secureworkflow/pythongssapi/httpx-gssapi/ci.yml/main?enable=pin","Warn: pipCommand not pinned by hash: .github/workflows/ci.yml:70","Warn: pipCommand not pinned by hash: .github/workflows/ci.yml:71","Warn: pipCommand not pinned by hash: .github/workflows/ci.yml:24","Warn: pipCommand not pinned by hash: .github/workflows/ci.yml:25","Warn: pipCommand not pinned by hash: .github/workflows/ci.yml:46","Warn: pipCommand not pinned by hash: .github/workflows/ci.yml:47","Warn: pipCommand not pinned by hash: .github/workflows/ci.yml:48","Info:   0 out of   6 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   2 third-party GitHubAction dependencies pinned","Info:   0 out of   7 pipCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"License","score":9,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Warn: project license file does not contain an FSF or OSI license."],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Packaging","score":10,"reason":"packaging workflow detected","details":["Info: Project packages its releases by way of GitHub Actions.: .github/workflows/ci.yml:54"],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Signed-Releases","score":0,"reason":"Project has not signed or included provenance with any releases.","details":["Warn: release artifact v0.4 not signed: https://api.github.com/repos/pythongssapi/httpx-gssapi/releases/188100453","Warn: release artifact v0.3.1 not signed: https://api.github.com/repos/pythongssapi/httpx-gssapi/releases/143024946","Warn: release artifact v0.3 not signed: https://api.github.com/repos/pythongssapi/httpx-gssapi/releases/134679721","Warn: release artifact v0.2.1 not signed: https://api.github.com/repos/pythongssapi/httpx-gssapi/releases/121958150","Warn: release artifact v0.2 not signed: https://api.github.com/repos/pythongssapi/httpx-gssapi/releases/101665702","Warn: release artifact v0.4 does not have provenance: https://api.github.com/repos/pythongssapi/httpx-gssapi/releases/188100453","Warn: release artifact v0.3.1 does not have provenance: https://api.github.com/repos/pythongssapi/httpx-gssapi/releases/143024946","Warn: release artifact v0.3 does not have provenance: https://api.github.com/repos/pythongssapi/httpx-gssapi/releases/134679721","Warn: release artifact v0.2.1 does not have provenance: https://api.github.com/repos/pythongssapi/httpx-gssapi/releases/121958150","Warn: release artifact v0.2 does not have provenance: https://api.github.com/repos/pythongssapi/httpx-gssapi/releases/101665702"],"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 10 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-22T20:42:25.027Z","repository_id":39865964,"created_at":"2025-08-22T20:42:25.028Z","updated_at":"2025-08-22T20:42:25.028Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273898131,"owners_count":25187642,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-06T02:00:13.247Z","response_time":2576,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-08T17:12:32.695Z","updated_at":"2025-09-06T11:40:22.916Z","avatar_url":"https://github.com/pythongssapi.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"HTTPX GSSAPI authentication library\n===================================\n\n`HTTPX \u003chttps://github.com/encode/httpx\u003e`_ is a full featured Python HTTP library with both sync and async APIs\ndesigned to be a next generation HTTP client for Python. This library is a port\nof `Requests GSSAPI \u003chttps://github.com/pythongssapi/requests-gssapi\u003e`_ to HTTPX which adds optional GSSAPI authentication support and\nsupports mutual authentication.\n\nBasic GET usage:\n\n.. code-block:: python\n\n    \u003e\u003e\u003e import httpx\n    \u003e\u003e\u003e from httpx_gssapi import HTTPSPNEGOAuth\n    \u003e\u003e\u003e r = httpx.get(\"http://example.org\", auth=HTTPSPNEGOAuth())\n\nBoth the sync and async HTTPX APIs should be fully supported.\n\nSetup\n-----\n\nIn order to use this library, there must already be a Kerberos Ticket-Granting\nTicket (TGT) in a credential cache (ccache).  Whether a TGT is available can\nbe easily determined by running the ``klist`` command.  If no TGT is\navailable, then it first must be obtained (for instance, by running the\n``kinit`` command, or pointing the $KRB5CCNAME to a credential cache with a\nvalid TGT).\n\nIn short, the library will handle the \"negotiations\" of Kerberos\nauthentication, but ensuring that a credentials are available and valid is the\nresponsibility of the user.\n\nAuthentication Failures\n-----------------------\n\nClient authentication failures will be communicated to the caller by returning\na 401 response.  A 401 response may also be the result of expired credentials\n(including the TGT).\n\nMutual Authentication\n---------------------\n\nMutual authentication is a poorly-named feature of the GSSAPI which doesn't\nprovide any additional security benefit to most possible uses of\nhttpx_gssapi.  Practically speaking, in most mechanism implementations\n(including krb5), it requires another round-trip between the client and server\nduring the authentication handshake.  Many clients and servers do not properly\nhandle the authentication handshake taking more than one round-trip.  If you\nencounter a MutualAuthenticationError, this is probably why.\n\nSo long as you're running over a TLS link whose security guarantees you trust,\nthere's no benefit to mutual authentication.  If you don't trust the link at\nall, mutual authentication won't help (since it's not tamper-proof, and GSSAPI\nisn't being used post-authentication.  There's some middle ground between the\ntwo where it helps a small amount (e.g., passive adversary over\nencrypted-but-unverified channel), but for Negotiate (what we're doing here),\nit's not generally helpful.\n\nFor a more technical explanation of what mutual authentication actually\nguarantees, I refer you to rfc2743 (GSSAPIv2), rfc4120 (krb5 in GSSAPI),\nrfc4178 (SPNEGO), and rfc4559 (HTTP Negotiate).\n\n\nDISABLED\n^^^^^^^^\n\nBy default, there's no need to explicitly disable mutual authentication.\nHowever, for compatability with older versions of requests_gssapi or\nrequests_kerberos, you can explicitly request it not be attempted:\n\n.. code-block:: python\n\n    \u003e\u003e\u003e import httpx\n    \u003e\u003e\u003e from httpx_gssapi import HTTPSPNEGOAuth, DISABLED\n    \u003e\u003e\u003e gssapi_auth = HTTPSPNEGOAuth(mutual_authentication=DISABLED)\n    \u003e\u003e\u003e r = httpx.get(\"https://example.org\", auth=gssapi_auth)\n    ...\n\nREQUIRED\n^^^^^^^^\n\nThis was historically the default, but no longer is.  If requested,\n``HTTPSPNEGOAuth`` will require mutual authentication from the server, and if\na server emits a non-error response which cannot be authenticated, a\n``httpx_gssapi.errors.MutualAuthenticationError`` will be raised.  (See\nabove for what this means.)  If a server emits an error which cannot be\nauthenticated, it will be returned to the user but with its contents and\nheaders stripped.  If the response content is more important than the need for\nmutual auth on errors, (eg, for certain WinRM calls) the stripping behavior\ncan be suppressed by setting ``sanitize_mutual_error_response=False``:\n\n.. code-block:: python\n\n    \u003e\u003e\u003e import httpx\n    \u003e\u003e\u003e from httpx_gssapi import HTTPSPNEGOAuth, REQUIRED\n    \u003e\u003e\u003e gssapi_auth = HTTPSPNEGOAuth(mutual_authentication=REQUIRED, sanitize_mutual_error_response=False)\n    \u003e\u003e\u003e r = httpx.get(\"https://windows.example.org/wsman\", auth=gssapi_auth)\n    ...\n\nOPTIONAL\n^^^^^^^^\n\nThis will cause ``httpx_gssapi`` to attempt mutual authentication if the\nserver advertises that it supports it, and cause a failure if authentication\nfails, but not if the server does not support it at all.  This is probably not\nwhat you want: link tampering will either cause hard failures, or silently\ncause it to not happen at all.  It is retained for compatability.\n\n.. code-block:: python\n\n    \u003e\u003e\u003e import httpx\n    \u003e\u003e\u003e from httpx_gssapi import HTTPSPNEGOAuth, OPTIONAL\n    \u003e\u003e\u003e gssapi_auth = HTTPSPNEGOAuth(mutual_authentication=OPTIONAL)\n    \u003e\u003e\u003e r = httpx.get(\"https://example.org\", auth=gssapi_auth)\n    ...\n\nOpportunistic Authentication\n----------------------------\n\n``HTTPSPNEGOAuth`` can be forced to preemptively initiate the GSSAPI\nexchange and present a token on the initial request (and all\nsubsequent). By default, authentication only occurs after a\n``401 Unauthorized`` response containing a Negotiate challenge\nis received from the origin server. This can cause mutual authentication\nfailures for hosts that use a persistent connection (eg, Windows/WinRM), as\nno GSSAPI challenges are sent after the initial auth handshake. This\nbehavior can be altered by setting  ``opportunistic_auth=True``:\n\n.. code-block:: python\n\n    \u003e\u003e\u003e import httpx\n    \u003e\u003e\u003e from httpx_gssapi import HTTPSPNEGOAuth, REQUIRED\n    \u003e\u003e\u003e gssapi_auth = HTTPSPNEGOAuth(mutual_authentication=REQUIRED, opportunistic_auth=True)\n    \u003e\u003e\u003e r = httpx.get(\"https://windows.example.org/wsman\", auth=gssapi_auth)\n    ...\n\nHostname Override\n-----------------\n\nIf communicating with a host whose DNS name doesn't match its\nhostname (eg, behind a content switch or load balancer),\nthe hostname used for the GSSAPI exchange can be overridden by\npassing in a custom name (string or ``gssapi.Name``):\n\n.. code-block:: python\n\n    \u003e\u003e\u003e import httpx\n    \u003e\u003e\u003e from httpx_gssapi import HTTPSPNEGOAuth, REQUIRED\n    \u003e\u003e\u003e gssapi_auth = HTTPSPNEGOAuth(target_name=\"internalhost.local\")\n    \u003e\u003e\u003e r = httpx.get(\"https://externalhost.example.org/\", auth=gssapi_auth)\n    ...\n\nExplicit Principal\n------------------\n\n``HTTPSPNEGOAuth`` normally uses the default principal (ie, the user for whom\nyou last ran ``kinit`` or ``kswitch``, or an SSO credential if\napplicable). However, an explicit credential can be in instead, if desired.\n\n.. code-block:: python\n\n    \u003e\u003e\u003e import gssapi\n    \u003e\u003e\u003e import httpx\n    \u003e\u003e\u003e from httpx_gssapi import HTTPSPNEGOAuth, REQUIRED\n    \u003e\u003e\u003e name = gssapi.Name(\"user@REALM\", gssapi.NameType.hostbased_service)\n    \u003e\u003e\u003e creds = gssapi.Credentials(name=name, usage=\"initiate\")\n    \u003e\u003e\u003e gssapi_auth = HTTPSPNEGOAuth(creds=creds)\n    \u003e\u003e\u003e r = httpx.get(\"http://example.org\", auth=gssapi_auth)\n    ...\n\nExplicit Mechanism\n------------------\n\n``HTTPSPNEGOAuth`` normally lets the underlying ``gssapi`` library decide which\nnegotiation mechanism to use. However, an explicit mechanism can be used instead\nif desired. The ``mech`` parameter will be passed straight through to ``gssapi``\nwithout interference. It is expected to be an instance of ``gssapi.mechs.Mechanism``.\n\n.. code-block:: python\n\n    \u003e\u003e\u003e import gssapi\n    \u003e\u003e\u003e import httpx\n    \u003e\u003e\u003e from httpx_gssapi import HTTPSPNEGOAuth\n    \u003e\u003e\u003e try:\n    ...   spnego = gssapi,mechs.Mechanism.from_sasl_name(\"SPNEGO\")\n    ... except AttributeError:\n    ...   spnego = gssapi.OID.from_int_seq(\"1.3.6.1.5.5.2\")\n    \u003e\u003e\u003e gssapi_auth = HTTPSPNEGOAuth(mech=spnego)\n    \u003e\u003e\u003e r = httpx.get(\"http://example.org\", auth=gssapi_auth)\n    ...\n\nDelegation\n----------\n\n``httpx_gssapi`` supports credential delegation (``GSS_C_DELEG_FLAG``).\nTo enable delegation of credentials to a server that requests delegation, pass\n``delegate=True`` to ``HTTPSPNEGOAuth``:\n\n.. code-block:: python\n\n    \u003e\u003e\u003e import httpx\n    \u003e\u003e\u003e from httpx_gssapi import HTTPSPNEGOAuth\n    \u003e\u003e\u003e r = httpx.get(\"http://example.org\", auth=HTTPSPNEGOAuth(delegate=True))\n    ...\n\nBe careful to only allow delegation to servers you trust as they will be able\nto impersonate you using the delegated credentials.\n\nLogging\n-------\n\nThis library makes extensive use of Python's logging facilities.\n\nLog messages are logged to the ``httpx_gssapi`` and\n``httpx_gssapi.gssapi`` named loggers.\n\nIf you are having difficulty we suggest you configure logging. Issues with the\nunderlying GSSAPI libraries will be made apparent. Additionally, copious debug\ninformation is made available which may assist in troubleshooting if you\nincrease your log level all the way up to debug.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpythongssapi%2Fhttpx-gssapi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpythongssapi%2Fhttpx-gssapi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpythongssapi%2Fhttpx-gssapi/lists"}