Skip to main content

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 explicit NTLM credentials and pyspnego[kerberos] for SPNEGO/Kerberos and Windows integrated NTLM.

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

When generateNTLMResponseToken is called without username and password, Windows uses the current logon session through SSPI via pyspnego. Non-Windows platforms return an empty token in the no-credential path, matching the Node package.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

lexmount_extra-0.1.0.tar.gz (7.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

lexmount_extra-0.1.0-py3-none-any.whl (9.0 kB view details)

Uploaded Python 3

File details

Details for the file lexmount_extra-0.1.0.tar.gz.

File metadata

  • Download URL: lexmount_extra-0.1.0.tar.gz
  • Upload date:
  • Size: 7.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for lexmount_extra-0.1.0.tar.gz
Algorithm Hash digest
SHA256 b619da681851d36eb3e8d2b4c9e179b446404599856a49e4c8184dd8a9e7c130
MD5 9c16a9ddd6fb2e994095fe41e3a5f68c
BLAKE2b-256 aab76cca453b749fe1480bebb539341e51c6aece10088d545d95052f6dc9425a

See more details on using hashes here.

File details

Details for the file lexmount_extra-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: lexmount_extra-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 9.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for lexmount_extra-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fa4445367c51755739a1c4c4f11feb366fb1bffc56ace9013507dc232e6ca715
MD5 f20d782d642849de568b32e467a0abe0
BLAKE2b-256 41b67acbc27e73ec138e2443656259fc4aaa3f9d352ce78234c2600401d026df

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page