@arun-syngrid/hippaguard 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +206 -0
- package/dist/index.esm.js +776 -0
- package/dist/index.esm.js.map +1 -0
- package/dist/index.js +794 -0
- package/dist/index.js.map +1 -0
- package/package.json +68 -0
package/README.md
ADDED
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
# HIPPAGuard ๐
|
|
2
|
+
|
|
3
|
+
Secure form handling with client-side encryption for React applications - HIPAA-compliant form components with built-in security.
|
|
4
|
+
|
|
5
|
+
<p align="center">
|
|
6
|
+
<img src="assets/logo.svg" width="64" height="64" alt="HIPPAGuard Logo" />
|
|
7
|
+
</p>
|
|
8
|
+
|
|
9
|
+
[](https://badge.fury.io/js/@hippaguard%2Freact)
|
|
10
|
+
[](https://opensource.org/licenses/MIT)
|
|
11
|
+
[](https://github.com/Anas-debug/HIPPAGuard)
|
|
12
|
+
|
|
13
|
+
## Overview
|
|
14
|
+
|
|
15
|
+
HIPPAGuard provides secure form components for handling sensitive healthcare data in React applications. It includes built-in encryption, data protection, and HIPAA compliance features.
|
|
16
|
+
|
|
17
|
+
## Key Features
|
|
18
|
+
|
|
19
|
+
- ๐ Client-side AES-256-GCM encryption
|
|
20
|
+
- โ๏ธ HIPAA & PHI/PII data protection
|
|
21
|
+
- ๐ก๏ธ Form validation & sanitization
|
|
22
|
+
- ๐ Simple React hooks API
|
|
23
|
+
- ๐ Full TypeScript support
|
|
24
|
+
- โ
Extensive test coverage
|
|
25
|
+
- ๐ Lightweight with minimal dependencies
|
|
26
|
+
- ๐ช Built for production use
|
|
27
|
+
|
|
28
|
+
## Getting Started
|
|
29
|
+
|
|
30
|
+
### Installation
|
|
31
|
+
|
|
32
|
+
```sh
|
|
33
|
+
npm install @hippaguard/react
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
### Basic Usage
|
|
37
|
+
|
|
38
|
+
```tsx
|
|
39
|
+
import { SecureForm, SecureField } from '@hippaguard/react';
|
|
40
|
+
|
|
41
|
+
function PatientForm() {
|
|
42
|
+
const handleSubmit = async (data) => {
|
|
43
|
+
// Data is automatically encrypted
|
|
44
|
+
console.log('Encrypted form data:', data);
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
return (
|
|
48
|
+
<SecureForm onSubmit={handleSubmit}>
|
|
49
|
+
<SecureField
|
|
50
|
+
name="firstName"
|
|
51
|
+
label="First Name"
|
|
52
|
+
required
|
|
53
|
+
sensitivityLevel="PHI"
|
|
54
|
+
/>
|
|
55
|
+
|
|
56
|
+
<SecureTextArea
|
|
57
|
+
name="symptoms"
|
|
58
|
+
label="Current Symptoms"
|
|
59
|
+
sensitivityLevel="PHI"
|
|
60
|
+
/>
|
|
61
|
+
|
|
62
|
+
<button type="submit">
|
|
63
|
+
Submit
|
|
64
|
+
</button>
|
|
65
|
+
</SecureForm>
|
|
66
|
+
);
|
|
67
|
+
}
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
## Core Components
|
|
71
|
+
|
|
72
|
+
### SecureField
|
|
73
|
+
Standard input field with encryption and validation.
|
|
74
|
+
|
|
75
|
+
```tsx
|
|
76
|
+
<SecureField
|
|
77
|
+
name="ssn"
|
|
78
|
+
label="Social Security Number"
|
|
79
|
+
type="text"
|
|
80
|
+
sensitivityLevel="PII"
|
|
81
|
+
validateFn={validateSSN}
|
|
82
|
+
required
|
|
83
|
+
/>
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
### SecureTextArea
|
|
87
|
+
Multiline text input with encryption.
|
|
88
|
+
|
|
89
|
+
```tsx
|
|
90
|
+
<SecureTextArea
|
|
91
|
+
name="notes"
|
|
92
|
+
label="Medical Notes"
|
|
93
|
+
rows={4}
|
|
94
|
+
sensitivityLevel="PHI"
|
|
95
|
+
/>
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
### SecureCheckbox
|
|
99
|
+
Secure checkbox component.
|
|
100
|
+
|
|
101
|
+
```tsx
|
|
102
|
+
<SecureCheckbox
|
|
103
|
+
name="consent"
|
|
104
|
+
label="I consent to treatment"
|
|
105
|
+
sensitivityLevel="PHI"
|
|
106
|
+
/>
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
### SecureRadioGroup
|
|
110
|
+
Radio button group with encryption.
|
|
111
|
+
|
|
112
|
+
```tsx
|
|
113
|
+
<SecureRadioGroup
|
|
114
|
+
name="gender"
|
|
115
|
+
label="Gender"
|
|
116
|
+
options={['Male', 'Female', 'Other']}
|
|
117
|
+
sensitivityLevel="PHI"
|
|
118
|
+
/>
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
## Validation
|
|
122
|
+
|
|
123
|
+
Built-in validation helpers:
|
|
124
|
+
|
|
125
|
+
```tsx
|
|
126
|
+
import { validators } from '@hippaguard/react';
|
|
127
|
+
|
|
128
|
+
<SecureField
|
|
129
|
+
name="email"
|
|
130
|
+
validateFn={validators.combine([
|
|
131
|
+
validators.required(),
|
|
132
|
+
validators.email()
|
|
133
|
+
])}
|
|
134
|
+
/>
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
## Context & Hooks
|
|
138
|
+
|
|
139
|
+
### SecurityProvider
|
|
140
|
+
Provides encryption context.
|
|
141
|
+
|
|
142
|
+
```tsx
|
|
143
|
+
import { SecurityProvider } from '@hippaguard/react';
|
|
144
|
+
|
|
145
|
+
function App() {
|
|
146
|
+
return (
|
|
147
|
+
<SecurityProvider>
|
|
148
|
+
<YourApp />
|
|
149
|
+
</SecurityProvider>
|
|
150
|
+
);
|
|
151
|
+
}
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
### useSecurity
|
|
155
|
+
Access encryption functions.
|
|
156
|
+
|
|
157
|
+
```tsx
|
|
158
|
+
const { encrypt, decrypt } = useSecurity();
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
## Security Features
|
|
162
|
+
|
|
163
|
+
- ๐ AES-256-GCM encryption
|
|
164
|
+
- ๐ Unique IV per encryption
|
|
165
|
+
- ๐ก๏ธ PBKDF2 key derivation
|
|
166
|
+
- ๐งน Auto key cleanup
|
|
167
|
+
- ๐ Zero plaintext storage
|
|
168
|
+
- โ
Input sanitization
|
|
169
|
+
|
|
170
|
+
## Contributing
|
|
171
|
+
|
|
172
|
+
We welcome contributions! Please check our [Contributing Guide](CONTRIBUTING.md).
|
|
173
|
+
|
|
174
|
+
### Development
|
|
175
|
+
|
|
176
|
+
1. Clone repo
|
|
177
|
+
```sh
|
|
178
|
+
git clone https://github.com/Anas-debug/HIPPAGuard.git
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
2. Install dependencies
|
|
182
|
+
```sh
|
|
183
|
+
npm install
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
3. Run tests
|
|
187
|
+
```sh
|
|
188
|
+
npm test
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
### Testing
|
|
192
|
+
- Unit tests
|
|
193
|
+
- Integration tests
|
|
194
|
+
- Security tests
|
|
195
|
+
- Edge cases
|
|
196
|
+
- Current coverage: ~87%
|
|
197
|
+
|
|
198
|
+
## Support
|
|
199
|
+
|
|
200
|
+
- ๐ [Documentation](https://github.com/Anas-debug/HIPPAGuard)
|
|
201
|
+
- ๐ [Issues](https://github.com/Anas-debug/HIPPAGuard/issues)
|
|
202
|
+
- โ๏ธ [Email](mailto:security@hippaguard.dev)
|
|
203
|
+
|
|
204
|
+
## License
|
|
205
|
+
|
|
206
|
+
[MIT](LICENSE) ยฉ [Anas Saoui](https://github.com/Anas-debug)
|