# 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
```bash
pip install hacs-auth
```
## Quick Start
```python
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.
Raw data
{
"_id": null,
"home_page": null,
"name": "hacs-auth",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.11",
"maintainer_email": "Solano Nocetti <solanovisitor@gmail.com>",
"keywords": "ai-agents, authentication, authorization, fhir, healthcare, jwt, oauth2",
"author": null,
"author_email": "Solano Nocetti <solanovisitor@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/3a/4f/c211a4408f6ef43e4a40eee6800b97d7dc8b08a4c0b9507637f53d0a3957/hacs_auth-0.3.1.tar.gz",
"platform": null,
"description": "# HACS Authentication\n\nAuthentication and authorization components for HACS (Healthcare Agent Communication Standard) providing JWT token management, role-based access control, and comprehensive audit logging.\n\n## Features\n\n- **JWT Token Management**: Healthcare-specific claims with organization context\n- **Role-Based Access Control**: 13+ healthcare roles with smart permissions\n- **Session Management**: Secure session handling with activity tracking \n- **Audit Logging**: HIPAA-compliant access tracking and compliance reports\n- **Healthcare Security**: Security levels, PHI tracking, consent management\n- **AI Agent Integration**: Simplified APIs for intelligent healthcare agents\n\n## Installation\n\n```bash\npip install hacs-auth\n```\n\n## Quick Start\n\n```python\nfrom hacs_auth import AuthManager, Actor, ActorRole, require_auth\n\n# JWT Authentication\nauth_manager = AuthManager()\ntoken = auth_manager.create_access_token(\n user_id=\"physician-123\",\n role=\"physician\", \n permissions=[\"read:patient\", \"write:observation\"],\n organization=\"Mayo Clinic\"\n)\n\n# Actor Management\nactor = Actor(\n name=\"Dr. Sarah Johnson\",\n role=ActorRole.PHYSICIAN,\n organization=\"Mayo Clinic\"\n)\n\n# Function Protection\n@require_auth(permission=\"read:patient\")\ndef get_patient_data(patient_id: str, **kwargs):\n token_data = kwargs[\"token_data\"]\n return f\"Patient data for {patient_id}\"\n```\n\n## License\n\nMIT License - see LICENSE file for details.",
"bugtrack_url": null,
"license": "MIT",
"summary": "Authentication and authorization components for HACS (Healthcare Agent Communication Standard)",
"version": "0.3.1",
"project_urls": {
"Changelog": "https://github.com/solanovisitor/hacs-ai/blob/main/CHANGELOG.md",
"Documentation": "https://github.com/solanovisitor/hacs-ai/blob/main/docs/",
"Homepage": "https://github.com/solanovisitor/hacs-ai",
"Issues": "https://github.com/solanovisitor/hacs-ai/issues",
"Repository": "https://github.com/solanovisitor/hacs-ai"
},
"split_keywords": [
"ai-agents",
" authentication",
" authorization",
" fhir",
" healthcare",
" jwt",
" oauth2"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "11739ea11302b865fefd96557e5ce834d9a12d536b215a98075781c61348bcfb",
"md5": "8753d8b3fe401829e79807c77dff60e6",
"sha256": "4fccf7943ef61b4627b5a669c215d5c1702114c4dc730d515cda19dcfad02df1"
},
"downloads": -1,
"filename": "hacs_auth-0.3.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "8753d8b3fe401829e79807c77dff60e6",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.11",
"size": 48837,
"upload_time": "2025-08-04T12:59:52",
"upload_time_iso_8601": "2025-08-04T12:59:52.266813Z",
"url": "https://files.pythonhosted.org/packages/11/73/9ea11302b865fefd96557e5ce834d9a12d536b215a98075781c61348bcfb/hacs_auth-0.3.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "3a4fc211a4408f6ef43e4a40eee6800b97d7dc8b08a4c0b9507637f53d0a3957",
"md5": "74ea2c377ae99f5627dd4f50d69c536b",
"sha256": "9f1007bfc93e64a3533931cc3939d07c4c96daf54571ad3c69c8939d69f38519"
},
"downloads": -1,
"filename": "hacs_auth-0.3.1.tar.gz",
"has_sig": false,
"md5_digest": "74ea2c377ae99f5627dd4f50d69c536b",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.11",
"size": 44386,
"upload_time": "2025-08-04T12:59:51",
"upload_time_iso_8601": "2025-08-04T12:59:51.259537Z",
"url": "https://files.pythonhosted.org/packages/3a/4f/c211a4408f6ef43e4a40eee6800b97d7dc8b08a4c0b9507637f53d0a3957/hacs_auth-0.3.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-08-04 12:59:51",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "solanovisitor",
"github_project": "hacs-ai",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "hacs-auth"
}