@open-charging-cloud/wwcp-poi 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +498 -300
- package/README.md +522 -300
- package/dist/common.d.ts +9 -0
- package/dist/common.d.ts.map +1 -1
- package/dist/history/apply.d.ts.map +1 -1
- package/dist/history/commit.d.ts.map +1 -1
- package/dist/history/epoch.d.ts +2 -0
- package/dist/history/epoch.d.ts.map +1 -1
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3224 -625
- package/dist/index.js.map +1 -1
- package/dist/keys.d.ts +2 -0
- package/dist/keys.d.ts.map +1 -1
- package/dist/network/certificates.d.ts +6 -4
- package/dist/network/certificates.d.ts.map +1 -1
- package/dist/network/evTaler.d.ts +13 -0
- package/dist/network/evTaler.d.ts.map +1 -1
- package/dist/network/identifications.d.ts +15 -2
- package/dist/network/identifications.d.ts.map +1 -1
- package/dist/network/partyKeys.d.ts.map +1 -1
- package/dist/network/roamingNetwork.d.ts +9 -0
- package/dist/network/roamingNetwork.d.ts.map +1 -1
- package/dist/network/versionTexts.d.ts +3 -2
- package/dist/network/versionTexts.d.ts.map +1 -1
- package/dist/network/writtenForm.d.ts +24 -0
- package/dist/network/writtenForm.d.ts.map +1 -0
- package/dist/proofs/keyStatement.d.ts +6 -1
- package/dist/proofs/keyStatement.d.ts.map +1 -1
- package/dist/proofs/signingKeyCertificate.d.ts +5 -0
- package/dist/proofs/signingKeyCertificate.d.ts.map +1 -1
- package/dist/proofs/stationProof.d.ts +5 -2
- package/dist/proofs/stationProof.d.ts.map +1 -1
- package/dist/proofs/trustContext.d.ts +56 -0
- package/dist/proofs/trustContext.d.ts.map +1 -0
- package/dist/verifier/chargingStation.d.ts +7 -1
- package/dist/verifier/chargingStation.d.ts.map +1 -1
- package/dist/verifier/documentKeys.d.ts +27 -0
- package/dist/verifier/documentKeys.d.ts.map +1 -0
- package/dist/verifier/historicalMeasurements.d.ts +96 -0
- package/dist/verifier/historicalMeasurements.d.ts.map +1 -0
- package/dist/verifier/measurementKeys.d.ts +48 -0
- package/dist/verifier/measurementKeys.d.ts.map +1 -0
- package/dist/verifier/observedVersions.d.ts +70 -0
- package/dist/verifier/observedVersions.d.ts.map +1 -0
- package/dist/verifier/pricePublication.d.ts +74 -0
- package/dist/verifier/pricePublication.d.ts.map +1 -0
- package/dist/verifier/sessionPrices.d.ts +75 -0
- package/dist/verifier/sessionPrices.d.ts.map +1 -0
- package/dist/verifier/trust.d.ts +3 -2
- package/dist/verifier/trust.d.ts.map +1 -1
- package/dist/verifier/trustTransitions.d.ts +67 -0
- package/dist/verifier/trustTransitions.d.ts.map +1 -0
- package/dist/verifier/version.d.ts +2 -1
- package/dist/verifier/version.d.ts.map +1 -1
- package/package.json +4 -4
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import type { JSONValue } from '../json/value.ts';
|
|
2
|
+
import type { ChargingStationProof } from '../proofs/stationProof.ts';
|
|
3
|
+
import type { Checkpoint } from '../history/checkpoint.ts';
|
|
4
|
+
import type { PriceStatement } from '../proofs/priceStatement.ts';
|
|
5
|
+
/** Authenticated observations supplied by the caller, never imported success flags. Comparison grants no authority. */
|
|
6
|
+
export interface VersionObservation {
|
|
7
|
+
readonly kind: 'station' | 'checkpoint' | 'price' | 'live' | 'policy';
|
|
8
|
+
readonly chain: string;
|
|
9
|
+
readonly epoch: string;
|
|
10
|
+
readonly position: number;
|
|
11
|
+
readonly digest: string;
|
|
12
|
+
readonly revision?: number;
|
|
13
|
+
readonly previous?: string;
|
|
14
|
+
readonly identity?: string;
|
|
15
|
+
readonly original: string;
|
|
16
|
+
readonly final?: boolean;
|
|
17
|
+
readonly rootDigest?: string;
|
|
18
|
+
}
|
|
19
|
+
export interface VersionConflict {
|
|
20
|
+
readonly code: 'fork' | 'identity' | 'link';
|
|
21
|
+
readonly kind: VersionObservation['kind'];
|
|
22
|
+
readonly chain: string;
|
|
23
|
+
readonly epoch: string;
|
|
24
|
+
readonly position: number;
|
|
25
|
+
readonly known: string;
|
|
26
|
+
readonly incoming: string;
|
|
27
|
+
readonly original: string;
|
|
28
|
+
readonly observedAt: number;
|
|
29
|
+
}
|
|
30
|
+
export interface ObservedVersions {
|
|
31
|
+
readonly version: 1;
|
|
32
|
+
readonly points: readonly VersionObservation[];
|
|
33
|
+
readonly transitions?: readonly {
|
|
34
|
+
readonly id: string;
|
|
35
|
+
readonly sequence: number;
|
|
36
|
+
readonly fromPolicyId: string;
|
|
37
|
+
readonly toPolicyId: string;
|
|
38
|
+
readonly fromEpoch: number;
|
|
39
|
+
readonly toEpoch: number;
|
|
40
|
+
readonly original: string;
|
|
41
|
+
}[];
|
|
42
|
+
readonly heads: Readonly<Record<string, {
|
|
43
|
+
readonly epoch: string;
|
|
44
|
+
readonly position: number;
|
|
45
|
+
readonly digest: string;
|
|
46
|
+
}>>;
|
|
47
|
+
readonly conflicts: readonly VersionConflict[];
|
|
48
|
+
}
|
|
49
|
+
export interface VersionIssue {
|
|
50
|
+
readonly code: 'fork' | 'identity' | 'link' | 'known-fork' | 'rollback' | 'continuity-missing' | 'epoch-transition';
|
|
51
|
+
readonly kind: VersionObservation['kind'];
|
|
52
|
+
readonly chain: string;
|
|
53
|
+
readonly detail: string;
|
|
54
|
+
}
|
|
55
|
+
export interface VersionComparison {
|
|
56
|
+
readonly accepted: boolean;
|
|
57
|
+
readonly status: 'first-seen' | 'matches' | 'advanced' | 'historical' | 'rejected';
|
|
58
|
+
readonly issues: readonly VersionIssue[];
|
|
59
|
+
readonly state: ObservedVersions;
|
|
60
|
+
}
|
|
61
|
+
export declare function emptyObservedVersions(): ObservedVersions;
|
|
62
|
+
export declare function observedVersionsChecksum(value: JSONValue): string;
|
|
63
|
+
/** Deterministic negative constraints. Current selection is monotonic; historical inspection permits older coordinates, never contradictory ones. */
|
|
64
|
+
export declare function compareObservedVersions(before: ObservedVersions, candidates: readonly VersionObservation[], mode: 'current' | 'historical', observedAt: number): VersionComparison;
|
|
65
|
+
/** Metadata projection only: callers must authenticate each original with the normal role/quorum verifiers first. */
|
|
66
|
+
export declare function stationVersionObservation(proof: ChargingStationProof, epoch?: string): VersionObservation;
|
|
67
|
+
export declare function checkpointVersionObservation(checkpoint: Checkpoint): VersionObservation;
|
|
68
|
+
export declare function priceVersionObservation(statement: PriceStatement): VersionObservation;
|
|
69
|
+
export declare function checkpointRootVersionObservation(checkpoint: Checkpoint): VersionObservation;
|
|
70
|
+
//# sourceMappingURL=observedVersions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"observedVersions.d.ts","sourceRoot":"","sources":["../../src/verifier/observedVersions.ts"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACtE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAGlE,uHAAuH;AACvH,MAAM,WAAW,kBAAkB;IAC/B,QAAQ,CAAC,IAAI,EAAC,SAAS,GAAC,YAAY,GAAC,OAAO,GAAC,MAAM,GAAC,QAAQ,CAAC;IAC7D,QAAQ,CAAC,KAAK,EAAC,MAAM,CAAC;IAAA,QAAQ,CAAC,KAAK,EAAC,MAAM,CAAC;IAAA,QAAQ,CAAC,QAAQ,EAAC,MAAM,CAAC;IAAA,QAAQ,CAAC,MAAM,EAAC,MAAM,CAAC;IAC5F,QAAQ,CAAC,QAAQ,CAAC,EAAC,MAAM,CAAC;IAAA,QAAQ,CAAC,QAAQ,CAAC,EAAC,MAAM,CAAC;IAAA,QAAQ,CAAC,QAAQ,CAAC,EAAC,MAAM,CAAC;IAAA,QAAQ,CAAC,QAAQ,EAAC,MAAM,CAAC;IAAA,QAAQ,CAAC,KAAK,CAAC,EAAC,O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,EAAC,UAAU,GAAE,kBAAkB,CAEzF"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import type { JSONObject, JSONValue } from '../json/value.ts';
|
|
2
|
+
import { POIPublicKey } from '../keys.ts';
|
|
3
|
+
import type { Checkpoint } from '../history/checkpoint.ts';
|
|
4
|
+
import type { PriceStatement } from '../proofs/priceStatement.ts';
|
|
5
|
+
/** Experimental extensions, not the checkpoint witness wire format or an RFC 3161 token. */
|
|
6
|
+
export declare const PRICE_PUBLICATION_RECEIPT_CONTEXT = "https://open.charging.cloud/contexts/wwcp/pricePublicationReceipt/v1";
|
|
7
|
+
export declare const WITNESS_PUBLICATION_POLICY_CONTEXT = "https://open.charging.cloud/contexts/wwcp/witnessPublicationPolicy/v1";
|
|
8
|
+
/** Bind the actual original CPO signature and the complete selected tariff, including its currency. */
|
|
9
|
+
export declare function pricePublicationOfferHashes(statement: PriceStatement, tariff: JSONObject): {
|
|
10
|
+
readonly priceStatementSHA256: string;
|
|
11
|
+
readonly tariffSHA256: string;
|
|
12
|
+
};
|
|
13
|
+
export interface PublicationWitness {
|
|
14
|
+
readonly id: string;
|
|
15
|
+
/** Independently approved organization identity; several keys/aliases never add votes. */
|
|
16
|
+
readonly organization: string;
|
|
17
|
+
readonly networks: readonly string[];
|
|
18
|
+
readonly keys: readonly POIPublicKey[];
|
|
19
|
+
readonly notBefore: number;
|
|
20
|
+
readonly notAfter: number;
|
|
21
|
+
/** Locally accepted upper bound, never taken from a receipt. */
|
|
22
|
+
readonly clockErrorMs: number;
|
|
23
|
+
/** Explicit receipt endpoints, not a guessed discovery URL. */
|
|
24
|
+
readonly endpoints: readonly string[];
|
|
25
|
+
readonly json: JSONObject;
|
|
26
|
+
}
|
|
27
|
+
export interface WitnessPublicationPolicy {
|
|
28
|
+
readonly requiredOrganizations: number;
|
|
29
|
+
readonly witnesses: readonly PublicationWitness[];
|
|
30
|
+
readonly json: JSONObject;
|
|
31
|
+
}
|
|
32
|
+
/** Syntax only. Callers must additionally apply their own public-network transport policy before fetching. */
|
|
33
|
+
export declare function publicPublicationURL(text: string): string;
|
|
34
|
+
/** Parsing a suggested policy never authorizes it. Only the caller supplies the accepted policy. */
|
|
35
|
+
export declare function parseWitnessPublicationPolicy(value: JSONValue): WitnessPublicationPolicy;
|
|
36
|
+
export declare class PricePublicationReceipt {
|
|
37
|
+
readonly json: JSONObject;
|
|
38
|
+
readonly observedAt: number;
|
|
39
|
+
readonly signedAt: number;
|
|
40
|
+
private constructor();
|
|
41
|
+
static parse(value: JSONValue): PricePublicationReceipt;
|
|
42
|
+
signingBytes(): Uint8Array;
|
|
43
|
+
digest(): string;
|
|
44
|
+
}
|
|
45
|
+
export interface PricePublicationVerification {
|
|
46
|
+
readonly status: 'witnessed-before-signed-start' | 'not-proven' | 'invalid';
|
|
47
|
+
readonly requiredOrganizations: number;
|
|
48
|
+
readonly organizations: readonly string[];
|
|
49
|
+
readonly timeBasis: 'trusted-witness-clocks-versus-signed-start';
|
|
50
|
+
readonly actualStartTime: 'not-independently-proven';
|
|
51
|
+
readonly receipts: readonly {
|
|
52
|
+
readonly witnessId: string;
|
|
53
|
+
readonly organization?: string;
|
|
54
|
+
readonly keyId?: string;
|
|
55
|
+
readonly receiptDigest?: string;
|
|
56
|
+
readonly latestPublicationAt?: number;
|
|
57
|
+
readonly sourceURL?: string;
|
|
58
|
+
readonly status: 'counted' | 'duplicate-organization' | 'after-start' | 'untrusted' | 'invalid';
|
|
59
|
+
readonly detail: string;
|
|
60
|
+
}[];
|
|
61
|
+
}
|
|
62
|
+
/** Inclusion and CPO signatures are checked by the calling shared session-price verifier first. */
|
|
63
|
+
export declare function verifyPricePublication(receipts: readonly JSONValue[], policy: WitnessPublicationPolicy | undefined, subject: {
|
|
64
|
+
readonly roamingNetworkId: string;
|
|
65
|
+
readonly evseId: string;
|
|
66
|
+
readonly statement: PriceStatement;
|
|
67
|
+
readonly tariff: JSONObject;
|
|
68
|
+
readonly checkpoints: readonly Checkpoint[];
|
|
69
|
+
readonly chargingStarted: number;
|
|
70
|
+
readonly now: number;
|
|
71
|
+
readonly excludedKeyMaterial?: readonly string[];
|
|
72
|
+
readonly excludedIdentities?: readonly string[];
|
|
73
|
+
}): PricePublicationVerification;
|
|
74
|
+
//# sourceMappingURL=pricePublication.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pricePublication.d.ts","sourceRoot":"","sources":["../../src/verifier/pricePublication.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAI1C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAGlE,4FAA4F;AAC5F,eAAO,MAAM,iCAAiC,yEAAyE,CAAC;AACxH,eAAO,MAAM,kCAAkC,0EAA0E,CAAC;AAC1H,uGAAuG;AACvG,wBAAgB,2BAA2B,CAAC,SAAS,EAAE,cAAc,EAAE,MAAM,EAAE,UAAU,GAAG;IAAC,QAAQ,CAAC,oBAAoB,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAA;CAAC,CAEjK;AACD,MAAM,WAAW,kBAAkB;IAC/B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,0FAA0F;IAC1F,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAC;IACrC,QAAQ,CAAC,IAAI,EAAE,SAAS,YAAY,EAAE,CAAC;IACvC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,gEAAgE;IAChE,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,+DAA+D;IAC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AAC;QACtC,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;QAC5B,QAAQ,CAAC,MAAM,EAAE,SAAS,GAAG,wBAAwB,GAAG,aAAa,GAAG,WAAW,GAAG,SAAS,CAAC;QAChG,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;KAC3B,EAAE,CAAC;CACP;AACD,mGAAmG;AACnG,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,SAAS,SAAS,EAAE,EAAE,MAAM,EAAE,wBAAwB,GAAG,SAAS,EAAE,OAAO,EAAE;IAC1H,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,SAAS,EAAE,cAAc,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,UAAU,CAAC;IAC5H,QAAQ,CAAC,WAAW,EAAE,SAAS,UAAU,EAAE,CAAC;IAAC,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACpG,QAAQ,CAAC,mBAAmB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAAC,QAAQ,CAAC,kBAAkB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CACrG,GAAG,4BAA4B,CAmC/B"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { type JSONValue, type JSONObject } from '../json/value.ts';
|
|
2
|
+
import { TrustContext } from '../proofs/trustContext.ts';
|
|
3
|
+
import { type VerifiedChargingStation } from './chargingStation.ts';
|
|
4
|
+
import { HistoricalTrustContext, type HistoricalMeterPolicy } from './historicalMeasurements.ts';
|
|
5
|
+
import { type WitnessPublicationPolicy, type PricePublicationVerification } from './pricePublication.ts';
|
|
6
|
+
export declare const SESSION_PRICE_EVIDENCE_CONTEXT = "https://open.charging.cloud/contexts/wwcp/sessionPriceEvidence/v1";
|
|
7
|
+
export declare const SESSION_PRICE_AGREEMENT_CONTEXT = "https://open.charging.cloud/contexts/wwcp/sessionPriceAgreement/v1";
|
|
8
|
+
export declare const SIMPLE_GROSS_PRICE_PROFILE = "chargy-gross-rates/v1";
|
|
9
|
+
/** Experimental CPO assertion, distinct from customer consent. */
|
|
10
|
+
export declare class SessionPriceAgreement {
|
|
11
|
+
readonly json: JSONObject;
|
|
12
|
+
readonly chargingStarted: number;
|
|
13
|
+
readonly signedAt: number;
|
|
14
|
+
private constructor();
|
|
15
|
+
static parse(value: JSONValue): SessionPriceAgreement;
|
|
16
|
+
signingBytes(): Uint8Array;
|
|
17
|
+
verify(station: VerifiedChargingStation): void;
|
|
18
|
+
}
|
|
19
|
+
export interface SessionPriceEvidence {
|
|
20
|
+
readonly evseId: string;
|
|
21
|
+
readonly proof: JSONValue;
|
|
22
|
+
readonly priceStatements: readonly JSONValue[];
|
|
23
|
+
readonly publicationReceipts: readonly JSONValue[];
|
|
24
|
+
readonly witnessCandidates: readonly JSONValue[];
|
|
25
|
+
readonly agreement?: JSONValue;
|
|
26
|
+
readonly priceProofs: readonly JSONValue[];
|
|
27
|
+
readonly checkpoints: readonly {
|
|
28
|
+
readonly checkpoint: JSONValue;
|
|
29
|
+
readonly operator: JSONValue;
|
|
30
|
+
}[];
|
|
31
|
+
}
|
|
32
|
+
export declare function parseSessionPriceEvidence(value: JSONValue): SessionPriceEvidence;
|
|
33
|
+
export interface SessionPriceRequest {
|
|
34
|
+
readonly evseId: string;
|
|
35
|
+
readonly meterSerialNumber: string;
|
|
36
|
+
readonly chargingStarted: number;
|
|
37
|
+
readonly startDocumentSHA256: string;
|
|
38
|
+
}
|
|
39
|
+
export interface SessionPriceVerification {
|
|
40
|
+
readonly station: VerifiedChargingStation;
|
|
41
|
+
readonly signatures: 'valid' | 'invalid' | 'missing';
|
|
42
|
+
readonly applicability: 'bound' | 'unbound' | 'missing' | 'invalid' | 'ambiguous' | 'unsupported';
|
|
43
|
+
readonly agreement: 'valid' | 'invalid' | 'missing';
|
|
44
|
+
readonly publication: 'valid' | 'invalid' | 'missing' | 'incomplete';
|
|
45
|
+
readonly publicationBeforeStart: 'not-proven' | 'witnessed-before-signed-start' | 'invalid';
|
|
46
|
+
readonly publicationWitnesses?: PricePublicationVerification;
|
|
47
|
+
readonly customerConsent: 'not-proven';
|
|
48
|
+
readonly latestOrSoleOffer: 'not-proven';
|
|
49
|
+
readonly chainGaps: boolean;
|
|
50
|
+
readonly checkedAt: number;
|
|
51
|
+
readonly checkpointIds: readonly string[];
|
|
52
|
+
readonly witnessedBy: readonly string[];
|
|
53
|
+
readonly diagnostics: readonly string[];
|
|
54
|
+
readonly selected?: {
|
|
55
|
+
readonly statement: JSONObject;
|
|
56
|
+
readonly digest: string;
|
|
57
|
+
readonly tariff: JSONObject;
|
|
58
|
+
readonly currency: string;
|
|
59
|
+
readonly elements: readonly JSONObject[];
|
|
60
|
+
readonly rates?: {
|
|
61
|
+
readonly currency: string;
|
|
62
|
+
readonly energyPerKWh?: string;
|
|
63
|
+
readonly flatFee?: string;
|
|
64
|
+
readonly timePerHour?: string;
|
|
65
|
+
};
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
export declare function verifySessionPriceEvidence(current: TrustContext | HistoricalTrustContext, value: JSONValue, request: SessionPriceRequest, policy?: HistoricalMeterPolicy & {
|
|
69
|
+
readonly publicationPolicy?: WitnessPublicationPolicy;
|
|
70
|
+
readonly relatedCheckpoints?: readonly {
|
|
71
|
+
readonly checkpoint: JSONValue;
|
|
72
|
+
readonly operator: JSONValue;
|
|
73
|
+
}[];
|
|
74
|
+
}): SessionPriceVerification;
|
|
75
|
+
//# sourceMappingURL=sessionPrices.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sessionPrices.d.ts","sourceRoot":"","sources":["../../src/verifier/sessionPrices.ts"],"names":[],"mappings":"AAiBA,OAAO,EAA8B,KAAK,SAAS,EAAE,KAAK,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAK/F,OAAO,EAAE,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AU,CAAC;QAAA,QAAQ,CAAC,QAAQ,EAAC,MAAM,CAAC;QAAA,QAAQ,CAAC,QAAQ,EAAC,SAAS,UAAU,EAAE,CAAC;QACjK,QAAQ,CAAC,KAAK,CAAC,EAAC;YAAC,QAAQ,CAAC,QAAQ,EAAC,MAAM,CAAC;YAAA,QAAQ,CAAC,YAAY,CAAC,EAAC,MAAM,CAAC;YAAA,QAAQ,CAAC,OAAO,CAAC,EAAC,MAAM,CAAC;YAAA,QAAQ,CAAC,WAAW,CAAC,EAAC,MAAM,CAAA;SAAC,CAAA;KAAC,CAAC;CACvI;AAgBD,wBAAgB,0BAA0B,CAAC,OAAO,EAAC,YAAY,GAAC,sBAAsB,EAAC,KAAK,EAAC,SAAS,EAAC,OAAO,EAAC,mBAAmB,EAC9H,MAAM,GAAC,qBAAqB,GAAC;IAAC,QAAQ,CAAC,iBAAiB,CAAC,EAAC,wBAAwB,CAAC;IAAA,QAAQ,CAAC,kBAAkB,CAAC,EAAC,SAAS;QAAC,QAAQ,CAAC,UAAU,EAAC,SAAS,CAAC;QAAA,QAAQ,CAAC,QAAQ,EAAC,SAAS,CAAA;KAAC,EAAE,CAAA;CAAI,GAAE,wBAAwB,CAuEvN"}
|
package/dist/verifier/trust.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import { type KeyUsage, type POIPublicKey } from '../keys.ts';
|
|
|
3
3
|
import { type RoleSignature } from '../history/commit.ts';
|
|
4
4
|
import { RoamingNetworkOperator, type RoamingNetwork } from '../network/roamingNetwork.ts';
|
|
5
5
|
import type { KeyStatement } from '../proofs/keyStatement.ts';
|
|
6
|
+
import { TrustContext } from '../proofs/trustContext.ts';
|
|
6
7
|
import type { TrustAnchor } from '../proofs/trustAnchor.ts';
|
|
7
8
|
/**
|
|
8
9
|
* The trust a verifier has in the roaming network operator of a version, from a trust anchor it pinned (SPECIFICATION.md
|
|
@@ -29,12 +30,12 @@ export declare class OperatorTrust {
|
|
|
29
30
|
* Verifies the key statement of the operator of the given version against the trust anchor (A1 step e) and returns the
|
|
30
31
|
* trust in its keys. `at` is when the statement must be valid, now by default.
|
|
31
32
|
*/
|
|
32
|
-
static of(
|
|
33
|
+
static of(basis: TrustAnchor | TrustContext, network: RoamingNetwork, at?: number | Date | string): OperatorTrust;
|
|
33
34
|
/**
|
|
34
35
|
* The same from the roaming network operator alone, e.g. as a proof of a charging station gives it (8.4): its key
|
|
35
36
|
* statement verified against the trust anchor at `at`.
|
|
36
37
|
*/
|
|
37
|
-
static fromOperatorJSON(
|
|
38
|
+
static fromOperatorJSON(basis: TrustAnchor | TrustContext, operatorJSON: JSONValue | undefined, at?: number | Date | string): OperatorTrust;
|
|
38
39
|
/**
|
|
39
40
|
* The trust in the operator of a later version of a history this trust follows (8.6, *Succession*): its key statement
|
|
40
41
|
* signed by identity keys trusted here, of as many holders as required, e.g. after the operator stated new keys signed
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"trust.d.ts","sourceRoot":"","sources":["../../src/verifier/trust.ts"],"names":[],"mappings":"AAkBA,OAAO,EAA4B,KAAK,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC5E,OAAO,EAAa,KAAK,QAAQ,EAAE,KAAK,YAAY,EAAE,MAAM,YAAY,CAAC;AACzE,OAAO,EAAkB,KAAK,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAC1E,OAAO,EAAE,sBAAsB,EAAE,KAAK,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC3F,OAAO,KAAK,EAAE,YAAY,EAAE,MAAiB,2BAA2B,CAAC;AAEzE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAkB,0BAA0B,CAAC;AAIxE;;;;;;;GAOG;AACH,qBAAa,aAAa;aAGF,MAAM,EAAc,WAAW;aAC/B,QAAQ,EAAY,sBAAsB;aAC1C,YAAY,EAAQ,YAAY;IAChD,0HAA0H;aAC1G,kBAAkB,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC;IAC/D,wEAAwE;aACxD,i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AG,IAAI,GAAG,MAAM,GAAG,aAAa;IAWxH;;;OAGG;WACW,gBAAgB,CAAC,KAAK,EAAE,WAAW,GAAG,YAAY,EAAE,YAAY,EAAE,SAAS,GAAG,SAAS,EAAE,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,GAAG,aAAa;IAKlJ;;;;;OAKG;IACI,UAAU,CAAC,OAAO,EAAE,cAAc,EAAE,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,GAAG,aAAa;IAiCtF,OAAO,CAAC,MAAM,CAAC,UAAU;IAqBzB;;;;OAIG;IACI,YAAY,CAAC,SAAS,EAAE,aAAa,EAAE,KAAK,GAAE,QAA0B,GAAG,YAAY,GAAG,SAAS;IAI1G;;;OAGG;IACI,QAAQ,CAAC,SAAS,EAAE,aAAa,EAAE,KAAK,GAAE,QAA0B,GAAG,MAAM,GAAG,SAAS;IAQhG,OAAO,CAAC,aAAa;IA8BrB;;;OAGG;IACI,wBAAwB,CAAC,UAAU,EAAE,SAAS,aAAa,EAAE,EACpC,MAAM,EAAM,CAAC,SAAS,EAAE,aAAa,EAAE,GAAG,EAAE,YAAY,KAAK,IAAI,EACjE,IAAI,EAAQ,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC;IAyBhE;;;OAGG;IACI,YAAY,CAAC,OAAO,EAAE,cAAc,GAAG,MAAM,EAAE;IAatD,4DAA4D;IAC5D,IAAW,YAAY,IAAI,MAAM,GAAG,SAAS,CAE5C;CAEJ"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { type JSONValue, type JSONObject } from '../json/value.ts';
|
|
2
|
+
import { TrustAnchor } from '../proofs/trustAnchor.ts';
|
|
3
|
+
import { KeyStatement } from '../proofs/keyStatement.ts';
|
|
4
|
+
import { TrustContext } from '../proofs/trustContext.ts';
|
|
5
|
+
import { Checkpoint } from '../history/checkpoint.ts';
|
|
6
|
+
import { type Epoch } from '../history/epoch.ts';
|
|
7
|
+
import { type ObservedVersions, type VersionComparison } from './observedVersions.ts';
|
|
8
|
+
/** Experimental compact trust delegation; not a replacement for History.followedBy or full owner/change-set replay. */
|
|
9
|
+
export declare const TRUST_TRANSITION_CONTEXT = "https://open.charging.cloud/contexts/wwcp/trustTransition/v1";
|
|
10
|
+
/** The digest of a key statement a transition continues: the SHA-256 of the canonical JSON of its content. */
|
|
11
|
+
export declare const trustStatementDigest: (statement: KeyStatement) => string;
|
|
12
|
+
/**
|
|
13
|
+
* The identity of the complete policy of a trust anchor: the SHA-256 of the canonical JSON (section 1) of
|
|
14
|
+
* `{network, holders, minConsensus, urls}`, its holders in their order, its URLs as a WHATWG URL serializes them (scheme
|
|
15
|
+
* and host in lower case, no default port) without trailing slashes, in their ordinal order; as lowercase hex, so that
|
|
16
|
+
* one endpoint spelled otherwise is one policy. WWCP_POI3 calculates it alike (`TrustTransition.PolicyIdOf`).
|
|
17
|
+
*/
|
|
18
|
+
export declare function trustPolicyId(anchor: TrustAnchor): string;
|
|
19
|
+
/**
|
|
20
|
+
* A compact delegation of trust from one authorized policy to the next: the exact policy and key statement it continues,
|
|
21
|
+
* the trust anchor and the roaming network operator it delegates to, its place in a chain of transitions, its interval,
|
|
22
|
+
* optionally the checkpoints of the old epoch and the start of the next one; signed by quorums of the holders of both.
|
|
23
|
+
*/
|
|
24
|
+
export declare class TrustTransition {
|
|
25
|
+
readonly json: JSONObject;
|
|
26
|
+
readonly sequence: number;
|
|
27
|
+
readonly previous: string | undefined;
|
|
28
|
+
readonly signedAt: number;
|
|
29
|
+
readonly validUntil: number;
|
|
30
|
+
readonly fromPolicyId: string;
|
|
31
|
+
readonly fromStatementDigest: string;
|
|
32
|
+
readonly anchor: TrustAnchor;
|
|
33
|
+
readonly operator: JSONObject;
|
|
34
|
+
private constructor();
|
|
35
|
+
static parse(value: JSONValue): TrustTransition;
|
|
36
|
+
/** What it names, but its signatures. */
|
|
37
|
+
content(): JSONObject;
|
|
38
|
+
/** The SHA-256 of the canonical JSON of its content: the `previous` of the next transition. */
|
|
39
|
+
digest(): string;
|
|
40
|
+
/** The signature input of a signature: its content with the side, the algorithm and the key of the signature. */
|
|
41
|
+
signingBytes(side: string, algorithm: string, keyId: string): Uint8Array;
|
|
42
|
+
}
|
|
43
|
+
export interface TransitionVerificationOptions {
|
|
44
|
+
readonly acceptedAt: number;
|
|
45
|
+
readonly epoch: Epoch;
|
|
46
|
+
readonly sequence: number;
|
|
47
|
+
readonly previous?: string | undefined;
|
|
48
|
+
}
|
|
49
|
+
/** Only produced after both holder quorums and the exact policies/evidence were authenticated. Never restored from a JSON flag. */
|
|
50
|
+
export declare class VerifiedTrustTransition {
|
|
51
|
+
readonly source: TrustTransition;
|
|
52
|
+
readonly context: TrustContext;
|
|
53
|
+
readonly epoch: Epoch;
|
|
54
|
+
readonly checkpoints: readonly Checkpoint[];
|
|
55
|
+
readonly first: Checkpoint | undefined;
|
|
56
|
+
readonly oldEpoch: Epoch;
|
|
57
|
+
readonly signedBy: {
|
|
58
|
+
readonly old: readonly number[];
|
|
59
|
+
readonly next: readonly number[];
|
|
60
|
+
};
|
|
61
|
+
private constructor();
|
|
62
|
+
static verify(basis: TrustContext, fromOperator: JSONValue, transition: TrustTransition, options: TransitionVerificationOptions): VerifiedTrustTransition;
|
|
63
|
+
}
|
|
64
|
+
/** Persist only original evidence and negative coordinates; authority is recreated on every resolver operation. */
|
|
65
|
+
export declare function applyVerifiedTrustTransition(before: ObservedVersions, verified: VerifiedTrustTransition, at: number): VersionComparison;
|
|
66
|
+
export declare const initialTrustEpoch: () => Epoch;
|
|
67
|
+
//# sourceMappingURL=trustTransitions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trustTransitions.d.ts","sourceRoot":"","sources":["../../src/verifier/trustTransitions.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAO,KAAK,SAAS,EAAE,KAAK,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAKxE,OAAO,EAAE,WAAW,EAAE,MAA+B,0B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AQ,CAAC,QAAQ,CAAC,EAAI,MAAM,GAAG,SAAS,CAAC;CAC5C;AAGD,mIAAmI;AACnI,qBAAa,uBAAuB;aAEI,MAAM,EAAQ,eAAe;aAC7B,OAAO,EAAO,YAAY;aAC1B,KAAK,EAAS,KAAK;aACnB,WAAW,EAAG,SAAS,UAAU,EAAE;aACnC,KAAK,EAAS,UAAU,GAAG,SAAS;aACpC,QAAQ,EAAM,KAAK;aACnB,QAAQ,EAAM;QAAE,QAAQ,CAAC,GAAG,EAAE,SAAS,MAAM,EAAE,CAAC;QAAC,QAAQ,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,CAAA;KAAE;IANvH,OAAO;WASO,MAAM,CAAC,KAAK,EAAU,YAAY,EAC3B,YAAY,EAAG,SAAS,EACxB,UAAU,EAAK,eAAe,EAC9B,OAAO,EAAQ,6BAA6B,GAAG,uBAAuB;CAkJ9F;AAGD,mHAAmH;AACnH,wBAAgB,4BAA4B,CAAC,MAAM,EAAE,gBAAgB,EAAE,QAAQ,EAAE,uBAAuB,EAAE,EAAE,EAAE,MAAM,GAAG,iBAAiB,CAgEvI;AAGD,eAAO,MAAM,iBAAiB,QAAO,KAAuD,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { JSONValue } from '../json/value.ts';
|
|
2
2
|
import { Commit } from '../history/commit.ts';
|
|
3
3
|
import { RoamingNetwork } from '../network/roamingNetwork.ts';
|
|
4
|
+
import { type TrustContext } from '../proofs/trustContext.ts';
|
|
4
5
|
import type { TrustAnchor } from '../proofs/trustAnchor.ts';
|
|
5
6
|
import { OperatorTrust } from './trust.ts';
|
|
6
7
|
/** A version of a roaming network checked from a trust anchor, as example A1 checks `QA`. */
|
|
@@ -26,7 +27,7 @@ export interface VerifiedVersion {
|
|
|
26
27
|
* trusted identity key of its holder, valid when it signed, and one that may sign for the party;
|
|
27
28
|
* g) the texts to show are those of the checked version; a trust anchor naming the network otherwise is warned of.
|
|
28
29
|
*/
|
|
29
|
-
export declare function verifyVersion(
|
|
30
|
+
export declare function verifyVersion(basis: TrustAnchor | TrustContext, networkJSON: JSONValue, commitJSON: JSONValue, at?: number | Date | string): VerifiedVersion;
|
|
30
31
|
/** A line telling what was checked, as example A1 prints it. */
|
|
31
32
|
export declare function describeVersion(version: VerifiedVersion): string;
|
|
32
33
|
//# sourceMappingURL=version.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../src/verifier/version.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAoB,kBAAkB,CAAC;AAChE,OAAO,EAAE,MAAM,EAAE,MAA4B,sBAAsB,CAAC;AACpE,OAAO,EAAE,cAAc,EAAE,MAAoB,8BAA8B,CAAC;AAC5E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAkB,0BAA0B,CAAC;AACxE,OAAO,EAAE,aAAa,EAAE,MAAqB,YAAY,CAAC;AAI1D,6FAA6F;AAC7F,MAAM,WAAW,eAAe;IAC5B,QAAQ,CAAC,OAAO,EAAI,cAAc,CAAC;IACnC,QAAQ,CAAC,MAAM,EAAK,MAAM,CAAC;IAC3B,QAAQ,CAAC,KAAK,EAAM,aAAa,CAAC;IAClC,wFAAwF;IACxF,QAAQ,CAAC,QAAQ,EAAG,SAAS,MAAM,EAAE,CAAC;IACtC,qFAAqF;IACrF,QAAQ,CAAC,QAAQ,EAAG,SAAS,MAAM,EAAE,CAAC;CACzC;AAGD;;;;;;;;;;;;GAYG;AACH,wBAAgB,aAAa,CAAC,
|
|
1
|
+
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../src/verifier/version.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAoB,kBAAkB,CAAC;AAChE,OAAO,EAAE,MAAM,EAAE,MAA4B,sBAAsB,CAAC;AACpE,OAAO,EAAE,cAAc,EAAE,MAAoB,8BAA8B,CAAC;AAC5E,OAAO,EAAY,KAAK,YAAY,EAAE,MAAO,2BAA2B,CAAC;AACzE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAkB,0BAA0B,CAAC;AACxE,OAAO,EAAE,aAAa,EAAE,MAAqB,YAAY,CAAC;AAI1D,6FAA6F;AAC7F,MAAM,WAAW,eAAe;IAC5B,QAAQ,CAAC,OAAO,EAAI,cAAc,CAAC;IACnC,QAAQ,CAAC,MAAM,EAAK,MAAM,CAAC;IAC3B,QAAQ,CAAC,KAAK,EAAM,aAAa,CAAC;IAClC,wFAAwF;IACxF,QAAQ,CAAC,QAAQ,EAAG,SAAS,MAAM,EAAE,CAAC;IACtC,qFAAqF;IACrF,QAAQ,CAAC,QAAQ,EAAG,SAAS,MAAM,EAAE,CAAC;CACzC;AAGD;;;;;;;;;;;;GAYG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAQ,WAAW,GAAG,YAAY,EACvC,WAAW,EAAE,SAAS,EACtB,UAAU,EAAG,SAAS,EACtB,EAAE,CAAC,EAAU,MAAM,GAAG,IAAI,GAAG,MAAM,GAAG,eAAe,CA+BlF;AAGD,gEAAgE;AAChE,wBAAgB,eAAe,CAAC,OAAO,EAAE,eAAe,GAAG,MAAM,CAGhE"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@open-charging-cloud/wwcp-poi",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "Verifies WWCP
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"description": "Verifies WWCP/POI data in TypeScript: trust anchors, key statements, roaming networks and their ETags, commits, checkpoints, charging station proofs and price statements - so that an EV driver's app knows the charging station and its tariffs it shows are the ones the roaming network signed and published.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"wwcp",
|
|
7
7
|
"poi",
|
|
@@ -69,8 +69,8 @@
|
|
|
69
69
|
},
|
|
70
70
|
"dependencies": {
|
|
71
71
|
"@noble/hashes": "^2.4.0",
|
|
72
|
-
"@vanaheimr/cose": "^0.
|
|
73
|
-
"@vanaheimr/metrological-cbor": "^0.
|
|
72
|
+
"@vanaheimr/cose": "^0.12.0",
|
|
73
|
+
"@vanaheimr/metrological-cbor": "^0.12.0"
|
|
74
74
|
},
|
|
75
75
|
"devDependencies": {
|
|
76
76
|
"@eslint/js": "^10.0.1",
|