@dxos/credentials 2.33.5-dev.b7c9d504 → 2.33.5-dev.b9f5bea6
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/.rush/temp/package-deps_build.json +15 -15
- package/.rush/temp/package-deps_build:test.json +15 -15
- package/.rush/temp/package-deps_prerelease.json +15 -15
- package/.rush/temp/shrinkwrap-deps.json +24 -15
- package/dist/src/auth/auth-plugin.test.js +8 -14
- package/dist/src/auth/auth-plugin.test.js.map +1 -1
- package/dist/src/auth/auth.test.js +1 -4
- package/dist/src/auth/auth.test.js.map +1 -1
- package/dist/src/greet/greeter-plugin.test.js +2 -4
- package/dist/src/greet/greeter-plugin.test.js.map +1 -1
- package/dist/src/greet/greeter.d.ts +4 -16
- package/dist/src/greet/greeter.d.ts.map +1 -1
- package/dist/src/greet/greeter.js +1 -1
- package/dist/src/greet/greeter.js.map +1 -1
- package/dist/src/greet/greeter.test.js +1 -2
- package/dist/src/greet/greeter.test.js.map +1 -1
- package/dist/src/greet/greeting-message.d.ts.map +1 -1
- package/dist/src/greet/greeting-message.js +5 -7
- package/dist/src/greet/greeting-message.js.map +1 -1
- package/dist/src/identity/identity-message.d.ts.map +1 -1
- package/dist/src/identity/identity-message.js +1 -4
- package/dist/src/identity/identity-message.js.map +1 -1
- package/dist/src/keys/keyring-helpers.d.ts +1 -1
- package/dist/src/keys/keyring-helpers.d.ts.map +1 -1
- package/dist/src/keys/keyring-helpers.js +29 -30
- package/dist/src/keys/keyring-helpers.js.map +1 -1
- package/dist/src/keys/keystore.d.ts.map +1 -1
- package/dist/src/keys/keystore.js +2 -6
- package/dist/src/keys/keystore.js.map +1 -1
- package/dist/src/keys/keytype.d.ts.map +1 -1
- package/dist/src/keys/keytype.js +1 -3
- package/dist/src/keys/keytype.js.map +1 -1
- package/dist/src/party/party-credential.d.ts +4 -4
- package/dist/src/party/party-credential.d.ts.map +1 -1
- package/dist/src/party/party-credential.js +16 -18
- package/dist/src/party/party-credential.js.map +1 -1
- package/dist/src/party/party-state.d.ts.map +1 -1
- package/dist/src/party/party-state.js +7 -9
- package/dist/src/party/party-state.js.map +1 -1
- package/dist/src/proto/datetime.d.ts.map +1 -1
- package/dist/src/proto/datetime.js +1 -3
- package/dist/src/proto/datetime.js.map +1 -1
- package/dist/src/proto/gen/dxos/credentials/greet.d.ts +1 -1
- package/dist/src/proto/gen/dxos/credentials/greet.d.ts.map +1 -1
- package/dist/src/proto/gen/index.d.ts.map +1 -1
- package/dist/src/proto/gen/index.js +1 -1
- package/dist/src/proto/gen/index.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +12 -12
- package/src/auth/auth-plugin.test.ts +8 -14
- package/src/auth/auth.test.ts +2 -5
- package/src/greet/greeter-plugin.test.ts +2 -4
- package/src/greet/greeter.test.js +1 -2
- package/src/greet/greeter.ts +3 -3
- package/src/greet/greeting-message.ts +5 -7
- package/src/identity/identity-message.ts +1 -4
- package/src/keys/keyring-helpers.ts +23 -24
- package/src/keys/keystore.ts +2 -6
- package/src/keys/keytype.ts +1 -3
- package/src/party/party-credential.ts +7 -9
- package/src/party/party-state.ts +7 -9
- package/src/proto/datetime.ts +1 -3
- package/src/proto/gen/dxos/credentials/greet.ts +1 -1
- package/src/proto/gen/index.ts +1 -1
|
@@ -19,7 +19,7 @@ import { SecretKey } from './keytype';
|
|
|
19
19
|
* Checks for a valid publicKey Buffer.
|
|
20
20
|
*/
|
|
21
21
|
// TODO(burdon): Move to dxos/crypto.
|
|
22
|
-
export
|
|
22
|
+
export const isValidPublicKey = (key: PublicKeyLike, keyType?: KeyType): key is PublicKeyLike => {
|
|
23
23
|
try {
|
|
24
24
|
PublicKey.from(key);
|
|
25
25
|
if (keyType && [KeyType.PARTY, KeyType.IDENTITY, KeyType.FEED, KeyType.DEVICE].includes(keyType)) {
|
|
@@ -29,12 +29,13 @@ export function isValidPublicKey (key: PublicKeyLike, keyType?: KeyType): key is
|
|
|
29
29
|
} catch (e: any) {
|
|
30
30
|
}
|
|
31
31
|
return false;
|
|
32
|
-
}
|
|
32
|
+
};
|
|
33
33
|
|
|
34
34
|
/**
|
|
35
35
|
* Checks for a valid publicKey Buffer.
|
|
36
36
|
*/
|
|
37
37
|
// TODO(burdon): Move to dxos/crypto.
|
|
38
|
+
// eslint-disable-next-line @stayradiated/prefer-arrow-functions/prefer-arrow-functions
|
|
38
39
|
export function assertValidPublicKey (key: PublicKeyLike, keyType?: KeyType): asserts key is PublicKeyLike {
|
|
39
40
|
assert(key);
|
|
40
41
|
assert(isValidPublicKey(key, keyType));
|
|
@@ -44,6 +45,7 @@ export function assertValidPublicKey (key: PublicKeyLike, keyType?: KeyType): as
|
|
|
44
45
|
* Checks for a valid secretKey Buffer.
|
|
45
46
|
*/
|
|
46
47
|
// TODO(burdon): Move to dxos/crypto.
|
|
48
|
+
// eslint-disable-next-line @stayradiated/prefer-arrow-functions/prefer-arrow-functions
|
|
47
49
|
export function assertValidSecretKey (key?: SecretKey, keyType?: KeyType): asserts key is SecretKey {
|
|
48
50
|
assert(key);
|
|
49
51
|
if (keyType && [KeyType.PARTY, KeyType.IDENTITY, KeyType.FEED, KeyType.DEVICE].includes(keyType)) {
|
|
@@ -55,6 +57,7 @@ export function assertValidSecretKey (key?: SecretKey, keyType?: KeyType): asser
|
|
|
55
57
|
* Checks for a valid publicKey/secretKey KeyPair.
|
|
56
58
|
*/
|
|
57
59
|
// TODO(burdon): Move to dxos/crypto.
|
|
60
|
+
// eslint-disable-next-line @stayradiated/prefer-arrow-functions/prefer-arrow-functions
|
|
58
61
|
export function assertValidKeyPair (keyRecord: any): asserts keyRecord is KeyPair {
|
|
59
62
|
const { publicKey, secretKey, type } = keyRecord;
|
|
60
63
|
assertValidPublicKey(publicKey, type);
|
|
@@ -128,40 +131,36 @@ export const createKeyRecord = (attributes: Partial<KeyRecord> = {},
|
|
|
128
131
|
* Utility method to produce stable output for signing/verifying.
|
|
129
132
|
*/
|
|
130
133
|
// TODO(burdon): Factor out.
|
|
131
|
-
export const canonicalStringify = (obj: any) => {
|
|
132
|
-
|
|
133
|
-
/* The point of signing and verifying is not that the internal, private state of the objects be
|
|
134
|
+
export const canonicalStringify = (obj: any) => stableStringify(obj, {
|
|
135
|
+
/* The point of signing and verifying is not that the internal, private state of the objects be
|
|
134
136
|
* identical, but that the public contents can be verified not to have been altered. For that reason,
|
|
135
137
|
* really private fields (indicated by '__') are not included in the signature.
|
|
136
138
|
* This gives a mechanism for attaching other attributes to an object without breaking the signature.
|
|
137
139
|
* We also skip @type.
|
|
138
140
|
*/
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
141
|
+
replacer: (key: any, value: any) => {
|
|
142
|
+
if (key.toString().startsWith('__') || key.toString() === '@type') {
|
|
143
|
+
return undefined;
|
|
144
|
+
}
|
|
145
|
+
if (value) {
|
|
146
|
+
if (PublicKey.isPublicKey(value)) {
|
|
147
|
+
return value.toHex();
|
|
148
|
+
}
|
|
149
|
+
if (Buffer.isBuffer(value)) {
|
|
150
|
+
return value.toString('hex');
|
|
142
151
|
}
|
|
143
|
-
if (value) {
|
|
144
|
-
|
|
145
|
-
return value.toHex();
|
|
146
|
-
}
|
|
147
|
-
if (Buffer.isBuffer(value)) {
|
|
148
|
-
return value.toString('hex');
|
|
149
|
-
}
|
|
150
|
-
if (value instanceof Uint8Array || (value.data && value.type === 'Buffer')) {
|
|
151
|
-
return Buffer.from(value).toString('hex');
|
|
152
|
-
}
|
|
152
|
+
if (value instanceof Uint8Array || (value.data && value.type === 'Buffer')) {
|
|
153
|
+
return Buffer.from(value).toString('hex');
|
|
153
154
|
}
|
|
154
|
-
return value;
|
|
155
155
|
}
|
|
156
|
-
|
|
157
|
-
}
|
|
156
|
+
return value;
|
|
157
|
+
}
|
|
158
|
+
});
|
|
158
159
|
|
|
159
160
|
/**
|
|
160
161
|
* Is object `key` a KeyChain?
|
|
161
162
|
*/
|
|
162
|
-
export const isKeyChain = (key: any = {}): key is KeyChain =>
|
|
163
|
-
return isValidPublicKey(key.publicKey) && key.message && key.message.signed && Array.isArray(key.message.signatures);
|
|
164
|
-
};
|
|
163
|
+
export const isKeyChain = (key: any = {}): key is KeyChain => isValidPublicKey(key.publicKey) && key.message && key.message.signed && Array.isArray(key.message.signatures);
|
|
165
164
|
|
|
166
165
|
/**
|
|
167
166
|
* Checks conformity and normalizes the KeyRecord. (Used before storing, so that only well-formed records are stored.)
|
package/src/keys/keystore.ts
CHANGED
|
@@ -17,12 +17,8 @@ import { KeyRecord } from '../proto';
|
|
|
17
17
|
const log = debug('dxos:halo:keys:keystore'); // eslint-disable-line unused-imports/no-unused-vars
|
|
18
18
|
|
|
19
19
|
const marshaller = {
|
|
20
|
-
marshall (record: KeyRecord) {
|
|
21
|
-
|
|
22
|
-
},
|
|
23
|
-
unmarshall (raw: any): KeyRecord {
|
|
24
|
-
return { ...raw, publicKey: PublicKey.from(raw.publicKey) };
|
|
25
|
-
}
|
|
20
|
+
marshall: (record: KeyRecord) => ({ ...record, publicKey: record.publicKey.asBuffer() }),
|
|
21
|
+
unmarshall: (raw: any): KeyRecord => ({ ...raw, publicKey: PublicKey.from(raw.publicKey) })
|
|
26
22
|
};
|
|
27
23
|
|
|
28
24
|
/**
|
package/src/keys/keytype.ts
CHANGED
|
@@ -143,12 +143,12 @@ export const isPartyCredentialMessage = (message: Message | SignedMessage) => {
|
|
|
143
143
|
* @return {boolean}
|
|
144
144
|
* @private
|
|
145
145
|
*/
|
|
146
|
-
export
|
|
146
|
+
export const isEnvelope = (message: any) => {
|
|
147
147
|
assert(message);
|
|
148
148
|
const type = message?.signed?.payload?.type;
|
|
149
149
|
const envelope = message?.signed?.payload?.envelope;
|
|
150
150
|
return type === PartyCredential.Type.ENVELOPE && envelope;
|
|
151
|
-
}
|
|
151
|
+
};
|
|
152
152
|
|
|
153
153
|
/**
|
|
154
154
|
* Is this a SignedMessage?
|
|
@@ -156,30 +156,28 @@ export function isEnvelope (message: any) {
|
|
|
156
156
|
* @return {boolean}
|
|
157
157
|
* @private
|
|
158
158
|
*/
|
|
159
|
-
export
|
|
160
|
-
return message && message.signed && message.signed.payload && message.signatures && Array.isArray(message.signatures);
|
|
161
|
-
}
|
|
159
|
+
export const isSignedMessage = (message: any): message is SignedMessage => message && message.signed && message.signed.payload && message.signatures && Array.isArray(message.signatures);
|
|
162
160
|
|
|
163
161
|
/**
|
|
164
162
|
* Wraps a SignedMessage with a Message.
|
|
165
163
|
*/
|
|
166
164
|
// TODO(burdon): Typespec is too loose.
|
|
167
|
-
export
|
|
165
|
+
export const wrapMessage = (message: Message | SignedMessage | Command | Auth): WithTypeUrl<Message> => {
|
|
168
166
|
const payload = message as any;
|
|
169
167
|
return { '@type': TYPE_URL_MESSAGE, payload } as WithTypeUrl<Message>;
|
|
170
|
-
}
|
|
168
|
+
};
|
|
171
169
|
|
|
172
170
|
/**
|
|
173
171
|
* Unwraps (if necessary) a Message to its contents.
|
|
174
172
|
*/
|
|
175
|
-
export
|
|
173
|
+
export const unwrapMessage = (message: any): any => {
|
|
176
174
|
let result: any = message;
|
|
177
175
|
while (result.payload) { // TODO(burdon): Recursion!
|
|
178
176
|
result = result.payload;
|
|
179
177
|
}
|
|
180
178
|
|
|
181
179
|
return result;
|
|
182
|
-
}
|
|
180
|
+
};
|
|
183
181
|
|
|
184
182
|
/**
|
|
185
183
|
* Unwrap a SignedMessage from its Envelopes.
|
package/src/party/party-state.ts
CHANGED
|
@@ -516,15 +516,13 @@ export class PartyState extends EventEmitter {
|
|
|
516
516
|
publicKey = PublicKey.from(publicKey);
|
|
517
517
|
const keyStr = publicKey.toHex();
|
|
518
518
|
|
|
519
|
-
const makeRecord = () => {
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
};
|
|
527
|
-
};
|
|
519
|
+
const makeRecord = () => ({
|
|
520
|
+
type: KeyType.UNKNOWN,
|
|
521
|
+
trusted: true,
|
|
522
|
+
own: false,
|
|
523
|
+
...attributes, // Let attributes clobber the defaults.
|
|
524
|
+
publicKey
|
|
525
|
+
});
|
|
528
526
|
|
|
529
527
|
let keyRecord = this._keyring.getKey(publicKey);
|
|
530
528
|
if (!keyRecord) {
|
package/src/proto/datetime.ts
CHANGED
|
@@ -8,6 +8,4 @@ import moment from 'moment';
|
|
|
8
8
|
* Creates a properly formatted RFC-3339 date-time string for "now".
|
|
9
9
|
* @returns {string}
|
|
10
10
|
*/
|
|
11
|
-
export const createDateTimeString = () =>
|
|
12
|
-
return moment().format('YYYY-MM-DDTHH:mm:ssZ');
|
|
13
|
-
};
|
|
11
|
+
export const createDateTimeString = () => moment().format('YYYY-MM-DDTHH:mm:ssZ');
|
|
@@ -32,7 +32,7 @@ export interface HandshakeResponse {
|
|
|
32
32
|
}
|
|
33
33
|
export interface NotarizeResponse {
|
|
34
34
|
copies?: ReturnType<typeof substitutions["google.protobuf.Any"]["decode"]>[];
|
|
35
|
-
|
|
35
|
+
feedHints?: ReturnType<typeof substitutions["dxos.halo.keys.PubKey"]["decode"]>[];
|
|
36
36
|
}
|
|
37
37
|
export interface KeyHint {
|
|
38
38
|
publicKey?: ReturnType<typeof substitutions["dxos.halo.keys.PubKey"]["decode"]>;
|
package/src/proto/gen/index.ts
CHANGED
|
@@ -49,5 +49,5 @@ export interface TYPES {
|
|
|
49
49
|
}
|
|
50
50
|
export interface SERVICES {
|
|
51
51
|
}
|
|
52
|
-
export const schemaJson = JSON.parse("{\"nested\":{\"dxos\":{\"nested\":{\"credentials\":{\"nested\":{\"auth\":{\"nested\":{\"Auth\":{\"fields\":{\"partyKey\":{\"type\":\"PubKey\",\"id\":1,\"comment\":\"The publicKey of the target Party for these credentials.\"},\"deviceKey\":{\"type\":\"PubKey\",\"id\":2,\"comment\":\"The publicKey of the authenticating Device.\"},\"identityKey\":{\"type\":\"PubKey\",\"id\":3,\"comment\":\"The publicKey of the authenticating Identity.\"},\"feedKey\":{\"type\":\"PubKey\",\"id\":4,\"comment\":\"The publicKey of the authenticating Identity.\"},\"feedAdmit\":{\"type\":\"google.protobuf.Any\",\"id\":5,\"comment\":\"FeedAdmit message to the should be written to a control feed in case the `feedKey` is not admitted to the party.\"}},\"comment\":\"The payload for a SignedMessage sent during handshake for replication authentication.\"}}},\"greet\":{\"nested\":{\"BeginResponse\":{\"fields\":{\"info\":{\"keyType\":\"string\",\"type\":\"google.protobuf.Any\",\"id\":1,\"comment\":null}},\"comment\":null},\"ClaimResponse\":{\"fields\":{\"id\":{\"type\":\"bytes\",\"id\":1,\"comment\":null},\"rendezvousKey\":{\"type\":\"bytes\",\"id\":2,\"comment\":null}},\"comment\":null},\"Command\":{\"fields\":{\"command\":{\"type\":\"Type\",\"id\":1,\"comment\":null},\"secret\":{\"type\":\"bytes\",\"id\":2,\"comment\":null},\"params\":{\"rule\":\"repeated\",\"type\":\"google.protobuf.Any\",\"id\":10,\"comment\":null}},\"nested\":{\"Type\":{\"values\":{\"BEGIN\":0,\"HANDSHAKE\":1,\"NOTARIZE\":2,\"FINISH\":3,\"CLAIM\":10},\"comment\":null,\"comments\":{\"BEGIN\":null,\"HANDSHAKE\":null,\"NOTARIZE\":null,\"FINISH\":null,\"CLAIM\":null}}},\"comment\":\"A Greeter command.\"},\"HandshakeResponse\":{\"fields\":{\"nonce\":{\"type\":\"bytes\",\"id\":1,\"comment\":null},\"partyKey\":{\"type\":\"PubKey\",\"id\":2,\"comment\":null}},\"comment\":null},\"KeyHint\":{\"fields\":{\"publicKey\":{\"type\":\"PubKey\",\"id\":1,\"comment\":null},\"type\":{\"type\":\"KeyType\",\"id\":2,\"comment\":null}},\"comment\":null},\"NotarizeResponse\":{\"fields\":{\"copies\":{\"rule\":\"repeated\",\"type\":\"google.protobuf.Any\",\"id\":1,\"comment\":null},\"
|
|
52
|
+
export const schemaJson = JSON.parse("{\"nested\":{\"dxos\":{\"nested\":{\"credentials\":{\"nested\":{\"auth\":{\"nested\":{\"Auth\":{\"fields\":{\"partyKey\":{\"type\":\"PubKey\",\"id\":1,\"comment\":\"The publicKey of the target Party for these credentials.\"},\"deviceKey\":{\"type\":\"PubKey\",\"id\":2,\"comment\":\"The publicKey of the authenticating Device.\"},\"identityKey\":{\"type\":\"PubKey\",\"id\":3,\"comment\":\"The publicKey of the authenticating Identity.\"},\"feedKey\":{\"type\":\"PubKey\",\"id\":4,\"comment\":\"The publicKey of the authenticating Identity.\"},\"feedAdmit\":{\"type\":\"google.protobuf.Any\",\"id\":5,\"comment\":\"FeedAdmit message to the should be written to a control feed in case the `feedKey` is not admitted to the party.\"}},\"comment\":\"The payload for a SignedMessage sent during handshake for replication authentication.\"}}},\"greet\":{\"nested\":{\"BeginResponse\":{\"fields\":{\"info\":{\"keyType\":\"string\",\"type\":\"google.protobuf.Any\",\"id\":1,\"comment\":null}},\"comment\":null},\"ClaimResponse\":{\"fields\":{\"id\":{\"type\":\"bytes\",\"id\":1,\"comment\":null},\"rendezvousKey\":{\"type\":\"bytes\",\"id\":2,\"comment\":null}},\"comment\":null},\"Command\":{\"fields\":{\"command\":{\"type\":\"Type\",\"id\":1,\"comment\":null},\"secret\":{\"type\":\"bytes\",\"id\":2,\"comment\":null},\"params\":{\"rule\":\"repeated\",\"type\":\"google.protobuf.Any\",\"id\":10,\"comment\":null}},\"nested\":{\"Type\":{\"values\":{\"BEGIN\":0,\"HANDSHAKE\":1,\"NOTARIZE\":2,\"FINISH\":3,\"CLAIM\":10},\"comment\":null,\"comments\":{\"BEGIN\":null,\"HANDSHAKE\":null,\"NOTARIZE\":null,\"FINISH\":null,\"CLAIM\":null}}},\"comment\":\"A Greeter command.\"},\"HandshakeResponse\":{\"fields\":{\"nonce\":{\"type\":\"bytes\",\"id\":1,\"comment\":null},\"partyKey\":{\"type\":\"PubKey\",\"id\":2,\"comment\":null}},\"comment\":null},\"KeyHint\":{\"fields\":{\"publicKey\":{\"type\":\"PubKey\",\"id\":1,\"comment\":null},\"type\":{\"type\":\"KeyType\",\"id\":2,\"comment\":null}},\"comment\":null},\"NotarizeResponse\":{\"fields\":{\"copies\":{\"rule\":\"repeated\",\"type\":\"google.protobuf.Any\",\"id\":1,\"comment\":null},\"feedHints\":{\"rule\":\"repeated\",\"type\":\"PubKey\",\"id\":2,\"comment\":null}},\"comment\":null}}},\"identity\":{\"nested\":{\"DeviceInfo\":{\"fields\":{\"publicKey\":{\"type\":\"PubKey\",\"id\":1,\"comment\":null},\"displayName\":{\"type\":\"string\",\"id\":2,\"comment\":null}},\"comment\":null},\"IdentityInfo\":{\"fields\":{\"publicKey\":{\"type\":\"PubKey\",\"id\":1,\"comment\":null},\"displayName\":{\"type\":\"string\",\"id\":2,\"comment\":null}},\"comment\":null}}},\"Message\":{\"fields\":{\"payload\":{\"rule\":\"required\",\"type\":\"google.protobuf.Any\",\"id\":1,\"comment\":null}},\"comment\":null},\"party\":{\"nested\":{\"Envelope\":{\"fields\":{\"partyKey\":{\"type\":\"PubKey\",\"id\":1,\"comment\":null},\"message\":{\"type\":\"Message\",\"id\":2,\"comment\":null}},\"comment\":null},\"FeedAdmit\":{\"fields\":{\"partyKey\":{\"type\":\"PubKey\",\"id\":1,\"comment\":null},\"feedKey\":{\"type\":\"PubKey\",\"id\":2,\"comment\":null}},\"comment\":null},\"FeedGenesis\":{\"fields\":{\"feedKey\":{\"type\":\"PubKey\",\"id\":1,\"comment\":null},\"ownerKey\":{\"type\":\"PubKey\",\"id\":2,\"comment\":null}},\"comment\":null},\"KeyAdmit\":{\"fields\":{\"partyKey\":{\"type\":\"PubKey\",\"id\":1,\"comment\":null},\"admitKey\":{\"type\":\"PubKey\",\"id\":2,\"comment\":null},\"admitKeyType\":{\"type\":\"KeyType\",\"id\":3,\"comment\":null}},\"comment\":null},\"PartyCredential\":{\"oneofs\":{\"contents\":{\"oneof\":[\"envelope\",\"partyGenesis\",\"keyAdmit\",\"feedAdmit\",\"feedGenesis\"],\"comment\":null}},\"fields\":{\"type\":{\"type\":\"Type\",\"id\":1,\"comment\":null},\"envelope\":{\"type\":\"Envelope\",\"id\":10,\"comment\":null},\"partyGenesis\":{\"type\":\"PartyGenesis\",\"id\":11,\"comment\":null},\"keyAdmit\":{\"type\":\"KeyAdmit\",\"id\":12,\"comment\":null},\"feedAdmit\":{\"type\":\"FeedAdmit\",\"id\":13,\"comment\":null},\"feedGenesis\":{\"type\":\"FeedGenesis\",\"id\":14,\"comment\":null}},\"nested\":{\"Type\":{\"values\":{\"ENVELOPE\":0,\"PARTY_GENESIS\":1,\"FEED_GENESIS\":2,\"KEY_ADMIT\":3,\"FEED_ADMIT\":4},\"comment\":null,\"comments\":{\"ENVELOPE\":null,\"PARTY_GENESIS\":null,\"FEED_GENESIS\":null,\"KEY_ADMIT\":null,\"FEED_ADMIT\":null}}},\"comment\":null},\"PartyGenesis\":{\"fields\":{\"partyKey\":{\"type\":\"PubKey\",\"id\":1,\"comment\":null},\"feedKey\":{\"type\":\"PubKey\",\"id\":2,\"comment\":null},\"admitKey\":{\"type\":\"PubKey\",\"id\":3,\"comment\":null},\"admitKeyType\":{\"type\":\"KeyType\",\"id\":4,\"comment\":null}},\"comment\":null},\"PartyInvitation\":{\"fields\":{\"id\":{\"type\":\"bytes\",\"id\":1,\"comment\":null},\"partyKey\":{\"type\":\"PubKey\",\"id\":2,\"comment\":null},\"issuerKey\":{\"type\":\"PubKey\",\"id\":3,\"comment\":null},\"inviteeKey\":{\"type\":\"PubKey\",\"id\":4,\"comment\":null}},\"comment\":null}}},\"SignedMessage\":{\"fields\":{\"signed\":{\"rule\":\"required\",\"type\":\"Signed\",\"id\":1,\"comment\":null},\"signatures\":{\"rule\":\"repeated\",\"type\":\"Signature\",\"id\":2,\"comment\":null}},\"nested\":{\"Signature\":{\"fields\":{\"key\":{\"rule\":\"required\",\"type\":\"PubKey\",\"id\":1,\"comment\":null},\"signature\":{\"rule\":\"required\",\"type\":\"bytes\",\"id\":2,\"comment\":null},\"keyChain\":{\"type\":\"KeyChain\",\"id\":3,\"comment\":null}},\"comment\":null},\"Signed\":{\"fields\":{\"created\":{\"rule\":\"required\",\"type\":\"string\",\"id\":1,\"comment\":null},\"nonce\":{\"rule\":\"required\",\"type\":\"bytes\",\"id\":2,\"comment\":null},\"payload\":{\"rule\":\"required\",\"type\":\"google.protobuf.Any\",\"id\":10,\"comment\":null}},\"comment\":null}},\"comment\":\"A generic container message used whenever messages are signed (e.g. PartyCredential)\"}}},\"halo\":{\"nested\":{\"keys\":{\"nested\":{\"KeyChain\":{\"fields\":{\"publicKey\":{\"rule\":\"required\",\"type\":\"PubKey\",\"id\":1,\"comment\":null},\"message\":{\"rule\":\"required\",\"type\":\"SignedMessage\",\"id\":2,\"comment\":null},\"parents\":{\"rule\":\"repeated\",\"type\":\"KeyChain\",\"id\":3,\"comment\":null}},\"comment\":null},\"KeyRecord\":{\"fields\":{\"type\":{\"rule\":\"required\",\"type\":\"KeyType\",\"id\":1,\"comment\":\"- The `KeyType` type of the key. This is often unknown for keys from other sources.\"},\"publicKey\":{\"rule\":\"required\",\"type\":\"PubKey\",\"id\":2,\"comment\":\"- The public key as a Buffer (required).\"},\"secretKey\":{\"type\":\"PrivKey\",\"id\":3,\"comment\":\"- The secret key as a Buffer (this will never be visible outside the Keyring).\"},\"hint\":{\"type\":\"bool\",\"id\":4,\"comment\":\"- Is this key from a Greeting \\\"hint\\\"?\"},\"own\":{\"type\":\"bool\",\"id\":5,\"comment\":\"- Is this our key? Usually true if `secretKey` is present,\\nmay be false for \\\"inception keys\\\" such as the Party key.\"},\"trusted\":{\"type\":\"bool\",\"id\":6,\"comment\":\"- Is this key to be trusted?\"},\"added\":{\"type\":\"string\",\"id\":7,\"comment\":\"- An RFC-3339 date/time string for when the key was added to the Keyring.\"},\"created\":{\"type\":\"string\",\"id\":8,\"comment\":\"- An RFC-3339 date/time string for when the key was created.\"}},\"comment\":null},\"KeyRecordList\":{\"fields\":{\"keys\":{\"rule\":\"repeated\",\"type\":\"KeyRecord\",\"id\":1,\"comment\":null}},\"comment\":null},\"KeyType\":{\"values\":{\"UNKNOWN\":0,\"IDENTITY\":1,\"DEVICE\":2,\"PARTY\":3,\"FEED\":4,\"DXNS_ADDRESS\":5},\"comment\":null,\"comments\":{\"UNKNOWN\":null,\"IDENTITY\":null,\"DEVICE\":null,\"PARTY\":null,\"FEED\":null,\"DXNS_ADDRESS\":null}},\"PrivKey\":{\"fields\":{\"data\":{\"type\":\"bytes\",\"id\":1,\"comment\":null}},\"comment\":null},\"PubKey\":{\"fields\":{\"data\":{\"type\":\"bytes\",\"id\":1,\"comment\":null}},\"comment\":null}}}}}}},\"google\":{\"nested\":{\"protobuf\":{\"nested\":{\"Any\":{\"fields\":{\"type_url\":{\"type\":\"string\",\"id\":1},\"value\":{\"type\":\"bytes\",\"id\":2}},\"comment\":null},\"BoolValue\":{\"fields\":{\"value\":{\"type\":\"bool\",\"id\":1}},\"comment\":null},\"BytesValue\":{\"fields\":{\"value\":{\"type\":\"bytes\",\"id\":1}},\"comment\":null},\"DoubleValue\":{\"fields\":{\"value\":{\"type\":\"double\",\"id\":1}},\"comment\":null},\"FloatValue\":{\"fields\":{\"value\":{\"type\":\"float\",\"id\":1}},\"comment\":null},\"Int32Value\":{\"fields\":{\"value\":{\"type\":\"int32\",\"id\":1}},\"comment\":null},\"Int64Value\":{\"fields\":{\"value\":{\"type\":\"int64\",\"id\":1}},\"comment\":null},\"StringValue\":{\"fields\":{\"value\":{\"type\":\"string\",\"id\":1}},\"comment\":null},\"UInt32Value\":{\"fields\":{\"value\":{\"type\":\"uint32\",\"id\":1}},\"comment\":null},\"UInt64Value\":{\"fields\":{\"value\":{\"type\":\"uint64\",\"id\":1}},\"comment\":null}}}}}}}");
|
|
53
53
|
export const schema = Schema.fromJson<TYPES, SERVICES>(schemaJson, substitutions);
|