@open-charging-cloud/chargy-gui 0.0.0-stage → 0.1.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/CHANGELOG.md +87 -0
- package/LICENSE +661 -0
- package/README.md +48 -2
- package/SECURITY.md +21 -0
- package/dist/anchorKeyTrust.d.ts +9 -0
- package/dist/anchorKeyTrust.d.ts.map +1 -0
- package/dist/anchorKeyTrust.js +24 -0
- package/dist/anchorKeyTrust.js.map +1 -0
- package/dist/anchorKeyTrustView.d.ts +14 -0
- package/dist/anchorKeyTrustView.d.ts.map +1 -0
- package/dist/anchorKeyTrustView.js +95 -0
- package/dist/anchorKeyTrustView.js.map +1 -0
- package/dist/browserFiles.d.ts +5 -0
- package/dist/browserFiles.d.ts.map +1 -0
- package/dist/browserFiles.js +100 -0
- package/dist/browserFiles.js.map +1 -0
- package/dist/core/i18n.json +1518 -0
- package/dist/core/package.json +119 -0
- package/dist/core/validationRules.json +8 -0
- package/dist/domHelpers.d.ts +25 -0
- package/dist/domHelpers.d.ts.map +1 -0
- package/dist/domHelpers.js +212 -0
- package/dist/domHelpers.js.map +1 -0
- package/dist/historicalSessionPanel.d.ts +24 -0
- package/dist/historicalSessionPanel.d.ts.map +1 -0
- package/dist/historicalSessionPanel.js +108 -0
- package/dist/historicalSessionPanel.js.map +1 -0
- package/dist/index.d.ts +40 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +56 -0
- package/dist/index.js.map +1 -0
- package/dist/liveLinkTrust.d.ts +208 -0
- package/dist/liveLinkTrust.d.ts.map +1 -0
- package/dist/liveLinkTrust.js +452 -0
- package/dist/liveLinkTrust.js.map +1 -0
- package/dist/livePOISession.d.ts +38 -0
- package/dist/livePOISession.d.ts.map +1 -0
- package/dist/livePOISession.js +193 -0
- package/dist/livePOISession.js.map +1 -0
- package/dist/measurementDetailsRenderer.d.ts +25 -0
- package/dist/measurementDetailsRenderer.d.ts.map +1 -0
- package/dist/measurementDetailsRenderer.js +343 -0
- package/dist/measurementDetailsRenderer.js.map +1 -0
- package/dist/poiConsistencyView.d.ts +3 -0
- package/dist/poiConsistencyView.d.ts.map +1 -0
- package/dist/poiConsistencyView.js +14 -0
- package/dist/poiConsistencyView.js.map +1 -0
- package/dist/poiObservedHistory.d.ts +49 -0
- package/dist/poiObservedHistory.d.ts.map +1 -0
- package/dist/poiObservedHistory.js +205 -0
- package/dist/poiObservedHistory.js.map +1 -0
- package/dist/poiTransport.d.ts +12 -0
- package/dist/poiTransport.d.ts.map +1 -0
- package/dist/poiTransport.js +74 -0
- package/dist/poiTransport.js.map +1 -0
- package/dist/poiTrustContext.d.ts +134 -0
- package/dist/poiTrustContext.d.ts.map +1 -0
- package/dist/poiTrustContext.js +243 -0
- package/dist/poiTrustContext.js.map +1 -0
- package/dist/poiTrustLineage.d.ts +10 -0
- package/dist/poiTrustLineage.d.ts.map +1 -0
- package/dist/poiTrustLineage.js +47 -0
- package/dist/poiTrustLineage.js.map +1 -0
- package/dist/poiURLs.d.ts +5 -0
- package/dist/poiURLs.d.ts.map +1 -0
- package/dist/poiURLs.js +24 -0
- package/dist/poiURLs.js.map +1 -0
- package/dist/poiWitnessManagement.d.ts +3 -0
- package/dist/poiWitnessManagement.d.ts.map +1 -0
- package/dist/poiWitnessManagement.js +127 -0
- package/dist/poiWitnessManagement.js.map +1 -0
- package/dist/poiWitnessTrust.d.ts +26 -0
- package/dist/poiWitnessTrust.d.ts.map +1 -0
- package/dist/poiWitnessTrust.js +90 -0
- package/dist/poiWitnessTrust.js.map +1 -0
- package/dist/pricePublicationData.d.ts +19 -0
- package/dist/pricePublicationData.d.ts.map +1 -0
- package/dist/pricePublicationData.js +83 -0
- package/dist/pricePublicationData.js.map +1 -0
- package/dist/roamingNetworks.d.ts +14 -0
- package/dist/roamingNetworks.d.ts.map +1 -0
- package/dist/roamingNetworks.js +33 -0
- package/dist/roamingNetworks.js.map +1 -0
- package/dist/securityFingerprint.d.ts +16 -0
- package/dist/securityFingerprint.d.ts.map +1 -0
- package/dist/securityFingerprint.js +36 -0
- package/dist/securityFingerprint.js.map +1 -0
- package/dist/securityFingerprintView.d.ts +3 -0
- package/dist/securityFingerprintView.d.ts.map +1 -0
- package/dist/securityFingerprintView.js +61 -0
- package/dist/securityFingerprintView.js.map +1 -0
- package/dist/sessionEvidenceStore.d.ts +23 -0
- package/dist/sessionEvidenceStore.d.ts.map +1 -0
- package/dist/sessionEvidenceStore.js +81 -0
- package/dist/sessionEvidenceStore.js.map +1 -0
- package/dist/sessionMeterKeyView.d.ts +9 -0
- package/dist/sessionMeterKeyView.d.ts.map +1 -0
- package/dist/sessionMeterKeyView.js +55 -0
- package/dist/sessionMeterKeyView.js.map +1 -0
- package/dist/sessionPOIData.d.ts +49 -0
- package/dist/sessionPOIData.d.ts.map +1 -0
- package/dist/sessionPOIData.js +161 -0
- package/dist/sessionPOIData.js.map +1 -0
- package/dist/sessionPOIPanel.d.ts +50 -0
- package/dist/sessionPOIPanel.d.ts.map +1 -0
- package/dist/sessionPOIPanel.js +288 -0
- package/dist/sessionPOIPanel.js.map +1 -0
- package/dist/sessionPriceData.d.ts +17 -0
- package/dist/sessionPriceData.d.ts.map +1 -0
- package/dist/sessionPriceData.js +51 -0
- package/dist/sessionPriceData.js.map +1 -0
- package/dist/sessionPricePanel.d.ts +31 -0
- package/dist/sessionPricePanel.d.ts.map +1 -0
- package/dist/sessionPricePanel.js +222 -0
- package/dist/sessionPricePanel.js.map +1 -0
- package/dist/sessionUIState.d.ts +12 -0
- package/dist/sessionUIState.d.ts.map +1 -0
- package/dist/sessionUIState.js +33 -0
- package/dist/sessionUIState.js.map +1 -0
- package/dist/stationProofData.d.ts +38 -0
- package/dist/stationProofData.d.ts.map +1 -0
- package/dist/stationProofData.js +83 -0
- package/dist/stationProofData.js.map +1 -0
- package/dist/stationProofPanel.d.ts +44 -0
- package/dist/stationProofPanel.d.ts.map +1 -0
- package/dist/stationProofPanel.js +304 -0
- package/dist/stationProofPanel.js.map +1 -0
- package/dist/stationProofView.d.ts +9 -0
- package/dist/stationProofView.d.ts.map +1 -0
- package/dist/stationProofView.js +186 -0
- package/dist/stationProofView.js.map +1 -0
- package/dist/trustAnchorData.d.ts +40 -0
- package/dist/trustAnchorData.d.ts.map +1 -0
- package/dist/trustAnchorData.js +91 -0
- package/dist/trustAnchorData.js.map +1 -0
- package/dist/trustAnchorDataView.d.ts +13 -0
- package/dist/trustAnchorDataView.d.ts.map +1 -0
- package/dist/trustAnchorDataView.js +69 -0
- package/dist/trustAnchorDataView.js.map +1 -0
- package/dist/trustAnchorImport.d.ts +5 -0
- package/dist/trustAnchorImport.d.ts.map +1 -0
- package/dist/trustAnchorImport.js +34 -0
- package/dist/trustAnchorImport.js.map +1 -0
- package/dist/trustAnchorPreview.d.ts +37 -0
- package/dist/trustAnchorPreview.d.ts.map +1 -0
- package/dist/trustAnchorPreview.js +180 -0
- package/dist/trustAnchorPreview.js.map +1 -0
- package/dist/trustManagement.d.ts +34 -0
- package/dist/trustManagement.d.ts.map +1 -0
- package/dist/trustManagement.js +405 -0
- package/dist/trustManagement.js.map +1 -0
- package/dist/trustStore.d.ts +75 -0
- package/dist/trustStore.d.ts.map +1 -0
- package/dist/trustStore.js +408 -0
- package/dist/trustStore.js.map +1 -0
- package/dist/trustTransitionView.d.ts +5 -0
- package/dist/trustTransitionView.d.ts.map +1 -0
- package/dist/trustTransitionView.js +110 -0
- package/dist/trustTransitionView.js.map +1 -0
- package/dist/trustedPublicKeys.d.ts +4 -0
- package/dist/trustedPublicKeys.d.ts.map +1 -0
- package/dist/trustedPublicKeys.js +25 -0
- package/dist/trustedPublicKeys.js.map +1 -0
- package/dist/wwcpPoi.d.ts +2 -0
- package/dist/wwcpPoi.d.ts.map +1 -0
- package/dist/wwcpPoi.js +2 -0
- package/dist/wwcpPoi.js.map +1 -0
- package/documentation/AUDIT.md +262 -0
- package/images/NGI0_tag.svg +149 -0
- package/package.json +75 -4
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { POITrustService } from './poiTrustContext.js';
|
|
2
|
+
import { renderSecurityFingerprint } from './securityFingerprintView.js';
|
|
3
|
+
import { broadcastTrustPolicyChange } from './poiObservedHistory.js';
|
|
4
|
+
/** An explicit local decision; pasted/downloaded data never changes trust by itself. */
|
|
5
|
+
export function renderTrustTransitionManager(parent, record, store, keys, localize, isCurrent, refresh) {
|
|
6
|
+
const root = parent.appendChild(document.createElement('section'));
|
|
7
|
+
root.className = 'trustTransitionManager';
|
|
8
|
+
root.dataset['policyId'] = record.id;
|
|
9
|
+
root.appendChild(document.createElement('h4')).textContent = localize('poiTransitionTitle');
|
|
10
|
+
root.appendChild(document.createElement('p')).textContent = localize('poiTransitionScope');
|
|
11
|
+
root.appendChild(document.createElement('p')).textContent = localize('poiTransitionCount') + ': ' + String(record.transitions?.length ?? 0);
|
|
12
|
+
if ((record.transitions?.length ?? 0) > 0) {
|
|
13
|
+
const history = root.appendChild(document.createElement('details'));
|
|
14
|
+
history.appendChild(document.createElement('summary')).textContent = localize('poiTransitionOriginals');
|
|
15
|
+
for (const item of record.transitions ?? [])
|
|
16
|
+
history.appendChild(document.createElement('pre')).textContent = item.text;
|
|
17
|
+
}
|
|
18
|
+
const label = root.appendChild(document.createElement('label'));
|
|
19
|
+
label.textContent = localize('poiTransitionInput');
|
|
20
|
+
const input = label.appendChild(document.createElement('textarea'));
|
|
21
|
+
input.rows = 6;
|
|
22
|
+
input.maxLength = 2 * 1024 * 1024;
|
|
23
|
+
input.spellcheck = false;
|
|
24
|
+
input.dataset['action'] = 'transition-text';
|
|
25
|
+
const file = root.appendChild(document.createElement('input'));
|
|
26
|
+
file.type = 'file';
|
|
27
|
+
file.accept = '.json,application/json';
|
|
28
|
+
file.dataset['action'] = 'transition-file';
|
|
29
|
+
const review = root.appendChild(document.createElement('button'));
|
|
30
|
+
review.type = 'button';
|
|
31
|
+
review.textContent = localize('poiTransitionReview');
|
|
32
|
+
review.dataset['action'] = 'review-transition';
|
|
33
|
+
const result = root.appendChild(document.createElement('div'));
|
|
34
|
+
result.className = 'trustTransitionResult';
|
|
35
|
+
const reset = () => { result.replaceChildren(); };
|
|
36
|
+
input.oninput = reset;
|
|
37
|
+
file.onchange = () => {
|
|
38
|
+
const chosen = file.files?.[0];
|
|
39
|
+
if (chosen === undefined)
|
|
40
|
+
return;
|
|
41
|
+
reset();
|
|
42
|
+
if (chosen.size > 2 * 1024 * 1024) {
|
|
43
|
+
result.textContent = localize('poiTransitionTooLarge');
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
void chosen.text().then(text => { if (isCurrent()) {
|
|
47
|
+
input.value = text;
|
|
48
|
+
reset();
|
|
49
|
+
} }).catch(() => { if (isCurrent())
|
|
50
|
+
result.textContent = localize('poiTransitionFailed'); });
|
|
51
|
+
};
|
|
52
|
+
review.onclick = () => {
|
|
53
|
+
review.disabled = true;
|
|
54
|
+
const text = input.value;
|
|
55
|
+
reset();
|
|
56
|
+
const service = new POITrustService(store, keys);
|
|
57
|
+
void service.previewTrustTransition(record.id, text).then(preview => {
|
|
58
|
+
if (!isCurrent() || text !== input.value)
|
|
59
|
+
return;
|
|
60
|
+
result.dataset['state'] = preview.consistency.accepted ? 'valid' : 'invalid';
|
|
61
|
+
for (const key of ['poiTransitionSignatures', 'poiTransitionOldQuorum', 'poiTransitionNewQuorum'])
|
|
62
|
+
result.appendChild(document.createElement('p')).textContent = '✅ ' + localize(key);
|
|
63
|
+
result.appendChild(document.createElement('p')).textContent = localize('trustAnchorQuorumLabel') + ': ' + String(preview.context.requiredConsensus);
|
|
64
|
+
result.appendChild(document.createElement('p')).textContent = 'Epoch ' + String(preview.transition.oldEpoch.number) + ' → ' + String(preview.transition.epoch.number);
|
|
65
|
+
for (const url of preview.transition.source.anchor.urls)
|
|
66
|
+
result.appendChild(document.createElement('p')).textContent = url;
|
|
67
|
+
const details = result.appendChild(document.createElement('details'));
|
|
68
|
+
details.appendChild(document.createElement('summary')).textContent = localize('poiTransitionNewKeys');
|
|
69
|
+
for (const id of preview.transition.source.anchor.keys)
|
|
70
|
+
details.appendChild(renderSecurityFingerprint(id, localize));
|
|
71
|
+
if (!preview.consistency.accepted) {
|
|
72
|
+
result.appendChild(document.createElement('p')).textContent = '❌ ' + localize('poiObservedRejected');
|
|
73
|
+
for (const issue of preview.consistency.issues)
|
|
74
|
+
result.appendChild(document.createElement('p')).textContent = issue.code + ': ' + issue.detail;
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
result.appendChild(document.createElement('p')).textContent = localize('poiTransitionConfirmScope');
|
|
78
|
+
const accept = result.appendChild(document.createElement('button'));
|
|
79
|
+
accept.type = 'button';
|
|
80
|
+
accept.textContent = localize('poiTransitionAccept');
|
|
81
|
+
accept.dataset['action'] = 'accept-transition';
|
|
82
|
+
accept.onclick = () => {
|
|
83
|
+
accept.disabled = true;
|
|
84
|
+
void (async () => {
|
|
85
|
+
if (!isCurrent() || text !== input.value)
|
|
86
|
+
throw new Error('The reviewed transition changed');
|
|
87
|
+
await store.appendTrustTransition(preview.record, preview.deleted, text, preview.acceptedAt, (current, deleted) => { service.validateTransitionAppend(current, deleted, text, preview.acceptedAt); });
|
|
88
|
+
await service.beginObservations(record.id);
|
|
89
|
+
broadcastTrustPolicyChange();
|
|
90
|
+
if (isCurrent())
|
|
91
|
+
refresh();
|
|
92
|
+
})().catch((error) => { if (isCurrent()) {
|
|
93
|
+
accept.disabled = false;
|
|
94
|
+
result.dataset['state'] = 'invalid';
|
|
95
|
+
result.appendChild(document.createElement('p')).textContent = localize('poiTransitionFailed') + ': ' + (error instanceof Error ? error.message : String(error));
|
|
96
|
+
} });
|
|
97
|
+
};
|
|
98
|
+
}).catch((error) => {
|
|
99
|
+
if (isCurrent()) {
|
|
100
|
+
result.dataset['state'] = 'invalid';
|
|
101
|
+
result.appendChild(document.createElement('p')).textContent = '❌ ' + localize('poiTransitionFailed');
|
|
102
|
+
const detail = result.appendChild(document.createElement('details'));
|
|
103
|
+
detail.appendChild(document.createElement('summary')).textContent = localize('poiDiagnostics');
|
|
104
|
+
detail.appendChild(document.createElement('pre')).textContent = error instanceof Error ? error.message : String(error);
|
|
105
|
+
}
|
|
106
|
+
}).finally(() => { if (isCurrent())
|
|
107
|
+
review.disabled = false; });
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
//# sourceMappingURL=trustTransitionView.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trustTransitionView.js","sourceRoot":"","sources":["../src/trustTransitionView.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,eAAe,EAAC,MAAM,sBAAsB,CAAC;AAErD,OAAO,EAAC,yBAAyB,EAAC,MAAM,8BAA8B,CAAC;AACvE,OAAO,EAAC,0BAA0B,EAAC,MAAM,yBAAyB,CAAC;AAEnE,wFAAwF;AACxF,MAAM,UAAU,4BAA4B,CAAC,MAAkB,EAAC,MAAwB,EAAC,KAAgB,EAAC,IAA4B,EAAC,QAA6B,EAAC,SAAqB,EAAC,OAAgB;IACvM,MAAM,IAAI,GAAC,MAAM,CAAC,WAAW,CAAC,QAAQ,CAAC,aAAa,CAAC,SAAS,CAAC,CAAC,CAAC;IAAA,IAAI,CAAC,SAAS,GAAC,wBAAwB,CAAC;IAAA,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,GAAC,MAAM,CAAC,EAAE,CAAC;IAC5I,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,CAAC,WAAW,GAAC,QAAQ,CAAC,oBAAoB,CAAC,CAAC;IAC1F,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,CAAC,WAAW,GAAC,QAAQ,CAAC,oBAAoB,CAAC,CAAC;IACzF,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,CAAC,WAAW,GAAC,QAAQ,CAAC,oBAAoB,CAAC,GAAC,IAAI,GAAC,MAAM,CA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CAAC,qBAAqB,CAAC,GAAC,IAAI,GAAC,CAAC,KAAK,YAAY,KAAK,CAAA,CAAC,CAAA,KAAK,CAAC,OAAO,CAAA,CAAC,CAAA,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;gBAAA,CAAC,CAAA,CAAC,CAAC,CAAC;YAAA,CAAC,CAAC;QACrQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,KAAa,EAAC,EAAE;YAAC,IAAG,SAAS,EAAE,EAAC,CAAC;gBAAA,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,GAAC,SAAS,CAAC;gBAAA,MAAM,CAAC,WAAW,CAAC,QAAQ,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,CAAC,WAAW,GAAC,IAAI,GAAC,QAAQ,CAAC,qBAAqB,CAAC,CAAC;gBAC1K,MAAM,MAAM,GAAC,MAAM,CAAC,WAAW,CAAC,QAAQ,CAAC,aAAa,CAAC,SAAS,CAAC,CAAC,CAAC;gBAAA,MAAM,CAAC,WAAW,CAAC,QAAQ,CAAC,aAAa,CAAC,SAAS,CAAC,CAAC,CAAC,WAAW,GAAC,QAAQ,CAAC,gBAAgB,CAAC,CAAC;gBAAA,MAAM,CAAC,WAAW,CAAC,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,CAAC,WAAW,GAAC,KAAK,YAAY,KAAK,CAAA,CAAC,CAAA,KAAK,CAAC,OAAO,CAAA,CAAC,CAAA,MAAM,CAAC,KAAK,CAAC,CAAC;YAAA,CAAC;QACtR,CAAC,CAAC,CAAC,OAAO,CAAC,GAAE,EAAE,GAAC,IAAG,SAAS,EAAE;YAAC,MAAM,CAAC,QAAQ,GAAC,KAAK,CAAC,CAAA,CAAC,CAAC,CAAC;IAAA,CAAC,CAAC;AAClE,CAAC","sourcesContent":["import type {POIPublicKey} from '@open-charging-cloud/wwcp-poi';\nimport {POITrustService} from './poiTrustContext.js';\nimport type {TrustStore,StoredTrustAnchor} from './trustStore.js';\nimport {renderSecurityFingerprint} from './securityFingerprintView.js';\nimport {broadcastTrustPolicyChange} from './poiObservedHistory.js';\n\n/** An explicit local decision; pasted/downloaded data never changes trust by itself. */\nexport function renderTrustTransitionManager(parent:HTMLElement,record:StoredTrustAnchor,store:TrustStore,keys:readonly POIPublicKey[],localize:(key:string)=>string,isCurrent:()=>boolean,refresh:()=>void):void {\n const root=parent.appendChild(document.createElement('section'));root.className='trustTransitionManager';root.dataset['policyId']=record.id;\n root.appendChild(document.createElement('h4')).textContent=localize('poiTransitionTitle');\n root.appendChild(document.createElement('p')).textContent=localize('poiTransitionScope');\n root.appendChild(document.createElement('p')).textContent=localize('poiTransitionCount')+': '+String(record.transitions?.length??0);\n if((record.transitions?.length??0)>0){const history=root.appendChild(document.createElement('details'));history.appendChild(document.createElement('summary')).textContent=localize('poiTransitionOriginals');\n for(const item of record.transitions??[])history.appendChild(document.createElement('pre')).textContent=item.text;}\n const label=root.appendChild(document.createElement('label'));label.textContent=localize('poiTransitionInput');\n const input=label.appendChild(document.createElement('textarea'));input.rows=6;input.maxLength=2*1024*1024;input.spellcheck=false;input.dataset['action']='transition-text';\n const file=root.appendChild(document.createElement('input'));file.type='file';file.accept='.json,application/json';file.dataset['action']='transition-file';\n const review=root.appendChild(document.createElement('button'));review.type='button';review.textContent=localize('poiTransitionReview');review.dataset['action']='review-transition';\n const result=root.appendChild(document.createElement('div'));result.className='trustTransitionResult';\n const reset=():void=>{result.replaceChildren();};input.oninput=reset;\n file.onchange=():void=>{const chosen=file.files?.[0];if(chosen===undefined)return;reset();\n if(chosen.size>2*1024*1024){result.textContent=localize('poiTransitionTooLarge');return;}\n void chosen.text().then(text=>{if(isCurrent()){input.value=text;reset();}}).catch(()=>{if(isCurrent())result.textContent=localize('poiTransitionFailed');});};\n review.onclick=():void=>{review.disabled=true;const text=input.value;reset();\n const service=new POITrustService(store,keys);\n void service.previewTrustTransition(record.id,text).then(preview=>{\n if(!isCurrent()||text!==input.value)return;\n result.dataset['state']=preview.consistency.accepted?'valid':'invalid';\n for(const key of ['poiTransitionSignatures','poiTransitionOldQuorum','poiTransitionNewQuorum'])result.appendChild(document.createElement('p')).textContent='✅ '+localize(key);\n result.appendChild(document.createElement('p')).textContent=localize('trustAnchorQuorumLabel')+': '+String(preview.context.requiredConsensus);\n result.appendChild(document.createElement('p')).textContent='Epoch '+String(preview.transition.oldEpoch.number)+' → '+String(preview.transition.epoch.number);\n for(const url of preview.transition.source.anchor.urls)result.appendChild(document.createElement('p')).textContent=url;\n const details=result.appendChild(document.createElement('details'));details.appendChild(document.createElement('summary')).textContent=localize('poiTransitionNewKeys');\n for(const id of preview.transition.source.anchor.keys)details.appendChild(renderSecurityFingerprint(id,localize));\n if(!preview.consistency.accepted){result.appendChild(document.createElement('p')).textContent='❌ '+localize('poiObservedRejected');\n for(const issue of preview.consistency.issues)result.appendChild(document.createElement('p')).textContent=issue.code+': '+issue.detail;return;}\n result.appendChild(document.createElement('p')).textContent=localize('poiTransitionConfirmScope');\n const accept=result.appendChild(document.createElement('button'));accept.type='button';accept.textContent=localize('poiTransitionAccept');accept.dataset['action']='accept-transition';\n accept.onclick=():void=>{accept.disabled=true;void(async():Promise<void>=>{\n if(!isCurrent()||text!==input.value)throw new Error('The reviewed transition changed');\n await store.appendTrustTransition(preview.record,preview.deleted,text,preview.acceptedAt,(current,deleted)=> { service.validateTransitionAppend(current,deleted,text,preview.acceptedAt); });\n await service.beginObservations(record.id);broadcastTrustPolicyChange();if(isCurrent())refresh();\n })().catch((error:unknown)=>{if(isCurrent()){accept.disabled=false;result.dataset['state']='invalid';result.appendChild(document.createElement('p')).textContent=localize('poiTransitionFailed')+': '+(error instanceof Error?error.message:String(error));}});};\n }).catch((error:unknown)=>{if(isCurrent()){result.dataset['state']='invalid';result.appendChild(document.createElement('p')).textContent='❌ '+localize('poiTransitionFailed');\n const detail=result.appendChild(document.createElement('details'));detail.appendChild(document.createElement('summary')).textContent=localize('poiDiagnostics');detail.appendChild(document.createElement('pre')).textContent=error instanceof Error?error.message:String(error);}\n }).finally(()=>{if(isCurrent())review.disabled=false;});};\n}\n"]}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { POIPublicKey } from '@open-charging-cloud/wwcp-poi';
|
|
2
|
+
/** Shared by the build loader and the app; malformed trust configuration is never skipped. */
|
|
3
|
+
export declare function parseTrustedPublicKeysJSONL(text: string, source?: string): readonly POIPublicKey[];
|
|
4
|
+
//# sourceMappingURL=trustedPublicKeys.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trustedPublicKeys.d.ts","sourceRoot":"","sources":["../src/trustedPublicKeys.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAa,MAAM,+BAA+B,CAAC;AAExE,8FAA8F;AAC9F,wBAAgB,2BAA2B,CAAC,IAAI,EAAE,MAAM,EACb,MAAM,GAAE,MAAoC,GAAG,SAAS,YAAY,EAAE,CAsBhH"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { POIPublicKey, parseJSON } from '@open-charging-cloud/wwcp-poi';
|
|
2
|
+
/** Shared by the build loader and the app; malformed trust configuration is never skipped. */
|
|
3
|
+
export function parseTrustedPublicKeysJSONL(text, source = "trusted-public-keys.jsonl") {
|
|
4
|
+
if (text.startsWith("\uFEFF"))
|
|
5
|
+
throw new Error(`${source}:1: UTF-8 BOM is not supported`);
|
|
6
|
+
const keys = [];
|
|
7
|
+
const ids = new Set();
|
|
8
|
+
for (const [index, line] of text.split(/\r?\n/).entries()) {
|
|
9
|
+
if (line.trim() === "")
|
|
10
|
+
continue;
|
|
11
|
+
try {
|
|
12
|
+
const key = POIPublicKey.parse(parseJSON(line));
|
|
13
|
+
if (ids.has(key.id))
|
|
14
|
+
throw new Error(`Duplicate trusted public key '${key.id}'`);
|
|
15
|
+
ids.add(key.id);
|
|
16
|
+
keys.push(key);
|
|
17
|
+
}
|
|
18
|
+
catch (error) {
|
|
19
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
20
|
+
throw new Error(`${source}:${index + 1}: ${message}`, { cause: error });
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
return Object.freeze(keys);
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=trustedPublicKeys.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trustedPublicKeys.js","sourceRoot":"","sources":["../src/trustedPublicKeys.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAExE,8FAA8F;AAC9F,MAAM,UAAU,2BAA2B,CAAC,IAAY,EACb,SAAiB,2BAA2B;IACnF,IAAI,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC;QACzB,MAAM,IAAI,KAAK,CAAC,GAAG,MAAM,gCAAgC,CAAC,CAAC;IAE/D,MAAM,IAAI,GAAmB,EAAE,CAAC;IAChC,MAAM,GAAG,GAAG,IAAI,GAAG,EAAU,CAAC;IAC9B,KAAK,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC;QACxD,IAAI,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE;YAClB,SAAS;QACb,IAAI,CAAC;YACD,MAAM,GAAG,GAAG,YAAY,CAAC,KAAK,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC;YAChD,IAAI,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC;gBACf,MAAM,IAAI,KAAK,CAAC,iCAAiC,GAAG,CAAC,EAAE,GAAG,CAAC,CAAC;YAChE,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;YAChB,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACnB,CAAC;QACD,OAAO,KAAK,EAAE,CAAC;YACX,MAAM,OAAO,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YACvE,MAAM,IAAI,KAAK,CAAC,GAAG,MAAM,IAAI,KAAK,GAAG,CAAC,KAAK,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC;QAC5E,CAAC;IACL,CAAC;IACD,OAAO,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;AAC/B,CAAC","sourcesContent":["import { POIPublicKey, parseJSON } from '@open-charging-cloud/wwcp-poi';\n\n/** Shared by the build loader and the app; malformed trust configuration is never skipped. */\nexport function parseTrustedPublicKeysJSONL(text: string,\n source: string = \"trusted-public-keys.jsonl\"): readonly POIPublicKey[] {\n if (text.startsWith(\"\\uFEFF\"))\n throw new Error(`${source}:1: UTF-8 BOM is not supported`);\n\n const keys: POIPublicKey[] = [];\n const ids = new Set<string>();\n for (const [index, line] of text.split(/\\r?\\n/).entries()) {\n if (line.trim() === \"\")\n continue;\n try {\n const key = POIPublicKey.parse(parseJSON(line));\n if (ids.has(key.id))\n throw new Error(`Duplicate trusted public key '${key.id}'`);\n ids.add(key.id);\n keys.push(key);\n }\n catch (error) {\n const message = error instanceof Error ? error.message : String(error);\n throw new Error(`${source}:${index + 1}: ${message}`, { cause: error });\n }\n }\n return Object.freeze(keys);\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wwcpPoi.d.ts","sourceRoot":"","sources":["../src/wwcpPoi.ts"],"names":[],"mappings":"AAAA,cAAc,+BAA+B,CAAC"}
|
package/dist/wwcpPoi.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wwcpPoi.js","sourceRoot":"","sources":["../src/wwcpPoi.ts"],"names":[],"mappings":"AAAA,cAAc,+BAA+B,CAAC","sourcesContent":["export * from \"@open-charging-cloud/wwcp-poi\";\n"]}
|
|
@@ -0,0 +1,262 @@
|
|
|
1
|
+
# Audit-Leitfaden für ChargyGUI.TS (PTB / EU MID & EU CRA)
|
|
2
|
+
|
|
3
|
+
Dieses Dokument ist der zentrale Audit-Leitfaden für die Bibliothek **`@open-charging-cloud/chargy-gui`** (`ChargyGUI.TS`). Es richtet sich an Prüfstellen der **Physikalisch-Technischen Bundesanstalt (PTB)** (insbesondere Arbeitsgruppe 8.51 Metrologiesoftware / Fachbereich 2.3) sowie an Konformitätsbewertungsstellen im Umfeld der Cybersicherheit.
|
|
4
|
+
|
|
5
|
+
> **Regulatorischer Hinweis (Doppel-Scope):** Die PTB bewertet gesetzlich ausschließlich die Konformität nach Mess- und Eichrecht (**EU MID 2014/32/EU**, **MessEG/MessEV**, **WELMEC 7.2**, **PTB-A 50.7**). Um ein maximales Maß an Nachvollziehbarkeit, Härtung und Lieferkettentransparenz sicherzustellen, ist dieser Leitfaden bewusst so aufgebaut, **als würde die PTB zusätzlich eine Konformitätsbewertung nach dem EU Cyber Resilience Act (Verordnung (EU) 2024/2847 — EU CRA)** für ein **kritisches Produkt mit digitalen Elementen** (Anhang IV / wesentliche Cybersicherheitsanforderungen nach Anhang I Teil I & II sowie technische Dokumentation nach Anhang VII) durchführen.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## 1. Prüfgegenstand & Normativer Rahmen
|
|
10
|
+
|
|
11
|
+
| Merkmal | Wert |
|
|
12
|
+
|---|---|
|
|
13
|
+
| Paketname | `@open-charging-cloud/chargy-gui` |
|
|
14
|
+
| Aktuelle Version | `0.1.1` (siehe [`package.json`](../package.json)) |
|
|
15
|
+
| Lizenz | `AGPL-3.0-only` ([`LICENSE`](../LICENSE)) |
|
|
16
|
+
| Ziel-Laufzeiten | Browser-DOM (WebApp, Electron Renderer, Cordova WebView) & Node.js `>= 22.18` (Tests/Build) |
|
|
17
|
+
| Sprache / Build | TypeScript 6 (`strict: true`, `exactOptionalPropertyTypes: true`, `noUncheckedIndexedAccess: true`, `noImplicitOverride: true`), `tsc` (ESM + `.d.ts` + Source Maps), ESLint `strictTypeChecked` (`--max-warnings=0`) |
|
|
18
|
+
| Kern-Abhängigkeiten | `@open-charging-cloud/chargy-core@^0.19.0` (Schicht 1 — eichrechtlicher Prüfkern), `@open-charging-cloud/wwcp-poi@^0.2.0` (Single-Instance POI-Verifikation), `@noble/hashes@^2.4.0` (HMAC-SHA-256) |
|
|
19
|
+
| Sicherheitsrichtlinie | [`SECURITY.md`](../SECURITY.md) (GitHub Private Vulnerability Reporting + PGP `0xC6CBE6A4`) |
|
|
20
|
+
|
|
21
|
+
### Normative Referenzen
|
|
22
|
+
1. **Mess- und Eichrecht (EU MID & national):**
|
|
23
|
+
- Richtlinie 2014/32/EU (MID), Anhang I (Grundlegende Anforderungen an Messgeräte und zugehörige Software, insb. unverfälschte Anzeige der Messergebnisse)
|
|
24
|
+
- MessEG / MessEV (Eichrecht für Ladeeinrichtungen in der Elektromobilität)
|
|
25
|
+
- **WELMEC 7.2** (Softwareanforderungen: Risikoklasse C/D, Softwaretrennung zwischen eichrechtlich relevantem Kern und Benutzeroberfläche, Software-Identifikation, Schutz gegen unzulässige Beeinflussung)
|
|
26
|
+
- **PTB-A 50.7** (Anforderungen an elektronische und softwaregesteuerte Messgeräte und Zusatzeinrichtungen, insb. Transparenzsoftware Abschnitt 3.1.1.3 Buchstabe B: eindeutige, manipulationssichere Anzeige von Messwerten, öffentlichen Schlüsseln und Verifikationsergebnissen)
|
|
27
|
+
2. **Cybersicherheit (hypothetischer EU-CRA-Prüfmaßstab für kritische Produkte):**
|
|
28
|
+
- **EU CRA (Verordnung (EU) 2024/2847)**, Anhang I Teil I (Wesentliche Sicherheitsanforderungen an Entwurf, Entwicklung und Herstellung — XSS-/Injektionsfreiheit, SSRF-Schutz, sichere Standardkonfiguration, Ressourcenlimits, Minimierung der Angriffsfläche)
|
|
29
|
+
- **EU CRA**, Anhang I Teil II (Anforderungen an die Behandlung von Schwachstellen, SBOM, koordinierte Offenlegung, Integrität)
|
|
30
|
+
- **EU CRA**, Anhang VII (Inhalt der technischen Dokumentation)
|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
## 2. Softwaretrennung & Schichtenmodell (WELMEC 7.2 / PTB-A 50.7 / EU CRA)
|
|
35
|
+
|
|
36
|
+
### 2.1 Drei-Schichten-Ökosystem
|
|
37
|
+
|
|
38
|
+
Um den von der PTB zu prüfenden eichrechtlichen Kern (`ChargyCore.TS`) vollständig von DOM-, Browser-, Netzwerk- und Trust-UI-Belangen zu trennen, gliedert sich das Chargy-Ökosystem in drei strikt getrennte Schichten:
|
|
39
|
+
|
|
40
|
+
```mermaid
|
|
41
|
+
flowchart TD
|
|
42
|
+
subgraph Shells["Schicht 3: Plattform-Shells (nicht eichrechtlich relevant)"]
|
|
43
|
+
Web["ChargyWebApp (Browser)"]
|
|
44
|
+
Desktop["ChargyDesktopApp (Electron / IPC-Fetch via setDefaultPOIFetch)"]
|
|
45
|
+
Mobile["ChargyMobileApp (Cordova iOS/Android)"]
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
subgraph GUI["Schicht 2: ChargyGUI.TS (@open-charging-cloud/chargy-gui) — Gegenstand dieses Leitfadens"]
|
|
49
|
+
LR["Schicht A: Legally Relevant Presentation Core (XSS-freier Detail-Renderer, domHelpers, SessionElementRegistry)"]
|
|
50
|
+
CC["Schicht B: Container-, Transport- & Convenience-Layer (SSRF/Transport-Policy, LiveLink TOFU-Store, URL/EVSE-Schutz, Visual Fingerprints, Browser-Dateien)"]
|
|
51
|
+
EXP["Schicht C: Experimental / Extensions (WWCP-POI Trust-UI, Live-POI, Station Proofs, Lineage, Observed History, Witness Policies, Preisbindung)"]
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
subgraph Core["Schicht 1: ChargyCore.TS (@open-charging-cloud/chargy-core) — 100 % DOM-frei"]
|
|
55
|
+
CoreVerify["Eichrechtliche Signaturprüfung, Messwert-Parsing, Plausibilität & IMeasurementDetailModel"]
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
subgraph POI["Kryptografische POI-Verifikationsbibliothek"]
|
|
59
|
+
WWCP["@open-charging-cloud/wwcp-poi (Single-Instance über ./wwcp-poi)"]
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
Web --> GUI
|
|
63
|
+
Desktop --> GUI
|
|
64
|
+
Mobile --> GUI
|
|
65
|
+
LR --> CoreVerify
|
|
66
|
+
CC --> WWCP
|
|
67
|
+
EXP --> CoreVerify
|
|
68
|
+
EXP --> WWCP
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
**Zentrale Trennungsgarantien:**
|
|
72
|
+
- **Keine eigene Eichrechts-Signaturprüfung in `ChargyGUI.TS`:** Sämtliche mathematischen Messwert-, Hash- und Signaturprüfungen erfolgen ausschließlich im 100 % DOM-freien `@open-charging-cloud/chargy-core` (siehe den zugehörigen Audit-Leitfaden `ChargyCore.TS/documentation/AUDIT.md`).
|
|
73
|
+
- **Datengetriebene Darstellung statt HTML-Generierung im Core:** `ChargyGUI.TS` konsumiert ausschließlich die unveränderlichen, DOM-freien `IMeasurementDetailModel`-Strukturen von `ChargyCore.TS` und erzeugt daraus DOM-Knoten über sichere APIs (`createElement`, `createTextNode`, `textContent`, `createElementNS`).
|
|
74
|
+
- **Keine Mutation von `ChargyCore`-Sitzungsobjekten:** Die Zuordnung zwischen geprüften `IChargingSession`-Objekten und ihren UI-Containern erfolgt extern über [`SessionElementRegistry`](../src/sessionUIState.ts) (`WeakMap<IChargingSession, HTMLDivElement>`).
|
|
75
|
+
- **Null unsichere HTML-/Code-Injektions-Sinks:** Keine Datei unter `src/` verwendet `.innerHTML`, `.outerHTML`, `.insertAdjacentHTML`, `document.write`, `eval()` oder `new Function()`. Diese Invariante wird automatisch in [`tests/securityAudit.test.ts`](../tests/securityAudit.test.ts) geprüft.
|
|
76
|
+
- **Kein gecachtes „Green Flag" im Trust-/POI-Layer:** Lokale IndexedDB-Speicher (`TrustStore`, `SessionEvidenceStore`, `POIObservedHistoryStore`, `POIWitnessTrustStore`) speichern ausschließlich Original-Evidenz und explizite lokale Benutzerentscheidungen — niemals zwischengespeicherte Verifikationsurteile.
|
|
77
|
+
|
|
78
|
+
### 2.2 Interne Abgrenzung innerhalb von `ChargyGUI.TS`
|
|
79
|
+
|
|
80
|
+
Alle **40 Quelldateien** unter `src/` (sowie das Build-Hilfsskript [`scripts/sync-core-assets.mjs`](../scripts/sync-core-assets.mjs)) sind eindeutig genau einer der folgenden drei Klassen zugeordnet:
|
|
81
|
+
|
|
82
|
+
#### Schicht A — Legally Relevant Presentation Core (eichrechtlich relevante Anzeige- & Trennungsschicht)
|
|
83
|
+
Diese Module bilden den für PTB-A 50.7 / WELMEC 7.2 relevanten Präsentationskern. Sie gewährleisten, dass Messwerte, Zähleridentitäten, Hashes, öffentliche Schlüssel, erwartete Signaturen und das Prüfergebnis (gültig/ungültig) unverfälscht und ohne XSS-/Spoofing-Risiko angezeigt werden. Jede Änderung in dieser Schicht erfordert eine erneute Überprüfung der Anzeigekorrektheit und Softwaretrennung.
|
|
84
|
+
|
|
85
|
+
| Bereich | Quelldateien | Verantwortung |
|
|
86
|
+
|---|---|---|
|
|
87
|
+
| **Messwert-Detail-Renderer** | [`src/measurementDetailsRenderer.ts`](../src/measurementDetailsRenderer.ts) | XSS-freies Rendering von `IMeasurementDetailModel` (`renderMeasurementDetails`, `renderMeasurementValueDetails`): Klartext-Felder mit interaktiver Hex-Markierung, OCMF-Kompakt-/Pretty-Ansicht, Hash, Public Key (`plain`, `leadingFour`, `derXY`), erwartete Signatur (`plain`, `rs`, `derRS`) und Verifikations-Badge |
|
|
88
|
+
| **Sichere DOM-Bausteine** | [`src/domHelpers.ts`](../src/domHelpers.ts) | Zentrale XSS-freie DOM-Helfer (`escapeHTML`, `clearElement`, `createDiv`, `createDiv2`, `createIcon`, `setIconContent`, `appendRelevanceBadge`, `createSafeExternalLink`, `createTextPopup`, `setLocalizedContent`, `renderPrettyJSON`, Fullscreen-Helfer); strikte URL-Schema-Prüfung (`http:`/`https:` + `rel="noopener noreferrer"`); lokalisierte Texte erlauben ausschließlich `<span class="important">` |
|
|
89
|
+
| **Externe Sitzungs-UI-Zuordnung** | [`src/sessionUIState.ts`](../src/sessionUIState.ts) | `SessionElementRegistry` (`WeakMap<IChargingSession, HTMLDivElement>`) zur strikten WELMEC-7.2-Trennung von DOM-Zustand und metrologischen Core-Objekten |
|
|
90
|
+
| **Kontrollierter Einstieg & Core-Asset-Sync** | [`src/index.ts`](../src/index.ts), [`scripts/sync-core-assets.mjs`](../scripts/sync-core-assets.mjs) | Re-Export von `@open-charging-cloud/chargy-core` und unveränderte Übernahme von `i18n.json`, `validationRules.json` und `package.json` nach `dist/core/` |
|
|
91
|
+
|
|
92
|
+
#### Schicht B — Container-, Transport-, Eingabe- & Convenience-Layer (nicht-metrologische Vorverarbeitung & Sicherheitsgrenzen)
|
|
93
|
+
Diese Module übernehmen Datei-Vorverarbeitung, Transport- und SSRF-Härtung, URL-/EVSE-ID-Validierung, datenschutzfreundliches Origin-Pinning sowie rein visuelle Fingerprint-Darstellung. Sie beeinflussen das mathematische Prüfergebnis von `ChargyCore.TS` **nicht**, bilden jedoch wegen ihrer unmittelbaren Exponiertheit gegenüber unkontrollierten Eingaben und Netzwerkantworten einen zentralen Schwerpunkt der **EU-CRA-Prüfung**.
|
|
94
|
+
|
|
95
|
+
| Bereich | Quelldateien | Verantwortung & Sicherheitsgrenzen |
|
|
96
|
+
|---|---|---|
|
|
97
|
+
| **Transport-Abstraktion & Payload-Limits** | [`src/poiTransport.ts`](../src/poiTransport.ts) | Austauschbare Fetch-Brücke (`getDefaultPOIFetch`, `setDefaultPOIFetch` für Electron-IPC); Streaming-Größenbegrenzung (`readResponseWithinLimit` prüft `Content-Length` und bricht Streams oberhalb von `maxPayloadBytes` hart ab) |
|
|
98
|
+
| **SSRF-Schutz, Transport-Policy & LiveLink TOFU-Store** | [`src/liveLinkTrust.ts`](../src/liveLinkTrust.ts) | Blockiert Klartext-Protokolle (`http:`/`ws:`) sowie Loopback-, RFC-1918-, Link-Local- und IPv6-gekapselte IPv4-Ziele (`isLoopbackHost`, `isPrivateNetworkHost`, `transportProtocolProblem`, `pollTargetProblem`); begrenzt Refresh-Intervalle (`5 s – 24 h`) und Payloads (`1 MiB` Default); speichert Origin-Zustimmungen OpenSSH-analog gehasht mit `HMAC-SHA-256` + 32-Byte-Salt (`upsertTrustedOrigin`, `matchesTrustedOrigin`), Idle-Expiry (`6 Monate` Default, `[1, 120]`), Label-Sanitizing und Hostname-Schmuggel-Schutz |
|
|
99
|
+
| **EVSE-ID- & Endpunkt-Validierung** | [`src/poiURLs.ts`](../src/poiURLs.ts) | Strikte Validierung von EVSE-IDs (`stationEVSEId`: 1–256 Zeichen, keine Steuerzeichen, kein Whitespace, keine `/`, `\`, `?`, `#`, `.`, `..`) und sichere URL-Konstruktion (`stationProofURL`, `stationPriceStatementsURL`) ohne Path-Traversal |
|
|
100
|
+
| **Browser-Dateierkennung & SVG-Normalisierung** | [`src/browserFiles.ts`](../src/browserFiles.ts) | MIME-/Endungserkennung (`browserFileTypeFromName`, `browserFileTypeFromNameOrData`), Dateinamensnormalisierung und Pixel-scharfe SVG-QR-Normalisierung (`normalizeDroppedSVGImageData`) |
|
|
101
|
+
| **Visuelle Sicherheits-Fingerprints** | [`src/securityFingerprint.ts`](../src/securityFingerprint.ts), [`src/securityFingerprintView.ts`](../src/securityFingerprintView.ts) | Deterministische `drunken-bishop-v1`-Darstellung (17×9-Raster, 1–64 Byte Hex) als SVG + Volltext-Anzeige/Copy-Button; explizit **reine Darstellung, keine Vertrauensentscheidung** |
|
|
102
|
+
| **Single-Instance-Brücke & Konfigurationsparser** | [`src/wwcpPoi.ts`](../src/wwcpPoi.ts), [`src/trustedPublicKeys.ts`](../src/trustedPublicKeys.ts), [`src/roamingNetworks.ts`](../src/roamingNetworks.ts) | Single-Instance-Export von `@open-charging-cloud/wwcp-poi`; Fail-Closed-JSONL-Parser für gebündelte Schlüssel (`parseTrustedPublicKeysJSONL`: lehnt UTF-8-BOM, Syntaxfehler und doppelte Key-IDs ab); Gruppierung authentifizierter vs. unverifizierter Roaming-Netzwerke |
|
|
103
|
+
|
|
104
|
+
#### Schicht C — Experimental / Extensions (WWCP-POI Trust-UI, Live-Transparenz, Preisbindung & historische Evidenz)
|
|
105
|
+
Diese **27 Module** realisieren die UI-Panels, Datenlader und IndexedDB-Speicher für WWCP Proof-of-Integrity (POI), LiveLink-Sitzungen, Stationsnachweise, Policy-Succession, lokale Equivocation-Erkennung und Tarif-/Preisprüfung. Für diese Erweiterungen wird **noch keine abschließende PTB-Baumusterprüfbescheinigung** vorausgesetzt; sie greifen **niemals** in die klassischen Eichrechts-Prüfpfade ein.
|
|
106
|
+
|
|
107
|
+
| Bereich | Quelldateien | Status & Sicherheitsabgrenzung |
|
|
108
|
+
|---|---|---|
|
|
109
|
+
| **Trust-Anchor-Import, Vorschau & KeyStatement-Verifikation** | [`src/trustAnchorImport.ts`](../src/trustAnchorImport.ts), [`src/trustAnchorPreview.ts`](../src/trustAnchorPreview.ts), [`src/trustAnchorData.ts`](../src/trustAnchorData.ts), [`src/trustAnchorDataView.ts`](../src/trustAnchorDataView.ts), [`src/anchorKeyTrust.ts`](../src/anchorKeyTrust.ts), [`src/anchorKeyTrustView.ts`](../src/anchorKeyTrustView.ts) | Preflight-Erkennung (QR/Text), Vorschau ohne automatischen Download, Download nur über explizite Anchor-URLs (`/keyStatement`, max. `1 MiB`, `credentials: "omit"`, `redirect: "error"`, `cache: "no-store"`), Policy-gebundene Schlüsselautorisierung |
|
|
110
|
+
| **Trust-Store, Trust-Context, Policy-Lineage & UI-Verwaltung** | [`src/trustStore.ts`](../src/trustStore.ts), [`src/trustManagement.ts`](../src/trustManagement.ts), [`src/poiTrustContext.ts`](../src/poiTrustContext.ts), [`src/poiTrustLineage.ts`](../src/poiTrustLineage.ts), [`src/trustTransitionView.ts`](../src/trustTransitionView.ts) | IndexedDB `ChargyTrustManagement` (transaktionale Snapshots ohne Vermischung von Anchor & gelöschten Schlüsseln; max. 32 Transitions / `8 MiB`; Integritätsprüfung gegen `trustAnchorStorageId` & `stationProofStorageId`), vollständige Lineage-Reverifikation ab Bootstrap-Root (`derivePOITrustLineage`), keine gespeicherten Vertrauens-Tokens |
|
|
111
|
+
| **Lokale Versionshistorie (Equivocation-Schutz) & Witness-Policies** | [`src/poiObservedHistory.ts`](../src/poiObservedHistory.ts), [`src/poiConsistencyView.ts`](../src/poiConsistencyView.ts), [`src/poiWitnessTrust.ts`](../src/poiWitnessTrust.ts), [`src/poiWitnessManagement.ts`](../src/poiWitnessManagement.ts) | IndexedDB `ChargyPOIObservedHistory` (max. `16 MiB`, versiegelt via `observedVersionsChecksum`, Tab-übergreifende Invalidierung über `BroadcastChannel` ohne Übergabe vertrauenswürdiger Zustände) & `ChargyPOIWitnessTrust` (max. `1 MiB`, Optimistic Concurrency über UUID-Revisionen; Empfehlungen erteilen keine Autorität) |
|
|
112
|
+
| **Stationsnachweise & Zählerschlüssel-Ansicht** | [`src/stationProofData.ts`](../src/stationProofData.ts), [`src/stationProofView.ts`](../src/stationProofView.ts), [`src/stationProofPanel.ts`](../src/stationProofPanel.ts), [`src/sessionMeterKeyView.ts`](../src/sessionMeterKeyView.ts) | Download nur von autorisierten Anchor-Spiegeln (`stationProofMaxBytes = 2 MiB`, Timeouts `15 s` / `30 s`, erneute Snapshot-Prüfung nach I/O), Abbruch veralteter UI-Writes bei Navigation |
|
|
113
|
+
| **Live-POI-Sitzungen, Sitzungsevidenz & historische Prüfung** | [`src/livePOISession.ts`](../src/livePOISession.ts), [`src/sessionPOIData.ts`](../src/sessionPOIData.ts), [`src/sessionPOIPanel.ts`](../src/sessionPOIPanel.ts), [`src/sessionEvidenceStore.ts`](../src/sessionEvidenceStore.ts), [`src/historicalSessionPanel.ts`](../src/historicalSessionPanel.ts) | LiveLink-Kontinuität & Equivocation-Aufzeichnung (`observeRejectedLiveCandidate`), Preis-Pinning, Größenlimits (`8 MiB` POI-Input, `4 MiB` Live-/Historical-/Price-Evidenz, `16 MiB` Archiv in `ChargySessionEvidence`), Content-Hash-Identität (`sessionEvidenceId`), strikte EVSE-Konflikterkennung (`sessionEVSEId`) |
|
|
114
|
+
| **Preis- & Tarifbindung (inkl. Witness-Receipts)** | [`src/sessionPriceData.ts`](../src/sessionPriceData.ts), [`src/sessionPricePanel.ts`](../src/sessionPricePanel.ts), [`src/pricePublicationData.ts`](../src/pricePublicationData.ts) | Beschränkter Abruf von `/priceStatements` (`2 MiB`) und Witness-Publication-Receipts (max. `16` Abfragen, `64` Receipts, `4 MiB` Gesamtbudget, `referrerPolicy: "no-referrer"`, keine Übertragung von Kunden- oder Startdokumenten) |
|
|
115
|
+
|
|
116
|
+
---
|
|
117
|
+
|
|
118
|
+
## 3. EU-CRA-Konformitätsbewertung (Hypothetischer Prüfmaßstab für kritische Produkte)
|
|
119
|
+
|
|
120
|
+
Unter der Annahme, dass `ChargyGUI.TS` als sicherheitskritische Vertrauens- und Präsentationsschicht einer eichrechtlichen Prüfsoftware im Sinne von **Anhang IV EU CRA** bewertet wird, ordnet die folgende Matrix die wesentlichen Anforderungen aus **EU CRA Anhang I** den technischen Kontrollen und Nachweisen zu:
|
|
121
|
+
|
|
122
|
+
| EU-CRA-Anforderung | Technische Umsetzung in `ChargyGUI.TS` | Nachweis / Verifikation |
|
|
123
|
+
|---|---|---|
|
|
124
|
+
| **Anhang I Teil I (1) — Security-by-Design, keine bekannten ausnutzbaren Schwachstellen** | Minimaler Produktions-Abhängigkeitsbaum (ausschließlich `@open-charging-cloud/chargy-core`, `@open-charging-cloud/wwcp-poi` und auditiertes `@noble/hashes`); lockfile-gepinnte Installation; keine legacy-Template-Engines oder unsicheren HTML-Sanitizer | `npm audit --omit=dev --audit-level=high` in CI (`supply-chain-audit`); [`package-lock.json`](../package-lock.json) |
|
|
125
|
+
| **Anhang I Teil I (2)(a)/(b) — Auslieferung mit sicherer Standardkonfiguration** | Standardmäßig nur `https:`/`wss:` erlaubt (`ITransportAllowances` standardmäßig leer/strikt); `credentials: "omit"`, `redirect: "error"`, `cache: "no-store"`, `referrerPolicy: "no-referrer"`; keine impliziten Netzwerkzugriffe beim Import/Preview; keine voreingestellten Witness-Vertrauenslisten (`witnesses: []`) | [`src/liveLinkTrust.ts`](../src/liveLinkTrust.ts#L647-L726), [`src/stationProofData.ts`](../src/stationProofData.ts#L68-L84), [`src/poiWitnessTrust.ts`](../src/poiWitnessTrust.ts#L3), [`tests/securityAudit.test.ts`](../tests/securityAudit.test.ts) |
|
|
126
|
+
| **Anhang I Teil I (2)(e)/(f) — Schutz der Integrität & Vertraulichkeit (Privacy-by-Design)** | OpenSSH-analog gehashter Origin-Store (`HMAC-SHA-256` + 32-Byte-CSPRNG-Salt, zeitkonstanter Vergleich, Anti-Hostname-Smuggling) verhindert Bewegungsprofile bei lokalem Profil-Snapshot; SHA-256-Integritätsbindung in `TrustStore`, `SessionEvidenceStore` und `POIObservedHistoryStore`; keine gecachten Autorisierungs-Flags | [`src/liveLinkTrust.ts`](../src/liveLinkTrust.ts#L134-L355), [`src/sessionEvidenceStore.ts`](../src/sessionEvidenceStore.ts#L14-L28), [`src/poiObservedHistory.ts`](../src/poiObservedHistory.ts#L17-L34), [`tests/securityAudit.test.ts`](../tests/securityAudit.test.ts) |
|
|
127
|
+
| **Anhang I Teil I (2)(g)/(i) — Verfügbarkeit & DoS-Härtung (Ressourcenlimits & Timeouts)** | Streaming-Payload-Abbruch via `readResponseWithinLimit`; harte Grenzen (`1 MiB` KeyStatement/Witness-Policy/Default-LiveLink, `2 MiB` StationProof/PriceStatements/Transition-Input, `4 MiB` Live-/Historical-/Price-Evidenz & Receipt-Gesamtbudget, `8 MiB` POI-Input/Transitions, `16 MiB` Archiv/Versionshistorie); feste Request-/Gesamt-Timeouts (`15 s` / `30 s`); Refresh-Clamping (`5 s – 86.400 s`) | [`src/poiTransport.ts`](../src/poiTransport.ts#L36-L101), [`src/stationProofData.ts`](../src/stationProofData.ts#L10-L87), [`src/pricePublicationData.ts`](../src/pricePublicationData.ts#L15-L43), [`tests/poiIntegration.test.ts`](../tests/poiIntegration.test.ts) |
|
|
128
|
+
| **Anhang I Teil I (2)(j) — Minimierung der Angriffsfläche (XSS-, Injection- & SSRF-Schutz)** | 0 `.innerHTML` / `.outerHTML` / `.insertAdjacentHTML` / `document.write` / `eval` / `new Function` im gesamten Codebestand; URL-Schema-Allowlisting (`createSafeExternalLink`); EVSE-ID-Pfad-Traversal-Schutz (`stationEVSEId`); umfassender SSRF-Filter (inkl. IPv4-in-IPv6 `::ffff:`, `::/96`, NAT64 `64:ff9b::/96`); `strictTypeChecked` ESLint (`--max-warnings=0`) & TS 6 (`exactOptionalPropertyTypes`, `noUncheckedIndexedAccess`) | [`tests/securityAudit.test.ts`](../tests/securityAudit.test.ts), [`tests/measurementDetailsRenderer.test.ts`](../tests/measurementDetailsRenderer.test.ts), [`tests/sharedComponents.test.ts`](../tests/sharedComponents.test.ts), [`eslint.config.js`](../eslint.config.js) |
|
|
129
|
+
| **Anhang I Teil II (1) — SBOM in gebräuchlichem, maschinenlesbarem Format** | Deterministische Erzeugung von **CycloneDX 1.6** (`sbom.cdx.json`) **und** **SPDX 2.3** (`sbom.spdx.json`) inkl. PURLs, Lizenzen, Abhängigkeitsgraph und SHA-512-Hashes | [`scripts/generate-sbom.mjs`](../scripts/generate-sbom.mjs), CI-Job `supply-chain-audit` |
|
|
130
|
+
| **Anhang I Teil II (2)/(5) — Koordinierte Schwachstellenbehandlung** | Vertrauliche Meldung über GitHub Private Vulnerability Reporting sowie PGP-verschlüsselte E-Mail (`0xC6CBE6A4`); dokumentierte Support-Versionen und PTB-Zertifizierungshinweis | [`SECURITY.md`](../SECURITY.md) |
|
|
131
|
+
| **Anhang I Teil II (8) / WELMEC 7.2 — Integritäts- & Reproduzierbarkeitsnachweis** | Deterministischer Zwei-Pass-Build mit Byte-für-Byte-SHA-512-Vergleich über alle **169 Ausgabedateien** (`dist/` inkl. `dist/core/*` + Paket- und Audit-Dokumentation) sowie `SHA256SUMS.txt` & `SHA512SUMS.txt` | [`scripts/verify-reproducible-build.mjs`](../scripts/verify-reproducible-build.mjs), [`.github/workflows/ci.yml`](../.github/workflows/ci.yml) |
|
|
132
|
+
|
|
133
|
+
---
|
|
134
|
+
|
|
135
|
+
## 4. Traceability Matrix (Anforderung / Modul → Code → Positive & Negative Tests)
|
|
136
|
+
|
|
137
|
+
### 4.1 Funktionsbereiche (Präsentation, Transport, Trust & POI)
|
|
138
|
+
|
|
139
|
+
| Bereich / Funktion | Schicht | Quelldatei(en) & zentrale Symbole | Positive Testfälle (erwartetes Verhalten) | Negative & Randfall-Testfälle (Angriff / Ablehnung) |
|
|
140
|
+
|---|---|---|---|---|
|
|
141
|
+
| **Eichrechtlicher Messwert-Detail-Renderer** | A | [`src/measurementDetailsRenderer.ts`](../src/measurementDetailsRenderer.ts) (`renderMeasurementDetails`, `renderMeasurementValueDetails`) | [`tests/measurementDetailsRenderer.test.ts`](../tests/measurementDetailsRenderer.test.ts) (Felder, Hex-Visualisierung, `leadingFour`-Public-Key, `rs`-Signatur, Prüfergebnis-Badge, `<span class="important">`-Intro) | [`tests/measurementDetailsRenderer.test.ts`](../tests/measurementDetailsRenderer.test.ts) (HTML-/Script-Payloads in Status-Items und Signer-Namen werden als reiner Text neutralisiert, keine `<b>`/`<img>`-Knoten erzeugt) |
|
|
142
|
+
| **XSS-freie DOM-Helfer & Pretty-JSON** | A | [`src/domHelpers.ts`](../src/domHelpers.ts) (`escapeHTML`, `createDiv`, `createDiv2`, `setIconContent`, `setLocalizedContent`, `createSafeExternalLink`, `renderPrettyJSON`) | [`tests/measurementDetailsRenderer.test.ts`](../tests/measurementDetailsRenderer.test.ts), [`tests/sharedComponents.test.ts`](../tests/sharedComponents.test.ts) (Encoding, Textknoten, `https://`-Links mit `rel="noopener noreferrer"`, erlaubtes `span.important`, dekoratives `aria-hidden`-Icon) | [`tests/measurementDetailsRenderer.test.ts`](../tests/measurementDetailsRenderer.test.ts), [`tests/sharedComponents.test.ts`](../tests/sharedComponents.test.ts) (XSS in JSON-Keys/Values/Label-Resolver, Ablehnung von `javascript:`- und `data:`-URLs als Textknoten, Neutralisierung injizierter `<img>`/`<b>`/`<script>`-Tags) |
|
|
143
|
+
| **WELMEC-7.2-Sitzungstrennung (`WeakMap`)** | A | [`src/sessionUIState.ts`](../src/sessionUIState.ts) (`SessionElementRegistry`) | [`tests/measurementDetailsRenderer.test.ts`](../tests/measurementDetailsRenderer.test.ts) (`set`/`get`/`delete` verknüpft DOM-Element extern) | [`tests/measurementDetailsRenderer.test.ts`](../tests/measurementDetailsRenderer.test.ts) (prüft explizit `"GUI" in session === false` — Core-Objekt bleibt unverändert) |
|
|
144
|
+
| **Visuelle Sicherheits-Fingerprints** | B | [`src/securityFingerprint.ts`](../src/securityFingerprint.ts), [`src/securityFingerprintView.ts`](../src/securityFingerprintView.ts) (`fingerprintBytes`, `drunkenBishop`, `renderSecurityFingerprint`) | [`tests/sharedComponents.test.ts`](../tests/sharedComponents.test.ts) (deterministisches 17×9-Raster `drunken-bishop-v1`, Schrittsumme = `bytes.length * 4`, SVG-`<rect>`-Rendering & Attribute) | [`tests/securityAudit.test.ts`](../tests/securityAudit.test.ts) (Ablehnung leerer Strings, Nicht-Hex-Zeichen und Eingaben > 64 Bytes) |
|
|
145
|
+
| **EVSE-ID- & POI-URL-Validierung** | B | [`src/poiURLs.ts`](../src/poiURLs.ts) (`stationEVSEId`, `stationProofURL`, `stationPriceStatementsURL`) | [`tests/sharedComponents.test.ts`](../tests/sharedComponents.test.ts) (Trimming, kanonischer Aufbau von `/EVSEs/<id>/proof` und `/priceStatements` unter Entfernen von Query/Fragment) | [`tests/sharedComponents.test.ts`](../tests/sharedComponents.test.ts) (Ablehnung von Path-Traversal `../escape` und Whitespace in EVSE-IDs) |
|
|
146
|
+
| **POI-Transport & Streaming-Limit** | B | [`src/poiTransport.ts`](../src/poiTransport.ts) (`getDefaultPOIFetch`, `setDefaultPOIFetch`, `readResponseWithinLimit`) | [`tests/poiIntegration.test.ts`](../tests/poiIntegration.test.ts) (Override & Restore der Fetch-Brücke, gültige Antwort innerhalb des Byte-Limits) | [`tests/poiIntegration.test.ts`](../tests/poiIntegration.test.ts) (harter Abbruch bei Überschreitung von `maxPayloadBytes`) |
|
|
147
|
+
| **LiveLink-SSRF-Schutz & gehashter TOFU-Origin-Store** | B | [`src/liveLinkTrust.ts`](../src/liveLinkTrust.ts) (`upsertTrustedOrigin`, `matchesTrustedOrigin`, `isLoopbackHost`, `isPrivateNetworkHost`, `transportProtocolProblem`, `pollTargetProblem`, `sanitizeTrustLabel`, `trustLabelForOrigin`, `parseTrustedOriginsStore`, `pruneExpiredTrustedOrigins`) | [`tests/poiIntegration.test.ts`](../tests/poiIntegration.test.ts), [`tests/securityAudit.test.ts`](../tests/securityAudit.test.ts) (HMAC-SHA-256 Matching, individuelle Random-Salts, kein Klartext-Origin im JSON, HTTPS/WSS zulässig, Loopback im Dev-Modus, Idle-Expiry-Pruning) | [`tests/poiIntegration.test.ts`](../tests/poiIntegration.test.ts), [`tests/securityAudit.test.ts`](../tests/securityAudit.test.ts) (Ablehnung von `http:`, `javascript:`, `file:`, Loopback, RFC 1918, Link-Local, IPv4-mapped IPv6, `__proto__`/`toString`/unbekannten Algorithmen, defektem Base64, Hostname-Smuggling, Steuer-/Bidi-Zeichen, korruptem Store-JSON) |
|
|
148
|
+
| **Browser-Dateityp-Erkennung & Live-Input-Vorfilter** | B / C | [`src/browserFiles.ts`](../src/browserFiles.ts), [`src/livePOISession.ts`](../src/livePOISession.ts), [`src/sessionPOIData.ts`](../src/sessionPOIData.ts) (`browserFileTypeFromNameOrData`, `originalLiveInput`, `hasSessionPOIContext`, `sessionEVSEId`) | [`tests/poiIntegration.test.ts`](../tests/poiIntegration.test.ts), [`tests/securityAudit.test.ts`](../tests/securityAudit.test.ts) (PNG-Endung, Inline-SVG-Erkennung, POI-Kontext-Erkennung, konsistente EVSE-IDs) | [`tests/poiIntegration.test.ts`](../tests/poiIntegration.test.ts), [`tests/securityAudit.test.ts`](../tests/securityAudit.test.ts) (Binär-PNG im Live-Input wirft nicht, `hasSessionPOIContext` ist `false` ohne Evidenz, widersprüchliche EVSE-IDs in derselben Sitzung werfen Fehler) |
|
|
149
|
+
| **Gebündelte Public-Keys (JSONL) & Evidenz-Integrität** | B / C | [`src/trustedPublicKeys.ts`](../src/trustedPublicKeys.ts), [`src/sessionEvidenceStore.ts`](../src/sessionEvidenceStore.ts) (`parseTrustedPublicKeysJSONL`, `sessionEvidenceId`, `readStoredSessionEvidence`) | [`tests/securityAudit.test.ts`](../tests/securityAudit.test.ts) (gültige leere JSONL, gültiger SHA-256-Evidenz-Datensatz) | [`tests/securityAudit.test.ts`](../tests/securityAudit.test.ts) (Ablehnung von UTF-8-BOM, ungültigem JSONL mit Zeilennummer, Ablehnung manipulierter Archivierungs-Dokumente via Digest-Mismatch) |
|
|
150
|
+
|
|
151
|
+
### 4.2 Querschnitts-, Sicherheits- & WELMEC-/CRA-Anforderungen
|
|
152
|
+
|
|
153
|
+
| Anforderung | Normbezug | Quelldatei(en) | Automatisierte Verifikation |
|
|
154
|
+
|---|---|---|---|
|
|
155
|
+
| **Null HTML-/Script-Injektions-Sinks im Codebestand** | WELMEC 7.2, PTB-A 50.7, EU CRA Anh. I Teil I (2)(j) | Gesamtes Verzeichnis `src/*.ts` | [`tests/securityAudit.test.ts`](../tests/securityAudit.test.ts) (prüft alle `src/*.ts` automatisiert auf Abwesenheit von `.innerHTML`, `.outerHTML`, `.insertAdjacentHTML`, `document.write`, `eval(`, `new Function(`) |
|
|
156
|
+
| **Strikte statische Typ- & Lint-Sicherheit** | EU CRA Anh. I Teil I (1)/(2)(j) | [`tsconfig.json`](../tsconfig.json), [`tsconfig.build.json`](../tsconfig.build.json), [`eslint.config.js`](../eslint.config.js) | `npm run typecheck` (`strict`, `exactOptionalPropertyTypes`, `noUncheckedIndexedAccess`, `noImplicitOverride`) & `npm run lint` (`strictTypeChecked`, `--max-warnings=0`) |
|
|
157
|
+
| **Reproduzierbare Build-Artefakte & Prüfsummen** | WELMEC 7.2 (Software-Identifikation), EU CRA Anh. I Teil II (8) | [`scripts/verify-reproducible-build.mjs`](../scripts/verify-reproducible-build.mjs), [`scripts/sync-core-assets.mjs`](../scripts/sync-core-assets.mjs) | `npm run verify:reproducible` + `sha256sum -c` / `sha512sum -c` im CI-Job `supply-chain-audit` |
|
|
158
|
+
| **Deterministische SBOM (CycloneDX 1.6 & SPDX 2.3)** | EU CRA Anh. I Teil II (1) | [`scripts/generate-sbom.mjs`](../scripts/generate-sbom.mjs) | `SOURCE_DATE_EPOCH=... npm run sbom` + Byte-Vergleich (`cmp -s`) im CI-Job `supply-chain-audit` |
|
|
159
|
+
|
|
160
|
+
---
|
|
161
|
+
|
|
162
|
+
## 5. Kryptografie-Inventar, Schlüssellängen & bewusste Einschränkungen
|
|
163
|
+
|
|
164
|
+
### 5.1 Direkt in `ChargyGUI.TS` eingesetzte kryptografische Primitive & Visualisierungsverfahren
|
|
165
|
+
|
|
166
|
+
`ChargyGUI.TS` implementiert **keine eigenen Signaturalgorithmen oder Kurvenarithmetik**. Direkt aufgerufen werden ausschließlich die folgenden Primitive:
|
|
167
|
+
|
|
168
|
+
| Primitiv / Verfahren | Standard | Schlüssel- / Ausgabelänge | Implementierung | Einsatz in `ChargyGUI.TS` |
|
|
169
|
+
|---|---|---|---|---|
|
|
170
|
+
| **HMAC-SHA-256** | RFC 2104 / FIPS 180-4 | 256-Bit Key (frischer 32-Byte-Salt pro Eintrag) → 256-Bit MAC | `@noble/hashes/hmac.js` + `@noble/hashes/sha2.js` in [`src/liveLinkTrust.ts`](../src/liveLinkTrust.ts#L134-L207) | OpenSSH-analoges Hashing gespeicherter LiveLink-Origins (Schutz gegen Bewegungsprofile & Harvesting; zeitkonstanter Byte-Vergleich) |
|
|
171
|
+
| **SHA-256 (Content-Adressierung & Integrität)** | FIPS 180-4 + RFC 8785 (Canonical JSON) | 256 Bit (32 B / 64 Hex-Zeichen) | `hash("sha256", ...)` & `canonicalJSONBytes` aus `@open-charging-cloud/wwcp-poi` | Deterministische Speicher-IDs, Policy-/Netzwerk-Identitäten & Integritäts-Prüfsummen in [`src/trustStore.ts`](../src/trustStore.ts), [`src/sessionEvidenceStore.ts`](../src/sessionEvidenceStore.ts), [`src/poiTrustContext.ts`](../src/poiTrustContext.ts), [`src/poiTrustLineage.ts`](../src/poiTrustLineage.ts), [`src/poiWitnessTrust.ts`](../src/poiWitnessTrust.ts), [`src/livePOISession.ts`](../src/livePOISession.ts), [`src/poiObservedHistory.ts`](../src/poiObservedHistory.ts) |
|
|
172
|
+
| **CSPRNG (`getRandomValues`, `randomUUID`)** | W3C Web Crypto API | 256 Bit (Salt) / 122 Bit Entropie (UUIDv4) | Laufzeit-`crypto.getRandomValues` & `crypto.randomUUID` | Frische 32-Byte-Salts in [`src/liveLinkTrust.ts`](../src/liveLinkTrust.ts#L246), Revisions-/Generations-IDs gegen Race-Conditions in [`src/poiWitnessTrust.ts`](../src/poiWitnessTrust.ts#L48) und [`src/poiObservedHistory.ts`](../src/poiObservedHistory.ts#L36) |
|
|
173
|
+
| **Drunken Bishop (`drunken-bishop-v1`)** | Kompatibel zu OpenSSH / Styx | Eingabe: 1–64 Bytes (8–512 Bit) → 17×9-Besuchsraster | [`src/securityFingerprint.ts`](../src/securityFingerprint.ts) | **Nicht-kryptografische visuelle Darstellung** von Hex-Fingerprints (reine Wiedererkennungshilfe, kein Identifikator) |
|
|
174
|
+
|
|
175
|
+
### 5.2 Delegierte Kryptografie in Abhängigkeiten
|
|
176
|
+
|
|
177
|
+
Alle asymmetrischen Signaturprüfungen, ASN.1-DER-/COSE-/CBOR-Dekodierungen und Merkle-Beweise werden strikt an die spezialisierten Kernbibliotheken delegiert:
|
|
178
|
+
|
|
179
|
+
| Abhängigkeit | Kryptografischer Verantwortungsbereich | Referenziertes Detail-Inventar |
|
|
180
|
+
|---|---|---|
|
|
181
|
+
| **`@open-charging-cloud/chargy-core`** (re-exportiert über [`src/index.ts`](../src/index.ts)) | Eichrechtliche Messwert-Verifikation (`ECDSA secp192r1/secp224k1/secp256r1/secp256k1/secp384r1/secp521r1`, `Ed25519`/`Ed448`, `ML-DSA-44/65/87`, `SHA-256/384/512`, striktes ASN.1-DER, RFC 8785 Canonical JSON, LiveLink-Dokument-Signaturen, Zählerschlüssel-Bindung) | Siehe `ChargyCore.TS/documentation/AUDIT.md`, Abschnitt 5 |
|
|
182
|
+
| **`@open-charging-cloud/wwcp-poi`** (Single-Instance via [`src/wwcpPoi.ts`](../src/wwcpPoi.ts), nutzt `@vanaheimr/cose` & `@vanaheimr/metrological-cbor`) | Verifikation von WWCP-POI Trust Anchors, KeyStatements, ChargingStationProofs, Checkpoints, Merkle-Inklusionsbeweisen, PriceStatements, Witness-Publication-Receipts, Trust-Transitions & `observedVersionsChecksum` | Paket `@open-charging-cloud/wwcp-poi@0.2.0` (`@noble/curves`, `@noble/hashes`, `@noble/ciphers`, `@noble/post-quantum`, `@vanaheimr/cose`, `@vanaheimr/metrological-cbor`) |
|
|
183
|
+
|
|
184
|
+
### 5.3 Bewusste Einschränkungen, Architektur-Invarianten & Fail-Closed-Entscheidungen
|
|
185
|
+
|
|
186
|
+
1. **Keine eigene Eichrechts-Kryptografie im GUI-Layer:**
|
|
187
|
+
- `ChargyGUI.TS` prüft niemals selbst Signaturen von Messwerten; es zeigt ausschließlich die von `ChargyCore.TS` gelieferten Verifikationsmodelle an. Ein Fehler im GUI-Layer kann daher kein mathematisches Prüfergebnis in `ChargyCore.TS` verfälschen.
|
|
188
|
+
2. **Keine persistierten „Green Flags" oder Autorisierungs-Caches:**
|
|
189
|
+
- Weder `TrustStore` noch `SessionEvidenceStore` oder `POIObservedHistoryStore` speichern ein wiederverwendbares „Vertrauenswürdig"-Flag. Jeder Prüfaufruf über `POITrustService` liest den aktuellen lokalen Zustand transaktional neu ein und verifiziert die Original-Dokumente ab den lokalen Wurzeln erneut (inklusive Re-Check nach Netzwerk-I/O gegen TOCTOU-Races).
|
|
190
|
+
3. **Policy-gebundene Isolation statt globaler Vertrauens-Union:**
|
|
191
|
+
- Manuell akzeptierte Schlüssel gelten strikt für genau eine Anchor-Policy (`trustAnchorStorageId(anchor)`). Unverifizierte oder fremde Policies werden in [`src/roamingNetworks.ts`](../src/roamingNetworks.ts) isoliert gehalten, selbst wenn sie denselben Netzwerk-Identifikator beanspruchen. Empfehlungen aus Dokumenten (z. B. Witness-Vorschläge oder Trust-Transitions) ändern niemals automatisch lokales Vertrauen.
|
|
192
|
+
4. **Explizite Grenzen des gehashten LiveLink-Origin-Stores (`src/liveLinkTrust.ts`):**
|
|
193
|
+
- Wie bei OpenSSH `HashKnownHosts` verhindert der 32-Byte-Per-Entry-Salt vorberechnete Tabellen und die Korrelation zweier Installationen und macht einen lokalen Snapshot als Harvesting-Quelle unbrauchbar. **Bewusste Grenze:** Öffentlich bekannte Endpunkt-URLs können bei lokalem Zugriff weiterhin per Einzel-Rateversuch gegen einen Eintrag getestet werden. Unbekannte Algorithmus-Bezeichner werden erhalten, matchen aber niemals (Fail-Closed).
|
|
194
|
+
5. **Drunken Bishop ist keine kryptografische Hash-Funktion:**
|
|
195
|
+
- `drunken-bishop-v1` (17×9-Raster) dient ausschließlich der visuellen Mustererkennung durch Menschen; verschiedene Fingerprints können ähnliche Raster ergeben. Daher stellt [`renderSecurityFingerprint`](../src/securityFingerprintView.ts) stets zusätzlich den vollständigen Hex-Fingerprint zum exakten Vergleich bereit.
|
|
196
|
+
6. **Strikte Transport- & SSRF-Policy (Fail-Closed):**
|
|
197
|
+
- Externe POI-/LiveLink-Abrufe sind standardmäßig ausschließlich über `https:` an öffentliche Internet-Hosts zulässig (`credentials: "omit"`, `redirect: "error"`, `cache: "no-store"`, Ablehnung eingebetteter URL-Zugangsdaten). Ausnahmen für lokale Entwicklung (`ITransportAllowances`) sind ausschließlich über explizite Aufruf-/Build-Parameter möglich — niemals über Dokument-Inhalte oder Nutzereingaben.
|
|
198
|
+
7. **Keine privaten Schlüssel im GUI-Layer:**
|
|
199
|
+
- `ChargyGUI.TS` verwaltet, speichert und verwendet keine privaten Signierschlüssel.
|
|
200
|
+
8. **Grenzen der IndexedDB-Integritätsprüfung:**
|
|
201
|
+
- Die SHA-256-Content-IDs und Checksummen in `ChargyTrustManagement`, `ChargySessionEvidence` und `ChargyPOIObservedHistory` schützen zuverlässig vor zufälliger Datenkorruption, Schema-Drift und naiven Manipulationen, bieten aber naturgemäß keinen Hardware-Schutz gegen einen vollständig kompromittierten Browser-Prozess oder Angreifer mit Schreibzugriff auf die Browser-Datenbank.
|
|
202
|
+
|
|
203
|
+
---
|
|
204
|
+
|
|
205
|
+
## 6. SBOM, Checksummen & Reproducible-Build-Prüfung
|
|
206
|
+
|
|
207
|
+
Für eine lückenlose Nachvollziehbarkeit sowohl im PTB-Einfrierprozess (Software-Identifikation über SHA-512) als auch für EU CRA Anhang I Teil II (maschinenlesbare SBOM & Lieferkettenintegrität) stehen reproduzierbare, Zero-Dependency-Skripte direkt im Repository bereit und laufen automatisch in GitHub Actions.
|
|
208
|
+
|
|
209
|
+
### 6.1 Lokale & CI-Befehle
|
|
210
|
+
|
|
211
|
+
| Befehl | Skript | Zweck |
|
|
212
|
+
|---|---|---|
|
|
213
|
+
| `npm run verify` | `typecheck && lint && test && build` | Vollständige statische Analyse (`tsc --noEmit`, `eslint . --max-warnings=0`), Vitest-Suite (4 Suites / 23 Tests inkl. XSS-/SSRF-/Integritäts-Audit) und Build (`dist/` + `dist/core/*`) |
|
|
214
|
+
| `npm run verify:reproducible` | [`scripts/verify-reproducible-build.mjs`](../scripts/verify-reproducible-build.mjs) | Führt **zwei saubere Clean-Builds** nacheinander aus, vergleicht **jede einzelne Ausgabedatei Byte-für-Byte** (SHA-512, aktuell **169 Dateien**) und schreibt `artifacts/SHA256SUMS.txt`, `artifacts/SHA512SUMS.txt` sowie `artifacts/build-manifest.json` |
|
|
215
|
+
| `npm run checksums` | [`scripts/verify-reproducible-build.mjs`](../scripts/verify-reproducible-build.mjs) (`--checksums-only`) | Erzeugt die Prüfsummendateien über den aktuellen Build-Stand ohne zweiten Build-Durchlauf |
|
|
216
|
+
| `npm run sbom` | [`scripts/generate-sbom.mjs`](../scripts/generate-sbom.mjs) | Erzeugt deterministische SBOMs in **CycloneDX 1.6** (`artifacts/sbom.cdx.json`) und **SPDX 2.3** (`artifacts/sbom.spdx.json`) direkt aus `package.json` und `package-lock.json` (aktuell **41 Runtime-/Optional-Komponenten** inkl. vollständigem transitivem Abhängigkeitsgraph von `@open-charging-cloud/chargy-core@0.19.0`, SHA-512-Integrity-Hashes sowie `SOURCE_DATE_EPOCH`-Unterstützung) |
|
|
217
|
+
|
|
218
|
+
### 6.2 CI-Verankerung ([`.github/workflows/ci.yml`](../.github/workflows/ci.yml))
|
|
219
|
+
|
|
220
|
+
Neben der Multi-OS-/Multi-Node-Testmatrix (`ubuntu-latest` Node 22.18 & 26, `windows-latest` Node 24) führt der Job **`supply-chain-audit`** bei jedem Push und Pull Request aus:
|
|
221
|
+
|
|
222
|
+
1. `npm ci` (strikte Lockfile-Installation mit SHA-512-Integrity-Prüfung über alle gepinnten Registry-Pakete)
|
|
223
|
+
2. `npm run verify:reproducible` (Zwei-Pass-Build-Determinismus über alle Build-Artefakte in `dist/` inkl. `dist/core/*` + veröffentlichte Paketdateien)
|
|
224
|
+
3. Unabhängige Gegenprüfung via GNU coreutils: `sha256sum -c artifacts/SHA256SUMS.txt && sha512sum -c artifacts/SHA512SUMS.txt`
|
|
225
|
+
4. Deterministische SBOM-Generierung mit `SOURCE_DATE_EPOCH="$(git log -1 --format=%ct)" npm run sbom` und anschließender Byte-Vergleich (`cmp -s`) über eine zweite Generierung
|
|
226
|
+
5. `npm audit --omit=dev --audit-level=high` zur Prüfung der Produktions-Abhängigkeiten auf bekannte Schwachstellen
|
|
227
|
+
6. Upload aller Audit-Artefakte (`sbom.cdx.json`, `sbom.spdx.json`, `SHA256SUMS.txt`, `SHA512SUMS.txt`, `build-manifest.json`) als Workflow-Artifact `audit-supply-chain-artifacts`
|
|
228
|
+
|
|
229
|
+
### 6.3 Schritt-für-Schritt-Prüfablauf für Auditoren (PTB / Benannte Stelle)
|
|
230
|
+
|
|
231
|
+
Ein externer Prüfer kann einen Release-Stand auf einer sauberen Maschine (auch vollständig offline nach einmaligem `npm ci`) wie folgt unabhängig nachprüfen:
|
|
232
|
+
|
|
233
|
+
```bash
|
|
234
|
+
# 1. Exakten Git-Commit auschecken und Integrität prüfen
|
|
235
|
+
git checkout <release-tag-or-commit>
|
|
236
|
+
git status
|
|
237
|
+
|
|
238
|
+
# 2. Gepinnte Abhängigkeiten exakt gemäß package-lock.json installieren
|
|
239
|
+
npm ci
|
|
240
|
+
|
|
241
|
+
# 3. Vollständige Verifikation (Typprüfung, ESLint --max-warnings=0, Vitest-Suite inkl. Security-Audit, Build)
|
|
242
|
+
npm run verify
|
|
243
|
+
|
|
244
|
+
# 4. Zwei-Pass-Reproduzierbarkeit prüfen und SHA-256/SHA-512-Prüfsummen erzeugen
|
|
245
|
+
npm run verify:reproducible
|
|
246
|
+
|
|
247
|
+
# 5. Prüfsummen mit Systemwerkzeugen gegenprüfen
|
|
248
|
+
sha256sum -c artifacts/SHA256SUMS.txt
|
|
249
|
+
sha512sum -c artifacts/SHA512SUMS.txt
|
|
250
|
+
|
|
251
|
+
# 6. Deterministische SBOMs (CycloneDX 1.6 & SPDX 2.3) erzeugen
|
|
252
|
+
SOURCE_DATE_EPOCH="$(git log -1 --format=%ct)" npm run sbom
|
|
253
|
+
```
|
|
254
|
+
|
|
255
|
+
Die resultierenden SHA-512-Werte von `dist/index.js`, `dist/measurementDetailsRenderer.js`, `dist/domHelpers.js`, `dist/sessionUIState.js` sowie der gesamten `artifacts/SHA512SUMS.txt` können direkt gegen die im Release-Protokoll bzw. in der Baumusterprüfbescheinigung dokumentierten Hashes abgeglichen werden.
|
|
256
|
+
|
|
257
|
+
---
|
|
258
|
+
|
|
259
|
+
## 7. Schwachstellenbehandlung & Freeze-Prozess
|
|
260
|
+
|
|
261
|
+
- **Meldeweg:** Ausschließlich vertraulich über GitHub Private Vulnerability Reporting oder PGP-verschlüsselt an `info@graphdefined.com` (Key ID `0xC6CBE6A4`, Fingerprint `3CD0 09F4 0008 616A 91D0 7646 2DD3 B48B C6CB E6A4`, Details siehe [`SECURITY.md`](../SECURITY.md)).
|
|
262
|
+
- **Eingefrorene Prüfständer (PTB-Freeze):** Da die Prüfsummen einer zugelassenen Transparenzsoftware — einschließlich der eichrechtlich relevanten Anzeigeschicht (Schicht A) — Bestandteil der eichrechtlichen Dokumentation sind, erfolgen **keine stillen automatischen Updates**. Sicherheitskorrekturen führen stets zu einer neuen, eindeutig versionierten Freigabe mit aktualisierter SBOM und neuer `SHA512SUMS.txt`, sodass Änderungen zwischen Baumuster-Versionen über `git diff`, SBOM-Diff und Traceability Matrix vollständig nachvollziehbar bleiben.
|