Skip to main content

Client for the PamAuthService

Project description

PamAuthServiceClient

Client for the PamAuthService

Installation

pip install PamAuthServiceClient

Quickstart

Use the PamAuthService running on a unix socket at /run/pam_auth_service.sock.

(If the PamAuthService is running on a network socket use url instead of path)

from pamauthserviceclient.client import PamAuthServiceClient

encryption_key = 'ENCRYPTION KEY'
verification_key = 'VERIFICATION KEY'

path = "/run/pam_auth_service.sock"
# url = "http://127.0.0.1:5000"

client = PamAuthServiceClient(encryption_key, verification_key, path=path)
# client = PamAuthServiceClient(encryption_key, verification_key, url=url)

res = client.authenticate("name", "password")
# None
#    if  name/password don't match
# {'version': '1.0', 'username': 'name', 'allowed_groups': []}
#    if user/password match

allowed_groups = ["group1", "xxx", "yyy", "zzz"]

res2 = client.authenticate("name", "password", allowed_groups)
# {'version': '1.0', 'username': 'name', 'allowed_groups': ['xxx', 'zzz']}
#    if user is authorized and member of the 'xxx' and 'zzz' group
#    and not member of the other groups.

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

PamAuthServiceClient-0.3.1.tar.gz (13.5 kB view details)

Uploaded Source

Built Distribution

PamAuthServiceClient-0.3.1-py2.py3-none-any.whl (5.7 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file PamAuthServiceClient-0.3.1.tar.gz.

File metadata

  • Download URL: PamAuthServiceClient-0.3.1.tar.gz
  • Upload date:
  • Size: 13.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.53.0 CPython/3.6.9

File hashes

Hashes for PamAuthServiceClient-0.3.1.tar.gz
Algorithm Hash digest
SHA256 2e75075995c7b8546e87e478868a9557f2309ab61fe5be336fc7a5a2911a94cc
MD5 117f139a280bf91b3aca887b7ec43079
BLAKE2b-256 e57ebcf5fabd95e57c7243d1ce04de49a84ded49e2fc013e13a2a93f89ebfac8

See more details on using hashes here.

File details

Details for the file PamAuthServiceClient-0.3.1-py2.py3-none-any.whl.

File metadata

  • Download URL: PamAuthServiceClient-0.3.1-py2.py3-none-any.whl
  • Upload date:
  • Size: 5.7 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.53.0 CPython/3.6.9

File hashes

Hashes for PamAuthServiceClient-0.3.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 ddb41a8486b8ce53f16d645a735b50ba5d531a4f6113e4b28c23a6fa5e4686db
MD5 9b6a11917ba50a5920868beb4885f173
BLAKE2b-256 84278e7386c080839d6cb4f0d1d8fdc4688dc27a27d54a12edb6153ee5c420ac

See more details on using hashes here.

Supported by

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