Skip to main content

Authentication and authorization components for HACS (Healthcare Agent Communication Standard)

Project description

HACS Authentication

Authentication and authorization components for HACS (Healthcare Agent Communication Standard) providing JWT token management, role-based access control, and comprehensive audit logging.

Features

  • JWT Token Management: Healthcare-specific claims with organization context
  • Role-Based Access Control: 13+ healthcare roles with smart permissions
  • Session Management: Secure session handling with activity tracking
  • Audit Logging: HIPAA-compliant access tracking and compliance reports
  • Healthcare Security: Security levels, PHI tracking, consent management
  • AI Agent Integration: Simplified APIs for intelligent healthcare agents

Installation

pip install hacs-auth

Quick Start

from hacs_auth import AuthManager, Actor, ActorRole, require_auth

# JWT Authentication
auth_manager = AuthManager()
token = auth_manager.create_access_token(
    user_id="physician-123",
    role="physician", 
    permissions=["read:patient", "write:observation"],
    organization="Mayo Clinic"
)

# Actor Management
actor = Actor(
    name="Dr. Sarah Johnson",
    role=ActorRole.PHYSICIAN,
    organization="Mayo Clinic"
)

# Function Protection
@require_auth(permission="read:patient")
def get_patient_data(patient_id: str, **kwargs):
    token_data = kwargs["token_data"]
    return f"Patient data for {patient_id}"

License

MIT License - see LICENSE file for details.

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

hacs_auth-0.3.0.tar.gz (44.4 kB view details)

Uploaded Source

Built Distribution

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

hacs_auth-0.3.0-py3-none-any.whl (48.8 kB view details)

Uploaded Python 3

File details

Details for the file hacs_auth-0.3.0.tar.gz.

File metadata

  • Download URL: hacs_auth-0.3.0.tar.gz
  • Upload date:
  • Size: 44.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.13

File hashes

Hashes for hacs_auth-0.3.0.tar.gz
Algorithm Hash digest
SHA256 0eda34345194b452cc950262f5b2b024c763bd9d2b01c7db1fc1558c2dea9f40
MD5 64cc0b34730346f52415b2a5e28dd198
BLAKE2b-256 0c9f619221d17b010266add56a61d9966eb39021af8a69124b96dc0e7912d10c

See more details on using hashes here.

File details

Details for the file hacs_auth-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: hacs_auth-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 48.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.13

File hashes

Hashes for hacs_auth-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8e47d0ad89494a084ee1883374efa4422cbb48d397f35fb45eb7af4cbfb00940
MD5 f1d864327fb4bba0f408616f957cbffd
BLAKE2b-256 16a346d46e2cb2f74178ae962aff62049c7c3f6882df756ebc0de51c182f3faf

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