Extra utilities for Lexmount Python SDK projects.
Project description
lexmount-extra
Extra utilities for Lexmount Python SDK projects.
Install
pip install lexmount-extra
The package uses ntlm-auth for non-Windows NTLM credentials,
pyspnego[kerberos] for SPNEGO/Kerberos and Windows integrated NTLM, and
pycryptodome as an MD4 fallback for Python/OpenSSL builds that do not expose
hashlib.new("md4").
On Debian/Ubuntu images, installing the Kerberos dependency may also require
the system package that provides krb5-config:
sudo apt-get install libkrb5-dev
Usage
from lexmount_extra import (
createKerberosAuthCallback,
createNTLMAuthCallback,
generateKerberosToken,
generateNTLMChallengeToken,
generateNTLMResponseToken,
)
type1_token = generateNTLMChallengeToken("web.lab.local", "LAB")
type3_token = generateNTLMResponseToken(
"http://web.lab.local/",
"web.lab.local",
"LAB",
"NTLM <server-type2-token>",
"alice",
"P@ssw0rd123!",
)
kerberos_token = generateKerberosToken(
"HTTP@web.lab.test",
"server-token",
)
Pythonic snake_case aliases are available for every Node-compatible camelCase function.
Lexmount authentication callbacks
from lexmount import register_integrated_auth_callback
from lexmount_extra import createKerberosAuthCallback, createNTLMAuthCallback
ntlm_auth = createNTLMAuthCallback({
"hostname": "web.lab.local",
"domain": "LAB",
})
kerberos_auth = createKerberosAuthCallback({
"hostname": "web.lab.test",
})
register_integrated_auth_callback(session, ntlm_auth)
register_integrated_auth_callback(session, kerberos_auth)
Both callback factories can be called without options. NTLM defaults to
USERDNSDOMAIN and USERDOMAIN when those environment variables exist.
Kerberos derives the HTTP@host service principal from the authentication
challenge origin when neither spn nor hostname is provided.
NTLM integrated authentication
Windows NTLM generation uses SSPI through pyspnego. Type 1 and Type 3 tokens
both support explicit username/password credentials, and Type 3 can also
use the current Windows logon session when credentials are omitted. The Lexmount
callback keeps the SSPI context between Type 1 and Type 3 by using the request's
frameId and requestId.
Non-Windows platforms use ntlm-auth. They support Type 1 and Type 3 with
explicit username/password credentials; Type 3 without credentials returns
an empty token.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file lexmount_extra-0.1.1.tar.gz.
File metadata
- Download URL: lexmount_extra-0.1.1.tar.gz
- Upload date:
- Size: 9.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8a3b7e04f2e6500bae175aa3cbb17ff1b7fe6bbdb50ad79b42975eb3b18a7cee
|
|
| MD5 |
723cf9197d4bd5788013a5b5579cb4ad
|
|
| BLAKE2b-256 |
9b177316aecf7b846edb64a7a06a9c3fdb1e22cea9a36a1fc7e7f12c777a3dff
|
Provenance
The following attestation bundles were made for lexmount_extra-0.1.1.tar.gz:
Publisher:
publish.yml on lexmount/lexmount-python-sdk-extra
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
lexmount_extra-0.1.1.tar.gz -
Subject digest:
8a3b7e04f2e6500bae175aa3cbb17ff1b7fe6bbdb50ad79b42975eb3b18a7cee - Sigstore transparency entry: 1639926494
- Sigstore integration time:
-
Permalink:
lexmount/lexmount-python-sdk-extra@89429b1a3173dafce8dc51888f522776a885e87d -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/lexmount
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@89429b1a3173dafce8dc51888f522776a885e87d -
Trigger Event:
release
-
Statement type:
File details
Details for the file lexmount_extra-0.1.1-py3-none-any.whl.
File metadata
- Download URL: lexmount_extra-0.1.1-py3-none-any.whl
- Upload date:
- Size: 10.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
27e45eeb15652ce84d7e080182ee71d80eafac05743f62696fa8fe1b965845b0
|
|
| MD5 |
5b75d4ed0d3c4891d1d480d6a91ecf72
|
|
| BLAKE2b-256 |
e167a97e6d140420002e4093cb52482b5ca1d80505ba43cd34f352e5e474d13a
|
Provenance
The following attestation bundles were made for lexmount_extra-0.1.1-py3-none-any.whl:
Publisher:
publish.yml on lexmount/lexmount-python-sdk-extra
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
lexmount_extra-0.1.1-py3-none-any.whl -
Subject digest:
27e45eeb15652ce84d7e080182ee71d80eafac05743f62696fa8fe1b965845b0 - Sigstore transparency entry: 1639926639
- Sigstore integration time:
-
Permalink:
lexmount/lexmount-python-sdk-extra@89429b1a3173dafce8dc51888f522776a885e87d -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/lexmount
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@89429b1a3173dafce8dc51888f522776a885e87d -
Trigger Event:
release
-
Statement type: