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.1.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.1-py3-none-any.whl (47.6 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for hacs_auth-0.4.1.tar.gz
Algorithm Hash digest
SHA256 72523e8035c1e1380a44c986310630c5a5df774297b346a980e22421a3da70ec
MD5 d09a28f3ae0e5cee17f6d9ee0a81df4b
BLAKE2b-256 1ba2fa8011a43b119441862ac840016550b566bab4e5fa714a7e3677dc7ca9c9

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for hacs_auth-0.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 df6e248a55fd3b7406bc9d664d66d4a6587103111df2f189fa4f3cd5496eda5f
MD5 01c4aba6e236ddbdb8f11672f4dd7efe
BLAKE2b-256 9424e24f08a00c632cd6a52adad210d101086b485d422852d8af9eb399eca7a3

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