secure-ui-components 0.1.0-beta.1
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/LICENSE +21 -0
- package/README.md +310 -0
- package/dist/components/secure-datetime/secure-datetime.css +263 -0
- package/dist/components/secure-datetime/secure-datetime.d.ts +124 -0
- package/dist/components/secure-datetime/secure-datetime.d.ts.map +1 -0
- package/dist/components/secure-datetime/secure-datetime.js +610 -0
- package/dist/components/secure-datetime/secure-datetime.js.map +1 -0
- package/dist/components/secure-file-upload/secure-file-upload.css +334 -0
- package/dist/components/secure-file-upload/secure-file-upload.d.ts +150 -0
- package/dist/components/secure-file-upload/secure-file-upload.d.ts.map +1 -0
- package/dist/components/secure-file-upload/secure-file-upload.js +911 -0
- package/dist/components/secure-file-upload/secure-file-upload.js.map +1 -0
- package/dist/components/secure-form/secure-form.css +62 -0
- package/dist/components/secure-form/secure-form.d.ts +128 -0
- package/dist/components/secure-form/secure-form.d.ts.map +1 -0
- package/dist/components/secure-form/secure-form.js +697 -0
- package/dist/components/secure-form/secure-form.js.map +1 -0
- package/dist/components/secure-input/secure-input.css +168 -0
- package/dist/components/secure-input/secure-input.d.ts +114 -0
- package/dist/components/secure-input/secure-input.d.ts.map +1 -0
- package/dist/components/secure-input/secure-input.js +785 -0
- package/dist/components/secure-input/secure-input.js.map +1 -0
- package/dist/components/secure-select/secure-select.css +195 -0
- package/dist/components/secure-select/secure-select.d.ts +149 -0
- package/dist/components/secure-select/secure-select.d.ts.map +1 -0
- package/dist/components/secure-select/secure-select.js +634 -0
- package/dist/components/secure-select/secure-select.js.map +1 -0
- package/dist/components/secure-submit-button/secure-submit-button.css +135 -0
- package/dist/components/secure-submit-button/secure-submit-button.d.ts +61 -0
- package/dist/components/secure-submit-button/secure-submit-button.d.ts.map +1 -0
- package/dist/components/secure-submit-button/secure-submit-button.js +399 -0
- package/dist/components/secure-submit-button/secure-submit-button.js.map +1 -0
- package/dist/components/secure-table/secure-table.css +341 -0
- package/dist/components/secure-table/secure-table.d.ts +64 -0
- package/dist/components/secure-table/secure-table.d.ts.map +1 -0
- package/dist/components/secure-table/secure-table.js +567 -0
- package/dist/components/secure-table/secure-table.js.map +1 -0
- package/dist/components/secure-textarea/secure-textarea.css +153 -0
- package/dist/components/secure-textarea/secure-textarea.d.ts +111 -0
- package/dist/components/secure-textarea/secure-textarea.d.ts.map +1 -0
- package/dist/components/secure-textarea/secure-textarea.js +477 -0
- package/dist/components/secure-textarea/secure-textarea.js.map +1 -0
- package/dist/core/base-component.d.ts +134 -0
- package/dist/core/base-component.d.ts.map +1 -0
- package/dist/core/base-component.js +303 -0
- package/dist/core/base-component.js.map +1 -0
- package/dist/core/base.css +37 -0
- package/dist/core/security-config.d.ts +89 -0
- package/dist/core/security-config.d.ts.map +1 -0
- package/dist/core/security-config.js +273 -0
- package/dist/core/security-config.js.map +1 -0
- package/dist/core/types.d.ts +212 -0
- package/dist/core/types.d.ts.map +1 -0
- package/dist/core/types.js +7 -0
- package/dist/core/types.js.map +1 -0
- package/dist/index.d.ts +18 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +19 -0
- package/dist/index.js.map +1 -0
- package/dist/package.json +89 -0
- package/dist/styles/tokens.css +257 -0
- package/package.json +118 -0
|
@@ -0,0 +1,273 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Security Configuration and Tier Definitions
|
|
3
|
+
*
|
|
4
|
+
* This module defines the four security tiers that govern all component behavior
|
|
5
|
+
* in the Secure-UI library. Each tier represents a different level of data sensitivity
|
|
6
|
+
* and applies corresponding security controls.
|
|
7
|
+
*
|
|
8
|
+
* Security Philosophy:
|
|
9
|
+
* - Defense in depth: Multiple layers of protection at each tier
|
|
10
|
+
* - Fail secure: Default to highest security when tier is ambiguous
|
|
11
|
+
* - Progressive enhancement: All tiers work without JavaScript
|
|
12
|
+
* - Zero trust: Always validate, never assume data is safe
|
|
13
|
+
*
|
|
14
|
+
* @module security-config
|
|
15
|
+
* @license MIT
|
|
16
|
+
*/
|
|
17
|
+
/**
|
|
18
|
+
* Security tier enumeration
|
|
19
|
+
* These constants should be used throughout the library to reference security levels
|
|
20
|
+
*/
|
|
21
|
+
export const SecurityTier = Object.freeze({
|
|
22
|
+
/** PUBLIC: Non-sensitive data (e.g., search queries, public comments) */
|
|
23
|
+
PUBLIC: 'public',
|
|
24
|
+
/** AUTHENTICATED: User-specific but non-sensitive data (e.g., display names, preferences) */
|
|
25
|
+
AUTHENTICATED: 'authenticated',
|
|
26
|
+
/** SENSITIVE: Personally identifiable information (e.g., email, phone, address) */
|
|
27
|
+
SENSITIVE: 'sensitive',
|
|
28
|
+
/** CRITICAL: High-risk data (e.g., passwords, SSN, payment info) */
|
|
29
|
+
CRITICAL: 'critical'
|
|
30
|
+
});
|
|
31
|
+
/**
|
|
32
|
+
* Default configuration for each security tier
|
|
33
|
+
*
|
|
34
|
+
* Security Note: These defaults implement defense-in-depth by progressively
|
|
35
|
+
* adding security controls at each tier. When in doubt, components should
|
|
36
|
+
* default to CRITICAL tier behavior.
|
|
37
|
+
*/
|
|
38
|
+
export const TIER_CONFIG = Object.freeze({
|
|
39
|
+
[SecurityTier.PUBLIC]: Object.freeze({
|
|
40
|
+
name: 'Public',
|
|
41
|
+
level: 1,
|
|
42
|
+
validation: Object.freeze({
|
|
43
|
+
required: false,
|
|
44
|
+
strict: false,
|
|
45
|
+
maxLength: 5000,
|
|
46
|
+
pattern: null,
|
|
47
|
+
sanitizeHtml: true
|
|
48
|
+
}),
|
|
49
|
+
masking: Object.freeze({
|
|
50
|
+
enabled: false,
|
|
51
|
+
character: '•',
|
|
52
|
+
partial: false
|
|
53
|
+
}),
|
|
54
|
+
storage: Object.freeze({
|
|
55
|
+
allowAutocomplete: true,
|
|
56
|
+
allowCache: true,
|
|
57
|
+
allowHistory: true
|
|
58
|
+
}),
|
|
59
|
+
audit: Object.freeze({
|
|
60
|
+
logAccess: false,
|
|
61
|
+
logChanges: false,
|
|
62
|
+
logSubmission: false,
|
|
63
|
+
includeMetadata: false
|
|
64
|
+
}),
|
|
65
|
+
ui: Object.freeze({
|
|
66
|
+
labelSuffix: '',
|
|
67
|
+
showSecurityBadge: false
|
|
68
|
+
}),
|
|
69
|
+
rateLimit: Object.freeze({
|
|
70
|
+
enabled: false,
|
|
71
|
+
maxAttempts: 0,
|
|
72
|
+
windowMs: 0
|
|
73
|
+
})
|
|
74
|
+
}),
|
|
75
|
+
[SecurityTier.AUTHENTICATED]: Object.freeze({
|
|
76
|
+
name: 'Authenticated',
|
|
77
|
+
level: 2,
|
|
78
|
+
validation: Object.freeze({
|
|
79
|
+
required: true,
|
|
80
|
+
strict: false,
|
|
81
|
+
maxLength: 1000,
|
|
82
|
+
pattern: null,
|
|
83
|
+
sanitizeHtml: true
|
|
84
|
+
}),
|
|
85
|
+
masking: Object.freeze({
|
|
86
|
+
enabled: false,
|
|
87
|
+
character: '•',
|
|
88
|
+
partial: false
|
|
89
|
+
}),
|
|
90
|
+
storage: Object.freeze({
|
|
91
|
+
allowAutocomplete: true,
|
|
92
|
+
allowCache: false,
|
|
93
|
+
allowHistory: false
|
|
94
|
+
}),
|
|
95
|
+
audit: Object.freeze({
|
|
96
|
+
logAccess: false,
|
|
97
|
+
logChanges: true,
|
|
98
|
+
logSubmission: true,
|
|
99
|
+
includeMetadata: true
|
|
100
|
+
}),
|
|
101
|
+
ui: Object.freeze({
|
|
102
|
+
labelSuffix: '',
|
|
103
|
+
showSecurityBadge: true
|
|
104
|
+
}),
|
|
105
|
+
rateLimit: Object.freeze({
|
|
106
|
+
enabled: false,
|
|
107
|
+
maxAttempts: 0,
|
|
108
|
+
windowMs: 0
|
|
109
|
+
})
|
|
110
|
+
}),
|
|
111
|
+
[SecurityTier.SENSITIVE]: Object.freeze({
|
|
112
|
+
name: 'Sensitive',
|
|
113
|
+
level: 3,
|
|
114
|
+
validation: Object.freeze({
|
|
115
|
+
required: true,
|
|
116
|
+
strict: true,
|
|
117
|
+
maxLength: 500,
|
|
118
|
+
pattern: null,
|
|
119
|
+
sanitizeHtml: true
|
|
120
|
+
}),
|
|
121
|
+
masking: Object.freeze({
|
|
122
|
+
enabled: false,
|
|
123
|
+
character: '•',
|
|
124
|
+
partial: true
|
|
125
|
+
}),
|
|
126
|
+
storage: Object.freeze({
|
|
127
|
+
allowAutocomplete: false,
|
|
128
|
+
allowCache: false,
|
|
129
|
+
allowHistory: false
|
|
130
|
+
}),
|
|
131
|
+
audit: Object.freeze({
|
|
132
|
+
logAccess: true,
|
|
133
|
+
logChanges: true,
|
|
134
|
+
logSubmission: true,
|
|
135
|
+
includeMetadata: true
|
|
136
|
+
}),
|
|
137
|
+
ui: Object.freeze({
|
|
138
|
+
labelSuffix: ' (Sensitive)',
|
|
139
|
+
showSecurityBadge: true
|
|
140
|
+
}),
|
|
141
|
+
rateLimit: Object.freeze({
|
|
142
|
+
enabled: true,
|
|
143
|
+
maxAttempts: 10,
|
|
144
|
+
windowMs: 60000
|
|
145
|
+
})
|
|
146
|
+
}),
|
|
147
|
+
[SecurityTier.CRITICAL]: Object.freeze({
|
|
148
|
+
name: 'Critical',
|
|
149
|
+
level: 4,
|
|
150
|
+
validation: Object.freeze({
|
|
151
|
+
required: true,
|
|
152
|
+
strict: true,
|
|
153
|
+
maxLength: 256,
|
|
154
|
+
pattern: null,
|
|
155
|
+
sanitizeHtml: true
|
|
156
|
+
}),
|
|
157
|
+
masking: Object.freeze({
|
|
158
|
+
enabled: true,
|
|
159
|
+
character: '•',
|
|
160
|
+
partial: false
|
|
161
|
+
}),
|
|
162
|
+
storage: Object.freeze({
|
|
163
|
+
allowAutocomplete: false,
|
|
164
|
+
allowCache: false,
|
|
165
|
+
allowHistory: false
|
|
166
|
+
}),
|
|
167
|
+
audit: Object.freeze({
|
|
168
|
+
logAccess: true,
|
|
169
|
+
logChanges: true,
|
|
170
|
+
logSubmission: true,
|
|
171
|
+
includeMetadata: true
|
|
172
|
+
}),
|
|
173
|
+
ui: Object.freeze({
|
|
174
|
+
labelSuffix: ' (Critical - Secure)',
|
|
175
|
+
showSecurityBadge: true
|
|
176
|
+
}),
|
|
177
|
+
rateLimit: Object.freeze({
|
|
178
|
+
enabled: true,
|
|
179
|
+
maxAttempts: 5,
|
|
180
|
+
windowMs: 60000
|
|
181
|
+
})
|
|
182
|
+
})
|
|
183
|
+
});
|
|
184
|
+
/**
|
|
185
|
+
* Get configuration for a specific security tier
|
|
186
|
+
*
|
|
187
|
+
* Security Note: If an invalid tier is provided, this function fails secure
|
|
188
|
+
* by returning the CRITICAL tier configuration.
|
|
189
|
+
*/
|
|
190
|
+
export function getTierConfig(tier) {
|
|
191
|
+
if (!tier || !TIER_CONFIG[tier]) {
|
|
192
|
+
console.warn(`Invalid security tier "${tier}", defaulting to CRITICAL`);
|
|
193
|
+
return TIER_CONFIG[SecurityTier.CRITICAL];
|
|
194
|
+
}
|
|
195
|
+
return TIER_CONFIG[tier];
|
|
196
|
+
}
|
|
197
|
+
/**
|
|
198
|
+
* Validate that a tier value is valid
|
|
199
|
+
*/
|
|
200
|
+
export function isValidTier(tier) {
|
|
201
|
+
return Object.values(SecurityTier).includes(tier);
|
|
202
|
+
}
|
|
203
|
+
/**
|
|
204
|
+
* Compare two security tiers
|
|
205
|
+
*
|
|
206
|
+
* @returns -1 if tier1 < tier2, 0 if equal, 1 if tier1 > tier2
|
|
207
|
+
*/
|
|
208
|
+
export function compareTiers(tier1, tier2) {
|
|
209
|
+
const config1 = getTierConfig(tier1);
|
|
210
|
+
const config2 = getTierConfig(tier2);
|
|
211
|
+
return Math.sign(config1.level - config2.level);
|
|
212
|
+
}
|
|
213
|
+
/**
|
|
214
|
+
* Get the more secure of two tiers
|
|
215
|
+
*/
|
|
216
|
+
export function getMoreSecureTier(tier1, tier2) {
|
|
217
|
+
return compareTiers(tier1, tier2) >= 0 ? tier1 : tier2;
|
|
218
|
+
}
|
|
219
|
+
/**
|
|
220
|
+
* Content Security Policy recommendations for each tier
|
|
221
|
+
*/
|
|
222
|
+
export const CSP_RECOMMENDATIONS = Object.freeze({
|
|
223
|
+
[SecurityTier.PUBLIC]: Object.freeze({
|
|
224
|
+
'default-src': ["'self'"],
|
|
225
|
+
'script-src': ["'self'"],
|
|
226
|
+
'style-src': ["'self'", "'unsafe-inline'"]
|
|
227
|
+
}),
|
|
228
|
+
[SecurityTier.AUTHENTICATED]: Object.freeze({
|
|
229
|
+
'default-src': ["'self'"],
|
|
230
|
+
'script-src': ["'self'"],
|
|
231
|
+
'style-src': ["'self'", "'unsafe-inline'"],
|
|
232
|
+
'form-action': ["'self'"]
|
|
233
|
+
}),
|
|
234
|
+
[SecurityTier.SENSITIVE]: Object.freeze({
|
|
235
|
+
'default-src': ["'self'"],
|
|
236
|
+
'script-src': ["'self'"],
|
|
237
|
+
'style-src': ["'self'", "'unsafe-inline'"],
|
|
238
|
+
'form-action': ["'self'"],
|
|
239
|
+
'frame-ancestors': ["'none'"],
|
|
240
|
+
'upgrade-insecure-requests': []
|
|
241
|
+
}),
|
|
242
|
+
[SecurityTier.CRITICAL]: Object.freeze({
|
|
243
|
+
'default-src': ["'self'"],
|
|
244
|
+
'script-src': ["'self'"],
|
|
245
|
+
'style-src': ["'self'", "'unsafe-inline'"],
|
|
246
|
+
'form-action': ["'self'"],
|
|
247
|
+
'frame-ancestors': ["'none'"],
|
|
248
|
+
'upgrade-insecure-requests': [],
|
|
249
|
+
'block-all-mixed-content': [],
|
|
250
|
+
'base-uri': ["'none'"]
|
|
251
|
+
})
|
|
252
|
+
});
|
|
253
|
+
/**
|
|
254
|
+
* Default security headers recommendations
|
|
255
|
+
*/
|
|
256
|
+
export const SECURITY_HEADERS = Object.freeze({
|
|
257
|
+
'X-Content-Type-Options': 'nosniff',
|
|
258
|
+
'X-Frame-Options': 'DENY',
|
|
259
|
+
'X-XSS-Protection': '1; mode=block',
|
|
260
|
+
'Referrer-Policy': 'strict-origin-when-cross-origin',
|
|
261
|
+
'Permissions-Policy': 'geolocation=(), microphone=(), camera=()'
|
|
262
|
+
});
|
|
263
|
+
export default {
|
|
264
|
+
SecurityTier,
|
|
265
|
+
TIER_CONFIG,
|
|
266
|
+
getTierConfig,
|
|
267
|
+
isValidTier,
|
|
268
|
+
compareTiers,
|
|
269
|
+
getMoreSecureTier,
|
|
270
|
+
CSP_RECOMMENDATIONS,
|
|
271
|
+
SECURITY_HEADERS
|
|
272
|
+
};
|
|
273
|
+
//# sourceMappingURL=security-config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"security-config.js","sourceRoot":"","sources":["../../src/core/security-config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AASH;;;GAGG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,CAAC;IACxC,yEAAyE;IACzE,MAAM,EAAE,QAAiB;IAEzB,6FAA6F;IAC7F,aAAa,EAAE,eAAwB;IAEvC,mFAAmF;IACnF,SAAS,EAAE,WAAoB;IAE/B,oEAAoE;IACpE,QAAQ,EAAE,UAAmB;CAC9B,CAAC,CAAC;AAEH;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,WAAW,GAAoD,MAAM,CAAC,MAAM,CAAC;IACxF,CAAC,YAAY,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,CAAC;QACnC,IAAI,EAAE,QAAQ;QACd,KAAK,EAAE,CAAC;QACR,UAAU,EAAE,MAAM,CAAC,MAAM,CAAC;YACxB,QAAQ,EAAE,KAAK;YACf,MAAM,EAAE,KAAK;YACb,SAAS,EAAE,IAAI;YACf,OAAO,EAAE,IAAI;YACb,YAAY,EAAE,IAAI;SACnB,CAAC;QACF,OAAO,EAAE,MAAM,CAAC,MAAM,CAAC;YACrB,OAAO,EAAE,KAAK;YACd,SAAS,EAAE,GAAG;YACd,OAAO,EAAE,KAAK;SACf,CAAC;QACF,OAAO,EAAE,MAAM,CAAC,MAAM,CAAC;YACrB,iBAAiB,EAAE,IAAI;YACvB,UAAU,EAAE,IAAI;YAChB,YAAY,EAAE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AAE;KAChC,CAAC;IAEF,CAAC,YAAY,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,CAAC;QACrC,aAAa,EAAE,CAAC,QAAQ,CAAC;QACzB,YAAY,EAAE,CAAC,QAAQ,CAAC;QACxB,WAAW,EAAE,CAAC,QAAQ,EAAE,iBAAiB,CAAC;QAC1C,aAAa,EAAE,CAAC,QAAQ,CAAC;QACzB,iBAAiB,EAAE,CAAC,QAAQ,CAAC;QAC7B,2BAA2B,EAAE,EAAE;QAC/B,yBAAyB,EAAE,EAAE;QAC7B,UAAU,EAAE,CAAC,QAAQ,CAAC;KACvB,CAAC;CACH,CAAC,CAAC;AAEH;;GAEG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAA8B,MAAM,CAAC,MAAM,CAAC;IACvE,wBAAwB,EAAE,SAAS;IACnC,iBAAiB,EAAE,MAAM;IACzB,kBAAkB,EAAE,eAAe;IACnC,iBAAiB,EAAE,iCAAiC;IACpD,oBAAoB,EAAE,0CAA0C;CACjE,CAAC,CAAC;AAEH,eAAe;IACb,YAAY;IACZ,WAAW;IACX,aAAa;IACb,WAAW;IACX,YAAY;IACZ,iBAAiB;IACjB,mBAAmB;IACnB,gBAAgB;CACjB,CAAC"}
|
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Shared type definitions for the Secure-UI component library.
|
|
3
|
+
* @module types
|
|
4
|
+
* @license MIT
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Security tier string literal values
|
|
8
|
+
*/
|
|
9
|
+
export type SecurityTierValue = 'public' | 'authenticated' | 'sensitive' | 'critical';
|
|
10
|
+
/**
|
|
11
|
+
* Validation configuration for a security tier
|
|
12
|
+
*/
|
|
13
|
+
export interface ValidationConfig {
|
|
14
|
+
readonly required: boolean;
|
|
15
|
+
readonly strict: boolean;
|
|
16
|
+
readonly maxLength: number;
|
|
17
|
+
readonly pattern: RegExp | null;
|
|
18
|
+
readonly sanitizeHtml: boolean;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Masking configuration for a security tier
|
|
22
|
+
*/
|
|
23
|
+
export interface MaskingConfig {
|
|
24
|
+
readonly enabled: boolean;
|
|
25
|
+
readonly character: string;
|
|
26
|
+
readonly partial: boolean;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Browser storage permissions for a security tier
|
|
30
|
+
*/
|
|
31
|
+
export interface StorageConfig {
|
|
32
|
+
readonly allowAutocomplete: boolean;
|
|
33
|
+
readonly allowCache: boolean;
|
|
34
|
+
readonly allowHistory: boolean;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Audit logging configuration for a security tier
|
|
38
|
+
*/
|
|
39
|
+
export interface AuditConfig {
|
|
40
|
+
readonly logAccess: boolean;
|
|
41
|
+
readonly logChanges: boolean;
|
|
42
|
+
readonly logSubmission: boolean;
|
|
43
|
+
readonly includeMetadata: boolean;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* UI configuration for a security tier
|
|
47
|
+
*/
|
|
48
|
+
export interface UIConfig {
|
|
49
|
+
readonly labelSuffix: string;
|
|
50
|
+
readonly showSecurityBadge: boolean;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Rate limiting configuration for a security tier
|
|
54
|
+
*/
|
|
55
|
+
export interface RateLimitConfig {
|
|
56
|
+
readonly enabled: boolean;
|
|
57
|
+
readonly maxAttempts: number;
|
|
58
|
+
readonly windowMs: number;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Complete tier configuration object
|
|
62
|
+
*/
|
|
63
|
+
export interface TierConfig {
|
|
64
|
+
readonly name: string;
|
|
65
|
+
readonly level: number;
|
|
66
|
+
readonly validation: ValidationConfig;
|
|
67
|
+
readonly masking: MaskingConfig;
|
|
68
|
+
readonly storage: StorageConfig;
|
|
69
|
+
readonly audit: AuditConfig;
|
|
70
|
+
readonly ui: UIConfig;
|
|
71
|
+
readonly rateLimit: RateLimitConfig;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Validation result returned by validateInput()
|
|
75
|
+
*/
|
|
76
|
+
export interface ValidationResult {
|
|
77
|
+
valid: boolean;
|
|
78
|
+
errors: string[];
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Validation options passed to validateInput()
|
|
82
|
+
*/
|
|
83
|
+
export interface ValidationOptions {
|
|
84
|
+
pattern?: RegExp | null;
|
|
85
|
+
minLength?: number;
|
|
86
|
+
maxLength?: number;
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Rate limit check result
|
|
90
|
+
*/
|
|
91
|
+
export interface RateLimitResult {
|
|
92
|
+
allowed: boolean;
|
|
93
|
+
retryAfter: number;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Rate limit state tracking
|
|
97
|
+
*/
|
|
98
|
+
export interface RateLimitState {
|
|
99
|
+
attempts: number;
|
|
100
|
+
windowStart: number;
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Audit log entry
|
|
104
|
+
*/
|
|
105
|
+
export interface AuditLogEntry {
|
|
106
|
+
event: string;
|
|
107
|
+
tier: SecurityTierValue;
|
|
108
|
+
timestamp: string;
|
|
109
|
+
userAgent?: string;
|
|
110
|
+
language?: string;
|
|
111
|
+
[key: string]: unknown;
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* CSP directive mapping
|
|
115
|
+
*/
|
|
116
|
+
export type CSPDirectives = Record<string, string[]>;
|
|
117
|
+
/**
|
|
118
|
+
* Security headers mapping
|
|
119
|
+
*/
|
|
120
|
+
export type SecurityHeaders = Record<string, string>;
|
|
121
|
+
/**
|
|
122
|
+
* Custom event detail for secure-input events
|
|
123
|
+
*/
|
|
124
|
+
export interface SecureInputEventDetail {
|
|
125
|
+
name: string;
|
|
126
|
+
value: string;
|
|
127
|
+
masked: boolean;
|
|
128
|
+
tier: SecurityTierValue;
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Custom event detail for secure-textarea events
|
|
132
|
+
*/
|
|
133
|
+
export interface SecureTextareaEventDetail {
|
|
134
|
+
name: string;
|
|
135
|
+
value: string;
|
|
136
|
+
tier: SecurityTierValue;
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Custom event detail for secure-select events
|
|
140
|
+
*/
|
|
141
|
+
export interface SecureSelectEventDetail {
|
|
142
|
+
name: string;
|
|
143
|
+
value: string;
|
|
144
|
+
tier: SecurityTierValue;
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* Custom event detail for secure-file-upload events
|
|
148
|
+
*/
|
|
149
|
+
export interface SecureFileUploadEventDetail {
|
|
150
|
+
name: string;
|
|
151
|
+
files: File[];
|
|
152
|
+
tier: SecurityTierValue;
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* Custom event detail for secure-datetime events
|
|
156
|
+
*/
|
|
157
|
+
export interface SecureDatetimeEventDetail {
|
|
158
|
+
name: string;
|
|
159
|
+
value: string;
|
|
160
|
+
type: string;
|
|
161
|
+
tier: SecurityTierValue;
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* Custom event detail for secure-form-submit events
|
|
165
|
+
*/
|
|
166
|
+
export interface SecureFormSubmitEventDetail {
|
|
167
|
+
formData: Record<string, string>;
|
|
168
|
+
formElement: HTMLFormElement;
|
|
169
|
+
preventDefault: () => void;
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* Custom event detail for secure-form-success events
|
|
173
|
+
*/
|
|
174
|
+
export interface SecureFormSuccessEventDetail {
|
|
175
|
+
formData: Record<string, string>;
|
|
176
|
+
response: Response;
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* Custom event detail for secure-audit events
|
|
180
|
+
*/
|
|
181
|
+
export type SecureAuditEventDetail = AuditLogEntry;
|
|
182
|
+
/**
|
|
183
|
+
* Table column definition
|
|
184
|
+
*/
|
|
185
|
+
export interface TableColumnDefinition {
|
|
186
|
+
key: string;
|
|
187
|
+
label: string;
|
|
188
|
+
sortable?: boolean;
|
|
189
|
+
filterable?: boolean;
|
|
190
|
+
tier?: SecurityTierValue;
|
|
191
|
+
width?: string;
|
|
192
|
+
render?: (value: unknown, row: Record<string, unknown>, columnKey: string) => string;
|
|
193
|
+
}
|
|
194
|
+
/**
|
|
195
|
+
* Table sort configuration
|
|
196
|
+
*/
|
|
197
|
+
export interface TableSortConfig {
|
|
198
|
+
column: string | null;
|
|
199
|
+
direction: 'asc' | 'desc';
|
|
200
|
+
}
|
|
201
|
+
/**
|
|
202
|
+
* Table pagination state
|
|
203
|
+
*/
|
|
204
|
+
export interface TablePaginationState {
|
|
205
|
+
currentPage: number;
|
|
206
|
+
pageSize: number;
|
|
207
|
+
}
|
|
208
|
+
/**
|
|
209
|
+
* Valid datetime input types
|
|
210
|
+
*/
|
|
211
|
+
export type DateTimeInputType = 'date' | 'time' | 'datetime-local' | 'month' | 'week';
|
|
212
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/core/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG,QAAQ,GAAG,eAAe,GAAG,WAAW,GAAG,UAAU,CAAC;AAEtF;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;IAC3B,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IACzB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,QAAQ,CAAC,YAAY,EAAE,OAAO,CAAC;CAChC;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,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;CAC3B;AAED;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAID;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG,MAAM,GAAG,MAAM,GAAG,gBAAgB,GAAG,OAAO,GAAG,MAAM,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/core/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Secure-UI Component Library
|
|
3
|
+
*
|
|
4
|
+
* @module @anthropic/secure-ui-components
|
|
5
|
+
* @license MIT
|
|
6
|
+
*/
|
|
7
|
+
export { SecureBaseComponent } from './core/base-component.js';
|
|
8
|
+
export { SecurityTier, TIER_CONFIG, getTierConfig, isValidTier, compareTiers, getMoreSecureTier, CSP_RECOMMENDATIONS, SECURITY_HEADERS } from './core/security-config.js';
|
|
9
|
+
export { SecureInput } from './components/secure-input/secure-input.js';
|
|
10
|
+
export { SecureTextarea } from './components/secure-textarea/secure-textarea.js';
|
|
11
|
+
export { SecureSelect } from './components/secure-select/secure-select.js';
|
|
12
|
+
export { SecureForm } from './components/secure-form/secure-form.js';
|
|
13
|
+
export { SecureFileUpload } from './components/secure-file-upload/secure-file-upload.js';
|
|
14
|
+
export { SecureDateTime } from './components/secure-datetime/secure-datetime.js';
|
|
15
|
+
export { SecureTable } from './components/secure-table/secure-table.js';
|
|
16
|
+
export { SecureSubmitButton } from './components/secure-submit-button/secure-submit-button.js';
|
|
17
|
+
export type { SecurityTierValue, TierConfig, ValidationConfig, MaskingConfig, StorageConfig, AuditConfig, UIConfig, RateLimitConfig, ValidationResult, ValidationOptions, RateLimitResult, RateLimitState, AuditLogEntry, CSPDirectives, SecurityHeaders, SecureInputEventDetail, SecureTextareaEventDetail, SecureSelectEventDetail, SecureFileUploadEventDetail, SecureDatetimeEventDetail, SecureFormSubmitEventDetail, SecureFormSuccessEventDetail, SecureAuditEventDetail, TableColumnDefinition, TableSortConfig, TablePaginationState, DateTimeInputType } from './core/types.js';
|
|
18
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,aAAa,EAAE,WAAW,EAAE,YAAY,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAG1K,OAAO,EAAE,WAAW,EAAE,MAAM,2CAA2C,CAAC;AACxE,OAAO,EAAE,cAAc,EAAE,MAAM,iDAAiD,CAAC;AACjF,OAAO,EAAE,YAAY,EAAE,MAAM,6CAA6C,CAAC;AAC3E,OAAO,EAAE,UAAU,EAAE,MAAM,yCAAyC,CAAC;AACrE,OAAO,EAAE,gBAAgB,EAAE,MAAM,uDAAuD,CAAC;AACzF,OAAO,EAAE,cAAc,EAAE,MAAM,iDAAiD,CAAC;AACjF,OAAO,EAAE,WAAW,EAAE,MAAM,2CAA2C,CAAC;AACxE,OAAO,EAAE,kBAAkB,EAAE,MAAM,2DAA2D,CAAC;AAG/F,YAAY,EACV,iBAAiB,EACjB,UAAU,EACV,gBAAgB,EAChB,aAAa,EACb,aAAa,EACb,WAAW,EACX,QAAQ,EACR,eAAe,EACf,gBAAgB,EAChB,iBAAiB,EACjB,eAAe,EACf,cAAc,EACd,aAAa,EACb,aAAa,EACb,eAAe,EACf,sBAAsB,EACtB,yBAAyB,EACzB,uBAAuB,EACvB,2BAA2B,EAC3B,yBAAyB,EACzB,2BAA2B,EAC3B,4BAA4B,EAC5B,sBAAsB,EACtB,qBAAqB,EACrB,eAAe,EACf,oBAAoB,EACpB,iBAAiB,EAClB,MAAM,iBAAiB,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Secure-UI Component Library
|
|
3
|
+
*
|
|
4
|
+
* @module @anthropic/secure-ui-components
|
|
5
|
+
* @license MIT
|
|
6
|
+
*/
|
|
7
|
+
// Core
|
|
8
|
+
export { SecureBaseComponent } from './core/base-component.js';
|
|
9
|
+
export { SecurityTier, TIER_CONFIG, getTierConfig, isValidTier, compareTiers, getMoreSecureTier, CSP_RECOMMENDATIONS, SECURITY_HEADERS } from './core/security-config.js';
|
|
10
|
+
// Components
|
|
11
|
+
export { SecureInput } from './components/secure-input/secure-input.js';
|
|
12
|
+
export { SecureTextarea } from './components/secure-textarea/secure-textarea.js';
|
|
13
|
+
export { SecureSelect } from './components/secure-select/secure-select.js';
|
|
14
|
+
export { SecureForm } from './components/secure-form/secure-form.js';
|
|
15
|
+
export { SecureFileUpload } from './components/secure-file-upload/secure-file-upload.js';
|
|
16
|
+
export { SecureDateTime } from './components/secure-datetime/secure-datetime.js';
|
|
17
|
+
export { SecureTable } from './components/secure-table/secure-table.js';
|
|
18
|
+
export { SecureSubmitButton } from './components/secure-submit-button/secure-submit-button.js';
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO;AACP,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,aAAa,EAAE,WAAW,EAAE,YAAY,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAE1K,aAAa;AACb,OAAO,EAAE,WAAW,EAAE,MAAM,2CAA2C,CAAC;AACxE,OAAO,EAAE,cAAc,EAAE,MAAM,iDAAiD,CAAC;AACjF,OAAO,EAAE,YAAY,EAAE,MAAM,6CAA6C,CAAC;AAC3E,OAAO,EAAE,UAAU,EAAE,MAAM,yCAAyC,CAAC;AACrE,OAAO,EAAE,gBAAgB,EAAE,MAAM,uDAAuD,CAAC;AACzF,OAAO,EAAE,cAAc,EAAE,MAAM,iDAAiD,CAAC;AACjF,OAAO,EAAE,WAAW,EAAE,MAAM,2CAA2C,CAAC;AACxE,OAAO,EAAE,kBAAkB,EAAE,MAAM,2DAA2D,CAAC"}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "secure-ui-components",
|
|
3
|
+
"version": "0.1.0-beta.1",
|
|
4
|
+
"description": "Security-first web component library with zero dependencies",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./index.js",
|
|
7
|
+
"module": "./index.js",
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": "./index.js",
|
|
11
|
+
"./secure-input": "./components/secure-input/secure-input.js",
|
|
12
|
+
"./secure-textarea": "./components/secure-textarea/secure-textarea.js",
|
|
13
|
+
"./secure-select": "./components/secure-select/secure-select.js",
|
|
14
|
+
"./secure-form": "./components/secure-form/secure-form.js",
|
|
15
|
+
"./secure-file-upload": "./components/secure-file-upload/secure-file-upload.js",
|
|
16
|
+
"./secure-datetime": "./components/secure-datetime/secure-datetime.js",
|
|
17
|
+
"./secure-table": "./components/secure-table/secure-table.js",
|
|
18
|
+
"./secure-submit-button": "./components/secure-submit-button/secure-submit-button.js",
|
|
19
|
+
"./base-component": "./core/base-component.js",
|
|
20
|
+
"./security-config": "./core/security-config.js",
|
|
21
|
+
"./tokens": "./styles/tokens.css"
|
|
22
|
+
},
|
|
23
|
+
"files": [
|
|
24
|
+
"dist",
|
|
25
|
+
"README.md",
|
|
26
|
+
"LICENSE"
|
|
27
|
+
],
|
|
28
|
+
"scripts": {
|
|
29
|
+
"clean": "node -e \"const fs=require('fs');fs.rmSync('dist',{recursive:true,force:true})\"",
|
|
30
|
+
"typecheck": "tsc --noEmit",
|
|
31
|
+
"build:ts": "tsc",
|
|
32
|
+
"build:css": "node build/css-inliner.js",
|
|
33
|
+
"build": "npm run clean && npm run build:ts && npm run build:css",
|
|
34
|
+
"build:dev": "npm run build:ts && node build/dev-build.js",
|
|
35
|
+
"serve": "node server.js",
|
|
36
|
+
"serve:dev": "node --watch server.js",
|
|
37
|
+
"start": "npm run build && npm run serve",
|
|
38
|
+
"dev": "npm run build && npm run serve:dev",
|
|
39
|
+
"lint": "eslint src tests",
|
|
40
|
+
"lint:fix": "eslint src tests --fix",
|
|
41
|
+
"test": "vitest run",
|
|
42
|
+
"test:watch": "vitest",
|
|
43
|
+
"test:coverage": "vitest run --coverage",
|
|
44
|
+
"size": "size-limit",
|
|
45
|
+
"audit:check": "npm audit --audit-level=high",
|
|
46
|
+
"prepublishOnly": "npm run lint && npm run typecheck && npm run test && npm run build"
|
|
47
|
+
},
|
|
48
|
+
"keywords": [
|
|
49
|
+
"web-components",
|
|
50
|
+
"security",
|
|
51
|
+
"ui",
|
|
52
|
+
"form-components",
|
|
53
|
+
"typescript",
|
|
54
|
+
"progressive-enhancement",
|
|
55
|
+
"zero-dependencies",
|
|
56
|
+
"xss-prevention",
|
|
57
|
+
"audit-logging",
|
|
58
|
+
"input-validation",
|
|
59
|
+
"shadow-dom",
|
|
60
|
+
"custom-elements"
|
|
61
|
+
],
|
|
62
|
+
"author": "Barry Prendergast <barryprendergast@gmail.com>",
|
|
63
|
+
"license": "MIT",
|
|
64
|
+
"repository": {
|
|
65
|
+
"type": "git",
|
|
66
|
+
"url": "https://github.com/Barryprender/Secure-UI.git"
|
|
67
|
+
},
|
|
68
|
+
"bugs": {
|
|
69
|
+
"url": "https://github.com/Barryprender/Secure-UI/issues"
|
|
70
|
+
},
|
|
71
|
+
"homepage": "https://github.com/Barryprender/Secure-UI#readme",
|
|
72
|
+
"devDependencies": {
|
|
73
|
+
"@size-limit/preset-small-lib": "^12.0.1",
|
|
74
|
+
"@vitest/coverage-v8": "^4.0.18",
|
|
75
|
+
"axe-core": "^4.11.1",
|
|
76
|
+
"cors": "^2.8.5",
|
|
77
|
+
"eslint-plugin-security": "^4.0.0",
|
|
78
|
+
"express": "^4.18.2",
|
|
79
|
+
"happy-dom": "^20.4.0",
|
|
80
|
+
"jsdom": "^27.4.0",
|
|
81
|
+
"size-limit": "^12.0.1",
|
|
82
|
+
"typescript": "^5.5.0",
|
|
83
|
+
"typescript-eslint": "^8.57.0",
|
|
84
|
+
"vitest": "^4.0.18"
|
|
85
|
+
},
|
|
86
|
+
"engines": {
|
|
87
|
+
"node": ">=18.0.0"
|
|
88
|
+
}
|
|
89
|
+
}
|