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.0.tar.gz (46.8 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.0-py3-none-any.whl (52.0 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for hacs_auth-0.4.0.tar.gz
Algorithm Hash digest
SHA256 6f088f7dacfbeb19e96e413822aaede0338172d0497cb67ceee00b140d3b45ce
MD5 5eedb1a8de3f0b3b908eadfd2caf8a6a
BLAKE2b-256 e42471a9184f1c8631016a37b7b976b0b3f8777e84a77ee7666fd950ae8150cc

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for hacs_auth-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fed20300b6d714109b23f2767e974dae68889d09c885868161340f4e6ab00926
MD5 165fc8d6b6b71a72eadac5d5651385f4
BLAKE2b-256 0a3d4141fd207c836acfbaba94fe3a1334b56be29ce84a4be5770dc4ec580716

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