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.4.3.tar.gz (42.9 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.4.3-py3-none-any.whl (47.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: hacs_auth-0.4.3.tar.gz
  • Upload date:
  • Size: 42.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.6

File hashes

Hashes for hacs_auth-0.4.3.tar.gz
Algorithm Hash digest
SHA256 9395b84a8a3ce34257f1a08cc014e6d60a43cb143be2a614a5381eea32166f0f
MD5 8f53df5453c53efc1e33f8ef9e8e9f31
BLAKE2b-256 210bfea0d374887e74a93e8e70a2e606f7e401d04a344e66efa4c4491e88a6a1

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hacs_auth-0.4.3-py3-none-any.whl
  • Upload date:
  • Size: 47.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.6

File hashes

Hashes for hacs_auth-0.4.3-py3-none-any.whl
Algorithm Hash digest
SHA256 60cfa71f34927d7acdb6322439f829d7f468003e3cd165ef2d6e71ddfe075992
MD5 cb09a1d56debc4abebfabc2d84d81b7e
BLAKE2b-256 58bebd42b48fc72771acb106bc826d88b0222f150fb2a34215ab2d2e86c43e1b

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