mirror of
https://gitlab.com/veilid/veilidchat.git
synced 2025-11-27 17:30:28 -05:00
proto cleanup
This commit is contained in:
parent
f951acd79a
commit
a93c711d52
84 changed files with 2393 additions and 2087 deletions
|
|
@ -1,4 +1,3 @@
|
|||
export 'identity.dart';
|
||||
export 'local_account.dart';
|
||||
export 'preferences.dart';
|
||||
export 'user_login.dart';
|
||||
|
|
|
|||
|
|
@ -1,184 +0,0 @@
|
|||
import 'package:fast_immutable_collections/fast_immutable_collections.dart';
|
||||
import 'package:freezed_annotation/freezed_annotation.dart';
|
||||
|
||||
import '../veilid_support/veilid_support.dart';
|
||||
import 'proto.dart' as proto;
|
||||
|
||||
part 'identity.freezed.dart';
|
||||
part 'identity.g.dart';
|
||||
|
||||
const String veilidChatAccountKey = 'com.veilid.veilidchat';
|
||||
|
||||
// AccountOwnerInfo is the key and owner info for the account dht key that is
|
||||
// stored in the identity key
|
||||
@freezed
|
||||
class AccountRecordInfo with _$AccountRecordInfo {
|
||||
const factory AccountRecordInfo({
|
||||
// Top level account keys and secrets
|
||||
required OwnedDHTRecordPointer accountRecord,
|
||||
}) = _AccountRecordInfo;
|
||||
|
||||
factory AccountRecordInfo.fromJson(dynamic json) =>
|
||||
_$AccountRecordInfoFromJson(json as Map<String, dynamic>);
|
||||
}
|
||||
|
||||
// Identity Key points to accounts associated with this identity
|
||||
// accounts field has a map of bundle id or uuid to account key pairs
|
||||
// DHT Schema: DFLT(1)
|
||||
// DHT Key (Private): identityRecordKey
|
||||
// DHT Owner Key: identityPublicKey
|
||||
// DHT Secret: identitySecretKey (stored encrypted
|
||||
// with unlock code in local table store)
|
||||
@freezed
|
||||
class Identity with _$Identity {
|
||||
const factory Identity({
|
||||
// Top level account keys and secrets
|
||||
required IMap<String, ISet<AccountRecordInfo>> accountRecords,
|
||||
}) = _Identity;
|
||||
|
||||
factory Identity.fromJson(dynamic json) =>
|
||||
_$IdentityFromJson(json as Map<String, dynamic>);
|
||||
}
|
||||
|
||||
// Identity Master key structure for created account
|
||||
// Master key allows for regeneration of identity DHT record
|
||||
// Bidirectional Master<->Identity signature allows for
|
||||
// chain of identity ownership for account recovery process
|
||||
//
|
||||
// Backed by a DHT key at masterRecordKey, the secret is kept
|
||||
// completely offline and only written to upon account recovery
|
||||
//
|
||||
// DHT Schema: DFLT(1)
|
||||
// DHT Record Key (Public): masterRecordKey
|
||||
// DHT Owner Key: masterPublicKey
|
||||
// DHT Owner Secret: masterSecretKey (kept offline)
|
||||
// Encryption: None
|
||||
@freezed
|
||||
class IdentityMaster with _$IdentityMaster {
|
||||
const factory IdentityMaster(
|
||||
{
|
||||
// Private DHT record storing identity account mapping
|
||||
required TypedKey identityRecordKey,
|
||||
// Public key of identity
|
||||
required PublicKey identityPublicKey,
|
||||
// Public DHT record storing this structure for account recovery
|
||||
required TypedKey masterRecordKey,
|
||||
// Public key of master identity used to sign identity keys for recovery
|
||||
required PublicKey masterPublicKey,
|
||||
// Signature of identityRecordKey and identityPublicKey by masterPublicKey
|
||||
required Signature identitySignature,
|
||||
// Signature of masterRecordKey and masterPublicKey by identityPublicKey
|
||||
required Signature masterSignature}) = _IdentityMaster;
|
||||
|
||||
factory IdentityMaster.fromJson(dynamic json) =>
|
||||
_$IdentityMasterFromJson(json as Map<String, dynamic>);
|
||||
}
|
||||
|
||||
extension IdentityMasterExtension on IdentityMaster {
|
||||
KeyPair identityWriter(SecretKey secret) =>
|
||||
KeyPair(key: identityPublicKey, secret: secret);
|
||||
|
||||
KeyPair masterWriter(SecretKey secret) =>
|
||||
KeyPair(key: masterPublicKey, secret: secret);
|
||||
|
||||
TypedKey identityPublicTypedKey() =>
|
||||
TypedKey(kind: identityRecordKey.kind, value: identityPublicKey);
|
||||
|
||||
Future<AccountRecordInfo> readAccountFromIdentity(
|
||||
{required SharedSecret identitySecret}) async {
|
||||
// Read the identity key to get the account keys
|
||||
final pool = await DHTRecordPool.instance();
|
||||
|
||||
final identityRecordCrypto = await DHTRecordCryptoPrivate.fromSecret(
|
||||
identityRecordKey.kind, identitySecret);
|
||||
|
||||
late final AccountRecordInfo accountRecordInfo;
|
||||
await (await pool.openRead(identityRecordKey,
|
||||
parent: masterRecordKey, crypto: identityRecordCrypto))
|
||||
.scope((identityRec) async {
|
||||
final identity = await identityRec.getJson(Identity.fromJson);
|
||||
if (identity == null) {
|
||||
// Identity could not be read or decrypted from DHT
|
||||
throw StateError('identity could not be read');
|
||||
}
|
||||
final accountRecords = IMapOfSets.from(identity.accountRecords);
|
||||
final vcAccounts = accountRecords.get(veilidChatAccountKey);
|
||||
if (vcAccounts.length != 1) {
|
||||
// No veilidchat account, or multiple accounts
|
||||
// somehow associated with identity
|
||||
throw StateError('no single veilidchat account');
|
||||
}
|
||||
|
||||
accountRecordInfo = vcAccounts.first;
|
||||
});
|
||||
|
||||
return accountRecordInfo;
|
||||
}
|
||||
|
||||
/// Creates a new Account associated with master identity and store it in the
|
||||
/// identity key.
|
||||
Future<void> newAccount({
|
||||
required SharedSecret identitySecret,
|
||||
required String name,
|
||||
required String title,
|
||||
}) async {
|
||||
final pool = await DHTRecordPool.instance();
|
||||
|
||||
/////// Add account with profile to DHT
|
||||
|
||||
// Open identity key for writing
|
||||
await (await pool.openWrite(
|
||||
identityRecordKey, identityWriter(identitySecret),
|
||||
parent: masterRecordKey))
|
||||
.scope((identityRec) async {
|
||||
// Create new account to insert into identity
|
||||
await (await pool.create(parent: identityRec.key))
|
||||
.deleteScope((accountRec) async {
|
||||
// Make empty contact list
|
||||
final contactList =
|
||||
await (await DHTShortArray.create(parent: accountRec.key))
|
||||
.scope((r) async => r.record.ownedDHTRecordPointer);
|
||||
|
||||
// Make empty contact invitation record list
|
||||
final contactInvitationRecords =
|
||||
await (await DHTShortArray.create(parent: accountRec.key))
|
||||
.scope((r) async => r.record.ownedDHTRecordPointer);
|
||||
|
||||
// Make empty chat record list
|
||||
final chatRecords =
|
||||
await (await DHTShortArray.create(parent: accountRec.key))
|
||||
.scope((r) async => r.record.ownedDHTRecordPointer);
|
||||
|
||||
// Make account object
|
||||
final account = proto.Account()
|
||||
..profile = (proto.Profile()
|
||||
..name = name
|
||||
..title = title)
|
||||
..contactList = contactList.toProto()
|
||||
..contactInvitationRecords = contactInvitationRecords.toProto()
|
||||
..chatList = chatRecords.toProto();
|
||||
|
||||
// Write account key
|
||||
await accountRec.eventualWriteProtobuf(account);
|
||||
|
||||
// Update identity key to include account
|
||||
final newAccountRecordInfo = AccountRecordInfo(
|
||||
accountRecord: OwnedDHTRecordPointer(
|
||||
recordKey: accountRec.key, owner: accountRec.ownerKeyPair!));
|
||||
await identityRec.eventualUpdateJson(Identity.fromJson,
|
||||
(oldIdentity) async {
|
||||
final oldAccountRecords = IMapOfSets.from(oldIdentity.accountRecords);
|
||||
// Only allow one account per identity for veilidchat
|
||||
if (oldAccountRecords.get(veilidChatAccountKey).isNotEmpty) {
|
||||
throw StateError(
|
||||
'Only one account per identity allowed for VeilidChat');
|
||||
}
|
||||
final accountRecords = oldAccountRecords
|
||||
.add(veilidChatAccountKey, newAccountRecordInfo)
|
||||
.asIMap();
|
||||
return oldIdentity.copyWith(accountRecords: accountRecords);
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
@ -1,575 +0,0 @@
|
|||
// coverage:ignore-file
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
// ignore_for_file: type=lint
|
||||
// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark
|
||||
|
||||
part of 'identity.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// FreezedGenerator
|
||||
// **************************************************************************
|
||||
|
||||
T _$identity<T>(T value) => value;
|
||||
|
||||
final _privateConstructorUsedError = UnsupportedError(
|
||||
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#custom-getters-and-methods');
|
||||
|
||||
AccountRecordInfo _$AccountRecordInfoFromJson(Map<String, dynamic> json) {
|
||||
return _AccountRecordInfo.fromJson(json);
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
mixin _$AccountRecordInfo {
|
||||
// Top level account keys and secrets
|
||||
OwnedDHTRecordPointer get accountRecord => throw _privateConstructorUsedError;
|
||||
|
||||
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
|
||||
@JsonKey(ignore: true)
|
||||
$AccountRecordInfoCopyWith<AccountRecordInfo> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class $AccountRecordInfoCopyWith<$Res> {
|
||||
factory $AccountRecordInfoCopyWith(
|
||||
AccountRecordInfo value, $Res Function(AccountRecordInfo) then) =
|
||||
_$AccountRecordInfoCopyWithImpl<$Res, AccountRecordInfo>;
|
||||
@useResult
|
||||
$Res call({OwnedDHTRecordPointer accountRecord});
|
||||
|
||||
$OwnedDHTRecordPointerCopyWith<$Res> get accountRecord;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class _$AccountRecordInfoCopyWithImpl<$Res, $Val extends AccountRecordInfo>
|
||||
implements $AccountRecordInfoCopyWith<$Res> {
|
||||
_$AccountRecordInfoCopyWithImpl(this._value, this._then);
|
||||
|
||||
// ignore: unused_field
|
||||
final $Val _value;
|
||||
// ignore: unused_field
|
||||
final $Res Function($Val) _then;
|
||||
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? accountRecord = null,
|
||||
}) {
|
||||
return _then(_value.copyWith(
|
||||
accountRecord: null == accountRecord
|
||||
? _value.accountRecord
|
||||
: accountRecord // ignore: cast_nullable_to_non_nullable
|
||||
as OwnedDHTRecordPointer,
|
||||
) as $Val);
|
||||
}
|
||||
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
$OwnedDHTRecordPointerCopyWith<$Res> get accountRecord {
|
||||
return $OwnedDHTRecordPointerCopyWith<$Res>(_value.accountRecord, (value) {
|
||||
return _then(_value.copyWith(accountRecord: value) as $Val);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$_AccountRecordInfoCopyWith<$Res>
|
||||
implements $AccountRecordInfoCopyWith<$Res> {
|
||||
factory _$$_AccountRecordInfoCopyWith(_$_AccountRecordInfo value,
|
||||
$Res Function(_$_AccountRecordInfo) then) =
|
||||
__$$_AccountRecordInfoCopyWithImpl<$Res>;
|
||||
@override
|
||||
@useResult
|
||||
$Res call({OwnedDHTRecordPointer accountRecord});
|
||||
|
||||
@override
|
||||
$OwnedDHTRecordPointerCopyWith<$Res> get accountRecord;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$_AccountRecordInfoCopyWithImpl<$Res>
|
||||
extends _$AccountRecordInfoCopyWithImpl<$Res, _$_AccountRecordInfo>
|
||||
implements _$$_AccountRecordInfoCopyWith<$Res> {
|
||||
__$$_AccountRecordInfoCopyWithImpl(
|
||||
_$_AccountRecordInfo _value, $Res Function(_$_AccountRecordInfo) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? accountRecord = null,
|
||||
}) {
|
||||
return _then(_$_AccountRecordInfo(
|
||||
accountRecord: null == accountRecord
|
||||
? _value.accountRecord
|
||||
: accountRecord // ignore: cast_nullable_to_non_nullable
|
||||
as OwnedDHTRecordPointer,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@JsonSerializable()
|
||||
class _$_AccountRecordInfo implements _AccountRecordInfo {
|
||||
const _$_AccountRecordInfo({required this.accountRecord});
|
||||
|
||||
factory _$_AccountRecordInfo.fromJson(Map<String, dynamic> json) =>
|
||||
_$$_AccountRecordInfoFromJson(json);
|
||||
|
||||
// Top level account keys and secrets
|
||||
@override
|
||||
final OwnedDHTRecordPointer accountRecord;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'AccountRecordInfo(accountRecord: $accountRecord)';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(dynamic other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$_AccountRecordInfo &&
|
||||
(identical(other.accountRecord, accountRecord) ||
|
||||
other.accountRecord == accountRecord));
|
||||
}
|
||||
|
||||
@JsonKey(ignore: true)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType, accountRecord);
|
||||
|
||||
@JsonKey(ignore: true)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$_AccountRecordInfoCopyWith<_$_AccountRecordInfo> get copyWith =>
|
||||
__$$_AccountRecordInfoCopyWithImpl<_$_AccountRecordInfo>(
|
||||
this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$$_AccountRecordInfoToJson(
|
||||
this,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
abstract class _AccountRecordInfo implements AccountRecordInfo {
|
||||
const factory _AccountRecordInfo(
|
||||
{required final OwnedDHTRecordPointer accountRecord}) =
|
||||
_$_AccountRecordInfo;
|
||||
|
||||
factory _AccountRecordInfo.fromJson(Map<String, dynamic> json) =
|
||||
_$_AccountRecordInfo.fromJson;
|
||||
|
||||
@override // Top level account keys and secrets
|
||||
OwnedDHTRecordPointer get accountRecord;
|
||||
@override
|
||||
@JsonKey(ignore: true)
|
||||
_$$_AccountRecordInfoCopyWith<_$_AccountRecordInfo> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
Identity _$IdentityFromJson(Map<String, dynamic> json) {
|
||||
return _Identity.fromJson(json);
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
mixin _$Identity {
|
||||
// Top level account keys and secrets
|
||||
IMap<String, ISet<AccountRecordInfo>> get accountRecords =>
|
||||
throw _privateConstructorUsedError;
|
||||
|
||||
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
|
||||
@JsonKey(ignore: true)
|
||||
$IdentityCopyWith<Identity> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class $IdentityCopyWith<$Res> {
|
||||
factory $IdentityCopyWith(Identity value, $Res Function(Identity) then) =
|
||||
_$IdentityCopyWithImpl<$Res, Identity>;
|
||||
@useResult
|
||||
$Res call({IMap<String, ISet<AccountRecordInfo>> accountRecords});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class _$IdentityCopyWithImpl<$Res, $Val extends Identity>
|
||||
implements $IdentityCopyWith<$Res> {
|
||||
_$IdentityCopyWithImpl(this._value, this._then);
|
||||
|
||||
// ignore: unused_field
|
||||
final $Val _value;
|
||||
// ignore: unused_field
|
||||
final $Res Function($Val) _then;
|
||||
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? accountRecords = null,
|
||||
}) {
|
||||
return _then(_value.copyWith(
|
||||
accountRecords: null == accountRecords
|
||||
? _value.accountRecords
|
||||
: accountRecords // ignore: cast_nullable_to_non_nullable
|
||||
as IMap<String, ISet<AccountRecordInfo>>,
|
||||
) as $Val);
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$_IdentityCopyWith<$Res> implements $IdentityCopyWith<$Res> {
|
||||
factory _$$_IdentityCopyWith(
|
||||
_$_Identity value, $Res Function(_$_Identity) then) =
|
||||
__$$_IdentityCopyWithImpl<$Res>;
|
||||
@override
|
||||
@useResult
|
||||
$Res call({IMap<String, ISet<AccountRecordInfo>> accountRecords});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$_IdentityCopyWithImpl<$Res>
|
||||
extends _$IdentityCopyWithImpl<$Res, _$_Identity>
|
||||
implements _$$_IdentityCopyWith<$Res> {
|
||||
__$$_IdentityCopyWithImpl(
|
||||
_$_Identity _value, $Res Function(_$_Identity) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? accountRecords = null,
|
||||
}) {
|
||||
return _then(_$_Identity(
|
||||
accountRecords: null == accountRecords
|
||||
? _value.accountRecords
|
||||
: accountRecords // ignore: cast_nullable_to_non_nullable
|
||||
as IMap<String, ISet<AccountRecordInfo>>,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@JsonSerializable()
|
||||
class _$_Identity implements _Identity {
|
||||
const _$_Identity({required this.accountRecords});
|
||||
|
||||
factory _$_Identity.fromJson(Map<String, dynamic> json) =>
|
||||
_$$_IdentityFromJson(json);
|
||||
|
||||
// Top level account keys and secrets
|
||||
@override
|
||||
final IMap<String, ISet<AccountRecordInfo>> accountRecords;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'Identity(accountRecords: $accountRecords)';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(dynamic other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$_Identity &&
|
||||
(identical(other.accountRecords, accountRecords) ||
|
||||
other.accountRecords == accountRecords));
|
||||
}
|
||||
|
||||
@JsonKey(ignore: true)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType, accountRecords);
|
||||
|
||||
@JsonKey(ignore: true)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$_IdentityCopyWith<_$_Identity> get copyWith =>
|
||||
__$$_IdentityCopyWithImpl<_$_Identity>(this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$$_IdentityToJson(
|
||||
this,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
abstract class _Identity implements Identity {
|
||||
const factory _Identity(
|
||||
{required final IMap<String, ISet<AccountRecordInfo>>
|
||||
accountRecords}) = _$_Identity;
|
||||
|
||||
factory _Identity.fromJson(Map<String, dynamic> json) = _$_Identity.fromJson;
|
||||
|
||||
@override // Top level account keys and secrets
|
||||
IMap<String, ISet<AccountRecordInfo>> get accountRecords;
|
||||
@override
|
||||
@JsonKey(ignore: true)
|
||||
_$$_IdentityCopyWith<_$_Identity> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
IdentityMaster _$IdentityMasterFromJson(Map<String, dynamic> json) {
|
||||
return _IdentityMaster.fromJson(json);
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
mixin _$IdentityMaster {
|
||||
// Private DHT record storing identity account mapping
|
||||
Typed<FixedEncodedString43> get identityRecordKey =>
|
||||
throw _privateConstructorUsedError; // Public key of identity
|
||||
FixedEncodedString43 get identityPublicKey =>
|
||||
throw _privateConstructorUsedError; // Public DHT record storing this structure for account recovery
|
||||
Typed<FixedEncodedString43> get masterRecordKey =>
|
||||
throw _privateConstructorUsedError; // Public key of master identity used to sign identity keys for recovery
|
||||
FixedEncodedString43 get masterPublicKey =>
|
||||
throw _privateConstructorUsedError; // Signature of identityRecordKey and identityPublicKey by masterPublicKey
|
||||
FixedEncodedString86 get identitySignature =>
|
||||
throw _privateConstructorUsedError; // Signature of masterRecordKey and masterPublicKey by identityPublicKey
|
||||
FixedEncodedString86 get masterSignature =>
|
||||
throw _privateConstructorUsedError;
|
||||
|
||||
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
|
||||
@JsonKey(ignore: true)
|
||||
$IdentityMasterCopyWith<IdentityMaster> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class $IdentityMasterCopyWith<$Res> {
|
||||
factory $IdentityMasterCopyWith(
|
||||
IdentityMaster value, $Res Function(IdentityMaster) then) =
|
||||
_$IdentityMasterCopyWithImpl<$Res, IdentityMaster>;
|
||||
@useResult
|
||||
$Res call(
|
||||
{Typed<FixedEncodedString43> identityRecordKey,
|
||||
FixedEncodedString43 identityPublicKey,
|
||||
Typed<FixedEncodedString43> masterRecordKey,
|
||||
FixedEncodedString43 masterPublicKey,
|
||||
FixedEncodedString86 identitySignature,
|
||||
FixedEncodedString86 masterSignature});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class _$IdentityMasterCopyWithImpl<$Res, $Val extends IdentityMaster>
|
||||
implements $IdentityMasterCopyWith<$Res> {
|
||||
_$IdentityMasterCopyWithImpl(this._value, this._then);
|
||||
|
||||
// ignore: unused_field
|
||||
final $Val _value;
|
||||
// ignore: unused_field
|
||||
final $Res Function($Val) _then;
|
||||
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? identityRecordKey = null,
|
||||
Object? identityPublicKey = null,
|
||||
Object? masterRecordKey = null,
|
||||
Object? masterPublicKey = null,
|
||||
Object? identitySignature = null,
|
||||
Object? masterSignature = null,
|
||||
}) {
|
||||
return _then(_value.copyWith(
|
||||
identityRecordKey: null == identityRecordKey
|
||||
? _value.identityRecordKey
|
||||
: identityRecordKey // ignore: cast_nullable_to_non_nullable
|
||||
as Typed<FixedEncodedString43>,
|
||||
identityPublicKey: null == identityPublicKey
|
||||
? _value.identityPublicKey
|
||||
: identityPublicKey // ignore: cast_nullable_to_non_nullable
|
||||
as FixedEncodedString43,
|
||||
masterRecordKey: null == masterRecordKey
|
||||
? _value.masterRecordKey
|
||||
: masterRecordKey // ignore: cast_nullable_to_non_nullable
|
||||
as Typed<FixedEncodedString43>,
|
||||
masterPublicKey: null == masterPublicKey
|
||||
? _value.masterPublicKey
|
||||
: masterPublicKey // ignore: cast_nullable_to_non_nullable
|
||||
as FixedEncodedString43,
|
||||
identitySignature: null == identitySignature
|
||||
? _value.identitySignature
|
||||
: identitySignature // ignore: cast_nullable_to_non_nullable
|
||||
as FixedEncodedString86,
|
||||
masterSignature: null == masterSignature
|
||||
? _value.masterSignature
|
||||
: masterSignature // ignore: cast_nullable_to_non_nullable
|
||||
as FixedEncodedString86,
|
||||
) as $Val);
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$_IdentityMasterCopyWith<$Res>
|
||||
implements $IdentityMasterCopyWith<$Res> {
|
||||
factory _$$_IdentityMasterCopyWith(
|
||||
_$_IdentityMaster value, $Res Function(_$_IdentityMaster) then) =
|
||||
__$$_IdentityMasterCopyWithImpl<$Res>;
|
||||
@override
|
||||
@useResult
|
||||
$Res call(
|
||||
{Typed<FixedEncodedString43> identityRecordKey,
|
||||
FixedEncodedString43 identityPublicKey,
|
||||
Typed<FixedEncodedString43> masterRecordKey,
|
||||
FixedEncodedString43 masterPublicKey,
|
||||
FixedEncodedString86 identitySignature,
|
||||
FixedEncodedString86 masterSignature});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$_IdentityMasterCopyWithImpl<$Res>
|
||||
extends _$IdentityMasterCopyWithImpl<$Res, _$_IdentityMaster>
|
||||
implements _$$_IdentityMasterCopyWith<$Res> {
|
||||
__$$_IdentityMasterCopyWithImpl(
|
||||
_$_IdentityMaster _value, $Res Function(_$_IdentityMaster) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? identityRecordKey = null,
|
||||
Object? identityPublicKey = null,
|
||||
Object? masterRecordKey = null,
|
||||
Object? masterPublicKey = null,
|
||||
Object? identitySignature = null,
|
||||
Object? masterSignature = null,
|
||||
}) {
|
||||
return _then(_$_IdentityMaster(
|
||||
identityRecordKey: null == identityRecordKey
|
||||
? _value.identityRecordKey
|
||||
: identityRecordKey // ignore: cast_nullable_to_non_nullable
|
||||
as Typed<FixedEncodedString43>,
|
||||
identityPublicKey: null == identityPublicKey
|
||||
? _value.identityPublicKey
|
||||
: identityPublicKey // ignore: cast_nullable_to_non_nullable
|
||||
as FixedEncodedString43,
|
||||
masterRecordKey: null == masterRecordKey
|
||||
? _value.masterRecordKey
|
||||
: masterRecordKey // ignore: cast_nullable_to_non_nullable
|
||||
as Typed<FixedEncodedString43>,
|
||||
masterPublicKey: null == masterPublicKey
|
||||
? _value.masterPublicKey
|
||||
: masterPublicKey // ignore: cast_nullable_to_non_nullable
|
||||
as FixedEncodedString43,
|
||||
identitySignature: null == identitySignature
|
||||
? _value.identitySignature
|
||||
: identitySignature // ignore: cast_nullable_to_non_nullable
|
||||
as FixedEncodedString86,
|
||||
masterSignature: null == masterSignature
|
||||
? _value.masterSignature
|
||||
: masterSignature // ignore: cast_nullable_to_non_nullable
|
||||
as FixedEncodedString86,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@JsonSerializable()
|
||||
class _$_IdentityMaster implements _IdentityMaster {
|
||||
const _$_IdentityMaster(
|
||||
{required this.identityRecordKey,
|
||||
required this.identityPublicKey,
|
||||
required this.masterRecordKey,
|
||||
required this.masterPublicKey,
|
||||
required this.identitySignature,
|
||||
required this.masterSignature});
|
||||
|
||||
factory _$_IdentityMaster.fromJson(Map<String, dynamic> json) =>
|
||||
_$$_IdentityMasterFromJson(json);
|
||||
|
||||
// Private DHT record storing identity account mapping
|
||||
@override
|
||||
final Typed<FixedEncodedString43> identityRecordKey;
|
||||
// Public key of identity
|
||||
@override
|
||||
final FixedEncodedString43 identityPublicKey;
|
||||
// Public DHT record storing this structure for account recovery
|
||||
@override
|
||||
final Typed<FixedEncodedString43> masterRecordKey;
|
||||
// Public key of master identity used to sign identity keys for recovery
|
||||
@override
|
||||
final FixedEncodedString43 masterPublicKey;
|
||||
// Signature of identityRecordKey and identityPublicKey by masterPublicKey
|
||||
@override
|
||||
final FixedEncodedString86 identitySignature;
|
||||
// Signature of masterRecordKey and masterPublicKey by identityPublicKey
|
||||
@override
|
||||
final FixedEncodedString86 masterSignature;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'IdentityMaster(identityRecordKey: $identityRecordKey, identityPublicKey: $identityPublicKey, masterRecordKey: $masterRecordKey, masterPublicKey: $masterPublicKey, identitySignature: $identitySignature, masterSignature: $masterSignature)';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(dynamic other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$_IdentityMaster &&
|
||||
(identical(other.identityRecordKey, identityRecordKey) ||
|
||||
other.identityRecordKey == identityRecordKey) &&
|
||||
(identical(other.identityPublicKey, identityPublicKey) ||
|
||||
other.identityPublicKey == identityPublicKey) &&
|
||||
(identical(other.masterRecordKey, masterRecordKey) ||
|
||||
other.masterRecordKey == masterRecordKey) &&
|
||||
(identical(other.masterPublicKey, masterPublicKey) ||
|
||||
other.masterPublicKey == masterPublicKey) &&
|
||||
(identical(other.identitySignature, identitySignature) ||
|
||||
other.identitySignature == identitySignature) &&
|
||||
(identical(other.masterSignature, masterSignature) ||
|
||||
other.masterSignature == masterSignature));
|
||||
}
|
||||
|
||||
@JsonKey(ignore: true)
|
||||
@override
|
||||
int get hashCode => Object.hash(
|
||||
runtimeType,
|
||||
identityRecordKey,
|
||||
identityPublicKey,
|
||||
masterRecordKey,
|
||||
masterPublicKey,
|
||||
identitySignature,
|
||||
masterSignature);
|
||||
|
||||
@JsonKey(ignore: true)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$_IdentityMasterCopyWith<_$_IdentityMaster> get copyWith =>
|
||||
__$$_IdentityMasterCopyWithImpl<_$_IdentityMaster>(this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$$_IdentityMasterToJson(
|
||||
this,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
abstract class _IdentityMaster implements IdentityMaster {
|
||||
const factory _IdentityMaster(
|
||||
{required final Typed<FixedEncodedString43> identityRecordKey,
|
||||
required final FixedEncodedString43 identityPublicKey,
|
||||
required final Typed<FixedEncodedString43> masterRecordKey,
|
||||
required final FixedEncodedString43 masterPublicKey,
|
||||
required final FixedEncodedString86 identitySignature,
|
||||
required final FixedEncodedString86 masterSignature}) = _$_IdentityMaster;
|
||||
|
||||
factory _IdentityMaster.fromJson(Map<String, dynamic> json) =
|
||||
_$_IdentityMaster.fromJson;
|
||||
|
||||
@override // Private DHT record storing identity account mapping
|
||||
Typed<FixedEncodedString43> get identityRecordKey;
|
||||
@override // Public key of identity
|
||||
FixedEncodedString43 get identityPublicKey;
|
||||
@override // Public DHT record storing this structure for account recovery
|
||||
Typed<FixedEncodedString43> get masterRecordKey;
|
||||
@override // Public key of master identity used to sign identity keys for recovery
|
||||
FixedEncodedString43 get masterPublicKey;
|
||||
@override // Signature of identityRecordKey and identityPublicKey by masterPublicKey
|
||||
FixedEncodedString86 get identitySignature;
|
||||
@override // Signature of masterRecordKey and masterPublicKey by identityPublicKey
|
||||
FixedEncodedString86 get masterSignature;
|
||||
@override
|
||||
@JsonKey(ignore: true)
|
||||
_$$_IdentityMasterCopyWith<_$_IdentityMaster> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
|
@ -1,60 +0,0 @@
|
|||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'identity.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
_$_AccountRecordInfo _$$_AccountRecordInfoFromJson(Map<String, dynamic> json) =>
|
||||
_$_AccountRecordInfo(
|
||||
accountRecord: OwnedDHTRecordPointer.fromJson(json['account_record']),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$_AccountRecordInfoToJson(
|
||||
_$_AccountRecordInfo instance) =>
|
||||
<String, dynamic>{
|
||||
'account_record': instance.accountRecord.toJson(),
|
||||
};
|
||||
|
||||
_$_Identity _$$_IdentityFromJson(Map<String, dynamic> json) => _$_Identity(
|
||||
accountRecords: IMap<String, ISet<AccountRecordInfo>>.fromJson(
|
||||
json['account_records'] as Map<String, dynamic>,
|
||||
(value) => value as String,
|
||||
(value) => ISet<AccountRecordInfo>.fromJson(
|
||||
value, (value) => AccountRecordInfo.fromJson(value))),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$_IdentityToJson(_$_Identity instance) =>
|
||||
<String, dynamic>{
|
||||
'account_records': instance.accountRecords.toJson(
|
||||
(value) => value,
|
||||
(value) => value.toJson(
|
||||
(value) => value.toJson(),
|
||||
),
|
||||
),
|
||||
};
|
||||
|
||||
_$_IdentityMaster _$$_IdentityMasterFromJson(Map<String, dynamic> json) =>
|
||||
_$_IdentityMaster(
|
||||
identityRecordKey:
|
||||
Typed<FixedEncodedString43>.fromJson(json['identity_record_key']),
|
||||
identityPublicKey:
|
||||
FixedEncodedString43.fromJson(json['identity_public_key']),
|
||||
masterRecordKey:
|
||||
Typed<FixedEncodedString43>.fromJson(json['master_record_key']),
|
||||
masterPublicKey: FixedEncodedString43.fromJson(json['master_public_key']),
|
||||
identitySignature:
|
||||
FixedEncodedString86.fromJson(json['identity_signature']),
|
||||
masterSignature: FixedEncodedString86.fromJson(json['master_signature']),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$_IdentityMasterToJson(_$_IdentityMaster instance) =>
|
||||
<String, dynamic>{
|
||||
'identity_record_key': instance.identityRecordKey.toJson(),
|
||||
'identity_public_key': instance.identityPublicKey.toJson(),
|
||||
'master_record_key': instance.masterRecordKey.toJson(),
|
||||
'master_public_key': instance.masterPublicKey.toJson(),
|
||||
'identity_signature': instance.identitySignature.toJson(),
|
||||
'master_signature': instance.masterSignature.toJson(),
|
||||
};
|
||||
|
|
@ -3,9 +3,8 @@ import 'dart:typed_data';
|
|||
import 'package:change_case/change_case.dart';
|
||||
import 'package:freezed_annotation/freezed_annotation.dart';
|
||||
|
||||
import '../entities/proto.dart' as proto;
|
||||
import '../proto/proto.dart' as proto;
|
||||
import '../veilid_support/veilid_support.dart';
|
||||
import 'identity.dart';
|
||||
|
||||
part 'local_account.freezed.dart';
|
||||
part 'local_account.g.dart';
|
||||
|
|
|
|||
|
|
@ -1,157 +0,0 @@
|
|||
import 'dart:typed_data';
|
||||
|
||||
import '../veilid_support/veilid_support.dart';
|
||||
|
||||
import 'proto/veilidchat.pb.dart' as proto;
|
||||
|
||||
export 'proto/veilidchat.pb.dart';
|
||||
|
||||
/// CryptoKey protobuf marshaling
|
||||
///
|
||||
extension CryptoKeyProto on CryptoKey {
|
||||
proto.CryptoKey toProto() {
|
||||
final b = decode().buffer.asByteData();
|
||||
final out = proto.CryptoKey()
|
||||
..u0 = b.getUint32(0 * 4)
|
||||
..u1 = b.getUint32(1 * 4)
|
||||
..u2 = b.getUint32(2 * 4)
|
||||
..u3 = b.getUint32(3 * 4)
|
||||
..u4 = b.getUint32(4 * 4)
|
||||
..u5 = b.getUint32(5 * 4)
|
||||
..u6 = b.getUint32(6 * 4)
|
||||
..u7 = b.getUint32(7 * 4);
|
||||
return out;
|
||||
}
|
||||
|
||||
static CryptoKey fromProto(proto.CryptoKey p) {
|
||||
final b = ByteData(32)
|
||||
..setUint32(0 * 4, p.u0)
|
||||
..setUint32(1 * 4, p.u1)
|
||||
..setUint32(2 * 4, p.u2)
|
||||
..setUint32(3 * 4, p.u3)
|
||||
..setUint32(4 * 4, p.u4)
|
||||
..setUint32(5 * 4, p.u5)
|
||||
..setUint32(6 * 4, p.u6)
|
||||
..setUint32(7 * 4, p.u7);
|
||||
return CryptoKey.fromBytes(Uint8List.view(b.buffer));
|
||||
}
|
||||
}
|
||||
|
||||
/// Signature protobuf marshaling
|
||||
///
|
||||
extension SignatureProto on Signature {
|
||||
proto.Signature toProto() {
|
||||
final b = decode().buffer.asByteData();
|
||||
final out = proto.Signature()
|
||||
..u0 = b.getUint32(0 * 4)
|
||||
..u1 = b.getUint32(1 * 4)
|
||||
..u2 = b.getUint32(2 * 4)
|
||||
..u3 = b.getUint32(3 * 4)
|
||||
..u4 = b.getUint32(4 * 4)
|
||||
..u5 = b.getUint32(5 * 4)
|
||||
..u6 = b.getUint32(6 * 4)
|
||||
..u7 = b.getUint32(7 * 4)
|
||||
..u8 = b.getUint32(8 * 4)
|
||||
..u9 = b.getUint32(9 * 4)
|
||||
..u10 = b.getUint32(10 * 4)
|
||||
..u11 = b.getUint32(11 * 4)
|
||||
..u12 = b.getUint32(12 * 4)
|
||||
..u13 = b.getUint32(13 * 4)
|
||||
..u14 = b.getUint32(14 * 4)
|
||||
..u15 = b.getUint32(15 * 4);
|
||||
return out;
|
||||
}
|
||||
|
||||
static Signature fromProto(proto.Signature p) {
|
||||
final b = ByteData(64)
|
||||
..setUint32(0 * 4, p.u0)
|
||||
..setUint32(1 * 4, p.u1)
|
||||
..setUint32(2 * 4, p.u2)
|
||||
..setUint32(3 * 4, p.u3)
|
||||
..setUint32(4 * 4, p.u4)
|
||||
..setUint32(5 * 4, p.u5)
|
||||
..setUint32(6 * 4, p.u6)
|
||||
..setUint32(7 * 4, p.u7)
|
||||
..setUint32(8 * 4, p.u8)
|
||||
..setUint32(9 * 4, p.u9)
|
||||
..setUint32(10 * 4, p.u10)
|
||||
..setUint32(11 * 4, p.u11)
|
||||
..setUint32(12 * 4, p.u12)
|
||||
..setUint32(13 * 4, p.u13)
|
||||
..setUint32(14 * 4, p.u14)
|
||||
..setUint32(15 * 4, p.u15);
|
||||
return Signature.fromBytes(Uint8List.view(b.buffer));
|
||||
}
|
||||
}
|
||||
|
||||
/// Nonce protobuf marshaling
|
||||
///
|
||||
extension NonceProto on Nonce {
|
||||
proto.Nonce toProto() {
|
||||
final b = decode().buffer.asByteData();
|
||||
final out = proto.Nonce()
|
||||
..u0 = b.getUint32(0 * 4)
|
||||
..u1 = b.getUint32(1 * 4)
|
||||
..u2 = b.getUint32(2 * 4)
|
||||
..u3 = b.getUint32(3 * 4)
|
||||
..u4 = b.getUint32(4 * 4)
|
||||
..u5 = b.getUint32(5 * 4);
|
||||
return out;
|
||||
}
|
||||
|
||||
static Nonce fromProto(proto.Nonce p) {
|
||||
final b = ByteData(24)
|
||||
..setUint32(0 * 4, p.u0)
|
||||
..setUint32(1 * 4, p.u1)
|
||||
..setUint32(2 * 4, p.u2)
|
||||
..setUint32(3 * 4, p.u3)
|
||||
..setUint32(4 * 4, p.u4)
|
||||
..setUint32(5 * 4, p.u5);
|
||||
return Nonce.fromBytes(Uint8List.view(b.buffer));
|
||||
}
|
||||
}
|
||||
|
||||
/// TypedKey protobuf marshaling
|
||||
///
|
||||
extension TypedKeyProto on TypedKey {
|
||||
proto.TypedKey toProto() {
|
||||
final out = proto.TypedKey()
|
||||
..kind = kind
|
||||
..value = value.toProto();
|
||||
return out;
|
||||
}
|
||||
|
||||
static TypedKey fromProto(proto.TypedKey p) =>
|
||||
TypedKey(kind: p.kind, value: CryptoKeyProto.fromProto(p.value));
|
||||
}
|
||||
|
||||
/// KeyPair protobuf marshaling
|
||||
///
|
||||
extension KeyPairProto on KeyPair {
|
||||
proto.KeyPair toProto() {
|
||||
final out = proto.KeyPair()
|
||||
..key = key.toProto()
|
||||
..secret = secret.toProto();
|
||||
return out;
|
||||
}
|
||||
|
||||
static KeyPair fromProto(proto.KeyPair p) => KeyPair(
|
||||
key: CryptoKeyProto.fromProto(p.key),
|
||||
secret: CryptoKeyProto.fromProto(p.secret));
|
||||
}
|
||||
|
||||
/// OwnedDHTRecordPointer protobuf marshaling
|
||||
///
|
||||
extension OwnedDHTRecordPointerProto on OwnedDHTRecordPointer {
|
||||
proto.OwnedDHTRecordPointer toProto() {
|
||||
final out = proto.OwnedDHTRecordPointer()
|
||||
..recordKey = recordKey.toProto()
|
||||
..owner = owner.toProto();
|
||||
return out;
|
||||
}
|
||||
|
||||
static OwnedDHTRecordPointer fromProto(proto.OwnedDHTRecordPointer p) =>
|
||||
OwnedDHTRecordPointer(
|
||||
recordKey: TypedKeyProto.fromProto(p.recordKey),
|
||||
owner: KeyPairProto.fromProto(p.owner));
|
||||
}
|
||||
File diff suppressed because it is too large
Load diff
|
|
@ -1,91 +0,0 @@
|
|||
//
|
||||
// Generated code. Do not modify.
|
||||
// source: veilidchat.proto
|
||||
//
|
||||
// @dart = 2.12
|
||||
|
||||
// ignore_for_file: annotate_overrides, camel_case_types
|
||||
// ignore_for_file: constant_identifier_names, library_prefixes
|
||||
// ignore_for_file: non_constant_identifier_names, prefer_final_fields
|
||||
// ignore_for_file: unnecessary_import, unnecessary_this, unused_import
|
||||
|
||||
import 'dart:core' as $core;
|
||||
|
||||
import 'package:protobuf/protobuf.dart' as $pb;
|
||||
|
||||
class AttachmentKind extends $pb.ProtobufEnum {
|
||||
static const AttachmentKind ATTACHMENT_KIND_UNSPECIFIED = AttachmentKind._(0, _omitEnumNames ? '' : 'ATTACHMENT_KIND_UNSPECIFIED');
|
||||
static const AttachmentKind ATTACHMENT_KIND_FILE = AttachmentKind._(1, _omitEnumNames ? '' : 'ATTACHMENT_KIND_FILE');
|
||||
static const AttachmentKind ATTACHMENT_KIND_IMAGE = AttachmentKind._(2, _omitEnumNames ? '' : 'ATTACHMENT_KIND_IMAGE');
|
||||
|
||||
static const $core.List<AttachmentKind> values = <AttachmentKind> [
|
||||
ATTACHMENT_KIND_UNSPECIFIED,
|
||||
ATTACHMENT_KIND_FILE,
|
||||
ATTACHMENT_KIND_IMAGE,
|
||||
];
|
||||
|
||||
static final $core.Map<$core.int, AttachmentKind> _byValue = $pb.ProtobufEnum.initByValue(values);
|
||||
static AttachmentKind? valueOf($core.int value) => _byValue[value];
|
||||
|
||||
const AttachmentKind._($core.int v, $core.String n) : super(v, n);
|
||||
}
|
||||
|
||||
class Availability extends $pb.ProtobufEnum {
|
||||
static const Availability AVAILABILITY_UNSPECIFIED = Availability._(0, _omitEnumNames ? '' : 'AVAILABILITY_UNSPECIFIED');
|
||||
static const Availability AVAILABILITY_OFFLINE = Availability._(1, _omitEnumNames ? '' : 'AVAILABILITY_OFFLINE');
|
||||
static const Availability AVAILABILITY_FREE = Availability._(2, _omitEnumNames ? '' : 'AVAILABILITY_FREE');
|
||||
static const Availability AVAILABILITY_BUSY = Availability._(3, _omitEnumNames ? '' : 'AVAILABILITY_BUSY');
|
||||
static const Availability AVAILABILITY_AWAY = Availability._(4, _omitEnumNames ? '' : 'AVAILABILITY_AWAY');
|
||||
|
||||
static const $core.List<Availability> values = <Availability> [
|
||||
AVAILABILITY_UNSPECIFIED,
|
||||
AVAILABILITY_OFFLINE,
|
||||
AVAILABILITY_FREE,
|
||||
AVAILABILITY_BUSY,
|
||||
AVAILABILITY_AWAY,
|
||||
];
|
||||
|
||||
static final $core.Map<$core.int, Availability> _byValue = $pb.ProtobufEnum.initByValue(values);
|
||||
static Availability? valueOf($core.int value) => _byValue[value];
|
||||
|
||||
const Availability._($core.int v, $core.String n) : super(v, n);
|
||||
}
|
||||
|
||||
class ChatType extends $pb.ProtobufEnum {
|
||||
static const ChatType CHAT_TYPE_UNSPECIFIED = ChatType._(0, _omitEnumNames ? '' : 'CHAT_TYPE_UNSPECIFIED');
|
||||
static const ChatType SINGLE_CONTACT = ChatType._(1, _omitEnumNames ? '' : 'SINGLE_CONTACT');
|
||||
static const ChatType GROUP = ChatType._(2, _omitEnumNames ? '' : 'GROUP');
|
||||
|
||||
static const $core.List<ChatType> values = <ChatType> [
|
||||
CHAT_TYPE_UNSPECIFIED,
|
||||
SINGLE_CONTACT,
|
||||
GROUP,
|
||||
];
|
||||
|
||||
static final $core.Map<$core.int, ChatType> _byValue = $pb.ProtobufEnum.initByValue(values);
|
||||
static ChatType? valueOf($core.int value) => _byValue[value];
|
||||
|
||||
const ChatType._($core.int v, $core.String n) : super(v, n);
|
||||
}
|
||||
|
||||
class EncryptionKeyType extends $pb.ProtobufEnum {
|
||||
static const EncryptionKeyType ENCRYPTION_KEY_TYPE_UNSPECIFIED = EncryptionKeyType._(0, _omitEnumNames ? '' : 'ENCRYPTION_KEY_TYPE_UNSPECIFIED');
|
||||
static const EncryptionKeyType ENCRYPTION_KEY_TYPE_NONE = EncryptionKeyType._(1, _omitEnumNames ? '' : 'ENCRYPTION_KEY_TYPE_NONE');
|
||||
static const EncryptionKeyType ENCRYPTION_KEY_TYPE_PIN = EncryptionKeyType._(2, _omitEnumNames ? '' : 'ENCRYPTION_KEY_TYPE_PIN');
|
||||
static const EncryptionKeyType ENCRYPTION_KEY_TYPE_PASSWORD = EncryptionKeyType._(3, _omitEnumNames ? '' : 'ENCRYPTION_KEY_TYPE_PASSWORD');
|
||||
|
||||
static const $core.List<EncryptionKeyType> values = <EncryptionKeyType> [
|
||||
ENCRYPTION_KEY_TYPE_UNSPECIFIED,
|
||||
ENCRYPTION_KEY_TYPE_NONE,
|
||||
ENCRYPTION_KEY_TYPE_PIN,
|
||||
ENCRYPTION_KEY_TYPE_PASSWORD,
|
||||
];
|
||||
|
||||
static final $core.Map<$core.int, EncryptionKeyType> _byValue = $pb.ProtobufEnum.initByValue(values);
|
||||
static EncryptionKeyType? valueOf($core.int value) => _byValue[value];
|
||||
|
||||
const EncryptionKeyType._($core.int v, $core.String n) : super(v, n);
|
||||
}
|
||||
|
||||
|
||||
const _omitEnumNames = $core.bool.fromEnvironment('protobuf.omit_enum_names');
|
||||
|
|
@ -1,514 +0,0 @@
|
|||
//
|
||||
// Generated code. Do not modify.
|
||||
// source: veilidchat.proto
|
||||
//
|
||||
// @dart = 2.12
|
||||
|
||||
// ignore_for_file: annotate_overrides, camel_case_types
|
||||
// ignore_for_file: constant_identifier_names, library_prefixes
|
||||
// ignore_for_file: non_constant_identifier_names, prefer_final_fields
|
||||
// ignore_for_file: unnecessary_import, unnecessary_this, unused_import
|
||||
|
||||
import 'dart:convert' as $convert;
|
||||
import 'dart:core' as $core;
|
||||
import 'dart:typed_data' as $typed_data;
|
||||
|
||||
@$core.Deprecated('Use attachmentKindDescriptor instead')
|
||||
const AttachmentKind$json = {
|
||||
'1': 'AttachmentKind',
|
||||
'2': [
|
||||
{'1': 'ATTACHMENT_KIND_UNSPECIFIED', '2': 0},
|
||||
{'1': 'ATTACHMENT_KIND_FILE', '2': 1},
|
||||
{'1': 'ATTACHMENT_KIND_IMAGE', '2': 2},
|
||||
],
|
||||
};
|
||||
|
||||
/// Descriptor for `AttachmentKind`. Decode as a `google.protobuf.EnumDescriptorProto`.
|
||||
final $typed_data.Uint8List attachmentKindDescriptor = $convert.base64Decode(
|
||||
'Cg5BdHRhY2htZW50S2luZBIfChtBVFRBQ0hNRU5UX0tJTkRfVU5TUEVDSUZJRUQQABIYChRBVF'
|
||||
'RBQ0hNRU5UX0tJTkRfRklMRRABEhkKFUFUVEFDSE1FTlRfS0lORF9JTUFHRRAC');
|
||||
|
||||
@$core.Deprecated('Use availabilityDescriptor instead')
|
||||
const Availability$json = {
|
||||
'1': 'Availability',
|
||||
'2': [
|
||||
{'1': 'AVAILABILITY_UNSPECIFIED', '2': 0},
|
||||
{'1': 'AVAILABILITY_OFFLINE', '2': 1},
|
||||
{'1': 'AVAILABILITY_FREE', '2': 2},
|
||||
{'1': 'AVAILABILITY_BUSY', '2': 3},
|
||||
{'1': 'AVAILABILITY_AWAY', '2': 4},
|
||||
],
|
||||
};
|
||||
|
||||
/// Descriptor for `Availability`. Decode as a `google.protobuf.EnumDescriptorProto`.
|
||||
final $typed_data.Uint8List availabilityDescriptor = $convert.base64Decode(
|
||||
'CgxBdmFpbGFiaWxpdHkSHAoYQVZBSUxBQklMSVRZX1VOU1BFQ0lGSUVEEAASGAoUQVZBSUxBQk'
|
||||
'lMSVRZX09GRkxJTkUQARIVChFBVkFJTEFCSUxJVFlfRlJFRRACEhUKEUFWQUlMQUJJTElUWV9C'
|
||||
'VVNZEAMSFQoRQVZBSUxBQklMSVRZX0FXQVkQBA==');
|
||||
|
||||
@$core.Deprecated('Use chatTypeDescriptor instead')
|
||||
const ChatType$json = {
|
||||
'1': 'ChatType',
|
||||
'2': [
|
||||
{'1': 'CHAT_TYPE_UNSPECIFIED', '2': 0},
|
||||
{'1': 'SINGLE_CONTACT', '2': 1},
|
||||
{'1': 'GROUP', '2': 2},
|
||||
],
|
||||
};
|
||||
|
||||
/// Descriptor for `ChatType`. Decode as a `google.protobuf.EnumDescriptorProto`.
|
||||
final $typed_data.Uint8List chatTypeDescriptor = $convert.base64Decode(
|
||||
'CghDaGF0VHlwZRIZChVDSEFUX1RZUEVfVU5TUEVDSUZJRUQQABISCg5TSU5HTEVfQ09OVEFDVB'
|
||||
'ABEgkKBUdST1VQEAI=');
|
||||
|
||||
@$core.Deprecated('Use encryptionKeyTypeDescriptor instead')
|
||||
const EncryptionKeyType$json = {
|
||||
'1': 'EncryptionKeyType',
|
||||
'2': [
|
||||
{'1': 'ENCRYPTION_KEY_TYPE_UNSPECIFIED', '2': 0},
|
||||
{'1': 'ENCRYPTION_KEY_TYPE_NONE', '2': 1},
|
||||
{'1': 'ENCRYPTION_KEY_TYPE_PIN', '2': 2},
|
||||
{'1': 'ENCRYPTION_KEY_TYPE_PASSWORD', '2': 3},
|
||||
],
|
||||
};
|
||||
|
||||
/// Descriptor for `EncryptionKeyType`. Decode as a `google.protobuf.EnumDescriptorProto`.
|
||||
final $typed_data.Uint8List encryptionKeyTypeDescriptor = $convert.base64Decode(
|
||||
'ChFFbmNyeXB0aW9uS2V5VHlwZRIjCh9FTkNSWVBUSU9OX0tFWV9UWVBFX1VOU1BFQ0lGSUVEEA'
|
||||
'ASHAoYRU5DUllQVElPTl9LRVlfVFlQRV9OT05FEAESGwoXRU5DUllQVElPTl9LRVlfVFlQRV9Q'
|
||||
'SU4QAhIgChxFTkNSWVBUSU9OX0tFWV9UWVBFX1BBU1NXT1JEEAM=');
|
||||
|
||||
@$core.Deprecated('Use cryptoKeyDescriptor instead')
|
||||
const CryptoKey$json = {
|
||||
'1': 'CryptoKey',
|
||||
'2': [
|
||||
{'1': 'u0', '3': 1, '4': 1, '5': 7, '10': 'u0'},
|
||||
{'1': 'u1', '3': 2, '4': 1, '5': 7, '10': 'u1'},
|
||||
{'1': 'u2', '3': 3, '4': 1, '5': 7, '10': 'u2'},
|
||||
{'1': 'u3', '3': 4, '4': 1, '5': 7, '10': 'u3'},
|
||||
{'1': 'u4', '3': 5, '4': 1, '5': 7, '10': 'u4'},
|
||||
{'1': 'u5', '3': 6, '4': 1, '5': 7, '10': 'u5'},
|
||||
{'1': 'u6', '3': 7, '4': 1, '5': 7, '10': 'u6'},
|
||||
{'1': 'u7', '3': 8, '4': 1, '5': 7, '10': 'u7'},
|
||||
],
|
||||
};
|
||||
|
||||
/// Descriptor for `CryptoKey`. Decode as a `google.protobuf.DescriptorProto`.
|
||||
final $typed_data.Uint8List cryptoKeyDescriptor = $convert.base64Decode(
|
||||
'CglDcnlwdG9LZXkSDgoCdTAYASABKAdSAnUwEg4KAnUxGAIgASgHUgJ1MRIOCgJ1MhgDIAEoB1'
|
||||
'ICdTISDgoCdTMYBCABKAdSAnUzEg4KAnU0GAUgASgHUgJ1NBIOCgJ1NRgGIAEoB1ICdTUSDgoC'
|
||||
'dTYYByABKAdSAnU2Eg4KAnU3GAggASgHUgJ1Nw==');
|
||||
|
||||
@$core.Deprecated('Use signatureDescriptor instead')
|
||||
const Signature$json = {
|
||||
'1': 'Signature',
|
||||
'2': [
|
||||
{'1': 'u0', '3': 1, '4': 1, '5': 7, '10': 'u0'},
|
||||
{'1': 'u1', '3': 2, '4': 1, '5': 7, '10': 'u1'},
|
||||
{'1': 'u2', '3': 3, '4': 1, '5': 7, '10': 'u2'},
|
||||
{'1': 'u3', '3': 4, '4': 1, '5': 7, '10': 'u3'},
|
||||
{'1': 'u4', '3': 5, '4': 1, '5': 7, '10': 'u4'},
|
||||
{'1': 'u5', '3': 6, '4': 1, '5': 7, '10': 'u5'},
|
||||
{'1': 'u6', '3': 7, '4': 1, '5': 7, '10': 'u6'},
|
||||
{'1': 'u7', '3': 8, '4': 1, '5': 7, '10': 'u7'},
|
||||
{'1': 'u8', '3': 9, '4': 1, '5': 7, '10': 'u8'},
|
||||
{'1': 'u9', '3': 10, '4': 1, '5': 7, '10': 'u9'},
|
||||
{'1': 'u10', '3': 11, '4': 1, '5': 7, '10': 'u10'},
|
||||
{'1': 'u11', '3': 12, '4': 1, '5': 7, '10': 'u11'},
|
||||
{'1': 'u12', '3': 13, '4': 1, '5': 7, '10': 'u12'},
|
||||
{'1': 'u13', '3': 14, '4': 1, '5': 7, '10': 'u13'},
|
||||
{'1': 'u14', '3': 15, '4': 1, '5': 7, '10': 'u14'},
|
||||
{'1': 'u15', '3': 16, '4': 1, '5': 7, '10': 'u15'},
|
||||
],
|
||||
};
|
||||
|
||||
/// Descriptor for `Signature`. Decode as a `google.protobuf.DescriptorProto`.
|
||||
final $typed_data.Uint8List signatureDescriptor = $convert.base64Decode(
|
||||
'CglTaWduYXR1cmUSDgoCdTAYASABKAdSAnUwEg4KAnUxGAIgASgHUgJ1MRIOCgJ1MhgDIAEoB1'
|
||||
'ICdTISDgoCdTMYBCABKAdSAnUzEg4KAnU0GAUgASgHUgJ1NBIOCgJ1NRgGIAEoB1ICdTUSDgoC'
|
||||
'dTYYByABKAdSAnU2Eg4KAnU3GAggASgHUgJ1NxIOCgJ1OBgJIAEoB1ICdTgSDgoCdTkYCiABKA'
|
||||
'dSAnU5EhAKA3UxMBgLIAEoB1IDdTEwEhAKA3UxMRgMIAEoB1IDdTExEhAKA3UxMhgNIAEoB1ID'
|
||||
'dTEyEhAKA3UxMxgOIAEoB1IDdTEzEhAKA3UxNBgPIAEoB1IDdTE0EhAKA3UxNRgQIAEoB1IDdT'
|
||||
'E1');
|
||||
|
||||
@$core.Deprecated('Use nonceDescriptor instead')
|
||||
const Nonce$json = {
|
||||
'1': 'Nonce',
|
||||
'2': [
|
||||
{'1': 'u0', '3': 1, '4': 1, '5': 7, '10': 'u0'},
|
||||
{'1': 'u1', '3': 2, '4': 1, '5': 7, '10': 'u1'},
|
||||
{'1': 'u2', '3': 3, '4': 1, '5': 7, '10': 'u2'},
|
||||
{'1': 'u3', '3': 4, '4': 1, '5': 7, '10': 'u3'},
|
||||
{'1': 'u4', '3': 5, '4': 1, '5': 7, '10': 'u4'},
|
||||
{'1': 'u5', '3': 6, '4': 1, '5': 7, '10': 'u5'},
|
||||
],
|
||||
};
|
||||
|
||||
/// Descriptor for `Nonce`. Decode as a `google.protobuf.DescriptorProto`.
|
||||
final $typed_data.Uint8List nonceDescriptor = $convert.base64Decode(
|
||||
'CgVOb25jZRIOCgJ1MBgBIAEoB1ICdTASDgoCdTEYAiABKAdSAnUxEg4KAnUyGAMgASgHUgJ1Mh'
|
||||
'IOCgJ1MxgEIAEoB1ICdTMSDgoCdTQYBSABKAdSAnU0Eg4KAnU1GAYgASgHUgJ1NQ==');
|
||||
|
||||
@$core.Deprecated('Use typedKeyDescriptor instead')
|
||||
const TypedKey$json = {
|
||||
'1': 'TypedKey',
|
||||
'2': [
|
||||
{'1': 'kind', '3': 1, '4': 1, '5': 7, '10': 'kind'},
|
||||
{'1': 'value', '3': 2, '4': 1, '5': 11, '6': '.CryptoKey', '10': 'value'},
|
||||
],
|
||||
};
|
||||
|
||||
/// Descriptor for `TypedKey`. Decode as a `google.protobuf.DescriptorProto`.
|
||||
final $typed_data.Uint8List typedKeyDescriptor = $convert.base64Decode(
|
||||
'CghUeXBlZEtleRISCgRraW5kGAEgASgHUgRraW5kEiAKBXZhbHVlGAIgASgLMgouQ3J5cHRvS2'
|
||||
'V5UgV2YWx1ZQ==');
|
||||
|
||||
@$core.Deprecated('Use keyPairDescriptor instead')
|
||||
const KeyPair$json = {
|
||||
'1': 'KeyPair',
|
||||
'2': [
|
||||
{'1': 'key', '3': 1, '4': 1, '5': 11, '6': '.CryptoKey', '10': 'key'},
|
||||
{'1': 'secret', '3': 2, '4': 1, '5': 11, '6': '.CryptoKey', '10': 'secret'},
|
||||
],
|
||||
};
|
||||
|
||||
/// Descriptor for `KeyPair`. Decode as a `google.protobuf.DescriptorProto`.
|
||||
final $typed_data.Uint8List keyPairDescriptor = $convert.base64Decode(
|
||||
'CgdLZXlQYWlyEhwKA2tleRgBIAEoCzIKLkNyeXB0b0tleVIDa2V5EiIKBnNlY3JldBgCIAEoCz'
|
||||
'IKLkNyeXB0b0tleVIGc2VjcmV0');
|
||||
|
||||
@$core.Deprecated('Use dHTDataDescriptor instead')
|
||||
const DHTData$json = {
|
||||
'1': 'DHTData',
|
||||
'2': [
|
||||
{'1': 'keys', '3': 1, '4': 3, '5': 11, '6': '.TypedKey', '10': 'keys'},
|
||||
{'1': 'hash', '3': 2, '4': 1, '5': 11, '6': '.TypedKey', '10': 'hash'},
|
||||
{'1': 'chunk', '3': 3, '4': 1, '5': 13, '10': 'chunk'},
|
||||
{'1': 'size', '3': 4, '4': 1, '5': 13, '10': 'size'},
|
||||
],
|
||||
};
|
||||
|
||||
/// Descriptor for `DHTData`. Decode as a `google.protobuf.DescriptorProto`.
|
||||
final $typed_data.Uint8List dHTDataDescriptor = $convert.base64Decode(
|
||||
'CgdESFREYXRhEh0KBGtleXMYASADKAsyCS5UeXBlZEtleVIEa2V5cxIdCgRoYXNoGAIgASgLMg'
|
||||
'kuVHlwZWRLZXlSBGhhc2gSFAoFY2h1bmsYAyABKA1SBWNodW5rEhIKBHNpemUYBCABKA1SBHNp'
|
||||
'emU=');
|
||||
|
||||
@$core.Deprecated('Use dHTShortArrayDescriptor instead')
|
||||
const DHTShortArray$json = {
|
||||
'1': 'DHTShortArray',
|
||||
'2': [
|
||||
{'1': 'keys', '3': 1, '4': 3, '5': 11, '6': '.TypedKey', '10': 'keys'},
|
||||
{'1': 'index', '3': 2, '4': 1, '5': 12, '10': 'index'},
|
||||
],
|
||||
};
|
||||
|
||||
/// Descriptor for `DHTShortArray`. Decode as a `google.protobuf.DescriptorProto`.
|
||||
final $typed_data.Uint8List dHTShortArrayDescriptor = $convert.base64Decode(
|
||||
'Cg1ESFRTaG9ydEFycmF5Eh0KBGtleXMYASADKAsyCS5UeXBlZEtleVIEa2V5cxIUCgVpbmRleB'
|
||||
'gCIAEoDFIFaW5kZXg=');
|
||||
|
||||
@$core.Deprecated('Use dHTLogDescriptor instead')
|
||||
const DHTLog$json = {
|
||||
'1': 'DHTLog',
|
||||
'2': [
|
||||
{'1': 'keys', '3': 1, '4': 3, '5': 11, '6': '.TypedKey', '10': 'keys'},
|
||||
{'1': 'back', '3': 2, '4': 1, '5': 11, '6': '.TypedKey', '10': 'back'},
|
||||
{'1': 'subkey_counts', '3': 3, '4': 3, '5': 13, '10': 'subkeyCounts'},
|
||||
{'1': 'total_subkeys', '3': 4, '4': 1, '5': 13, '10': 'totalSubkeys'},
|
||||
],
|
||||
};
|
||||
|
||||
/// Descriptor for `DHTLog`. Decode as a `google.protobuf.DescriptorProto`.
|
||||
final $typed_data.Uint8List dHTLogDescriptor = $convert.base64Decode(
|
||||
'CgZESFRMb2cSHQoEa2V5cxgBIAMoCzIJLlR5cGVkS2V5UgRrZXlzEh0KBGJhY2sYAiABKAsyCS'
|
||||
'5UeXBlZEtleVIEYmFjaxIjCg1zdWJrZXlfY291bnRzGAMgAygNUgxzdWJrZXlDb3VudHMSIwoN'
|
||||
'dG90YWxfc3Via2V5cxgEIAEoDVIMdG90YWxTdWJrZXlz');
|
||||
|
||||
@$core.Deprecated('Use dataReferenceDescriptor instead')
|
||||
const DataReference$json = {
|
||||
'1': 'DataReference',
|
||||
'2': [
|
||||
{'1': 'dht_data', '3': 1, '4': 1, '5': 11, '6': '.TypedKey', '9': 0, '10': 'dhtData'},
|
||||
],
|
||||
'8': [
|
||||
{'1': 'kind'},
|
||||
],
|
||||
};
|
||||
|
||||
/// Descriptor for `DataReference`. Decode as a `google.protobuf.DescriptorProto`.
|
||||
final $typed_data.Uint8List dataReferenceDescriptor = $convert.base64Decode(
|
||||
'Cg1EYXRhUmVmZXJlbmNlEiYKCGRodF9kYXRhGAEgASgLMgkuVHlwZWRLZXlIAFIHZGh0RGF0YU'
|
||||
'IGCgRraW5k');
|
||||
|
||||
@$core.Deprecated('Use attachmentDescriptor instead')
|
||||
const Attachment$json = {
|
||||
'1': 'Attachment',
|
||||
'2': [
|
||||
{'1': 'kind', '3': 1, '4': 1, '5': 14, '6': '.AttachmentKind', '10': 'kind'},
|
||||
{'1': 'mime', '3': 2, '4': 1, '5': 9, '10': 'mime'},
|
||||
{'1': 'name', '3': 3, '4': 1, '5': 9, '10': 'name'},
|
||||
{'1': 'content', '3': 4, '4': 1, '5': 11, '6': '.DataReference', '10': 'content'},
|
||||
{'1': 'signature', '3': 5, '4': 1, '5': 11, '6': '.Signature', '10': 'signature'},
|
||||
],
|
||||
};
|
||||
|
||||
/// Descriptor for `Attachment`. Decode as a `google.protobuf.DescriptorProto`.
|
||||
final $typed_data.Uint8List attachmentDescriptor = $convert.base64Decode(
|
||||
'CgpBdHRhY2htZW50EiMKBGtpbmQYASABKA4yDy5BdHRhY2htZW50S2luZFIEa2luZBISCgRtaW'
|
||||
'1lGAIgASgJUgRtaW1lEhIKBG5hbWUYAyABKAlSBG5hbWUSKAoHY29udGVudBgEIAEoCzIOLkRh'
|
||||
'dGFSZWZlcmVuY2VSB2NvbnRlbnQSKAoJc2lnbmF0dXJlGAUgASgLMgouU2lnbmF0dXJlUglzaW'
|
||||
'duYXR1cmU=');
|
||||
|
||||
@$core.Deprecated('Use messageDescriptor instead')
|
||||
const Message$json = {
|
||||
'1': 'Message',
|
||||
'2': [
|
||||
{'1': 'author', '3': 1, '4': 1, '5': 11, '6': '.TypedKey', '10': 'author'},
|
||||
{'1': 'timestamp', '3': 2, '4': 1, '5': 4, '10': 'timestamp'},
|
||||
{'1': 'text', '3': 3, '4': 1, '5': 9, '10': 'text'},
|
||||
{'1': 'signature', '3': 4, '4': 1, '5': 11, '6': '.Signature', '10': 'signature'},
|
||||
{'1': 'attachments', '3': 5, '4': 3, '5': 11, '6': '.Attachment', '10': 'attachments'},
|
||||
],
|
||||
};
|
||||
|
||||
/// Descriptor for `Message`. Decode as a `google.protobuf.DescriptorProto`.
|
||||
final $typed_data.Uint8List messageDescriptor = $convert.base64Decode(
|
||||
'CgdNZXNzYWdlEiEKBmF1dGhvchgBIAEoCzIJLlR5cGVkS2V5UgZhdXRob3ISHAoJdGltZXN0YW'
|
||||
'1wGAIgASgEUgl0aW1lc3RhbXASEgoEdGV4dBgDIAEoCVIEdGV4dBIoCglzaWduYXR1cmUYBCAB'
|
||||
'KAsyCi5TaWduYXR1cmVSCXNpZ25hdHVyZRItCgthdHRhY2htZW50cxgFIAMoCzILLkF0dGFjaG'
|
||||
'1lbnRSC2F0dGFjaG1lbnRz');
|
||||
|
||||
@$core.Deprecated('Use conversationDescriptor instead')
|
||||
const Conversation$json = {
|
||||
'1': 'Conversation',
|
||||
'2': [
|
||||
{'1': 'profile', '3': 1, '4': 1, '5': 11, '6': '.Profile', '10': 'profile'},
|
||||
{'1': 'identity_master_json', '3': 2, '4': 1, '5': 9, '10': 'identityMasterJson'},
|
||||
{'1': 'messages', '3': 3, '4': 1, '5': 11, '6': '.TypedKey', '10': 'messages'},
|
||||
],
|
||||
};
|
||||
|
||||
/// Descriptor for `Conversation`. Decode as a `google.protobuf.DescriptorProto`.
|
||||
final $typed_data.Uint8List conversationDescriptor = $convert.base64Decode(
|
||||
'CgxDb252ZXJzYXRpb24SIgoHcHJvZmlsZRgBIAEoCzIILlByb2ZpbGVSB3Byb2ZpbGUSMAoUaW'
|
||||
'RlbnRpdHlfbWFzdGVyX2pzb24YAiABKAlSEmlkZW50aXR5TWFzdGVySnNvbhIlCghtZXNzYWdl'
|
||||
'cxgDIAEoCzIJLlR5cGVkS2V5UghtZXNzYWdlcw==');
|
||||
|
||||
@$core.Deprecated('Use contactDescriptor instead')
|
||||
const Contact$json = {
|
||||
'1': 'Contact',
|
||||
'2': [
|
||||
{'1': 'edited_profile', '3': 1, '4': 1, '5': 11, '6': '.Profile', '10': 'editedProfile'},
|
||||
{'1': 'remote_profile', '3': 2, '4': 1, '5': 11, '6': '.Profile', '10': 'remoteProfile'},
|
||||
{'1': 'identity_master_json', '3': 3, '4': 1, '5': 9, '10': 'identityMasterJson'},
|
||||
{'1': 'identity_public_key', '3': 4, '4': 1, '5': 11, '6': '.TypedKey', '10': 'identityPublicKey'},
|
||||
{'1': 'remote_conversation_record_key', '3': 5, '4': 1, '5': 11, '6': '.TypedKey', '10': 'remoteConversationRecordKey'},
|
||||
{'1': 'local_conversation_record_key', '3': 6, '4': 1, '5': 11, '6': '.TypedKey', '10': 'localConversationRecordKey'},
|
||||
{'1': 'show_availability', '3': 7, '4': 1, '5': 8, '10': 'showAvailability'},
|
||||
],
|
||||
};
|
||||
|
||||
/// Descriptor for `Contact`. Decode as a `google.protobuf.DescriptorProto`.
|
||||
final $typed_data.Uint8List contactDescriptor = $convert.base64Decode(
|
||||
'CgdDb250YWN0Ei8KDmVkaXRlZF9wcm9maWxlGAEgASgLMgguUHJvZmlsZVINZWRpdGVkUHJvZm'
|
||||
'lsZRIvCg5yZW1vdGVfcHJvZmlsZRgCIAEoCzIILlByb2ZpbGVSDXJlbW90ZVByb2ZpbGUSMAoU'
|
||||
'aWRlbnRpdHlfbWFzdGVyX2pzb24YAyABKAlSEmlkZW50aXR5TWFzdGVySnNvbhI5ChNpZGVudG'
|
||||
'l0eV9wdWJsaWNfa2V5GAQgASgLMgkuVHlwZWRLZXlSEWlkZW50aXR5UHVibGljS2V5Ek4KHnJl'
|
||||
'bW90ZV9jb252ZXJzYXRpb25fcmVjb3JkX2tleRgFIAEoCzIJLlR5cGVkS2V5UhtyZW1vdGVDb2'
|
||||
'52ZXJzYXRpb25SZWNvcmRLZXkSTAodbG9jYWxfY29udmVyc2F0aW9uX3JlY29yZF9rZXkYBiAB'
|
||||
'KAsyCS5UeXBlZEtleVIabG9jYWxDb252ZXJzYXRpb25SZWNvcmRLZXkSKwoRc2hvd19hdmFpbG'
|
||||
'FiaWxpdHkYByABKAhSEHNob3dBdmFpbGFiaWxpdHk=');
|
||||
|
||||
@$core.Deprecated('Use profileDescriptor instead')
|
||||
const Profile$json = {
|
||||
'1': 'Profile',
|
||||
'2': [
|
||||
{'1': 'name', '3': 1, '4': 1, '5': 9, '10': 'name'},
|
||||
{'1': 'title', '3': 2, '4': 1, '5': 9, '10': 'title'},
|
||||
{'1': 'status', '3': 3, '4': 1, '5': 9, '10': 'status'},
|
||||
{'1': 'availability', '3': 4, '4': 1, '5': 14, '6': '.Availability', '10': 'availability'},
|
||||
{'1': 'avatar', '3': 5, '4': 1, '5': 11, '6': '.TypedKey', '9': 0, '10': 'avatar', '17': true},
|
||||
],
|
||||
'8': [
|
||||
{'1': '_avatar'},
|
||||
],
|
||||
};
|
||||
|
||||
/// Descriptor for `Profile`. Decode as a `google.protobuf.DescriptorProto`.
|
||||
final $typed_data.Uint8List profileDescriptor = $convert.base64Decode(
|
||||
'CgdQcm9maWxlEhIKBG5hbWUYASABKAlSBG5hbWUSFAoFdGl0bGUYAiABKAlSBXRpdGxlEhYKBn'
|
||||
'N0YXR1cxgDIAEoCVIGc3RhdHVzEjEKDGF2YWlsYWJpbGl0eRgEIAEoDjINLkF2YWlsYWJpbGl0'
|
||||
'eVIMYXZhaWxhYmlsaXR5EiYKBmF2YXRhchgFIAEoCzIJLlR5cGVkS2V5SABSBmF2YXRhcogBAU'
|
||||
'IJCgdfYXZhdGFy');
|
||||
|
||||
@$core.Deprecated('Use ownedDHTRecordPointerDescriptor instead')
|
||||
const OwnedDHTRecordPointer$json = {
|
||||
'1': 'OwnedDHTRecordPointer',
|
||||
'2': [
|
||||
{'1': 'record_key', '3': 1, '4': 1, '5': 11, '6': '.TypedKey', '10': 'recordKey'},
|
||||
{'1': 'owner', '3': 2, '4': 1, '5': 11, '6': '.KeyPair', '10': 'owner'},
|
||||
],
|
||||
};
|
||||
|
||||
/// Descriptor for `OwnedDHTRecordPointer`. Decode as a `google.protobuf.DescriptorProto`.
|
||||
final $typed_data.Uint8List ownedDHTRecordPointerDescriptor = $convert.base64Decode(
|
||||
'ChVPd25lZERIVFJlY29yZFBvaW50ZXISKAoKcmVjb3JkX2tleRgBIAEoCzIJLlR5cGVkS2V5Ug'
|
||||
'lyZWNvcmRLZXkSHgoFb3duZXIYAiABKAsyCC5LZXlQYWlyUgVvd25lcg==');
|
||||
|
||||
@$core.Deprecated('Use chatDescriptor instead')
|
||||
const Chat$json = {
|
||||
'1': 'Chat',
|
||||
'2': [
|
||||
{'1': 'type', '3': 1, '4': 1, '5': 14, '6': '.ChatType', '10': 'type'},
|
||||
{'1': 'remote_conversation_key', '3': 2, '4': 1, '5': 11, '6': '.TypedKey', '10': 'remoteConversationKey'},
|
||||
],
|
||||
};
|
||||
|
||||
/// Descriptor for `Chat`. Decode as a `google.protobuf.DescriptorProto`.
|
||||
final $typed_data.Uint8List chatDescriptor = $convert.base64Decode(
|
||||
'CgRDaGF0Eh0KBHR5cGUYASABKA4yCS5DaGF0VHlwZVIEdHlwZRJBChdyZW1vdGVfY29udmVyc2'
|
||||
'F0aW9uX2tleRgCIAEoCzIJLlR5cGVkS2V5UhVyZW1vdGVDb252ZXJzYXRpb25LZXk=');
|
||||
|
||||
@$core.Deprecated('Use accountDescriptor instead')
|
||||
const Account$json = {
|
||||
'1': 'Account',
|
||||
'2': [
|
||||
{'1': 'profile', '3': 1, '4': 1, '5': 11, '6': '.Profile', '10': 'profile'},
|
||||
{'1': 'invisible', '3': 2, '4': 1, '5': 8, '10': 'invisible'},
|
||||
{'1': 'auto_away_timeout_sec', '3': 3, '4': 1, '5': 13, '10': 'autoAwayTimeoutSec'},
|
||||
{'1': 'contact_list', '3': 4, '4': 1, '5': 11, '6': '.OwnedDHTRecordPointer', '10': 'contactList'},
|
||||
{'1': 'contact_invitation_records', '3': 5, '4': 1, '5': 11, '6': '.OwnedDHTRecordPointer', '10': 'contactInvitationRecords'},
|
||||
{'1': 'chat_list', '3': 6, '4': 1, '5': 11, '6': '.OwnedDHTRecordPointer', '10': 'chatList'},
|
||||
],
|
||||
};
|
||||
|
||||
/// Descriptor for `Account`. Decode as a `google.protobuf.DescriptorProto`.
|
||||
final $typed_data.Uint8List accountDescriptor = $convert.base64Decode(
|
||||
'CgdBY2NvdW50EiIKB3Byb2ZpbGUYASABKAsyCC5Qcm9maWxlUgdwcm9maWxlEhwKCWludmlzaW'
|
||||
'JsZRgCIAEoCFIJaW52aXNpYmxlEjEKFWF1dG9fYXdheV90aW1lb3V0X3NlYxgDIAEoDVISYXV0'
|
||||
'b0F3YXlUaW1lb3V0U2VjEjkKDGNvbnRhY3RfbGlzdBgEIAEoCzIWLk93bmVkREhUUmVjb3JkUG'
|
||||
'9pbnRlclILY29udGFjdExpc3QSVAoaY29udGFjdF9pbnZpdGF0aW9uX3JlY29yZHMYBSABKAsy'
|
||||
'Fi5Pd25lZERIVFJlY29yZFBvaW50ZXJSGGNvbnRhY3RJbnZpdGF0aW9uUmVjb3JkcxIzCgljaG'
|
||||
'F0X2xpc3QYBiABKAsyFi5Pd25lZERIVFJlY29yZFBvaW50ZXJSCGNoYXRMaXN0');
|
||||
|
||||
@$core.Deprecated('Use contactInvitationDescriptor instead')
|
||||
const ContactInvitation$json = {
|
||||
'1': 'ContactInvitation',
|
||||
'2': [
|
||||
{'1': 'contact_request_inbox_key', '3': 1, '4': 1, '5': 11, '6': '.TypedKey', '10': 'contactRequestInboxKey'},
|
||||
{'1': 'writer_secret', '3': 2, '4': 1, '5': 12, '10': 'writerSecret'},
|
||||
],
|
||||
};
|
||||
|
||||
/// Descriptor for `ContactInvitation`. Decode as a `google.protobuf.DescriptorProto`.
|
||||
final $typed_data.Uint8List contactInvitationDescriptor = $convert.base64Decode(
|
||||
'ChFDb250YWN0SW52aXRhdGlvbhJEChljb250YWN0X3JlcXVlc3RfaW5ib3hfa2V5GAEgASgLMg'
|
||||
'kuVHlwZWRLZXlSFmNvbnRhY3RSZXF1ZXN0SW5ib3hLZXkSIwoNd3JpdGVyX3NlY3JldBgCIAEo'
|
||||
'DFIMd3JpdGVyU2VjcmV0');
|
||||
|
||||
@$core.Deprecated('Use signedContactInvitationDescriptor instead')
|
||||
const SignedContactInvitation$json = {
|
||||
'1': 'SignedContactInvitation',
|
||||
'2': [
|
||||
{'1': 'contact_invitation', '3': 1, '4': 1, '5': 12, '10': 'contactInvitation'},
|
||||
{'1': 'identity_signature', '3': 2, '4': 1, '5': 11, '6': '.Signature', '10': 'identitySignature'},
|
||||
],
|
||||
};
|
||||
|
||||
/// Descriptor for `SignedContactInvitation`. Decode as a `google.protobuf.DescriptorProto`.
|
||||
final $typed_data.Uint8List signedContactInvitationDescriptor = $convert.base64Decode(
|
||||
'ChdTaWduZWRDb250YWN0SW52aXRhdGlvbhItChJjb250YWN0X2ludml0YXRpb24YASABKAxSEW'
|
||||
'NvbnRhY3RJbnZpdGF0aW9uEjkKEmlkZW50aXR5X3NpZ25hdHVyZRgCIAEoCzIKLlNpZ25hdHVy'
|
||||
'ZVIRaWRlbnRpdHlTaWduYXR1cmU=');
|
||||
|
||||
@$core.Deprecated('Use contactRequestDescriptor instead')
|
||||
const ContactRequest$json = {
|
||||
'1': 'ContactRequest',
|
||||
'2': [
|
||||
{'1': 'encryption_key_type', '3': 1, '4': 1, '5': 14, '6': '.EncryptionKeyType', '10': 'encryptionKeyType'},
|
||||
{'1': 'private', '3': 2, '4': 1, '5': 12, '10': 'private'},
|
||||
],
|
||||
};
|
||||
|
||||
/// Descriptor for `ContactRequest`. Decode as a `google.protobuf.DescriptorProto`.
|
||||
final $typed_data.Uint8List contactRequestDescriptor = $convert.base64Decode(
|
||||
'Cg5Db250YWN0UmVxdWVzdBJCChNlbmNyeXB0aW9uX2tleV90eXBlGAEgASgOMhIuRW5jcnlwdG'
|
||||
'lvbktleVR5cGVSEWVuY3J5cHRpb25LZXlUeXBlEhgKB3ByaXZhdGUYAiABKAxSB3ByaXZhdGU=');
|
||||
|
||||
@$core.Deprecated('Use contactRequestPrivateDescriptor instead')
|
||||
const ContactRequestPrivate$json = {
|
||||
'1': 'ContactRequestPrivate',
|
||||
'2': [
|
||||
{'1': 'writer_key', '3': 1, '4': 1, '5': 11, '6': '.CryptoKey', '10': 'writerKey'},
|
||||
{'1': 'profile', '3': 2, '4': 1, '5': 11, '6': '.Profile', '10': 'profile'},
|
||||
{'1': 'identity_master_record_key', '3': 3, '4': 1, '5': 11, '6': '.TypedKey', '10': 'identityMasterRecordKey'},
|
||||
{'1': 'chat_record_key', '3': 4, '4': 1, '5': 11, '6': '.TypedKey', '10': 'chatRecordKey'},
|
||||
{'1': 'expiration', '3': 5, '4': 1, '5': 4, '10': 'expiration'},
|
||||
],
|
||||
};
|
||||
|
||||
/// Descriptor for `ContactRequestPrivate`. Decode as a `google.protobuf.DescriptorProto`.
|
||||
final $typed_data.Uint8List contactRequestPrivateDescriptor = $convert.base64Decode(
|
||||
'ChVDb250YWN0UmVxdWVzdFByaXZhdGUSKQoKd3JpdGVyX2tleRgBIAEoCzIKLkNyeXB0b0tleV'
|
||||
'IJd3JpdGVyS2V5EiIKB3Byb2ZpbGUYAiABKAsyCC5Qcm9maWxlUgdwcm9maWxlEkYKGmlkZW50'
|
||||
'aXR5X21hc3Rlcl9yZWNvcmRfa2V5GAMgASgLMgkuVHlwZWRLZXlSF2lkZW50aXR5TWFzdGVyUm'
|
||||
'Vjb3JkS2V5EjEKD2NoYXRfcmVjb3JkX2tleRgEIAEoCzIJLlR5cGVkS2V5Ug1jaGF0UmVjb3Jk'
|
||||
'S2V5Eh4KCmV4cGlyYXRpb24YBSABKARSCmV4cGlyYXRpb24=');
|
||||
|
||||
@$core.Deprecated('Use contactResponseDescriptor instead')
|
||||
const ContactResponse$json = {
|
||||
'1': 'ContactResponse',
|
||||
'2': [
|
||||
{'1': 'accept', '3': 1, '4': 1, '5': 8, '10': 'accept'},
|
||||
{'1': 'identity_master_record_key', '3': 2, '4': 1, '5': 11, '6': '.TypedKey', '10': 'identityMasterRecordKey'},
|
||||
{'1': 'remote_conversation_record_key', '3': 3, '4': 1, '5': 11, '6': '.TypedKey', '10': 'remoteConversationRecordKey'},
|
||||
],
|
||||
};
|
||||
|
||||
/// Descriptor for `ContactResponse`. Decode as a `google.protobuf.DescriptorProto`.
|
||||
final $typed_data.Uint8List contactResponseDescriptor = $convert.base64Decode(
|
||||
'Cg9Db250YWN0UmVzcG9uc2USFgoGYWNjZXB0GAEgASgIUgZhY2NlcHQSRgoaaWRlbnRpdHlfbW'
|
||||
'FzdGVyX3JlY29yZF9rZXkYAiABKAsyCS5UeXBlZEtleVIXaWRlbnRpdHlNYXN0ZXJSZWNvcmRL'
|
||||
'ZXkSTgoecmVtb3RlX2NvbnZlcnNhdGlvbl9yZWNvcmRfa2V5GAMgASgLMgkuVHlwZWRLZXlSG3'
|
||||
'JlbW90ZUNvbnZlcnNhdGlvblJlY29yZEtleQ==');
|
||||
|
||||
@$core.Deprecated('Use signedContactResponseDescriptor instead')
|
||||
const SignedContactResponse$json = {
|
||||
'1': 'SignedContactResponse',
|
||||
'2': [
|
||||
{'1': 'contact_response', '3': 1, '4': 1, '5': 12, '10': 'contactResponse'},
|
||||
{'1': 'identity_signature', '3': 2, '4': 1, '5': 11, '6': '.Signature', '10': 'identitySignature'},
|
||||
],
|
||||
};
|
||||
|
||||
/// Descriptor for `SignedContactResponse`. Decode as a `google.protobuf.DescriptorProto`.
|
||||
final $typed_data.Uint8List signedContactResponseDescriptor = $convert.base64Decode(
|
||||
'ChVTaWduZWRDb250YWN0UmVzcG9uc2USKQoQY29udGFjdF9yZXNwb25zZRgBIAEoDFIPY29udG'
|
||||
'FjdFJlc3BvbnNlEjkKEmlkZW50aXR5X3NpZ25hdHVyZRgCIAEoCzIKLlNpZ25hdHVyZVIRaWRl'
|
||||
'bnRpdHlTaWduYXR1cmU=');
|
||||
|
||||
@$core.Deprecated('Use contactInvitationRecordDescriptor instead')
|
||||
const ContactInvitationRecord$json = {
|
||||
'1': 'ContactInvitationRecord',
|
||||
'2': [
|
||||
{'1': 'contact_request_inbox', '3': 1, '4': 1, '5': 11, '6': '.OwnedDHTRecordPointer', '10': 'contactRequestInbox'},
|
||||
{'1': 'writer_key', '3': 2, '4': 1, '5': 11, '6': '.CryptoKey', '10': 'writerKey'},
|
||||
{'1': 'writer_secret', '3': 3, '4': 1, '5': 11, '6': '.CryptoKey', '10': 'writerSecret'},
|
||||
{'1': 'local_conversation_record_key', '3': 4, '4': 1, '5': 11, '6': '.TypedKey', '10': 'localConversationRecordKey'},
|
||||
{'1': 'expiration', '3': 5, '4': 1, '5': 4, '10': 'expiration'},
|
||||
{'1': 'invitation', '3': 6, '4': 1, '5': 12, '10': 'invitation'},
|
||||
{'1': 'message', '3': 7, '4': 1, '5': 9, '10': 'message'},
|
||||
],
|
||||
};
|
||||
|
||||
/// Descriptor for `ContactInvitationRecord`. Decode as a `google.protobuf.DescriptorProto`.
|
||||
final $typed_data.Uint8List contactInvitationRecordDescriptor = $convert.base64Decode(
|
||||
'ChdDb250YWN0SW52aXRhdGlvblJlY29yZBJKChVjb250YWN0X3JlcXVlc3RfaW5ib3gYASABKA'
|
||||
'syFi5Pd25lZERIVFJlY29yZFBvaW50ZXJSE2NvbnRhY3RSZXF1ZXN0SW5ib3gSKQoKd3JpdGVy'
|
||||
'X2tleRgCIAEoCzIKLkNyeXB0b0tleVIJd3JpdGVyS2V5Ei8KDXdyaXRlcl9zZWNyZXQYAyABKA'
|
||||
'syCi5DcnlwdG9LZXlSDHdyaXRlclNlY3JldBJMCh1sb2NhbF9jb252ZXJzYXRpb25fcmVjb3Jk'
|
||||
'X2tleRgEIAEoCzIJLlR5cGVkS2V5Uhpsb2NhbENvbnZlcnNhdGlvblJlY29yZEtleRIeCgpleH'
|
||||
'BpcmF0aW9uGAUgASgEUgpleHBpcmF0aW9uEh4KCmludml0YXRpb24YBiABKAxSCmludml0YXRp'
|
||||
'b24SGAoHbWVzc2FnZRgHIAEoCVIHbWVzc2FnZQ==');
|
||||
|
||||
|
|
@ -1,14 +0,0 @@
|
|||
//
|
||||
// Generated code. Do not modify.
|
||||
// source: veilidchat.proto
|
||||
//
|
||||
// @dart = 2.12
|
||||
|
||||
// ignore_for_file: annotate_overrides, camel_case_types
|
||||
// ignore_for_file: constant_identifier_names
|
||||
// ignore_for_file: deprecated_member_use_from_same_package, library_prefixes
|
||||
// ignore_for_file: non_constant_identifier_names, prefer_final_fields
|
||||
// ignore_for_file: unnecessary_import, unnecessary_this, unused_import
|
||||
|
||||
export 'veilidchat.pb.dart';
|
||||
|
||||
|
|
@ -2,7 +2,6 @@ import 'package:fast_immutable_collections/fast_immutable_collections.dart';
|
|||
import 'package:freezed_annotation/freezed_annotation.dart';
|
||||
|
||||
import '../veilid_support/veilid_support.dart';
|
||||
import 'identity.dart';
|
||||
|
||||
part 'user_login.freezed.dart';
|
||||
part 'user_login.g.dart';
|
||||
|
|
|
|||
|
|
@ -1,374 +0,0 @@
|
|||
syntax = "proto3";
|
||||
|
||||
// 32-byte value in bigendian format
|
||||
message CryptoKey {
|
||||
fixed32 u0 = 1;
|
||||
fixed32 u1 = 2;
|
||||
fixed32 u2 = 3;
|
||||
fixed32 u3 = 4;
|
||||
fixed32 u4 = 5;
|
||||
fixed32 u5 = 6;
|
||||
fixed32 u6 = 7;
|
||||
fixed32 u7 = 8;
|
||||
}
|
||||
|
||||
// 64-byte value in bigendian format
|
||||
message Signature {
|
||||
fixed32 u0 = 1;
|
||||
fixed32 u1 = 2;
|
||||
fixed32 u2 = 3;
|
||||
fixed32 u3 = 4;
|
||||
fixed32 u4 = 5;
|
||||
fixed32 u5 = 6;
|
||||
fixed32 u6 = 7;
|
||||
fixed32 u7 = 8;
|
||||
fixed32 u8 = 9;
|
||||
fixed32 u9 = 10;
|
||||
fixed32 u10 = 11;
|
||||
fixed32 u11 = 12;
|
||||
fixed32 u12 = 13;
|
||||
fixed32 u13 = 14;
|
||||
fixed32 u14 = 15;
|
||||
fixed32 u15 = 16;
|
||||
}
|
||||
|
||||
// 24-byte value in bigendian format
|
||||
message Nonce {
|
||||
fixed32 u0 = 1;
|
||||
fixed32 u1 = 2;
|
||||
fixed32 u2 = 3;
|
||||
fixed32 u3 = 4;
|
||||
fixed32 u4 = 5;
|
||||
fixed32 u5 = 6;
|
||||
}
|
||||
|
||||
// 36-byte typed crypto key
|
||||
message TypedKey {
|
||||
// CryptoKind FourCC in bigendian format
|
||||
fixed32 kind = 1;
|
||||
// Key value
|
||||
CryptoKey value = 2;
|
||||
}
|
||||
|
||||
// Key pair
|
||||
message KeyPair {
|
||||
// Public key
|
||||
CryptoKey key = 1;
|
||||
// Private key
|
||||
CryptoKey secret = 2;
|
||||
}
|
||||
|
||||
|
||||
// DHTData - represents chunked blob data in the DHT
|
||||
// Header in subkey 0 follows this structure
|
||||
//
|
||||
// stride = descriptor subkey count on first key - 1
|
||||
// Subkeys 1..=stride on the first key are concatenated chunks
|
||||
// Subkeys 0..stride on the 'keys' keys are concatenated chunks
|
||||
//
|
||||
// Keys must use writable schema in order to make this data mutable
|
||||
|
||||
message DHTData {
|
||||
// Other keys to concatenate
|
||||
// Uses the same writer as this DHTList with SMPL schema
|
||||
repeated TypedKey keys = 1;
|
||||
// Hash of reassembled data to verify contents
|
||||
TypedKey hash = 2;
|
||||
// Chunk size per subkey
|
||||
uint32 chunk = 3;
|
||||
// Total data size
|
||||
uint32 size = 4;
|
||||
}
|
||||
|
||||
// DHTShortArray - represents a re-orderable collection of up to 256 individual elements
|
||||
// Header in subkey 0 of first key follows this structure
|
||||
//
|
||||
// stride = descriptor subkey count on first key - 1
|
||||
// Subkeys 1..=stride on the first key are individual elements
|
||||
// Subkeys 0..stride on the 'keys' keys are also individual elements
|
||||
//
|
||||
// Keys must use writable schema in order to make this list mutable
|
||||
message DHTShortArray {
|
||||
// Other keys to concatenate
|
||||
// Uses the same writer as this DHTList with SMPL schema
|
||||
repeated TypedKey keys = 1;
|
||||
|
||||
// Item position index (uint8[256])
|
||||
// Actual item location is:
|
||||
// idx = index[n] + 1 (offset for header at idx 0)
|
||||
// key = idx / stride
|
||||
// subkey = idx % stride
|
||||
bytes index = 2;
|
||||
// Free items are not represented in the list but can be
|
||||
// calculated through iteration
|
||||
}
|
||||
|
||||
// DHTLog - represents an appendable/truncatable log collection of individual elements
|
||||
// Header in subkey 0 of first key follows this structure
|
||||
//
|
||||
// stride = descriptor subkey count on first key - 1
|
||||
// Subkeys 1..=stride on the first key are individual elements
|
||||
// Subkeys 0..stride on the 'keys' keys are also individual elements
|
||||
//
|
||||
// Keys must use writable schema in order to make this list mutable
|
||||
message DHTLog {
|
||||
// Other keys to concatenate
|
||||
repeated TypedKey keys = 1;
|
||||
// Back link to another DHTLog further back
|
||||
TypedKey back = 2;
|
||||
// Count of subkeys in all keys in this DHTLog
|
||||
repeated uint32 subkey_counts = 3;
|
||||
// Total count of subkeys in all keys in this DHTLog including all backlogs
|
||||
uint32 total_subkeys = 4;
|
||||
}
|
||||
|
||||
// DataReference
|
||||
// Pointer to data somewhere in Veilid
|
||||
// Abstraction over DHTData and BlockStore
|
||||
message DataReference {
|
||||
oneof kind {
|
||||
TypedKey dht_data = 1;
|
||||
// TypedKey block = 2;
|
||||
}
|
||||
}
|
||||
|
||||
// AttachmentKind
|
||||
// Enumeration of well-known attachment types
|
||||
enum AttachmentKind {
|
||||
ATTACHMENT_KIND_UNSPECIFIED = 0;
|
||||
ATTACHMENT_KIND_FILE = 1;
|
||||
ATTACHMENT_KIND_IMAGE = 2;
|
||||
}
|
||||
|
||||
// A single attachment
|
||||
message Attachment {
|
||||
// Type of the data
|
||||
AttachmentKind kind = 1;
|
||||
// MIME type of the data
|
||||
string mime = 2;
|
||||
// Title or filename
|
||||
string name = 3;
|
||||
// Pointer to the data content
|
||||
DataReference content = 4;
|
||||
// Author signature over all attachment fields and content fields and bytes
|
||||
Signature signature = 5;
|
||||
}
|
||||
|
||||
// A single message as part of a series of messages
|
||||
// Messages are stored in a DHTLog
|
||||
// DHT Schema: SMPL(0,1,[identityPublicKey])
|
||||
message Message {
|
||||
// Author of the message
|
||||
TypedKey author = 1;
|
||||
// Time the message was sent (us since epoch)
|
||||
uint64 timestamp = 2;
|
||||
// Text of the message
|
||||
string text = 3;
|
||||
// Author signature over all of the fields and attachment signatures
|
||||
Signature signature = 4;
|
||||
// Attachments on the message
|
||||
repeated Attachment attachments = 5;
|
||||
}
|
||||
|
||||
// A record of a 1-1 chat that is synchronized between
|
||||
// two users. Visible and encrypted for the other party
|
||||
//
|
||||
// DHT Schema: SMPL(0,1,[identityPublicKey])
|
||||
// DHT Key (UnicastOutbox): localConversation
|
||||
// DHT Secret: None
|
||||
// Encryption: DH(IdentityA, IdentityB)
|
||||
|
||||
message Conversation {
|
||||
// Profile to publish to friend
|
||||
Profile profile = 1;
|
||||
// Identity master (JSON) to publish to friend
|
||||
string identity_master_json = 2;
|
||||
// Messages DHTLog (xxx for now DHTShortArray)
|
||||
TypedKey messages = 3;
|
||||
}
|
||||
|
||||
// A record of a contact that has accepted a contact invitation
|
||||
// Contains a copy of the most recent remote profile as well as
|
||||
// a locally edited profile.
|
||||
// Contains a copy of the most recent identity from the contact's
|
||||
// Master identity dht key
|
||||
//
|
||||
// Stored in ContactList DHTList
|
||||
message Contact {
|
||||
// Friend's profile as locally edited
|
||||
Profile edited_profile = 1;
|
||||
// Copy of friend's profile from remote conversation
|
||||
Profile remote_profile = 2;
|
||||
// Copy of friend's IdentityMaster in JSON from remote conversation
|
||||
string identity_master_json = 3;
|
||||
// Copy of friend's most recent identity public key from their identityMaster
|
||||
TypedKey identity_public_key = 4;
|
||||
// Remote conversation key to sync from friend
|
||||
TypedKey remote_conversation_record_key = 5;
|
||||
// Our conversation key for friend to sync
|
||||
TypedKey local_conversation_record_key = 6;
|
||||
// Show availability
|
||||
bool show_availability = 7;
|
||||
}
|
||||
|
||||
// Contact availability
|
||||
enum Availability {
|
||||
AVAILABILITY_UNSPECIFIED = 0;
|
||||
AVAILABILITY_OFFLINE = 1;
|
||||
AVAILABILITY_FREE = 2;
|
||||
AVAILABILITY_BUSY = 3;
|
||||
AVAILABILITY_AWAY = 4;
|
||||
}
|
||||
|
||||
// Publicly shared profile information for both contacts and accounts
|
||||
// Contains:
|
||||
// Name - Friendly name
|
||||
// Title - Title of user
|
||||
// Icon - Little picture to represent user in contact list
|
||||
message Profile {
|
||||
// Friendy name
|
||||
string name = 1;
|
||||
// Title of user
|
||||
string title = 2;
|
||||
// Status/away message
|
||||
string status = 3;
|
||||
// Availability
|
||||
Availability availability = 4;
|
||||
// Avatar DHTData
|
||||
optional TypedKey avatar = 5;
|
||||
}
|
||||
|
||||
// A pointer to an child DHT record
|
||||
message OwnedDHTRecordPointer {
|
||||
// DHT Record key
|
||||
TypedKey record_key = 1;
|
||||
// DHT record owner key
|
||||
KeyPair owner = 2;
|
||||
}
|
||||
|
||||
enum ChatType {
|
||||
CHAT_TYPE_UNSPECIFIED = 0;
|
||||
SINGLE_CONTACT = 1;
|
||||
GROUP = 2;
|
||||
}
|
||||
|
||||
// Either a 1-1 converation or a group chat (eventually)
|
||||
message Chat {
|
||||
// What kind of chat is this
|
||||
ChatType type = 1;
|
||||
// 1-1 Chat key
|
||||
TypedKey remote_conversation_key = 2;
|
||||
}
|
||||
|
||||
// A record of an individual account
|
||||
// Pointed to by the identity account map in the identity key
|
||||
//
|
||||
// DHT Schema: DFLT(1)
|
||||
// DHT Private: accountSecretKey
|
||||
message Account {
|
||||
// The user's profile that gets shared with contacts
|
||||
Profile profile = 1;
|
||||
// Invisibility makes you always look 'Offline'
|
||||
bool invisible = 2;
|
||||
// Auto-away sets 'away' mode after an inactivity time
|
||||
uint32 auto_away_timeout_sec = 3;
|
||||
// The contacts DHTList for this account
|
||||
// DHT Private
|
||||
OwnedDHTRecordPointer contact_list = 4;
|
||||
// The ContactInvitationRecord DHTShortArray for this account
|
||||
// DHT Private
|
||||
OwnedDHTRecordPointer contact_invitation_records = 5;
|
||||
// The chats DHTList for this account
|
||||
// DHT Private
|
||||
OwnedDHTRecordPointer chat_list = 6;
|
||||
|
||||
}
|
||||
|
||||
// EncryptionKeyType
|
||||
// Encryption of secret
|
||||
enum EncryptionKeyType {
|
||||
ENCRYPTION_KEY_TYPE_UNSPECIFIED = 0;
|
||||
ENCRYPTION_KEY_TYPE_NONE = 1;
|
||||
ENCRYPTION_KEY_TYPE_PIN = 2;
|
||||
ENCRYPTION_KEY_TYPE_PASSWORD = 3;
|
||||
}
|
||||
|
||||
// Invitation that is shared for VeilidChat contact connections
|
||||
// serialized to QR code or data blob, not send over DHT, out of band.
|
||||
// Writer secret is unique to this invitation. Writer public key is in the ContactRequestPrivate
|
||||
// in the ContactRequestInbox subkey 0 DHT key
|
||||
message ContactInvitation {
|
||||
// Contact request DHT record key
|
||||
TypedKey contact_request_inbox_key = 1;
|
||||
// Writer secret key bytes possibly encrypted with nonce appended
|
||||
bytes writer_secret = 2;
|
||||
}
|
||||
|
||||
// Signature of invitation with identity
|
||||
message SignedContactInvitation {
|
||||
// The serialized bytes for the contact invitation
|
||||
bytes contact_invitation = 1;
|
||||
// The signature of the contact_invitation bytes with the identity
|
||||
Signature identity_signature = 2;
|
||||
}
|
||||
|
||||
// Contact request unicastinbox on the DHT
|
||||
// DHTSchema: SMPL 1 owner key, 1 writer key symmetrically encrypted with writer secret
|
||||
message ContactRequest {
|
||||
// The kind of encryption used on the unicastinbox writer key
|
||||
EncryptionKeyType encryption_key_type = 1;
|
||||
// The private part encoded and symmetrically encrypted with the unicastinbox writer secret
|
||||
bytes private = 2;
|
||||
}
|
||||
|
||||
// The private part of a possibly encrypted contact request
|
||||
// Symmetrically encrypted with writer secret
|
||||
message ContactRequestPrivate {
|
||||
// Writer public key for signing writes to contact request unicastinbox
|
||||
CryptoKey writer_key = 1;
|
||||
// Snapshot of profile
|
||||
Profile profile = 2;
|
||||
// Identity master DHT record key
|
||||
TypedKey identity_master_record_key = 3;
|
||||
// Local chat DHT record key
|
||||
TypedKey chat_record_key = 4;
|
||||
// Expiration timestamp
|
||||
uint64 expiration = 5;
|
||||
}
|
||||
|
||||
// To accept or reject a contact request, fill this out and send to the ContactRequest unicastinbox
|
||||
message ContactResponse {
|
||||
// Accept or reject
|
||||
bool accept = 1;
|
||||
// Remote identity master DHT record key
|
||||
TypedKey identity_master_record_key = 2;
|
||||
// Remote chat DHT record key if accepted
|
||||
TypedKey remote_conversation_record_key = 3;
|
||||
}
|
||||
|
||||
// Signature of response with identity
|
||||
// Symmetrically encrypted with writer secret
|
||||
message SignedContactResponse {
|
||||
// Serialized bytes for ContactResponse
|
||||
bytes contact_response = 1;
|
||||
// Signature of the contact_accept bytes with the identity
|
||||
Signature identity_signature = 2;
|
||||
}
|
||||
|
||||
// Contact request record kept in Account DHTList to keep track of extant contact invitations
|
||||
message ContactInvitationRecord {
|
||||
// Contact request unicastinbox DHT record key (parent is accountkey)
|
||||
OwnedDHTRecordPointer contact_request_inbox = 1;
|
||||
// Writer key sent to contact for the contact_request_inbox smpl inbox subkey
|
||||
CryptoKey writer_key = 2;
|
||||
// Writer secret sent encrypted in the invitation
|
||||
CryptoKey writer_secret = 3;
|
||||
// Local chat DHT record key (parent is accountkey, will be moved to Contact if accepted)
|
||||
TypedKey local_conversation_record_key = 4;
|
||||
// Expiration timestamp
|
||||
uint64 expiration = 5;
|
||||
// A copy of the raw SignedContactInvitation invitation bytes post-encryption and signing
|
||||
bytes invitation = 6;
|
||||
// The message sent along with the invitation
|
||||
string message = 7;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue