From e20fa4424125d8c913aaf7df99073a1528bf4b6e Mon Sep 17 00:00:00 2001 From: Matthew Brisebois Date: Wed, 26 Jun 2024 10:03:51 -0600 Subject: [PATCH 01/10] Convert tabs to spaces --- dnas/deepkey/zomelets/src/index.js | 256 ++-- dnas/deepkey/zomelets/src/types.js | 206 ++-- dnas/deepkey/zomelets/webpack.config.js | 54 +- tests/integration/test_basic.js | 182 +-- tests/integration/test_change_rules.js | 348 +++--- tests/integration/test_claim_unmanaged_key.js | 468 +++---- tests/integration/test_key_management.js | 1086 ++++++++--------- tests/key_store.js | 84 +- tests/utils.js | 28 +- 9 files changed, 1356 insertions(+), 1356 deletions(-) diff --git a/dnas/deepkey/zomelets/src/index.js b/dnas/deepkey/zomelets/src/index.js index 38f59f3..50ca139 100644 --- a/dnas/deepkey/zomelets/src/index.js +++ b/dnas/deepkey/zomelets/src/index.js @@ -2,11 +2,11 @@ import { AnyDhtHash, AgentPubKey, ActionHash, EntryHash, -} from '@spartan-hc/holo-hash'; // approx. 11kb +} from '@spartan-hc/holo-hash'; // approx. 11kb import { Zomelet, CellZomelets, -} from '@spartan-hc/zomelets'; // approx. 7kb +} from '@spartan-hc/zomelets'; // approx. 7kb import { Signature, SignedAction, @@ -22,180 +22,180 @@ import { KeyRegistrationEntry, KeyInfo, -} from './types.js'; +} from './types.js'; -const functions = { +const functions = { // Local reading async query_keyset_authority_action_hash () { - const result = await this.call(); + const result = await this.call(); - return new ActionHash( result ); + return new ActionHash( result ); }, async query_keyset_root_action_hash () { - const result = await this.call(); + const result = await this.call(); - return new ActionHash( result ); + return new ActionHash( result ); }, async query_app_bindings () { - const result = await this.call(); + const result = await this.call(); - return result.map( ([addr, app_binding]) => [ - new ActionHash( addr ), - AppBinding( app_binding ), - ]); + return result.map( ([addr, app_binding]) => [ + new ActionHash( addr ), + AppBinding( app_binding ), + ]); }, async query_app_bindings_by_installed_app_id ( input ) { - const result = await this.call( input ); + const result = await this.call( input ); - return result.map( ([addr, app_binding]) => [ - new ActionHash( addr ), - AppBinding( app_binding ), - ]); + return result.map( ([addr, app_binding]) => [ + new ActionHash( addr ), + AppBinding( app_binding ), + ]); }, async query_app_binding_by_index ( input ) { - const result = await this.call( input ); + const result = await this.call( input ); - return [ - new ActionHash( result[0] ), - AppBinding( result[1] ), - ]; + return [ + new ActionHash( result[0] ), + AppBinding( result[1] ), + ]; }, async query_app_binding_by_key ( input ) { - const result = await this.call( input ); + const result = await this.call( input ); - return [ - new ActionHash( result[0] ), - AppBinding( result[1] ), - ]; + return [ + new ActionHash( result[0] ), + AppBinding( result[1] ), + ]; }, async query_apps_with_keys () { - const result = await this.call(); - - return result.map( ([app_binding, key_metas]) => { - return [ - AppBinding( app_binding ), - key_metas.map( key_meta => KeyMeta( key_meta ) ), - ]; - }); + const result = await this.call(); + + return result.map( ([app_binding, key_metas]) => { + return [ + AppBinding( app_binding ), + key_metas.map( key_meta => KeyMeta( key_meta ) ), + ]; + }); }, async query_key_lineage ( input ) { - const result = await this.call( input ); + const result = await this.call( input ); - return result.map( key => new Uint8Array(key) ); + return result.map( key => new Uint8Array(key) ); }, async query_same_lineage ( input ) { - const result = await this.call( input ); + const result = await this.call( input ); - return result; + return result; }, async sign ( bytes ) { - const result = await this.call( bytes ); + const result = await this.call( bytes ); - return new Signature( result ); + return new Signature( result ); }, // Public reading async get_keyset_root ( input ) { - const result = await this.call( input ); + const result = await this.call( input ); - return KeysetRoot( result ); + return KeysetRoot( result ); }, async get_device_keys ( input ) { - const result = await this.call( input ); + const result = await this.call( input ); - return result.map( ([ hash, key_anchor ]) => ({ - "hash": new EntryHash( hash ), - "anchor": KeyAnchor( key_anchor ), - }) ); + return result.map( ([ hash, key_anchor ]) => ({ + "hash": new EntryHash( hash ), + "anchor": KeyAnchor( key_anchor ), + }) ); }, async get_key_lineage ( input ) { - const result = await this.call( input ); + const result = await this.call( input ); - return result.map( key => new Uint8Array(key) ); + return result.map( key => new Uint8Array(key) ); }, async same_lineage ( input ) { - const result = await this.call( input ); + const result = await this.call( input ); - return result; + return result; }, async key_state ( input, options ) { - if ( !Array.isArray( input ) ) - input = [ input, Date.now() ]; + if ( !Array.isArray( input ) ) + input = [ input, Date.now() ]; - // Because the 'Timestamp' type on the other side expects nano seconds - if ( options?.adjust_for_nano_seconds !== false ) - input[1] *= 1000; + // Because the 'Timestamp' type on the other side expects nano seconds + if ( options?.adjust_for_nano_seconds !== false ) + input[1] *= 1000; - const result = await this.call( input ); + const result = await this.call( input ); - return KeyState( result ); + return KeyState( result ); }, // Key Registration async next_derivation_details ( input ) { - const result = await this.call( input ); + const result = await this.call( input ); - return result; + return result; }, async get_key_derivation_details ( input ) { - const result = await this.call( input ); + const result = await this.call( input ); - return result; + return result; }, async create_key ( input ) { - const result = await this.call( input ); + const result = await this.call( input ); - return [ - new ActionHash( result[0] ), - KeyRegistrationEntry( result[1] ), - KeyMeta( result[2] ), - ]; + return [ + new ActionHash( result[0] ), + KeyRegistrationEntry( result[1] ), + KeyMeta( result[2] ), + ]; }, async update_key ( input ) { - const result = await this.call( input ); + const result = await this.call( input ); - return [ - new ActionHash( result[0] ), - KeyRegistrationEntry( result[1] ), - KeyMeta( result[2] ), - ]; + return [ + new ActionHash( result[0] ), + KeyRegistrationEntry( result[1] ), + KeyMeta( result[2] ), + ]; }, async revoke_key ( input ) { - const result = await this.call( input ); + const result = await this.call( input ); - return [ - new ActionHash( result[0] ), - KeyRegistrationEntry( result[1] ), - ]; + return [ + new ActionHash( result[0] ), + KeyRegistrationEntry( result[1] ), + ]; }, async delete_key_registration ( input ) { - const result = await this.call( input ); + const result = await this.call( input ); - return [ - new ActionHash( result[0] ), - KeyRegistrationEntry( input[1] ), - ]; + return [ + new ActionHash( result[0] ), + KeyRegistrationEntry( input[1] ), + ]; }, // Change Rules async update_change_rule ( input ) { - const result = await this.call( input ); + const result = await this.call( input ); - return new ChangeRule( result ); + return new ChangeRule( result ); }, async construct_authority_spec ( input ) { - const result = await this.call( input ); + const result = await this.call( input ); - return { - "authority_spec": AuthoritySpec( result[0] ), - "serialized": new Uint8Array( result[1] ), - }; + return { + "authority_spec": AuthoritySpec( result[0] ), + "serialized": new Uint8Array( result[1] ), + }; }, async get_current_change_rule_for_ksr ( input ) { - const result = await this.call( input ); + const result = await this.call( input ); - return new ChangeRule( result ); + return new ChangeRule( result ); }, "get_ksr_change_rule_links": true, @@ -204,13 +204,13 @@ const functions = { // Virtual functions // async get_ksr_keys ( input ) { - const ksr = await this.functions.get_keyset_root ( input ); + const ksr = await this.functions.get_keyset_root ( input ); - return await this.functions.get_device_keys( ksr.first_deepkey_agent ); + return await this.functions.get_device_keys( ksr.first_deepkey_agent ); }, }; -const APP_ENTRY_STRUCTS_MAP = { +const APP_ENTRY_STRUCTS_MAP = { ChangeRule, KeysetRoot, KeyMeta, @@ -221,63 +221,63 @@ const APP_ENTRY_STRUCTS_MAP = { function formatSignal ( signal ) { if ( signal.action ) { - signal.signed_action = SignedAction( signal.action ); - signal.action = signal.signed_action.hashed.content; + signal.signed_action = SignedAction( signal.action ); + signal.action = signal.signed_action.hashed.content; } if ( signal.app_entry ) { - const app_entry_type = signal.app_entry.type; - const struct = APP_ENTRY_STRUCTS_MAP[ app_entry_type ]; + const app_entry_type = signal.app_entry.type; + const struct = APP_ENTRY_STRUCTS_MAP[ app_entry_type ]; - if ( struct === undefined ) - throw new TypeError(`No AppEntry struct for type '${app_entry_type}'`); + if ( struct === undefined ) + throw new TypeError(`No AppEntry struct for type '${app_entry_type}'`); - signal.app_entry_type = app_entry_type; - signal.app_entry = struct( signal.app_entry ); + signal.app_entry_type = app_entry_type; + signal.app_entry = struct( signal.app_entry ); } // console.log("Signal", JSON.stringify(signal,null,4) ); return signal; } -const signals = { +const signals = { EntryCreated ( signal ) { - formatSignal( signal ); - - // if ( signal.action ) { - // console.log( - // " %s Action => [%s]", - // signal.action.type, signal.signed_action.hashed.hash, JSON.stringify(signal.action,null,4) - // ); - // } - - // if ( signal.app_entry ) { - // console.log( - // "SIGNAL: AppEntry => [%s]", signal.app_entry_type, JSON.stringify(signal.app_entry,null,4) - // ); - // } + formatSignal( signal ); + + // if ( signal.action ) { + // console.log( + // " %s Action => [%s]", + // signal.action.type, signal.signed_action.hashed.hash, JSON.stringify(signal.action,null,4) + // ); + // } + + // if ( signal.app_entry ) { + // console.log( + // "SIGNAL: AppEntry => [%s]", signal.app_entry_type, JSON.stringify(signal.app_entry,null,4) + // ); + // } }, LinkCreated ( signal ) { - formatSignal( signal ); + formatSignal( signal ); - // console.log( - // "SIGNAL: LinkType => [%s]", signal.action.type, signal.link_type - // ); + // console.log( + // "SIGNAL: LinkType => [%s]", signal.action.type, signal.link_type + // ); }, }; -export const DeepKeyCSRZomelet = new Zomelet({ +export const DeepKeyCSRZomelet = new Zomelet({ functions, signals, }); -export const DeepKeyCell = new CellZomelets({ +export const DeepKeyCell = new CellZomelets({ "deepkey_csr": DeepKeyCSRZomelet, }); -export * from './types.js'; +export * from './types.js'; export default { // Zomelets diff --git a/dnas/deepkey/zomelets/src/types.js b/dnas/deepkey/zomelets/src/types.js index db0c23a..83708f7 100644 --- a/dnas/deepkey/zomelets/src/types.js +++ b/dnas/deepkey/zomelets/src/types.js @@ -1,106 +1,106 @@ -import { Bytes } from '@whi/bytes-class'; +import { Bytes } from '@whi/bytes-class'; import { AgentPubKey, DnaHash, ActionHash, EntryHash, AnyLinkableHash, -} from '@spartan-hc/holo-hash'; +} from '@spartan-hc/holo-hash'; import { // ScopedEntity, intoStruct, AnyType, OptionType, None, VecType, MapType, -} from '@whi/into-struct'; +} from '@whi/into-struct'; -export const Signature = Bytes; +export const Signature = Bytes; export class EntryTypeEnum { constructor ( data ) { - if ( "App" in data ) - return intoStruct( data, AppEntryTypeStruct ); + if ( "App" in data ) + return intoStruct( data, AppEntryTypeStruct ); - // console.log("EntryTypeEnum constructor:", data ); - throw new Error(`Unhandled Action entry type: ${Object.keys(data)[0]}`); + // console.log("EntryTypeEnum constructor:", data ); + throw new Error(`Unhandled Action entry type: ${Object.keys(data)[0]}`); } } -export const AppEntryTypeStruct = { +export const AppEntryTypeStruct = { "App": { - "entry_index": Number, - "zome_index": Number, - "visibility": AnyType, + "entry_index": Number, + "zome_index": Number, + "visibility": AnyType, }, }; -export const WeightStruct = { - "bucket_id": Number, - "units": Number, - "rate_bytes": OptionType( Number ), +export const WeightStruct = { + "bucket_id": Number, + "units": Number, + "rate_bytes": OptionType( Number ), }; -export const ActionBaseStruct = { - "type": String, - "author": AgentPubKey, - "timestamp": Number, - "action_seq": Number, - "prev_action": OptionType( ActionHash ), +export const ActionBaseStruct = { + "type": String, + "author": AgentPubKey, + "timestamp": Number, + "action_seq": Number, + "prev_action": OptionType( ActionHash ), } -export const CreateActionStruct = { +export const CreateActionStruct = { ...ActionBaseStruct, - "entry_type": EntryTypeEnum, - "entry_hash": EntryHash, - "weight": WeightStruct, + "entry_type": EntryTypeEnum, + "entry_hash": EntryHash, + "weight": WeightStruct, }; -export const UpdateActionStruct = { +export const UpdateActionStruct = { ...ActionBaseStruct, - "original_action_address": ActionHash, - "original_entry_address": EntryHash, - "entry_type": EntryTypeEnum, - "entry_hash": EntryHash, - "weight": WeightStruct, + "original_action_address": ActionHash, + "original_entry_address": EntryHash, + "entry_type": EntryTypeEnum, + "entry_hash": EntryHash, + "weight": WeightStruct, }; -export const DeleteActionStruct = { +export const DeleteActionStruct = { ...ActionBaseStruct, - "deletes_address": ActionHash, - "deletes_entry_address": EntryHash, - "weight": WeightStruct, + "deletes_address": ActionHash, + "deletes_entry_address": EntryHash, + "weight": WeightStruct, }; -export const CreateLinkActionStruct = { +export const CreateLinkActionStruct = { ...ActionBaseStruct, - "base_address": AnyLinkableHash, - "target_address": AnyLinkableHash, - "zome_index": Number, - "link_type": Number, - "tag": Bytes, - "weight": WeightStruct, + "base_address": AnyLinkableHash, + "target_address": AnyLinkableHash, + "zome_index": Number, + "link_type": Number, + "tag": Bytes, + "weight": WeightStruct, }; export class ActionEnum { constructor ( data ) { - if ( data.type === "Create" ) - return intoStruct( data, CreateActionStruct ); - if ( data.type === "Update" ) - return intoStruct( data, UpdateActionStruct ); - if ( data.type === "Delete" ) - return intoStruct( data, DeleteActionStruct ); - if ( data.type === "CreateLink" ) - return intoStruct( data, CreateLinkActionStruct ); - - // console.log("ActionEnum constructor:", data ); - throw new Error(`Unhandled Action type: ${data.type}`); + if ( data.type === "Create" ) + return intoStruct( data, CreateActionStruct ); + if ( data.type === "Update" ) + return intoStruct( data, UpdateActionStruct ); + if ( data.type === "Delete" ) + return intoStruct( data, DeleteActionStruct ); + if ( data.type === "CreateLink" ) + return intoStruct( data, CreateLinkActionStruct ); + + // console.log("ActionEnum constructor:", data ); + throw new Error(`Unhandled Action type: ${data.type}`); } } -export const SignedActionStruct = { +export const SignedActionStruct = { "hashed": { - "content": ActionEnum, - "hash": ActionHash, + "content": ActionEnum, + "hash": ActionHash, }, - "signature": Signature, + "signature": Signature, }; export function SignedAction ( data ) { @@ -108,16 +108,16 @@ export function SignedAction ( data ) { } -export const AuthorizationStruct = [ Number, Signature ]; +export const AuthorizationStruct = [ Number, Signature ]; export function Authorization ( data ) { return intoStruct( data, AuthorizationStruct ); } -export const AuthoritySpecStruct = { - "sigs_required": Number, - "authorized_signers": VecType( Bytes ), +export const AuthoritySpecStruct = { + "sigs_required": Number, + "authorized_signers": VecType( Bytes ), }; export function AuthoritySpec ( data ) { @@ -125,9 +125,9 @@ export function AuthoritySpec ( data ) { } -export const AuthorizedSpecChangeStruct = { - "new_spec": AuthoritySpecStruct, - "authorization_of_new_spec": VecType( AuthorizationStruct ), +export const AuthorizedSpecChangeStruct = { + "new_spec": AuthoritySpecStruct, + "authorization_of_new_spec": VecType( AuthorizationStruct ), }; export function AuthorizedSpecChange ( data ) { @@ -135,9 +135,9 @@ export function AuthorizedSpecChange ( data ) { } -export const ChangeRuleStruct = { - "keyset_root": ActionHash, - "spec_change": AuthorizedSpecChangeStruct, +export const ChangeRuleStruct = { + "keyset_root": ActionHash, + "spec_change": AuthorizedSpecChangeStruct, }; export function ChangeRule ( data ) { @@ -145,10 +145,10 @@ export function ChangeRule ( data ) { } -export const KeysetRootStruct = { - "first_deepkey_agent": AgentPubKey, - "root_pub_key": Bytes, - "signed_fda": Signature, +export const KeysetRootStruct = { + "first_deepkey_agent": AgentPubKey, + "root_pub_key": Bytes, + "signed_fda": Signature, }; export function KeysetRoot ( data ) { @@ -156,18 +156,18 @@ export function KeysetRoot ( data ) { } -export const DerivationDetails = { - "app_index": Number, - "key_index": Number, +export const DerivationDetails = { + "app_index": Number, + "key_index": Number, }; -export const KeyMetaStruct = { - "app_binding_addr": ActionHash, - "key_index": Number, - "key_registration_addr": ActionHash, - "key_anchor_addr": ActionHash, - "derivation_seed": OptionType( Bytes ), - "derivation_bytes": OptionType( Bytes ), +export const KeyMetaStruct = { + "app_binding_addr": ActionHash, + "key_index": Number, + "key_registration_addr": ActionHash, + "key_anchor_addr": ActionHash, + "derivation_seed": OptionType( Bytes ), + "derivation_bytes": OptionType( Bytes ), }; export function KeyMeta ( data ) { @@ -175,8 +175,8 @@ export function KeyMeta ( data ) { } -export const KeyAnchorStruct = { - "bytes": Bytes, +export const KeyAnchorStruct = { + "bytes": Bytes, }; export function KeyAnchor ( data ) { @@ -184,12 +184,12 @@ export function KeyAnchor ( data ) { } -export const AppBindingStruct = { - "app_index": Number, - "app_name": String, - "installed_app_id": String, - "dna_hashes": VecType( DnaHash ), - "metadata": Object, +export const AppBindingStruct = { + "app_index": Number, + "app_name": String, + "installed_app_id": String, + "dna_hashes": VecType( DnaHash ), + "metadata": Object, }; export function AppBinding ( data ) { @@ -198,31 +198,31 @@ export function AppBinding ( data ) { export const KeyGenerationStruct = { - "new_key": AgentPubKey, - "new_key_signing_of_author": Signature, + "new_key": AgentPubKey, + "new_key_signing_of_author": Signature, }; export const KeyRevocationStruct = { - "prior_key_registration": ActionHash, - "revocation_authorization": VecType( AuthorizationStruct ), + "prior_key_registration": ActionHash, + "revocation_authorization": VecType( AuthorizationStruct ), }; export function KeyRegistrationEntry ( entry ) { if ( "Create" in entry ) - entry.Create = intoStruct( entry.Create, KeyGenerationStruct ); + entry.Create = intoStruct( entry.Create, KeyGenerationStruct ); else if ( "CreateOnly" in entry ) - entry.CreateOnly = intoStruct( entry.CreateOnly, KeyGenerationStruct ); + entry.CreateOnly = intoStruct( entry.CreateOnly, KeyGenerationStruct ); else if ( "Update" in entry ) - entry.Update = intoStruct( entry.Update, [ KeyRevocationStruct, KeyGenerationStruct ] ); + entry.Update = intoStruct( entry.Update, [ KeyRevocationStruct, KeyGenerationStruct ] ); else if ( "Delete" in entry ) - entry.Delete = intoStruct( entry.Delete, KeyRevocationStruct ); + entry.Delete = intoStruct( entry.Delete, KeyRevocationStruct ); else - throw new TypeError(`Unknown type for KeyRegistration entry: ${Object.keys(entry)[0]}`); + throw new TypeError(`Unknown type for KeyRegistration entry: ${Object.keys(entry)[0]}`); return entry; } // export class KeyRegistration extends ScopedEntity { -// static STRUCT = KeyRegistrationStruct; +// static STRUCT = KeyRegistrationStruct; // } export const KeyInfoStruct = [ @@ -238,11 +238,11 @@ export function KeyInfo ( data ) { export function KeyState ( entry ) { if ( "NotFound" in entry ) - null; + null; if ( "Valid" in entry ) - entry.Valid = intoStruct( entry.Valid, SignedActionStruct ); + entry.Valid = intoStruct( entry.Valid, SignedActionStruct ); if ( "Invalid" in entry ) - entry.Invalid = intoStruct( entry.Invalid, OptionType( SignedActionStruct ) ); + entry.Invalid = intoStruct( entry.Invalid, OptionType( SignedActionStruct ) ); return entry; } diff --git a/dnas/deepkey/zomelets/webpack.config.js b/dnas/deepkey/zomelets/webpack.config.js index 5dd3bc8..e04f92f 100644 --- a/dnas/deepkey/zomelets/webpack.config.js +++ b/dnas/deepkey/zomelets/webpack.config.js @@ -1,47 +1,47 @@ -import webpack from 'webpack'; -import TerserPlugin from 'terser-webpack-plugin'; +import webpack from 'webpack'; +import TerserPlugin from 'terser-webpack-plugin'; -const MODE = process.env.MODE || "development"; -const FILENAME = process.env.FILENAME || "deepkey-zomelets"; -const FILEEXT = MODE === "production" ? "min.js" : "js"; +const MODE = process.env.MODE || "development"; +const FILENAME = process.env.FILENAME || "deepkey-zomelets"; +const FILEEXT = MODE === "production" ? "min.js" : "js"; export default { - "target": "web", - "mode": MODE, + "target": "web", + "mode": MODE, "entry": { - "main": { - "import": "./src/index.js", - "filename": `${FILENAME}.${FILEEXT}`, - "library": { - "type": "module", - }, - }, + "main": { + "import": "./src/index.js", + "filename": `${FILENAME}.${FILEEXT}`, + "library": { + "type": "module", + }, + }, }, "resolve": { - "mainFields": [ "module", "browser", "main" ], + "mainFields": [ "module", "browser", "main" ], }, "experiments": { - "outputModule": true, + "outputModule": true, }, "optimization": { - "minimizer": [ - new TerserPlugin({ - "terserOptions": { - "keep_classnames": true, - }, - }), - ], + "minimizer": [ + new TerserPlugin({ + "terserOptions": { + "keep_classnames": true, + }, + }), + ], }, - "devtool": "source-map", + "devtool": "source-map", "stats": { - "colors": true, + "colors": true, }, "plugins": [ new webpack.optimize.LimitChunkCountPlugin({ - "maxChunks": 1, - }), + "maxChunks": 1, + }), ], }; diff --git a/tests/integration/test_basic.js b/tests/integration/test_basic.js index 6714ff3..7c708d5 100644 --- a/tests/integration/test_basic.js +++ b/tests/integration/test_basic.js @@ -1,82 +1,82 @@ -import { Logger } from '@whi/weblogger'; -const log = new Logger("test-basic", process.env.LOG_LEVEL ); +import { Logger } from '@whi/weblogger'; +const log = new Logger("test-basic", process.env.LOG_LEVEL ); -// import why from 'why-is-node-running'; +// import why from 'why-is-node-running'; -import path from 'path'; -import crypto from 'crypto'; +import path from 'path'; +import crypto from 'crypto'; -import { expect } from 'chai'; +import { expect } from 'chai'; -import json from '@whi/json'; +import json from '@whi/json'; import { HoloHash, DnaHash, AgentPubKey, ActionHash, EntryHash, -} from '@spartan-hc/holo-hash'; -import { Holochain } from '@spartan-hc/holochain-backdrop'; +} from '@spartan-hc/holo-hash'; +import { Holochain } from '@spartan-hc/holochain-backdrop'; import { DeepKeyCell, -} from '@holochain/deepkey-zomelets'; +} from '@holochain/deepkey-zomelets'; import { AppInterfaceClient, -} from '@spartan-hc/app-interface-client'; +} from '@spartan-hc/app-interface-client'; import { expect_reject, linearSuite, -} from '../utils.js'; +} from '../utils.js'; import { KeyStore, -} from '../key_store.js'; +} from '../key_store.js'; -const __dirname = path.dirname( new URL(import.meta.url).pathname ); -const DEEPKEY_DNA_PATH = path.join( __dirname, "../../dnas/deepkey.dna" ); -const DEEPKEY_DNA_NAME = "deepkey"; +const __dirname = path.dirname( new URL(import.meta.url).pathname ); +const DEEPKEY_DNA_PATH = path.join( __dirname, "../../dnas/deepkey.dna" ); +const DEEPKEY_DNA_NAME = "deepkey"; -const dna1_hash = new DnaHash( crypto.randomBytes( 32 ) ); +const dna1_hash = new DnaHash( crypto.randomBytes( 32 ) ); -const ALICE1_DEVICE_SEED = Buffer.from("jJQhp80zPT+XBMOZmtfwdBqY9ay9k2w520iwaet1if4=", "base64"); +const ALICE1_DEVICE_SEED = Buffer.from("jJQhp80zPT+XBMOZmtfwdBqY9ay9k2w520iwaet1if4=", "base64"); -const alice1_app1_id = "alice1-app1"; -const alice1_key_store = new KeyStore( ALICE1_DEVICE_SEED, "alice1" ); +const alice1_app1_id = "alice1-app1"; +const alice1_key_store = new KeyStore( ALICE1_DEVICE_SEED, "alice1" ); let app_port; let installations; describe("DeepKey", function () { - const holochain = new Holochain({ - "timeout": 20_000, - "default_stdout_loggers": log.level_rank > 3, + const holochain = new Holochain({ + "timeout": 20_000, + "default_stdout_loggers": log.level_rank > 3, }); before(async function () { - this.timeout( 60_000 ); - - installations = await holochain.install([ - "alice1", - ], { - "app_name": "test", - "bundle": { - [DEEPKEY_DNA_NAME]: DEEPKEY_DNA_PATH, - }, - "membrane_proofs": { - [DEEPKEY_DNA_NAME]: { - "joining_proof": crypto.randomBytes( 32 ), - }, - }, - }); - - app_port = await holochain.ensureAppPort(); + this.timeout( 60_000 ); + + installations = await holochain.install([ + "alice1", + ], { + "app_name": "test", + "bundle": { + [DEEPKEY_DNA_NAME]: DEEPKEY_DNA_PATH, + }, + "membrane_proofs": { + [DEEPKEY_DNA_NAME]: { + "joining_proof": crypto.randomBytes( 32 ), + }, + }, + }); + + app_port = await holochain.ensureAppPort(); }); linearSuite("Basic", basic_tests ); after(async () => { - await holochain.destroy(); + await holochain.destroy(); }); }); @@ -89,77 +89,77 @@ function basic_tests () { let ksr1_addr; before(async function () { - this.timeout( 30_000 ); + this.timeout( 30_000 ); - client = new AppInterfaceClient( app_port, { - "logging": process.env.LOG_LEVEL || "normal", - }); + client = new AppInterfaceClient( app_port, { + "logging": process.env.LOG_LEVEL || "normal", + }); - const alice1_token = installations.alice1.test.auth.token; - alice1_client = await client.app( alice1_token ); + const alice1_token = installations.alice1.test.auth.token; + alice1_client = await client.app( alice1_token ); - ({ - deepkey, - } = alice1_client.createInterface({ - [DEEPKEY_DNA_NAME]: DeepKeyCell, - })); + ({ + deepkey, + } = alice1_client.createInterface({ + [DEEPKEY_DNA_NAME]: DeepKeyCell, + })); - alice1_deepkey = deepkey.zomes.deepkey_csr.functions; + alice1_deepkey = deepkey.zomes.deepkey_csr.functions; - ksr1_addr = await alice1_deepkey.query_keyset_authority_action_hash(); + ksr1_addr = await alice1_deepkey.query_keyset_authority_action_hash(); }); it("should query keyset root action hash", async function () { - await alice1_deepkey.query_keyset_root_action_hash(); + await alice1_deepkey.query_keyset_root_action_hash(); }); it("should get KSR keys (1)", async function () { - const keys = await alice1_deepkey.get_ksr_keys( ksr1_addr ); - log.normal("KSR keys: %s", json.debug(keys) ); + const keys = await alice1_deepkey.get_ksr_keys( ksr1_addr ); + log.normal("KSR keys: %s", json.debug(keys) ); - expect( keys ).to.have.length( 1 ); + expect( keys ).to.have.length( 1 ); }); it("should register new key", async function () { - this.timeout( 5_000 ); - - const derivation_details = await alice1_deepkey.next_derivation_details(); - const { - app_index, - key_index, - } = derivation_details; - const path = `app/${app_index}/key/${key_index}`; - const new_key = await alice1_key_store.createKey( path ); - - const [ addr, key_reg, key_meta ] = await alice1_deepkey.create_key({ - "app_binding": { - "app_name": "Alice1 - App #1", - "installed_app_id": "alice1-app1", - "dna_hashes": [ dna1_hash ], - }, - "key_generation": { - "new_key": await new_key.getAgent(), - "new_key_signing_of_author": await new_key.sign( alice1_client.agent_id ), - }, - "derivation_details": { - ...derivation_details, - "derivation_seed": alice1_key_store.seed, - "derivation_bytes": new_key.derivation_bytes, - }, - }); - log.normal("Key Registration (%s): %s", addr, json.debug(key_reg) ); - log.normal("Key Meta: %s", json.debug(key_meta) ); - log.normal("Key registration (update) addr: %s", addr ); + this.timeout( 5_000 ); + + const derivation_details = await alice1_deepkey.next_derivation_details(); + const { + app_index, + key_index, + } = derivation_details; + const path = `app/${app_index}/key/${key_index}`; + const new_key = await alice1_key_store.createKey( path ); + + const [ addr, key_reg, key_meta ] = await alice1_deepkey.create_key({ + "app_binding": { + "app_name": "Alice1 - App #1", + "installed_app_id": "alice1-app1", + "dna_hashes": [ dna1_hash ], + }, + "key_generation": { + "new_key": await new_key.getAgent(), + "new_key_signing_of_author": await new_key.sign( alice1_client.agent_id ), + }, + "derivation_details": { + ...derivation_details, + "derivation_seed": alice1_key_store.seed, + "derivation_bytes": new_key.derivation_bytes, + }, + }); + log.normal("Key Registration (%s): %s", addr, json.debug(key_reg) ); + log.normal("Key Meta: %s", json.debug(key_meta) ); + log.normal("Key registration (update) addr: %s", addr ); }); it("should get KSR keys (2)", async function () { - const keys = await alice1_deepkey.get_ksr_keys( ksr1_addr ); - log.normal("KSR keys: %s", json.debug(keys) ); + const keys = await alice1_deepkey.get_ksr_keys( ksr1_addr ); + log.normal("KSR keys: %s", json.debug(keys) ); - expect( keys ).to.have.length( 2 ); + expect( keys ).to.have.length( 2 ); }); after(async function () { - await client.close(); + await client.close(); }); } diff --git a/tests/integration/test_change_rules.js b/tests/integration/test_change_rules.js index 571e63f..57a6b07 100644 --- a/tests/integration/test_change_rules.js +++ b/tests/integration/test_change_rules.js @@ -1,85 +1,85 @@ -import { Logger } from '@whi/weblogger'; -const log = new Logger("test-basic", process.env.LOG_LEVEL ); +import { Logger } from '@whi/weblogger'; +const log = new Logger("test-basic", process.env.LOG_LEVEL ); -// import why from 'why-is-node-running'; +// import why from 'why-is-node-running'; -import path from 'path'; -import crypto from 'crypto'; +import path from 'path'; +import crypto from 'crypto'; -import { expect } from 'chai'; +import { expect } from 'chai'; -import * as ed from '@noble/ed25519'; +import * as ed from '@noble/ed25519'; -import json from '@whi/json'; +import json from '@whi/json'; import { HoloHash, DnaHash, AgentPubKey, ActionHash, EntryHash, -} from '@spartan-hc/holo-hash'; -import { Holochain } from '@spartan-hc/holochain-backdrop'; +} from '@spartan-hc/holo-hash'; +import { Holochain } from '@spartan-hc/holochain-backdrop'; import { DeepKeyCell, -} from '@holochain/deepkey-zomelets'; +} from '@holochain/deepkey-zomelets'; import { AppInterfaceClient, -} from '@spartan-hc/app-interface-client'; +} from '@spartan-hc/app-interface-client'; import { expect_reject, linearSuite, -} from '../utils.js'; +} from '../utils.js'; -const __dirname = path.dirname( new URL(import.meta.url).pathname ); -const DEEPKEY_DNA_PATH = path.join( __dirname, "../../dnas/deepkey.dna" ); -const DEEPKEY_DNA_NAME = "deepkey"; +const __dirname = path.dirname( new URL(import.meta.url).pathname ); +const DEEPKEY_DNA_PATH = path.join( __dirname, "../../dnas/deepkey.dna" ); +const DEEPKEY_DNA_NAME = "deepkey"; -const dna1_hash = new DnaHash( crypto.randomBytes( 32 ) ); +const dna1_hash = new DnaHash( crypto.randomBytes( 32 ) ); -const revocation_key1 = ed.utils.randomPrivateKey(); -const revocation_key2 = ed.utils.randomPrivateKey(); -const revocation_key3 = ed.utils.randomPrivateKey(); -const revocation_key4 = ed.utils.randomPrivateKey(); +const revocation_key1 = ed.utils.randomPrivateKey(); +const revocation_key2 = ed.utils.randomPrivateKey(); +const revocation_key3 = ed.utils.randomPrivateKey(); +const revocation_key4 = ed.utils.randomPrivateKey(); -const rev1_pubkey = await ed.getPublicKeyAsync( revocation_key1 ); -const rev2_pubkey = await ed.getPublicKeyAsync( revocation_key2 ); -const rev3_pubkey = await ed.getPublicKeyAsync( revocation_key3 ); -const rev4_pubkey = await ed.getPublicKeyAsync( revocation_key4 ); +const rev1_pubkey = await ed.getPublicKeyAsync( revocation_key1 ); +const rev2_pubkey = await ed.getPublicKeyAsync( revocation_key2 ); +const rev3_pubkey = await ed.getPublicKeyAsync( revocation_key3 ); +const rev4_pubkey = await ed.getPublicKeyAsync( revocation_key4 ); let app_port; let installations; describe("DeepKey", function () { - const holochain = new Holochain({ - "timeout": 20_000, - "default_stdout_loggers": log.level_rank > 3, + const holochain = new Holochain({ + "timeout": 20_000, + "default_stdout_loggers": log.level_rank > 3, }); before(async function () { - this.timeout( 60_000 ); - - installations = await holochain.install([ - "alice1", - ], { - "app_name": "test", - "bundle": { - [DEEPKEY_DNA_NAME]: DEEPKEY_DNA_PATH, - }, - "membrane_proofs": { - [DEEPKEY_DNA_NAME]: { - "joining_proof": crypto.randomBytes( 32 ), - }, - }, - }); - - app_port = await holochain.ensureAppPort(); + this.timeout( 60_000 ); + + installations = await holochain.install([ + "alice1", + ], { + "app_name": "test", + "bundle": { + [DEEPKEY_DNA_NAME]: DEEPKEY_DNA_PATH, + }, + "membrane_proofs": { + [DEEPKEY_DNA_NAME]: { + "joining_proof": crypto.randomBytes( 32 ), + }, + }, + }); + + app_port = await holochain.ensureAppPort(); }); linearSuite("Change Rules", basic_tests ); after(async () => { - await holochain.destroy(); + await holochain.destroy(); }); }); @@ -92,152 +92,152 @@ function basic_tests () { let ksr1_addr; before(async function () { - this.timeout( 30_000 ); + this.timeout( 30_000 ); - client = new AppInterfaceClient( app_port, { - "logging": process.env.LOG_LEVEL || "normal", - }); + client = new AppInterfaceClient( app_port, { + "logging": process.env.LOG_LEVEL || "normal", + }); - const alice1_token = installations.alice1.test.auth.token; - alice1_client = await client.app( alice1_token ); + const alice1_token = installations.alice1.test.auth.token; + alice1_client = await client.app( alice1_token ); - { - ({ - deepkey, - } = alice1_client.createInterface({ - [DEEPKEY_DNA_NAME]: DeepKeyCell, - })); + { + ({ + deepkey, + } = alice1_client.createInterface({ + [DEEPKEY_DNA_NAME]: DeepKeyCell, + })); - alice1_deepkey = deepkey.zomes.deepkey_csr.functions; - } + alice1_deepkey = deepkey.zomes.deepkey_csr.functions; + } - ksr1_addr = await alice1_deepkey.query_keyset_authority_action_hash(); + ksr1_addr = await alice1_deepkey.query_keyset_authority_action_hash(); }); it("should update change rule for (alice1) KSR", async function () { - const auth_spec_package = await alice1_deepkey.construct_authority_spec({ - "sigs_required": 2, - "authorized_signers": [ - rev1_pubkey, - rev2_pubkey, - rev3_pubkey, - ], - }); - // log.normal("Constructed Authority Spec: %s", json.debug(auth_spec_package.authority_spec) ); - - const new_change_rule = await alice1_deepkey.update_change_rule({ - "authority_spec": auth_spec_package.authority_spec, - }); - - log.normal("New Change Rule: %s", json.debug(new_change_rule) ); + const auth_spec_package = await alice1_deepkey.construct_authority_spec({ + "sigs_required": 2, + "authorized_signers": [ + rev1_pubkey, + rev2_pubkey, + rev3_pubkey, + ], + }); + // log.normal("Constructed Authority Spec: %s", json.debug(auth_spec_package.authority_spec) ); + + const new_change_rule = await alice1_deepkey.update_change_rule({ + "authority_spec": auth_spec_package.authority_spec, + }); + + log.normal("New Change Rule: %s", json.debug(new_change_rule) ); }); it("should update change rule using revocation key for (alice1) KSR", async function () { - const auth_spec_package = await alice1_deepkey.construct_authority_spec({ - "sigs_required": 2, - "authorized_signers": [ - rev1_pubkey, - rev2_pubkey, - rev3_pubkey, - rev4_pubkey, - ], - }); - // log.normal("Constructed Authority Spec: %s", json.debug(auth_spec_package.authority_spec) ); - - log.info("Signing new auth spec with authority: %s", new AgentPubKey( rev1_pubkey ) ); - const new_change_rule = await alice1_deepkey.update_change_rule({ - "authority_spec": auth_spec_package.authority_spec, - "authorizations": [ - [ 0, await ed.signAsync( auth_spec_package.serialized, revocation_key1 ) ], - [ 2, await ed.signAsync( auth_spec_package.serialized, revocation_key3 ) ], - ], - }); - - log.normal("New Change Rule: %s", json.debug(new_change_rule) ); - - const current_change_rule = await alice1_deepkey.get_current_change_rule_for_ksr( ksr1_addr ); - - expect( current_change_rule ).to.deep.equal( new_change_rule ); + const auth_spec_package = await alice1_deepkey.construct_authority_spec({ + "sigs_required": 2, + "authorized_signers": [ + rev1_pubkey, + rev2_pubkey, + rev3_pubkey, + rev4_pubkey, + ], + }); + // log.normal("Constructed Authority Spec: %s", json.debug(auth_spec_package.authority_spec) ); + + log.info("Signing new auth spec with authority: %s", new AgentPubKey( rev1_pubkey ) ); + const new_change_rule = await alice1_deepkey.update_change_rule({ + "authority_spec": auth_spec_package.authority_spec, + "authorizations": [ + [ 0, await ed.signAsync( auth_spec_package.serialized, revocation_key1 ) ], + [ 2, await ed.signAsync( auth_spec_package.serialized, revocation_key3 ) ], + ], + }); + + log.normal("New Change Rule: %s", json.debug(new_change_rule) ); + + const current_change_rule = await alice1_deepkey.get_current_change_rule_for_ksr( ksr1_addr ); + + expect( current_change_rule ).to.deep.equal( new_change_rule ); }); linearSuite("Errors", function () { - it("should fail to update change rule entry because invalid signature for (alice1) KSR", async function () { - await expect_reject(async () => { - await alice1_deepkey.update_change_rule({ - "authority_spec": { - "sigs_required": 1, - "authorized_signers": [ - crypto.randomBytes(32), - ], - }, - "authorizations": [ - [ 0, crypto.randomBytes(64) ], - [ 1, crypto.randomBytes(64) ], - ], - }); - }, "Authorization has invalid signature" ); - }); - - it("should fail to update change rule entry because invalid signature for (alice1) KSR", async function () { - await expect_reject(async () => { - await alice1_deepkey.update_change_rule({ - "authority_spec": { - "sigs_required": 2, - "authorized_signers": [ - crypto.randomBytes(32), - ], - }, - "authorizations": [ - [ 0, crypto.randomBytes(64) ], - ], - }); - }, "There are not enough authorities" ); - }); - - it("should fail to update change rule entry because not enough signatures for (alice1) KSR", async function () { - await expect_reject(async () => { - const auth_spec_package = await alice1_deepkey.construct_authority_spec({ - "sigs_required": 1, - "authorized_signers": [ - crypto.randomBytes(32), - ], - }); - await alice1_deepkey.update_change_rule({ - "authority_spec": { - "sigs_required": 1, - "authorized_signers": [ - crypto.randomBytes(32), - ], - }, - "authorizations": [ - [ 0, await ed.signAsync( auth_spec_package.serialized, revocation_key1 ) ], - ], - }); - }, "change rule requires at least" ); - }); - - it("should fail to update change rule entry because invalid signature for (alice1) KSR", async function () { - await expect_reject(async () => { - const auth_spec_package = await alice1_deepkey.construct_authority_spec({ - "sigs_required": 0, - "authorized_signers": [ - crypto.randomBytes(32), - ], - }); - await alice1_deepkey.update_change_rule({ - "authority_spec": auth_spec_package.authority_spec, - "authorizations": [ - [ 0, await ed.signAsync( auth_spec_package.serialized, revocation_key1 ) ], - [ 2, await ed.signAsync( auth_spec_package.serialized, revocation_key3 ) ], - ], - }); - }, "Required signatures cannot be 0" ); - }); + it("should fail to update change rule entry because invalid signature for (alice1) KSR", async function () { + await expect_reject(async () => { + await alice1_deepkey.update_change_rule({ + "authority_spec": { + "sigs_required": 1, + "authorized_signers": [ + crypto.randomBytes(32), + ], + }, + "authorizations": [ + [ 0, crypto.randomBytes(64) ], + [ 1, crypto.randomBytes(64) ], + ], + }); + }, "Authorization has invalid signature" ); + }); + + it("should fail to update change rule entry because invalid signature for (alice1) KSR", async function () { + await expect_reject(async () => { + await alice1_deepkey.update_change_rule({ + "authority_spec": { + "sigs_required": 2, + "authorized_signers": [ + crypto.randomBytes(32), + ], + }, + "authorizations": [ + [ 0, crypto.randomBytes(64) ], + ], + }); + }, "There are not enough authorities" ); + }); + + it("should fail to update change rule entry because not enough signatures for (alice1) KSR", async function () { + await expect_reject(async () => { + const auth_spec_package = await alice1_deepkey.construct_authority_spec({ + "sigs_required": 1, + "authorized_signers": [ + crypto.randomBytes(32), + ], + }); + await alice1_deepkey.update_change_rule({ + "authority_spec": { + "sigs_required": 1, + "authorized_signers": [ + crypto.randomBytes(32), + ], + }, + "authorizations": [ + [ 0, await ed.signAsync( auth_spec_package.serialized, revocation_key1 ) ], + ], + }); + }, "change rule requires at least" ); + }); + + it("should fail to update change rule entry because invalid signature for (alice1) KSR", async function () { + await expect_reject(async () => { + const auth_spec_package = await alice1_deepkey.construct_authority_spec({ + "sigs_required": 0, + "authorized_signers": [ + crypto.randomBytes(32), + ], + }); + await alice1_deepkey.update_change_rule({ + "authority_spec": auth_spec_package.authority_spec, + "authorizations": [ + [ 0, await ed.signAsync( auth_spec_package.serialized, revocation_key1 ) ], + [ 2, await ed.signAsync( auth_spec_package.serialized, revocation_key3 ) ], + ], + }); + }, "Required signatures cannot be 0" ); + }); }); after(async function () { - await client.close(); + await client.close(); }); } diff --git a/tests/integration/test_claim_unmanaged_key.js b/tests/integration/test_claim_unmanaged_key.js index 0a07d80..78f7261 100644 --- a/tests/integration/test_claim_unmanaged_key.js +++ b/tests/integration/test_claim_unmanaged_key.js @@ -1,86 +1,86 @@ -import { Logger } from '@whi/weblogger'; -const log = new Logger("test-basic", process.env.LOG_LEVEL ); +import { Logger } from '@whi/weblogger'; +const log = new Logger("test-basic", process.env.LOG_LEVEL ); -// import why from 'why-is-node-running'; +// import why from 'why-is-node-running'; -import path from 'path'; -import crypto from 'crypto'; +import path from 'path'; +import crypto from 'crypto'; -import { expect } from 'chai'; +import { expect } from 'chai'; -import * as ed from '@noble/ed25519'; +import * as ed from '@noble/ed25519'; -import json from '@whi/json'; +import json from '@whi/json'; import { HoloHash, DnaHash, AgentPubKey, ActionHash, EntryHash, -} from '@spartan-hc/holo-hash'; -import { Holochain } from '@spartan-hc/holochain-backdrop'; +} from '@spartan-hc/holo-hash'; +import { Holochain } from '@spartan-hc/holochain-backdrop'; import { DeepKeyCell, -} from '@holochain/deepkey-zomelets'; +} from '@holochain/deepkey-zomelets'; import { AppInterfaceClient, -} from '@spartan-hc/app-interface-client'; +} from '@spartan-hc/app-interface-client'; import { expect_reject, linearSuite, -} from '../utils.js'; +} from '../utils.js'; import { KeyStore, -} from '../key_store.js'; +} from '../key_store.js'; -const __dirname = path.dirname( new URL(import.meta.url).pathname ); -const DEEPKEY_DNA_PATH = path.join( __dirname, "../../dnas/deepkey.dna" ); +const __dirname = path.dirname( new URL(import.meta.url).pathname ); +const DEEPKEY_DNA_PATH = path.join( __dirname, "../../dnas/deepkey.dna" ); -const dna1_hash = new DnaHash( crypto.randomBytes( 32 ) ); +const dna1_hash = new DnaHash( crypto.randomBytes( 32 ) ); -const alice1_app1_id = "alice1-app1"; -const alice2_app1_id = "alice2-app1"; +const alice1_app1_id = "alice1-app1"; +const alice2_app1_id = "alice2-app1"; -const ALICE1_DEVICE_SEED = Buffer.from("jJQhp80zPT+XBMOZmtfwdBqY9ay9k2w520iwaet1if4=", "base64"); -const alice1_key_store = new KeyStore( ALICE1_DEVICE_SEED, "alice1" ); +const ALICE1_DEVICE_SEED = Buffer.from("jJQhp80zPT+XBMOZmtfwdBqY9ay9k2w520iwaet1if4=", "base64"); +const alice1_key_store = new KeyStore( ALICE1_DEVICE_SEED, "alice1" ); -const revocation_key1 = ed.utils.randomPrivateKey(); -const revocation_key2 = ed.utils.randomPrivateKey(); -const rev1_pubkey = await ed.getPublicKeyAsync( revocation_key1 ); -const rev2_pubkey = await ed.getPublicKeyAsync( revocation_key2 ); +const revocation_key1 = ed.utils.randomPrivateKey(); +const revocation_key2 = ed.utils.randomPrivateKey(); +const rev1_pubkey = await ed.getPublicKeyAsync( revocation_key1 ); +const rev2_pubkey = await ed.getPublicKeyAsync( revocation_key2 ); let app_port; let installations; describe("DeepKey", function () { - const holochain = new Holochain({ - "timeout": 20_000, - "default_stdout_loggers": log.level_rank > 3, + const holochain = new Holochain({ + "timeout": 20_000, + "default_stdout_loggers": log.level_rank > 3, }); before(async function () { - this.timeout( 60_000 ); - - installations = await holochain.install([ - "alice_host", - "alice1", - "alice2", - ], { - "app_name": "test", - "bundle": { - "deepkey": DEEPKEY_DNA_PATH, - }, - }); - - app_port = await holochain.ensureAppPort(); + this.timeout( 60_000 ); + + installations = await holochain.install([ + "alice_host", + "alice1", + "alice2", + ], { + "app_name": "test", + "bundle": { + "deepkey": DEEPKEY_DNA_PATH, + }, + }); + + app_port = await holochain.ensureAppPort(); }); linearSuite("Basic", basic_tests ); after(async () => { - await holochain.destroy(); + await holochain.destroy(); }); }); @@ -99,9 +99,9 @@ function basic_tests () { let alice2_deepkey; // Alice key1 - const app_index = 1; // 0 is reserved for the deepkey cell agent - const key_index = 0; - const key1a_path = `app/${app_index}/key/${key_index}`; + const app_index = 1; // 0 is reserved for the deepkey cell agent + const key_index = 0; + const key1a_path = `app/${app_index}/key/${key_index}`; let alice1_key1a; // Hosted Alice key1 @@ -112,211 +112,211 @@ function basic_tests () { let alice2_key1a_reg, alice2_key1a_reg_addr; before(async function () { - this.timeout( 30_000 ); - - client = new AppInterfaceClient( app_port, { - "logging": process.env.LOG_LEVEL || "normal", - }); - - const hosted_alice_token = installations.alice_host.test.auth.token; - hosted_alice_client = await client.app( hosted_alice_token ); - - const alice1_token = installations.alice1.test.auth.token; - alice1_client = await client.app( alice1_token ); - - const alice2_token = installations.alice2.test.auth.token; - alice2_client = await client.app( alice2_token ); - - { - const { - deepkey, - } = hosted_alice_client.createInterface({ - "deepkey": DeepKeyCell, - }); - - hosted_alice_deepkey = deepkey.zomes.deepkey_csr.functions; - } - { - const { - deepkey, - } = alice1_client.createInterface({ - "deepkey": DeepKeyCell, - }); - - alice1_deepkey = deepkey.zomes.deepkey_csr.functions; - } - { - const { - deepkey, - } = alice2_client.createInterface({ - "deepkey": DeepKeyCell, - }); - - alice2_deepkey = deepkey.zomes.deepkey_csr.functions; - } - - const hosted_alice_ksr_addr = await hosted_alice_deepkey.query_keyset_authority_action_hash(); - const alice1_ksr_addr = await alice1_deepkey.query_keyset_authority_action_hash(); - const alice2_ksr_addr = await alice2_deepkey.query_keyset_authority_action_hash(); - - const auth_spec_package = await alice1_deepkey.construct_authority_spec({ - "sigs_required": 1, - "authorized_signers": [ - rev1_pubkey, - rev2_pubkey, - ], - }); - const new_change_rule = await alice1_deepkey.update_change_rule({ - "authority_spec": auth_spec_package.authority_spec, - }); - log.normal("New Change Rule: %s", json.debug(new_change_rule) ); - - alice1_key1a = await alice1_key_store.createKey( key1a_path ); + this.timeout( 30_000 ); + + client = new AppInterfaceClient( app_port, { + "logging": process.env.LOG_LEVEL || "normal", + }); + + const hosted_alice_token = installations.alice_host.test.auth.token; + hosted_alice_client = await client.app( hosted_alice_token ); + + const alice1_token = installations.alice1.test.auth.token; + alice1_client = await client.app( alice1_token ); + + const alice2_token = installations.alice2.test.auth.token; + alice2_client = await client.app( alice2_token ); + + { + const { + deepkey, + } = hosted_alice_client.createInterface({ + "deepkey": DeepKeyCell, + }); + + hosted_alice_deepkey = deepkey.zomes.deepkey_csr.functions; + } + { + const { + deepkey, + } = alice1_client.createInterface({ + "deepkey": DeepKeyCell, + }); + + alice1_deepkey = deepkey.zomes.deepkey_csr.functions; + } + { + const { + deepkey, + } = alice2_client.createInterface({ + "deepkey": DeepKeyCell, + }); + + alice2_deepkey = deepkey.zomes.deepkey_csr.functions; + } + + const hosted_alice_ksr_addr = await hosted_alice_deepkey.query_keyset_authority_action_hash(); + const alice1_ksr_addr = await alice1_deepkey.query_keyset_authority_action_hash(); + const alice2_ksr_addr = await alice2_deepkey.query_keyset_authority_action_hash(); + + const auth_spec_package = await alice1_deepkey.construct_authority_spec({ + "sigs_required": 1, + "authorized_signers": [ + rev1_pubkey, + rev2_pubkey, + ], + }); + const new_change_rule = await alice1_deepkey.update_change_rule({ + "authority_spec": auth_spec_package.authority_spec, + }); + log.normal("New Change Rule: %s", json.debug(new_change_rule) ); + + alice1_key1a = await alice1_key_store.createKey( key1a_path ); }); it("should register unmanaged key (alice)", async function () { - this.timeout( 5_000 ); - - const [ addr, key_reg, key_meta ] = await hosted_alice_deepkey.create_key({ - "app_binding": { - "app_name": "Alice - App #1", - "installed_app_id": alice1_app1_id, - "dna_hashes": [ dna1_hash ], - }, - "key_generation": { - "new_key": await alice1_key1a.getAgent(), - "new_key_signing_of_author": await alice1_key1a.sign( hosted_alice_client.agent_id ), - }, - "derivation_details": { - app_index, - key_index, - "derivation_seed": alice1_key_store.seed, - "derivation_bytes": alice1_key1a.derivation_bytes, - }, - "create_only": true, - }); - log.normal("Key Registration (%s): %s", addr, json.debug(key_reg) ); - log.normal("Key Meta: %s", json.debug(key_meta) ); - log.normal("Key registration (create) addr: %s", addr ); - - hosted_alice_key1a_reg = key_reg; - hosted_alice_key1a_reg_addr = addr; - - { - const key_state = await hosted_alice_deepkey.key_state( - await alice1_key1a.getBytes() - ); - log.normal("Key (1a) state: %s", json.debug(key_state) ); - - expect( key_state ).to.have.key( "Valid" ); - } + this.timeout( 5_000 ); + + const [ addr, key_reg, key_meta ] = await hosted_alice_deepkey.create_key({ + "app_binding": { + "app_name": "Alice - App #1", + "installed_app_id": alice1_app1_id, + "dna_hashes": [ dna1_hash ], + }, + "key_generation": { + "new_key": await alice1_key1a.getAgent(), + "new_key_signing_of_author": await alice1_key1a.sign( hosted_alice_client.agent_id ), + }, + "derivation_details": { + app_index, + key_index, + "derivation_seed": alice1_key_store.seed, + "derivation_bytes": alice1_key1a.derivation_bytes, + }, + "create_only": true, + }); + log.normal("Key Registration (%s): %s", addr, json.debug(key_reg) ); + log.normal("Key Meta: %s", json.debug(key_meta) ); + log.normal("Key registration (create) addr: %s", addr ); + + hosted_alice_key1a_reg = key_reg; + hosted_alice_key1a_reg_addr = addr; + + { + const key_state = await hosted_alice_deepkey.key_state( + await alice1_key1a.getBytes() + ); + log.normal("Key (1a) state: %s", json.debug(key_state) ); + + expect( key_state ).to.have.key( "Valid" ); + } }); it("should claim unmanaged key", async function () { - this.timeout( 5_000 ); - - const [ addr, key_reg, key_meta ] = await alice1_deepkey.create_key({ - "app_binding": { - "app_name": "Alice1 - App #1", - "installed_app_id": alice1_app1_id, - "dna_hashes": [ dna1_hash ], - }, - "key_generation": { - "new_key": await alice1_key1a.getAgent(), - "new_key_signing_of_author": await alice1_key1a.sign( alice1_client.agent_id ), - }, - "derivation_details": { - app_index, - key_index, - "derivation_seed": alice1_key_store.seed, - "derivation_bytes": alice1_key1a.derivation_bytes, - }, - }); - log.normal("Key Registration (%s): %s", addr, json.debug(key_reg) ); - log.normal("Key Meta: %s", json.debug(key_meta) ); - log.normal("Key registration (update) addr: %s", addr ); - - alice1_key1a_reg = key_reg; - alice1_key1a_reg_addr = addr; + this.timeout( 5_000 ); + + const [ addr, key_reg, key_meta ] = await alice1_deepkey.create_key({ + "app_binding": { + "app_name": "Alice1 - App #1", + "installed_app_id": alice1_app1_id, + "dna_hashes": [ dna1_hash ], + }, + "key_generation": { + "new_key": await alice1_key1a.getAgent(), + "new_key_signing_of_author": await alice1_key1a.sign( alice1_client.agent_id ), + }, + "derivation_details": { + app_index, + key_index, + "derivation_seed": alice1_key_store.seed, + "derivation_bytes": alice1_key1a.derivation_bytes, + }, + }); + log.normal("Key Registration (%s): %s", addr, json.debug(key_reg) ); + log.normal("Key Meta: %s", json.debug(key_meta) ); + log.normal("Key registration (update) addr: %s", addr ); + + alice1_key1a_reg = key_reg; + alice1_key1a_reg_addr = addr; }); it("should fail to update hosted key", async function () { - this.timeout( 10_000 ); - - await expect_reject(async () => { - await hosted_alice_deepkey.revoke_key({ - "key_revocation": { - "prior_key_registration": hosted_alice_key1a_reg_addr, - "revocation_authorization": [ - [ 0, await alice1_key1a.sign( hosted_alice_key1a_reg_addr ) ], - ], - }, - }); - }, "cannot be updated" ); + this.timeout( 10_000 ); + + await expect_reject(async () => { + await hosted_alice_deepkey.revoke_key({ + "key_revocation": { + "prior_key_registration": hosted_alice_key1a_reg_addr, + "revocation_authorization": [ + [ 0, await alice1_key1a.sign( hosted_alice_key1a_reg_addr ) ], + ], + }, + }); + }, "cannot be updated" ); }); it("should update key", async function () { - this.timeout( 10_000 ); - - const [ addr, key_reg ] = await alice1_deepkey.revoke_key({ - "key_revocation": { - "prior_key_registration": alice1_key1a_reg_addr, - "revocation_authorization": [ - [ 0, await ed.signAsync( alice1_key1a_reg_addr, revocation_key1 ) ], - ], - }, - }); - log.normal("Key Registration (%s): %s", addr, json.debug(key_reg) ); - log.normal("Key registration (update) addr: %s", addr ); - - { - const key_state = await hosted_alice_deepkey.key_state( - await alice1_key1a.getBytes() - ); - log.normal("Key (1a) state: %s", json.debug(key_state) ); - - expect( key_state ).to.have.key( "Invalid" ); - } + this.timeout( 10_000 ); + + const [ addr, key_reg ] = await alice1_deepkey.revoke_key({ + "key_revocation": { + "prior_key_registration": alice1_key1a_reg_addr, + "revocation_authorization": [ + [ 0, await ed.signAsync( alice1_key1a_reg_addr, revocation_key1 ) ], + ], + }, + }); + log.normal("Key Registration (%s): %s", addr, json.debug(key_reg) ); + log.normal("Key registration (update) addr: %s", addr ); + + { + const key_state = await hosted_alice_deepkey.key_state( + await alice1_key1a.getBytes() + ); + log.normal("Key (1a) state: %s", json.debug(key_state) ); + + expect( key_state ).to.have.key( "Invalid" ); + } }); it("should claim unmanaged key with another chain", async function () { - this.timeout( 5_000 ); - - const [ addr, key_reg, key_meta ] = await alice2_deepkey.create_key({ - "app_binding": { - "app_name": "Alice2 - App #1", - "installed_app_id": alice2_app1_id, - "dna_hashes": [ dna1_hash ], - }, - "key_generation": { - "new_key": await alice1_key1a.getAgent(), - "new_key_signing_of_author": await alice1_key1a.sign( alice2_client.agent_id ), - }, - "derivation_details": { - app_index, - key_index, - "derivation_seed": alice1_key_store.seed, - "derivation_bytes": alice1_key1a.derivation_bytes, - }, - }); - log.normal("Key Registration (%s): %s", addr, json.debug(key_reg) ); - log.normal("Key Meta: %s", json.debug(key_meta) ); - log.normal("Key registration (update) addr: %s", addr ); - - alice2_key1a_reg = key_reg; - alice2_key1a_reg_addr = addr; - - { - const key_state = await hosted_alice_deepkey.key_state( - await alice1_key1a.getBytes() - ); - log.normal("Key (1a) state: %s", json.debug(key_state) ); - - expect( key_state ).to.have.key( "Invalid" ); - } + this.timeout( 5_000 ); + + const [ addr, key_reg, key_meta ] = await alice2_deepkey.create_key({ + "app_binding": { + "app_name": "Alice2 - App #1", + "installed_app_id": alice2_app1_id, + "dna_hashes": [ dna1_hash ], + }, + "key_generation": { + "new_key": await alice1_key1a.getAgent(), + "new_key_signing_of_author": await alice1_key1a.sign( alice2_client.agent_id ), + }, + "derivation_details": { + app_index, + key_index, + "derivation_seed": alice1_key_store.seed, + "derivation_bytes": alice1_key1a.derivation_bytes, + }, + }); + log.normal("Key Registration (%s): %s", addr, json.debug(key_reg) ); + log.normal("Key Meta: %s", json.debug(key_meta) ); + log.normal("Key registration (update) addr: %s", addr ); + + alice2_key1a_reg = key_reg; + alice2_key1a_reg_addr = addr; + + { + const key_state = await hosted_alice_deepkey.key_state( + await alice1_key1a.getBytes() + ); + log.normal("Key (1a) state: %s", json.debug(key_state) ); + + expect( key_state ).to.have.key( "Invalid" ); + } }); after(async function () { - await client.close(); + await client.close(); }); } diff --git a/tests/integration/test_key_management.js b/tests/integration/test_key_management.js index 6766b85..9a0e9d9 100644 --- a/tests/integration/test_key_management.js +++ b/tests/integration/test_key_management.js @@ -1,90 +1,90 @@ -import { Logger } from '@whi/weblogger'; -const log = new Logger("test-basic", process.env.LOG_LEVEL ); +import { Logger } from '@whi/weblogger'; +const log = new Logger("test-basic", process.env.LOG_LEVEL ); -// import why from 'why-is-node-running'; +// import why from 'why-is-node-running'; -import path from 'path'; -import crypto from 'crypto'; +import path from 'path'; +import crypto from 'crypto'; -import { expect } from 'chai'; +import { expect } from 'chai'; -import json from '@whi/json'; +import json from '@whi/json'; import { HoloHash, DnaHash, AgentPubKey, ActionHash, EntryHash, -} from '@spartan-hc/holo-hash'; -import { Holochain } from '@spartan-hc/holochain-backdrop'; +} from '@spartan-hc/holo-hash'; +import { Holochain } from '@spartan-hc/holochain-backdrop'; import { DeepKeyCell, -} from '@holochain/deepkey-zomelets'; +} from '@holochain/deepkey-zomelets'; import { AppInterfaceClient, -} from '@spartan-hc/app-interface-client'; +} from '@spartan-hc/app-interface-client'; import { expect_reject, linearSuite, -} from '../utils.js'; +} from '../utils.js'; import { KeyStore, random_key, -} from '../key_store.js'; +} from '../key_store.js'; -const __dirname = path.dirname( new URL(import.meta.url).pathname ); -const DEEPKEY_DNA_PATH = path.join( __dirname, "../../dnas/deepkey.dna" ); -const DEEPKEY_DNA_NAME = "deepkey"; +const __dirname = path.dirname( new URL(import.meta.url).pathname ); +const DEEPKEY_DNA_PATH = path.join( __dirname, "../../dnas/deepkey.dna" ); +const DEEPKEY_DNA_NAME = "deepkey"; -const dna1_hash = new DnaHash( crypto.randomBytes( 32 ) ); +const dna1_hash = new DnaHash( crypto.randomBytes( 32 ) ); -const ALICE_DEVICE_SEED = Buffer.from("jJQhp80zPT+XBMOZmtfwdBqY9ay9k2w520iwaet1if4=", "base64"); -const BOBBY_DEVICE_SEED = Buffer.from("jJQhp80zPT+XBMOZmtfwdBqY9ay9k2w520iwaet1if4=", "base64"); +const ALICE_DEVICE_SEED = Buffer.from("jJQhp80zPT+XBMOZmtfwdBqY9ay9k2w520iwaet1if4=", "base64"); +const BOBBY_DEVICE_SEED = Buffer.from("jJQhp80zPT+XBMOZmtfwdBqY9ay9k2w520iwaet1if4=", "base64"); -const alice_key_store = new KeyStore( ALICE_DEVICE_SEED, "alice" ); -const bobby_key_store = new KeyStore( BOBBY_DEVICE_SEED, "bobby" ); +const alice_key_store = new KeyStore( ALICE_DEVICE_SEED, "alice" ); +const bobby_key_store = new KeyStore( BOBBY_DEVICE_SEED, "bobby" ); -const alice_app1_id = "alice-app1"; -const alice_app2_id = "alice-app2"; -const alice_app3_id = "alice-app3"; -const bobby_app1_id = "bobby-app1"; +const alice_app1_id = "alice-app1"; +const alice_app2_id = "alice-app2"; +const alice_app3_id = "alice-app3"; +const bobby_app1_id = "bobby-app1"; let app_port; let installations; describe("DeepKey", function () { - const holochain = new Holochain({ - "timeout": 20_000, - "default_stdout_loggers": log.level_rank > 3, + const holochain = new Holochain({ + "timeout": 20_000, + "default_stdout_loggers": log.level_rank > 3, }); before(async function () { - this.timeout( 60_000 ); - - installations = await holochain.install([ - "alice", - "bobby", - ], { - "app_name": "test", - "bundle": { - [DEEPKEY_DNA_NAME]: DEEPKEY_DNA_PATH, - }, - "membrane_proofs": { - [DEEPKEY_DNA_NAME]: { - "joining_proof": crypto.randomBytes( 32 ), - }, - }, - }); - - app_port = await holochain.ensureAppPort(); + this.timeout( 60_000 ); + + installations = await holochain.install([ + "alice", + "bobby", + ], { + "app_name": "test", + "bundle": { + [DEEPKEY_DNA_NAME]: DEEPKEY_DNA_PATH, + }, + "membrane_proofs": { + [DEEPKEY_DNA_NAME]: { + "joining_proof": crypto.randomBytes( 32 ), + }, + }, + }); + + app_port = await holochain.ensureAppPort(); }); linearSuite("Key Management", basic_tests ); after(async () => { - await holochain.destroy(); + await holochain.destroy(); }); }); @@ -106,570 +106,570 @@ function basic_tests () { let alice_key3a_reg, alice_key3a_reg_addr, alice_key3a, alice_key3; before(async function () { - this.timeout( 30_000 ); + this.timeout( 30_000 ); - client = new AppInterfaceClient( app_port, { - "logging": process.env.LOG_LEVEL || "normal", - }); + client = new AppInterfaceClient( app_port, { + "logging": process.env.LOG_LEVEL || "normal", + }); - const alice_token = installations.alice.test.auth.token; - alice_client = await client.app( alice_token ); + const alice_token = installations.alice.test.auth.token; + alice_client = await client.app( alice_token ); - const bobby_token = installations.bobby.test.auth.token; - bobby_client = await client.app( bobby_token ); + const bobby_token = installations.bobby.test.auth.token; + bobby_client = await client.app( bobby_token ); - { - ({ - deepkey, - } = alice_client.createInterface({ - [DEEPKEY_DNA_NAME]: DeepKeyCell, - })); + { + ({ + deepkey, + } = alice_client.createInterface({ + [DEEPKEY_DNA_NAME]: DeepKeyCell, + })); - alice_deepkey = deepkey.zomes.deepkey_csr.functions; - } + alice_deepkey = deepkey.zomes.deepkey_csr.functions; + } - { - ({ - deepkey, - } = bobby_client.createInterface({ - [DEEPKEY_DNA_NAME]: DeepKeyCell, - })); + { + ({ + deepkey, + } = bobby_client.createInterface({ + [DEEPKEY_DNA_NAME]: DeepKeyCell, + })); - bobby_deepkey = deepkey.zomes.deepkey_csr.functions; - } + bobby_deepkey = deepkey.zomes.deepkey_csr.functions; + } - ksr1_addr = await alice_deepkey.query_keyset_authority_action_hash(); + ksr1_addr = await alice_deepkey.query_keyset_authority_action_hash(); }); it("should register new key (alice)", async function () { - this.timeout( 5_000 ); - - const derivation_details = await alice_deepkey.next_derivation_details(); - const { - app_index, - key_index, - } = derivation_details; - const path = `app/${app_index}/key/${key_index}`; - const new_key = await alice_key_store.createKey( path ); - - const [ addr, key_reg, key_meta ] = await alice_deepkey.create_key({ - "app_binding": { - "app_name": "Alice - App #1", - "installed_app_id": alice_app1_id, - "dna_hashes": [ dna1_hash ], - }, - "key_generation": { - "new_key": await new_key.getAgent(), - "new_key_signing_of_author": await new_key.sign( alice_client.agent_id ), - }, - "derivation_details": { - ...derivation_details, - "derivation_seed": alice_key_store.seed, - "derivation_bytes": new_key.derivation_bytes, - }, - }); - log.normal("Key Registration (%s): %s", addr, json.debug(key_reg) ); - log.normal("Key Meta: %s", json.debug(key_meta) ); - log.normal("Key registration (create) addr: %s", addr ); - - alice_key1a = await new_key.getBytes(); - alice_key1a_reg = key_reg; - alice_key1a_reg_addr = addr; - - { - const key_state = await alice_deepkey.key_state( alice_key1a ); - log.normal("Key (1a) state: %s", json.debug(key_state) ); - - expect( key_state ).to.have.key( "Valid" ); - } + this.timeout( 5_000 ); + + const derivation_details = await alice_deepkey.next_derivation_details(); + const { + app_index, + key_index, + } = derivation_details; + const path = `app/${app_index}/key/${key_index}`; + const new_key = await alice_key_store.createKey( path ); + + const [ addr, key_reg, key_meta ] = await alice_deepkey.create_key({ + "app_binding": { + "app_name": "Alice - App #1", + "installed_app_id": alice_app1_id, + "dna_hashes": [ dna1_hash ], + }, + "key_generation": { + "new_key": await new_key.getAgent(), + "new_key_signing_of_author": await new_key.sign( alice_client.agent_id ), + }, + "derivation_details": { + ...derivation_details, + "derivation_seed": alice_key_store.seed, + "derivation_bytes": new_key.derivation_bytes, + }, + }); + log.normal("Key Registration (%s): %s", addr, json.debug(key_reg) ); + log.normal("Key Meta: %s", json.debug(key_meta) ); + log.normal("Key registration (create) addr: %s", addr ); + + alice_key1a = await new_key.getBytes(); + alice_key1a_reg = key_reg; + alice_key1a_reg_addr = addr; + + { + const key_state = await alice_deepkey.key_state( alice_key1a ); + log.normal("Key (1a) state: %s", json.debug(key_state) ); + + expect( key_state ).to.have.key( "Valid" ); + } }); it("should query (alice) keyset keys (1)", async function () { - const keys = await alice_deepkey.query_apps_with_keys(); - log.normal("Keyset app keys: %s", json.debug(keys) ); + const keys = await alice_deepkey.query_apps_with_keys(); + log.normal("Keyset app keys: %s", json.debug(keys) ); - expect( keys ).to.have.length( 2 ); + expect( keys ).to.have.length( 2 ); }); it("should update key (alice)", async function () { - this.timeout( 5_000 ); - - const derivation_details = await alice_deepkey.next_derivation_details( alice_key1a ); - const { - app_index, - key_index, - } = derivation_details; - const path = `app/${app_index}/key/${key_index}`; - const new_key = await alice_key_store.createKey( path ); - - expect( derivation_details ).to.deep.equal({ - "app_index": 1, - "key_index": 1, - }); - - const [ addr, key_reg, key_meta ] = await alice_deepkey.update_key({ - "key_revocation": { - "prior_key_registration": alice_key1a_reg_addr, - "revocation_authorization": [ - [ 0, await alice_deepkey.sign( alice_key1a_reg_addr ) ], - ], - }, - "key_generation": { - "new_key": await new_key.getAgent(), - "new_key_signing_of_author": await new_key.sign( alice_client.agent_id ), - }, - "derivation_details": { - ...derivation_details, - "derivation_seed": alice_key_store.seed, - "derivation_bytes": new_key.derivation_bytes, - }, - }); - log.normal("Key Registration (%s): %s", addr, json.debug(key_reg) ); - log.normal("Key Meta: %s", json.debug(key_meta) ); - log.normal("Key registration (update) addr: %s", addr ); - - alice_key1b = await new_key.getBytes(); - alice_key1b_reg = key_reg; - alice_key1b_reg_addr = addr; - - expect( key_meta.key_index ).to.equal( 1 ); - - { - const key_state = await alice_deepkey.key_state( alice_key1a ); - log.normal("Key (1a) state: %s", json.debug(key_state) ); - - expect( key_state ).to.have.key( "Invalid" ); - } - { - const key_state = await alice_deepkey.key_state( alice_key1b ); - log.normal("Key (1b) state: %s", json.debug(key_state) ); - - expect( key_state ).to.have.key( "Valid" ); - } + this.timeout( 5_000 ); + + const derivation_details = await alice_deepkey.next_derivation_details( alice_key1a ); + const { + app_index, + key_index, + } = derivation_details; + const path = `app/${app_index}/key/${key_index}`; + const new_key = await alice_key_store.createKey( path ); + + expect( derivation_details ).to.deep.equal({ + "app_index": 1, + "key_index": 1, + }); + + const [ addr, key_reg, key_meta ] = await alice_deepkey.update_key({ + "key_revocation": { + "prior_key_registration": alice_key1a_reg_addr, + "revocation_authorization": [ + [ 0, await alice_deepkey.sign( alice_key1a_reg_addr ) ], + ], + }, + "key_generation": { + "new_key": await new_key.getAgent(), + "new_key_signing_of_author": await new_key.sign( alice_client.agent_id ), + }, + "derivation_details": { + ...derivation_details, + "derivation_seed": alice_key_store.seed, + "derivation_bytes": new_key.derivation_bytes, + }, + }); + log.normal("Key Registration (%s): %s", addr, json.debug(key_reg) ); + log.normal("Key Meta: %s", json.debug(key_meta) ); + log.normal("Key registration (update) addr: %s", addr ); + + alice_key1b = await new_key.getBytes(); + alice_key1b_reg = key_reg; + alice_key1b_reg_addr = addr; + + expect( key_meta.key_index ).to.equal( 1 ); + + { + const key_state = await alice_deepkey.key_state( alice_key1a ); + log.normal("Key (1a) state: %s", json.debug(key_state) ); + + expect( key_state ).to.have.key( "Invalid" ); + } + { + const key_state = await alice_deepkey.key_state( alice_key1b ); + log.normal("Key (1b) state: %s", json.debug(key_state) ); + + expect( key_state ).to.have.key( "Valid" ); + } }); it("should query (alice) keyset keys (1)", async function () { - const keys = await alice_deepkey.query_apps_with_keys(); - log.normal("Keyset app keys: %s", json.debug(keys) ); + const keys = await alice_deepkey.query_apps_with_keys(); + log.normal("Keyset app keys: %s", json.debug(keys) ); - expect( keys ).to.have.length( 2 ); + expect( keys ).to.have.length( 2 ); }); it("should get (alice) KSR keys (1)", async function () { - const keys = await alice_deepkey.get_ksr_keys( ksr1_addr ); - log.normal("KSR keys: %s", json.debug(keys) ); + const keys = await alice_deepkey.get_ksr_keys( ksr1_addr ); + log.normal("KSR keys: %s", json.debug(keys) ); - expect( keys ).to.have.length( 2 ); + expect( keys ).to.have.length( 2 ); }); it("should query (alice) app bindings", async function () { - let app_bindings = await alice_deepkey.query_app_bindings(); - log.normal("App Bindings: %s", json.debug(app_bindings) ); + let app_bindings = await alice_deepkey.query_app_bindings(); + log.normal("App Bindings: %s", json.debug(app_bindings) ); - expect( app_bindings ).to.have.length( 2 ); + expect( app_bindings ).to.have.length( 2 ); }); it("should update key (alice)", async function () { - this.timeout( 5_000 ); - - const derivation_details = await alice_deepkey.next_derivation_details( alice_key1b ); - const { - app_index, - key_index, - } = derivation_details; - const path = `app/${app_index}/key/${key_index}`; - const new_key = await alice_key_store.createKey( path ); - - const [ addr, key_reg, key_meta ] = await alice_deepkey.update_key({ - "key_revocation": { - "prior_key_registration": alice_key1b_reg_addr, - "revocation_authorization": [ - [ 0, await alice_deepkey.sign( alice_key1b_reg_addr ) ], - ], - }, - "key_generation": { - "new_key": await new_key.getAgent(), - "new_key_signing_of_author": await new_key.sign( alice_client.agent_id ), - }, - "derivation_details": { - ...derivation_details, - "derivation_seed": alice_key_store.seed, - "derivation_bytes": new_key.derivation_bytes, - }, - }); - log.normal("Key Registration (%s): %s", addr, json.debug(key_reg) ); - log.normal("Key Meta: %s", json.debug(key_meta) ); - log.normal("Key registration (update) addr: %s", addr ); - - alice_key1c = await new_key.getBytes(); - alice_key1c_reg = key_reg; - alice_key1c_reg_addr = addr; + this.timeout( 5_000 ); + + const derivation_details = await alice_deepkey.next_derivation_details( alice_key1b ); + const { + app_index, + key_index, + } = derivation_details; + const path = `app/${app_index}/key/${key_index}`; + const new_key = await alice_key_store.createKey( path ); + + const [ addr, key_reg, key_meta ] = await alice_deepkey.update_key({ + "key_revocation": { + "prior_key_registration": alice_key1b_reg_addr, + "revocation_authorization": [ + [ 0, await alice_deepkey.sign( alice_key1b_reg_addr ) ], + ], + }, + "key_generation": { + "new_key": await new_key.getAgent(), + "new_key_signing_of_author": await new_key.sign( alice_client.agent_id ), + }, + "derivation_details": { + ...derivation_details, + "derivation_seed": alice_key_store.seed, + "derivation_bytes": new_key.derivation_bytes, + }, + }); + log.normal("Key Registration (%s): %s", addr, json.debug(key_reg) ); + log.normal("Key Meta: %s", json.debug(key_meta) ); + log.normal("Key registration (update) addr: %s", addr ); + + alice_key1c = await new_key.getBytes(); + alice_key1c_reg = key_reg; + alice_key1c_reg_addr = addr; }); it("should revoke key (alice)", async function () { - this.timeout( 5_000 ); - - const [ addr, key_reg ] = await alice_deepkey.revoke_key({ - "key_revocation": { - "prior_key_registration": alice_key1c_reg_addr, - "revocation_authorization": [ - [ 0, await alice_deepkey.sign( alice_key1c_reg_addr ) ], - ], - }, - }); - log.normal("Key Registration (%s): %s", addr, json.debug(key_reg) ); - log.normal("Key registration (update) addr: %s", addr ); - - alice_key1d_reg = key_reg; - alice_key1d_reg_addr = addr; - - { - const key_state = await alice_deepkey.key_state( alice_key1a ); - log.normal("Key (1a) state: %s", json.debug(key_state) ); - - expect( key_state ).to.have.key( "Invalid" ); - expect( key_state.Invalid ).to.not.be.null; - } - { - const key_state = await alice_deepkey.key_state( alice_key1b ); - log.normal("Key (1b) state: %s", json.debug(key_state) ); - - expect( key_state ).to.have.key( "Invalid" ); - expect( key_state.Invalid ).to.not.be.null; - } - { - const key_state = await alice_deepkey.key_state( alice_key1c ); - log.normal("Key (1c) state: %s", json.debug(key_state) ); - - expect( key_state ).to.have.key( "Invalid" ); - expect( key_state.Invalid ).to.not.be.null; - } + this.timeout( 5_000 ); + + const [ addr, key_reg ] = await alice_deepkey.revoke_key({ + "key_revocation": { + "prior_key_registration": alice_key1c_reg_addr, + "revocation_authorization": [ + [ 0, await alice_deepkey.sign( alice_key1c_reg_addr ) ], + ], + }, + }); + log.normal("Key Registration (%s): %s", addr, json.debug(key_reg) ); + log.normal("Key registration (update) addr: %s", addr ); + + alice_key1d_reg = key_reg; + alice_key1d_reg_addr = addr; + + { + const key_state = await alice_deepkey.key_state( alice_key1a ); + log.normal("Key (1a) state: %s", json.debug(key_state) ); + + expect( key_state ).to.have.key( "Invalid" ); + expect( key_state.Invalid ).to.not.be.null; + } + { + const key_state = await alice_deepkey.key_state( alice_key1b ); + log.normal("Key (1b) state: %s", json.debug(key_state) ); + + expect( key_state ).to.have.key( "Invalid" ); + expect( key_state.Invalid ).to.not.be.null; + } + { + const key_state = await alice_deepkey.key_state( alice_key1c ); + log.normal("Key (1c) state: %s", json.debug(key_state) ); + + expect( key_state ).to.have.key( "Invalid" ); + expect( key_state.Invalid ).to.not.be.null; + } }); it("should check key state before creation (alice)", async function () { - const timestamp = Date.now() - (60 * 60 * 1000); // 1 hour ago - const key_state = await alice_deepkey.key_state([ alice_key1a, timestamp ]); - log.normal("Key (1a) state @ %s: %s", timestamp, json.debug(key_state) ); + const timestamp = Date.now() - (60 * 60 * 1000); // 1 hour ago + const key_state = await alice_deepkey.key_state([ alice_key1a, timestamp ]); + log.normal("Key (1a) state @ %s: %s", timestamp, json.debug(key_state) ); - expect( key_state ).to.have.key( "Invalid" ); - expect( key_state.Invalid ).to.be.null; + expect( key_state ).to.have.key( "Invalid" ); + expect( key_state.Invalid ).to.be.null; }); it("should register another key", async function () { - this.timeout( 10_000 ); - - const derivation_details = await alice_deepkey.next_derivation_details(); - const { - app_index, - key_index, - } = derivation_details; - const path = `app/${app_index}/key/${key_index}`; - const new_key = await alice_key_store.createKey( path ); - - const [ addr, key_reg, key_meta ] = await alice_deepkey.create_key({ - "app_binding": { - "app_name": "Alice - App #2", - "installed_app_id": alice_app2_id, - "dna_hashes": [ dna1_hash ], - }, - "key_generation": { - "new_key": await new_key.getAgent(), - "new_key_signing_of_author": await new_key.sign( alice_client.agent_id ), - }, - "derivation_details": { - ...derivation_details, - "derivation_seed": alice_key_store.seed, - "derivation_bytes": new_key.derivation_bytes, - }, - }); - - alice_key2a = await new_key.getBytes(); - alice_key2a_reg = key_reg; - alice_key2a_reg_addr = addr; + this.timeout( 10_000 ); + + const derivation_details = await alice_deepkey.next_derivation_details(); + const { + app_index, + key_index, + } = derivation_details; + const path = `app/${app_index}/key/${key_index}`; + const new_key = await alice_key_store.createKey( path ); + + const [ addr, key_reg, key_meta ] = await alice_deepkey.create_key({ + "app_binding": { + "app_name": "Alice - App #2", + "installed_app_id": alice_app2_id, + "dna_hashes": [ dna1_hash ], + }, + "key_generation": { + "new_key": await new_key.getAgent(), + "new_key_signing_of_author": await new_key.sign( alice_client.agent_id ), + }, + "derivation_details": { + ...derivation_details, + "derivation_seed": alice_key_store.seed, + "derivation_bytes": new_key.derivation_bytes, + }, + }); + + alice_key2a = await new_key.getBytes(); + alice_key2a_reg = key_reg; + alice_key2a_reg_addr = addr; }); it("should register new key with the same app ID (alice)", async function () { - this.timeout( 5_000 ); - - const derivation_details = await alice_deepkey.next_derivation_details(); - const { - app_index, - key_index, - } = derivation_details; - const path = `app/${app_index}/key/${key_index}`; - const new_key = await alice_key_store.createKey( path ); - - const [ addr, key_reg, key_meta ] = await alice_deepkey.create_key({ - "app_binding": { - "app_name": "Alice - App #1", - "installed_app_id": alice_app1_id, - "dna_hashes": [ dna1_hash ], - }, - "key_generation": { - "new_key": await new_key.getAgent(), - "new_key_signing_of_author": await new_key.sign( alice_client.agent_id ), - }, - "derivation_details": { - ...derivation_details, - "derivation_seed": alice_key_store.seed, - "derivation_bytes": new_key.derivation_bytes, - }, - }); - log.normal("Key Registration (%s): %s", addr, json.debug(key_reg) ); - log.normal("Key Meta: %s", json.debug(key_meta) ); - log.normal("Key registration (create) addr: %s", addr ); + this.timeout( 5_000 ); + + const derivation_details = await alice_deepkey.next_derivation_details(); + const { + app_index, + key_index, + } = derivation_details; + const path = `app/${app_index}/key/${key_index}`; + const new_key = await alice_key_store.createKey( path ); + + const [ addr, key_reg, key_meta ] = await alice_deepkey.create_key({ + "app_binding": { + "app_name": "Alice - App #1", + "installed_app_id": alice_app1_id, + "dna_hashes": [ dna1_hash ], + }, + "key_generation": { + "new_key": await new_key.getAgent(), + "new_key_signing_of_author": await new_key.sign( alice_client.agent_id ), + }, + "derivation_details": { + ...derivation_details, + "derivation_seed": alice_key_store.seed, + "derivation_bytes": new_key.derivation_bytes, + }, + }); + log.normal("Key Registration (%s): %s", addr, json.debug(key_reg) ); + log.normal("Key Meta: %s", json.debug(key_meta) ); + log.normal("Key registration (create) addr: %s", addr ); }); it("should get derivation details for key 1b (alice)", async function () { - { - const derivation_details = await alice_deepkey.get_key_derivation_details( alice_client.agent_id.getHash() ); - - log.normal("Key (0a) derivation details: %s", json.debug(derivation_details) ); - - expect( derivation_details ).to.deep.equal({ - app_index: 0, - key_index: 0, - }); - } - { - const derivation_details = await alice_deepkey.get_key_derivation_details( alice_key1b ); - - log.normal("Key (1b) derivation details: %s", json.debug(derivation_details) ); - - expect( derivation_details ).to.deep.equal({ - app_index: 1, - key_index: 1, - }); - } - { - const derivation_details = await alice_deepkey.get_key_derivation_details( alice_key2a ); - - log.normal("Key (2a) derivation details: %s", json.debug(derivation_details) ); - - expect( derivation_details ).to.deep.equal({ - app_index: 2, - key_index: 0, - }); - } + { + const derivation_details = await alice_deepkey.get_key_derivation_details( alice_client.agent_id.getHash() ); + + log.normal("Key (0a) derivation details: %s", json.debug(derivation_details) ); + + expect( derivation_details ).to.deep.equal({ + app_index: 0, + key_index: 0, + }); + } + { + const derivation_details = await alice_deepkey.get_key_derivation_details( alice_key1b ); + + log.normal("Key (1b) derivation details: %s", json.debug(derivation_details) ); + + expect( derivation_details ).to.deep.equal({ + app_index: 1, + key_index: 1, + }); + } + { + const derivation_details = await alice_deepkey.get_key_derivation_details( alice_key2a ); + + log.normal("Key (2a) derivation details: %s", json.debug(derivation_details) ); + + expect( derivation_details ).to.deep.equal({ + app_index: 2, + key_index: 0, + }); + } }); it("should register unmanaged key (alice)", async function () { - this.timeout( 5_000 ); - - const new_key = await random_key(); - - const [ addr, key_reg, key_meta ] = await alice_deepkey.create_key({ - "app_binding": { - "app_name": "Alice - App #3", - "installed_app_id": alice_app3_id, - "dna_hashes": [ dna1_hash ], - }, - "key_generation": { - "new_key": await new_key.getAgent(), - "new_key_signing_of_author": await new_key.sign( alice_client.agent_id ), - }, - "create_only": true, - }); - log.normal("Key Registration (%s): %s", addr, json.debug(key_reg) ); - log.normal("Key Meta: %s", json.debug(key_meta) ); - log.normal("Key registration (create) addr: %s", addr ); - - alice_key3 = new_key; - alice_key3a = await new_key.getBytes(); - alice_key3a_reg = key_reg; - alice_key3a_reg_addr = addr; - - { - const key_state = await alice_deepkey.key_state( alice_key3a ); - log.normal("Key (3a) state: %s", json.debug(key_state) ); - - expect( key_state ).to.have.key( "Valid" ); - } + this.timeout( 5_000 ); + + const new_key = await random_key(); + + const [ addr, key_reg, key_meta ] = await alice_deepkey.create_key({ + "app_binding": { + "app_name": "Alice - App #3", + "installed_app_id": alice_app3_id, + "dna_hashes": [ dna1_hash ], + }, + "key_generation": { + "new_key": await new_key.getAgent(), + "new_key_signing_of_author": await new_key.sign( alice_client.agent_id ), + }, + "create_only": true, + }); + log.normal("Key Registration (%s): %s", addr, json.debug(key_reg) ); + log.normal("Key Meta: %s", json.debug(key_meta) ); + log.normal("Key registration (create) addr: %s", addr ); + + alice_key3 = new_key; + alice_key3a = await new_key.getBytes(); + alice_key3a_reg = key_reg; + alice_key3a_reg_addr = addr; + + { + const key_state = await alice_deepkey.key_state( alice_key3a ); + log.normal("Key (3a) state: %s", json.debug(key_state) ); + + expect( key_state ).to.have.key( "Valid" ); + } }); it("should query key lineage", async function () { - { - const lineage = await alice_deepkey.query_key_lineage( alice_key1a ); - log.normal("Key lineage: %s", json.debug(lineage) ); - - expect( lineage ).to.have.length( 3 ); - expect( lineage[0] ).to.deep.equal( alice_key1a ); - expect( lineage[1] ).to.deep.equal( alice_key1b ); - expect( lineage[2] ).to.deep.equal( alice_key1c ); - } - { - const lineage = await alice_deepkey.query_key_lineage( alice_key1b ); - log.normal("Key lineage: %s", json.debug(lineage) ); - - expect( lineage ).to.have.length( 3 ); - expect( lineage[0] ).to.deep.equal( alice_key1a ); - expect( lineage[1] ).to.deep.equal( alice_key1b ); - expect( lineage[2] ).to.deep.equal( alice_key1c ); - } - { - const lineage = await alice_deepkey.query_key_lineage( alice_key1c ); - log.normal("Key lineage: %s", json.debug(lineage) ); - - expect( lineage ).to.have.length( 3 ); - expect( lineage[0] ).to.deep.equal( alice_key1a ); - expect( lineage[1] ).to.deep.equal( alice_key1b ); - expect( lineage[2] ).to.deep.equal( alice_key1c ); - } + { + const lineage = await alice_deepkey.query_key_lineage( alice_key1a ); + log.normal("Key lineage: %s", json.debug(lineage) ); + + expect( lineage ).to.have.length( 3 ); + expect( lineage[0] ).to.deep.equal( alice_key1a ); + expect( lineage[1] ).to.deep.equal( alice_key1b ); + expect( lineage[2] ).to.deep.equal( alice_key1c ); + } + { + const lineage = await alice_deepkey.query_key_lineage( alice_key1b ); + log.normal("Key lineage: %s", json.debug(lineage) ); + + expect( lineage ).to.have.length( 3 ); + expect( lineage[0] ).to.deep.equal( alice_key1a ); + expect( lineage[1] ).to.deep.equal( alice_key1b ); + expect( lineage[2] ).to.deep.equal( alice_key1c ); + } + { + const lineage = await alice_deepkey.query_key_lineage( alice_key1c ); + log.normal("Key lineage: %s", json.debug(lineage) ); + + expect( lineage ).to.have.length( 3 ); + expect( lineage[0] ).to.deep.equal( alice_key1a ); + expect( lineage[1] ).to.deep.equal( alice_key1b ); + expect( lineage[2] ).to.deep.equal( alice_key1c ); + } }); it("should get key lineage", async function () { - { - const lineage = await alice_deepkey.get_key_lineage( alice_key1a ); - log.normal("Key lineage: %s", json.debug(lineage) ); - - expect( lineage ).to.have.length( 3 ); - expect( lineage[0] ).to.deep.equal( alice_key1a ); - expect( lineage[1] ).to.deep.equal( alice_key1b ); - expect( lineage[2] ).to.deep.equal( alice_key1c ); - } - { - const lineage = await alice_deepkey.get_key_lineage( alice_key1b ); - log.normal("Key lineage: %s", json.debug(lineage) ); - - expect( lineage ).to.have.length( 3 ); - expect( lineage[0] ).to.deep.equal( alice_key1a ); - expect( lineage[1] ).to.deep.equal( alice_key1b ); - expect( lineage[2] ).to.deep.equal( alice_key1c ); - } - { - const lineage = await alice_deepkey.get_key_lineage( alice_key1c ); - log.normal("Key lineage: %s", json.debug(lineage) ); - - expect( lineage ).to.have.length( 3 ); - expect( lineage[0] ).to.deep.equal( alice_key1a ); - expect( lineage[1] ).to.deep.equal( alice_key1b ); - expect( lineage[2] ).to.deep.equal( alice_key1c ); - } + { + const lineage = await alice_deepkey.get_key_lineage( alice_key1a ); + log.normal("Key lineage: %s", json.debug(lineage) ); + + expect( lineage ).to.have.length( 3 ); + expect( lineage[0] ).to.deep.equal( alice_key1a ); + expect( lineage[1] ).to.deep.equal( alice_key1b ); + expect( lineage[2] ).to.deep.equal( alice_key1c ); + } + { + const lineage = await alice_deepkey.get_key_lineage( alice_key1b ); + log.normal("Key lineage: %s", json.debug(lineage) ); + + expect( lineage ).to.have.length( 3 ); + expect( lineage[0] ).to.deep.equal( alice_key1a ); + expect( lineage[1] ).to.deep.equal( alice_key1b ); + expect( lineage[2] ).to.deep.equal( alice_key1c ); + } + { + const lineage = await alice_deepkey.get_key_lineage( alice_key1c ); + log.normal("Key lineage: %s", json.debug(lineage) ); + + expect( lineage ).to.have.length( 3 ); + expect( lineage[0] ).to.deep.equal( alice_key1a ); + expect( lineage[1] ).to.deep.equal( alice_key1b ); + expect( lineage[2] ).to.deep.equal( alice_key1c ); + } }); it("should check keys have the same lineage", async function () { - // Query - { - const same_lineage = await alice_deepkey.query_same_lineage([ - alice_key1a, - alice_key1c, - ]); - log.normal("Keys have the same lineage: %s", same_lineage ); - - expect( same_lineage ).to.be.true; - } - { - const same_lineage = await alice_deepkey.query_same_lineage([ - alice_key1a, - alice_key2a, - ]); - log.normal("Keys have the same lineage: %s", same_lineage ); - - expect( same_lineage ).to.be.false; - } - // Get - { - const same_lineage = await alice_deepkey.same_lineage([ - alice_key1a, - alice_key1c, - ]); - log.normal("Keys have the same lineage: %s", same_lineage ); - - expect( same_lineage ).to.be.true; - } - { - const same_lineage = await alice_deepkey.same_lineage([ - alice_key1a, - alice_key2a, - ]); - log.normal("Keys have the same lineage: %s", same_lineage ); - - expect( same_lineage ).to.be.false; - } + // Query + { + const same_lineage = await alice_deepkey.query_same_lineage([ + alice_key1a, + alice_key1c, + ]); + log.normal("Keys have the same lineage: %s", same_lineage ); + + expect( same_lineage ).to.be.true; + } + { + const same_lineage = await alice_deepkey.query_same_lineage([ + alice_key1a, + alice_key2a, + ]); + log.normal("Keys have the same lineage: %s", same_lineage ); + + expect( same_lineage ).to.be.false; + } + // Get + { + const same_lineage = await alice_deepkey.same_lineage([ + alice_key1a, + alice_key1c, + ]); + log.normal("Keys have the same lineage: %s", same_lineage ); + + expect( same_lineage ).to.be.true; + } + { + const same_lineage = await alice_deepkey.same_lineage([ + alice_key1a, + alice_key2a, + ]); + log.normal("Keys have the same lineage: %s", same_lineage ); + + expect( same_lineage ).to.be.false; + } }); linearSuite("Errors", function () { - it("should fail to register invalid key", async function () { - await expect_reject(async () => { - await alice_deepkey.create_key({ - "app_binding": { - "app_name": "?", - "installed_app_id": "?", - "dna_hashes": [ dna1_hash ], - }, - "key_generation": { - "new_key": new AgentPubKey( crypto.randomBytes( 32 ) ), - "new_key_signing_of_author": crypto.randomBytes( 64 ), - }, - }); - }, "Signature does not match new key" ); - }); - - it("should fail to manage CreateOnly key", async function () { - this.timeout( 10_000 ); - - await expect_reject(async () => { - await alice_deepkey.revoke_key({ - "key_revocation": { - "prior_key_registration": alice_key3a_reg_addr, - "revocation_authorization": [ - [ 0, await alice_key3.sign( alice_key3a_reg_addr ) ], - ], - }, - }); - }, "cannot be updated" ); - }); - - it("should fail to revoke key", async function () { - this.timeout( 10_000 ); - - await expect_reject(async () => { - await alice_deepkey.revoke_key({ - "key_revocation": { - "prior_key_registration": alice_key2a_reg_addr, - "revocation_authorization": [ - [ 0, crypto.randomBytes(64) ], - ], - }, - }); - }, "Authorization has invalid signature" ); - }); - - it("should fail to revoke key that belongs to another KSR", async function () { - this.timeout( 10_000 ); - - await expect_reject(async () => { - await bobby_deepkey.delete_key_registration([ - alice_key2a_reg_addr, - { - "prior_key_registration": alice_key2a_reg_addr, - "revocation_authorization": [ - [ 0, await alice_deepkey.sign( alice_key2a_reg_addr ) ], - ], - }, - ]); - }, "cannot revoke key registered by another author" ); - }); - - it("should fail to duplicate a revoke", async function () { - this.timeout( 10_000 ); - - await expect_reject(async () => { - await alice_deepkey.revoke_key({ - "key_revocation": { - "prior_key_registration": alice_key1c_reg_addr, - "revocation_authorization": [ - [ 0, await alice_deepkey.sign( alice_key1c_reg_addr ) ], - ], - }, - }); - }, "already a KeyRegistration" ); - }); + it("should fail to register invalid key", async function () { + await expect_reject(async () => { + await alice_deepkey.create_key({ + "app_binding": { + "app_name": "?", + "installed_app_id": "?", + "dna_hashes": [ dna1_hash ], + }, + "key_generation": { + "new_key": new AgentPubKey( crypto.randomBytes( 32 ) ), + "new_key_signing_of_author": crypto.randomBytes( 64 ), + }, + }); + }, "Signature does not match new key" ); + }); + + it("should fail to manage CreateOnly key", async function () { + this.timeout( 10_000 ); + + await expect_reject(async () => { + await alice_deepkey.revoke_key({ + "key_revocation": { + "prior_key_registration": alice_key3a_reg_addr, + "revocation_authorization": [ + [ 0, await alice_key3.sign( alice_key3a_reg_addr ) ], + ], + }, + }); + }, "cannot be updated" ); + }); + + it("should fail to revoke key", async function () { + this.timeout( 10_000 ); + + await expect_reject(async () => { + await alice_deepkey.revoke_key({ + "key_revocation": { + "prior_key_registration": alice_key2a_reg_addr, + "revocation_authorization": [ + [ 0, crypto.randomBytes(64) ], + ], + }, + }); + }, "Authorization has invalid signature" ); + }); + + it("should fail to revoke key that belongs to another KSR", async function () { + this.timeout( 10_000 ); + + await expect_reject(async () => { + await bobby_deepkey.delete_key_registration([ + alice_key2a_reg_addr, + { + "prior_key_registration": alice_key2a_reg_addr, + "revocation_authorization": [ + [ 0, await alice_deepkey.sign( alice_key2a_reg_addr ) ], + ], + }, + ]); + }, "cannot revoke key registered by another author" ); + }); + + it("should fail to duplicate a revoke", async function () { + this.timeout( 10_000 ); + + await expect_reject(async () => { + await alice_deepkey.revoke_key({ + "key_revocation": { + "prior_key_registration": alice_key1c_reg_addr, + "revocation_authorization": [ + [ 0, await alice_deepkey.sign( alice_key1c_reg_addr ) ], + ], + }, + }); + }, "already a KeyRegistration" ); + }); }); after(async function () { - await client.close(); + await client.close(); }); } diff --git a/tests/key_store.js b/tests/key_store.js index 379c164..de61f5b 100644 --- a/tests/key_store.js +++ b/tests/key_store.js @@ -1,97 +1,97 @@ -import { Logger } from '@whi/weblogger'; -const log = new Logger("key-store", process.env.LOG_LEVEL ); +import { Logger } from '@whi/weblogger'; +const log = new Logger("key-store", process.env.LOG_LEVEL ); -import crypto from 'crypto'; -import * as ed from '@noble/ed25519'; -import { hmac } from '@noble/hashes/hmac'; -import { sha256 } from '@noble/hashes/sha256'; +import crypto from 'crypto'; +import * as ed from '@noble/ed25519'; +import { hmac } from '@noble/hashes/hmac'; +import { sha256 } from '@noble/hashes/sha256'; import { AgentPubKey, -} from '@spartan-hc/holo-hash'; +} from '@spartan-hc/holo-hash'; export class KeyStore { - #device_seed = null; - #name = Buffer.from( crypto.randomBytes( 12 ) ).toString("hex"); - #keys = {}; + #device_seed = null; + #name = Buffer.from( crypto.randomBytes( 12 ) ).toString("hex"); + #keys = {}; constructor ( device_seed, name ) { - this.#device_seed = Buffer.from( device_seed ).toString("hex"); + this.#device_seed = Buffer.from( device_seed ).toString("hex"); - if ( name ) - this.#name = name; + if ( name ) + this.#name = name; } get name () { - return this.#name; + return this.#name; } get seed () { - return this.#device_seed; + return this.#device_seed; } async createKey ( path ) { - if ( typeof path !== "string" ) - throw new TypeError(`Path must be a string; not type '${typeof path}'`); + if ( typeof path !== "string" ) + throw new TypeError(`Path must be a string; not type '${typeof path}'`); - const secret = hmac( sha256, this.#device_seed, path ); - const key = new Key( secret, Buffer.from(path, "utf8") ) - const agent = await key.getAgent(); + const secret = hmac( sha256, this.#device_seed, path ); + const key = new Key( secret, Buffer.from(path, "utf8") ) + const agent = await key.getAgent(); - log.normal("[%s] Created key from derivation path '%s': (agent) %s", this.name, path, agent ); - this.#keys[agent] = key; + log.normal("[%s] Created key from derivation path '%s': (agent) %s", this.name, path, agent ); + this.#keys[agent] = key; - return key; + return key; } getKey ( agent ) { - return this.#keys[ new AgentPubKey( agent ) ]; + return this.#keys[ new AgentPubKey( agent ) ]; } } export class Key { - #secret = null; - #bytes = null; - #derivation_bytes = null; + #secret = null; + #bytes = null; + #derivation_bytes = null; constructor ( secret, derivation_bytes ) { - if ( !(secret instanceof Uint8Array) ) - throw new TypeError(`Secret must be a Uint8Array; not type '${secret?.constructor?.name || typeof secret}'`); - if ( secret.length !== 32 ) - throw new Error(`Secret must 32 bytes; not length ${secret.length}`); + if ( !(secret instanceof Uint8Array) ) + throw new TypeError(`Secret must be a Uint8Array; not type '${secret?.constructor?.name || typeof secret}'`); + if ( secret.length !== 32 ) + throw new Error(`Secret must 32 bytes; not length ${secret.length}`); - this.#secret = secret; - this.#derivation_bytes = derivation_bytes; + this.#secret = secret; + this.#derivation_bytes = derivation_bytes; } get derivation_bytes () { - return this.#derivation_bytes; + return this.#derivation_bytes; } async getBytes () { - if ( this.#bytes === null ) - this.#bytes = await ed.getPublicKeyAsync( this.#secret ); + if ( this.#bytes === null ) + this.#bytes = await ed.getPublicKeyAsync( this.#secret ); - return new Uint8Array( this.#bytes ); + return new Uint8Array( this.#bytes ); } async getAgent () { - return new AgentPubKey( await this.getBytes() ); + return new AgentPubKey( await this.getBytes() ); } async sign ( bytes ) { - if ( !(bytes instanceof Uint8Array) ) - throw new TypeError(`Key signing expects a Uint8Array; not type '${bytes?.constructor?.name || typeof bytes}'`); + if ( !(bytes instanceof Uint8Array) ) + throw new TypeError(`Key signing expects a Uint8Array; not type '${bytes?.constructor?.name || typeof bytes}'`); - return await ed.signAsync( bytes, this.#secret ); + return await ed.signAsync( bytes, this.#secret ); } } export function random_key () { - const secret = ed.utils.randomPrivateKey(); + const secret = ed.utils.randomPrivateKey(); return new Key( secret ); } diff --git a/tests/utils.js b/tests/utils.js index 3eddeb8..2df4500 100644 --- a/tests/utils.js +++ b/tests/utils.js @@ -1,29 +1,29 @@ -import { expect } from 'chai'; +import { expect } from 'chai'; export async function expect_reject ( cb, error, message ) { - let failed = false; + let failed = false; try { - await cb(); + await cb(); } catch (err) { - failed = true; - expect( () => { throw err } ).to.throw( error, message ); + failed = true; + expect( () => { throw err } ).to.throw( error, message ); } - expect( failed ).to.be.true; + expect( failed ).to.be.true; } export function linearSuite ( name, setup_fn, args_fn ) { describe( name, function () { - beforeEach(function () { - let parent_suite = this.currentTest.parent; - if ( parent_suite.tests.some(test => test.state === "failed") ) - this.skip(); - if ( parent_suite.parent?.tests.some(test => test.state === "failed") ) - this.skip(); - }); - setup_fn.call( this, args_fn ); + beforeEach(function () { + let parent_suite = this.currentTest.parent; + if ( parent_suite.tests.some(test => test.state === "failed") ) + this.skip(); + if ( parent_suite.parent?.tests.some(test => test.state === "failed") ) + this.skip(); + }); + setup_fn.call( this, args_fn ); }); } From 84454dd72238b4aa898a62a025149951d347a512 Mon Sep 17 00:00:00 2001 From: Matthew Brisebois Date: Wed, 24 Jul 2024 15:24:39 -0600 Subject: [PATCH 02/10] Update for Holochain v0.4.0-dev.7 --- Cargo.lock | 32 ++--- Cargo.toml | 8 +- Makefile | 4 +- dnas/deepkey/sdk/Cargo.toml | 2 +- dnas/deepkey/types/Cargo.toml | 6 +- flake.lock | 256 ++++++++-------------------------- flake.nix | 37 ++--- package-lock.json | 179 ++++++++++++++++++------ package.json | 4 +- 9 files changed, 234 insertions(+), 294 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 2a0a3bc..78c466d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -961,9 +961,9 @@ dependencies = [ [[package]] name = "hdi" -version = "0.5.0-dev.1" +version = "0.5.0-dev.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "367fb15bb6f1bf07c73dd3da85830a2fe2a37de5eceac5a0450e241222b0d9be" +checksum = "ff15f519955feed397b6c1b79ce0b2062dab2f67b626d8e46c76a7f9de694e63" dependencies = [ "getrandom", "hdk_derive", @@ -979,9 +979,9 @@ dependencies = [ [[package]] name = "hdk" -version = "0.4.0-dev.1" +version = "0.4.0-dev.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08966c37dccd8a205b22799f6143b25455378a7ac8b8af0a8826c6f2dc5c0070" +checksum = "d3e4a4ac76aadc261e2a513f8ffb345504a7d667d3a02f65f349b801c4aaa33e" dependencies = [ "getrandom", "hdi", @@ -999,9 +999,9 @@ dependencies = [ [[package]] name = "hdk_derive" -version = "0.4.0-dev.1" +version = "0.4.0-dev.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d73ba220510d0b83c0fe717d20b763f343229d0e59b248796f7a8ae94bb0b69" +checksum = "f6adaaddb9883624c159cd89049f545f065b9c5eaf46172a1f42f35fa88f6a98" dependencies = [ "darling 0.14.4", "heck 0.5.0", @@ -1033,9 +1033,9 @@ checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" [[package]] name = "holo_hash" -version = "0.4.0-dev.1" +version = "0.4.0-dev.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "439389b876b16eeddb280e4daf68002c8792103e40ed332bb9bef6a898f7a367" +checksum = "80b84303db38ecc1c5a3b5334b3da34201cf04dc231b37e7fda01e418e160089" dependencies = [ "arbitrary", "base64", @@ -1063,9 +1063,9 @@ dependencies = [ [[package]] name = "holochain_integrity_types" -version = "0.4.0-dev.1" +version = "0.4.0-dev.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c204c0e9f64f0c04e4980df7049e99dac459311d81298f352e1e2e38946ecf8" +checksum = "c41780c1d157026b8730e45877960238a976f72bef3d832d14d2d6dc24716187" dependencies = [ "arbitrary", "holo_hash", @@ -1147,9 +1147,9 @@ dependencies = [ [[package]] name = "holochain_wasmer_common" -version = "0.0.93" +version = "0.0.94" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e77c4d54b5bf86dfa0266588d43fc913b0442799f34c8fc04b0e8eda0260bd4" +checksum = "c9f7d17668e4a4997b5e121c7a951ea9606331ef206b991f1e81420c84d98485" dependencies = [ "holochain_serialized_bytes", "serde", @@ -1161,9 +1161,9 @@ dependencies = [ [[package]] name = "holochain_wasmer_guest" -version = "0.0.93" +version = "0.0.94" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10fcb10d7d455c5222a13b2343e2a438bcbbf3f97ef79f16c9e01203f6616dd0" +checksum = "e292e12fda0716ce36b566c7cf3dad8443fdc7c56950e42c5a3ba81988e792d0" dependencies = [ "holochain_serialized_bytes", "holochain_wasmer_common", @@ -1175,9 +1175,9 @@ dependencies = [ [[package]] name = "holochain_zome_types" -version = "0.4.0-dev.1" +version = "0.4.0-dev.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ab039f61375d1aa5b33de73971ae176775040e8aad8f65ec72cf274ce50b178" +checksum = "2afa8b7ee86e8f1c6c91e74a462cefc0cba5ef12cb84d39ed24ed9dfa27743cb" dependencies = [ "derive_more", "holo_hash", diff --git a/Cargo.toml b/Cargo.toml index 7167359..98eafad 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -19,10 +19,10 @@ rmp-serde = "1" serde_bytes = "0.11" hc_deepkey_types = { version = "0.8.0-dev.1", path = "dnas/deepkey/types" } hc_deepkey_sdk = { version = "0.7.0-dev.1", path = "dnas/deepkey/sdk" } -holo_hash = { version = "=0.4.0-dev.1", features = ["hashing", "encoding"] } -holochain_integrity_types = { version = "=0.4.0-dev.1" } -hdi = { version = "=0.5.0-dev.1" } -hdk = { version = "=0.4.0-dev.1" } +holo_hash = { version = "=0.4.0-dev.5", features = ["hashing", "encoding"] } +holochain_integrity_types = { version = "=0.4.0-dev.5" } +hdi = { version = "=0.5.0-dev.5" } +hdk = { version = "=0.4.0-dev.6" } whi_hdi_extensions = { version = "0.9" } # whi_hdi_extensions = { path = "../whi_hdi_extensions" } whi_hdk_extensions = { version = "0.9" } diff --git a/Makefile b/Makefile index a05b863..8aaf4f5 100644 --- a/Makefile +++ b/Makefile @@ -63,9 +63,9 @@ GG_REPLACE_LOCATIONS = ':(exclude)*.lock' zomes/ dnas/ tests/ # git grep -l 'dna_binding' -- $(GG_REPLACE_LOCATIONS) | xargs sed -i 's|dna_binding|app_binding|g' npm-reinstall-local: - cd tests; npm uninstall $(NPM_PACKAGE); npm i --save $(LOCAL_PATH) + cd tests; npm uninstall $(NPM_PACKAGE); npm i --save-dev $(LOCAL_PATH) npm-reinstall-public: - cd tests; npm uninstall $(NPM_PACKAGE); npm i --save $(NPM_PACKAGE) + cd tests; npm uninstall $(NPM_PACKAGE); npm i --save-dev $(NPM_PACKAGE) npm-use-app-interface-client-public: npm-use-app-interface-client-local: diff --git a/dnas/deepkey/sdk/Cargo.toml b/dnas/deepkey/sdk/Cargo.toml index a41e3de..58e11eb 100644 --- a/dnas/deepkey/sdk/Cargo.toml +++ b/dnas/deepkey/sdk/Cargo.toml @@ -14,7 +14,7 @@ crate-type = ["cdylib", "rlib"] [dependencies] hc_deepkey_types = { version = "0.8.0-dev.1", path = "../types" } -hdk = "=0.4.0-dev.1" +hdk = "=0.4.0-dev.6" serde = "1" serde_bytes = "0.11" diff --git a/dnas/deepkey/types/Cargo.toml b/dnas/deepkey/types/Cargo.toml index 72572db..84ae5c7 100644 --- a/dnas/deepkey/types/Cargo.toml +++ b/dnas/deepkey/types/Cargo.toml @@ -13,9 +13,9 @@ name = "deepkey_types" crate-type = ["cdylib", "rlib"] [dependencies] -hdi = "=0.5.0-dev.1" -holo_hash = { version = "=0.4.0-dev.1", features = ["hashing", "encoding"] } -holochain_integrity_types = "=0.4.0-dev.1" +hdi = "=0.5.0-dev.5" +holo_hash = { version = "=0.4.0-dev.5", features = ["hashing", "encoding"] } +holochain_integrity_types = "=0.4.0-dev.5" rmpv = { version = "1", features = ["with-serde"] } serde = "1" diff --git a/flake.lock b/flake.lock index b6645c2..ac416c9 100644 --- a/flake.lock +++ b/flake.lock @@ -3,11 +3,11 @@ "cargo-chef": { "flake": false, "locked": { - "lastModified": 1695999026, - "narHash": "sha256-UtLoZd7YBRSF9uXStfC3geEFqSqZXFh1rLHaP8hre0Y=", + "lastModified": 1716357509, + "narHash": "sha256-7iSxwTaJnDLqaFu4ydxkx7ivhDvSQQcXWKawv/e4NHE=", "owner": "LukeMathWalker", "repo": "cargo-chef", - "rev": "6e96ae5cd023b718ae40d608981e50a6e7d7facf", + "rev": "b468537839bfc7c23d744b85d7a5090954626550", "type": "github" }, "original": { @@ -42,11 +42,11 @@ ] }, "locked": { - "lastModified": 1707363936, - "narHash": "sha256-QbqyvGFYt84QNOQLOOTWplZZkzkyDhYrAl/N/9H0vFM=", + "lastModified": 1721322122, + "narHash": "sha256-a0G1NvyXGzdwgu6e1HQpmK5R5yLsfxeBe07nNDyYd+g=", "owner": "ipetkov", "repo": "crane", - "rev": "9107434eda6991e9388ad87b815dafa337446d16", + "rev": "8a68b987c476a33e90f203f0927614a75c3f47ea", "type": "github" }, "original": { @@ -58,11 +58,11 @@ "crate2nix": { "flake": false, "locked": { - "lastModified": 1706909251, - "narHash": "sha256-T7G9Uhh77P0kKri/u+Mwa/4YnXwdPsJSwYCiJCCW+fs=", + "lastModified": 1719760654, + "narHash": "sha256-L3VIJ9182wsYJqP27xO5qiWwfK+a00x0JHiy8ns3NQE=", "owner": "kolloch", "repo": "crate2nix", - "rev": "15656bb6cb15f55ee3344bf4362e6489feb93db6", + "rev": "a6ca1e58132bab26fc08572f22a34bbb86f4d91d", "type": "github" }, "original": { @@ -108,11 +108,11 @@ "nixpkgs-lib": "nixpkgs-lib" }, "locked": { - "lastModified": 1706830856, - "narHash": "sha256-a0NYyp+h9hlb7ddVz4LUn1vT/PLwqfrWYcHMvFB1xYg=", + "lastModified": 1719994518, + "narHash": "sha256-pQMhCCHyQGRzdfAkdJ4cIWiw+JNuWsTX7f0ZYSyz0VY=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "b253292d9c0a5ead9bc98c4e9a26c6312e27d69f", + "rev": "9227223f6d922fee3c7b190b2cc238a99527bbb7", "type": "github" }, "original": { @@ -120,37 +120,19 @@ "type": "indirect" } }, - "flake-utils": { - "inputs": { - "systems": "systems" - }, - "locked": { - "lastModified": 1705309234, - "narHash": "sha256-uNRRNRKmJyCRC/8y1RqBkqWBLM034y4qN7EprSdmgyA=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "1ef2e671c3b0c19053962c07dbda38332dcebf26", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, "holochain": { "flake": false, "locked": { - "lastModified": 1714578487, - "narHash": "sha256-R0nmeZEEkHBCPmLiuWpx54qjGrrbay4b0QxxIJXsn2o=", + "lastModified": 1717619254, + "narHash": "sha256-iuhK1TA9tF5r3tfBfiwT1ruBMW8QAKfgZn7CIXWZs4w=", "owner": "holochain", "repo": "holochain", - "rev": "f64ad12ccb5e3c872f5588a32437f03fef0b154b", + "rev": "2ce54138e975104b7f6ea0d7c802265a34a2bf1b", "type": "github" }, "original": { "owner": "holochain", - "ref": "holochain-0.4.0-dev.1", + "ref": "holochain-0.4.0-dev.7", "repo": "holochain", "type": "github" } @@ -182,11 +164,11 @@ "versions": "versions" }, "locked": { - "lastModified": 1713450396, - "narHash": "sha256-e+QXL3bXdHeJ+wscK2o5veHbvQzGAyyWOH4Je+6VJRw=", + "lastModified": 1721413603, + "narHash": "sha256-LrSUS7RQ4NiWTlaZ3QR8gdcOUdT+vfPcZVkOfG73tPM=", "owner": "holochain", "repo": "holochain", - "rev": "7f83e2ca811dea2abd2865079e44bfe211431163", + "rev": "d36925c84609a36303c3b6439d03d07c46e71078", "type": "github" }, "original": { @@ -195,59 +177,19 @@ "type": "github" } }, - "holochain-nix-versions": { - "inputs": { - "holochain": "holochain_3", - "lair": "lair_3", - "launcher": "launcher_2", - "scaffolding": "scaffolding_2" - }, - "locked": { - "dir": "versions/0_2", - "lastModified": 1713450396, - "narHash": "sha256-e+QXL3bXdHeJ+wscK2o5veHbvQzGAyyWOH4Je+6VJRw=", - "owner": "holochain", - "repo": "holochain", - "rev": "7f83e2ca811dea2abd2865079e44bfe211431163", - "type": "github" - }, - "original": { - "dir": "versions/0_2", - "owner": "holochain", - "repo": "holochain", - "type": "github" - } - }, "holochain_2": { "flake": false, "locked": { - "lastModified": 1707245081, - "narHash": "sha256-l9WHMlD9IDuEv/N/3WDCsP3XLUUnZFrOBEZjbWnC+/Y=", - "owner": "holochain", - "repo": "holochain", - "rev": "0a3b2408b2d6482b913b9f0faf58a39b567f763a", - "type": "github" - }, - "original": { - "owner": "holochain", - "ref": "holochain-0.2.6", - "repo": "holochain", - "type": "github" - } - }, - "holochain_3": { - "flake": false, - "locked": { - "lastModified": 1712666843, - "narHash": "sha256-GN2RNMWtJ7L+zYyz7pZ5zuhsd6MFs0/ojPlhxrOChzQ=", + "lastModified": 1718142789, + "narHash": "sha256-Lam1hWLqi+zv0umdTIIHK9YKHVWQrI/Z4AySo97xK9E=", "owner": "holochain", "repo": "holochain", - "rev": "6a83dfe77ef5710dc3cee724048972b68bf6c2c4", + "rev": "582f05b66b690448b1574d1aa6004114ff98187f", "type": "github" }, "original": { "owner": "holochain", - "ref": "holochain-0.2.7", + "ref": "holochain-0.3.1", "repo": "holochain", "type": "github" } @@ -272,33 +214,16 @@ "lair_2": { "flake": false, "locked": { - "lastModified": 1706550351, - "narHash": "sha256-psVjtb+zj0pZnHTj1xNP2pGBd5Ua1cSwdOAdYdUe3yQ=", - "owner": "holochain", - "repo": "lair", - "rev": "b11e65eff11c8ac3bf938607946f5c7201298a65", - "type": "github" - }, - "original": { - "owner": "holochain", - "ref": "lair_keystore-v0.4.2", - "repo": "lair", - "type": "github" - } - }, - "lair_3": { - "flake": false, - "locked": { - "lastModified": 1706550351, - "narHash": "sha256-psVjtb+zj0pZnHTj1xNP2pGBd5Ua1cSwdOAdYdUe3yQ=", + "lastModified": 1709335027, + "narHash": "sha256-rKMhh7TLuR1lqze2YFWZCGYKZQoB4dZxjpX3sb7r7Jk=", "owner": "holochain", "repo": "lair", - "rev": "b11e65eff11c8ac3bf938607946f5c7201298a65", + "rev": "826be915efc839d1d1b8a2156b158999b8de8d5b", "type": "github" }, "original": { "owner": "holochain", - "ref": "lair_keystore-v0.4.2", + "ref": "lair_keystore-v0.4.4", "repo": "lair", "type": "github" } @@ -306,44 +231,27 @@ "launcher": { "flake": false, "locked": { - "lastModified": 1684183666, - "narHash": "sha256-rOE/W/BBYyZKOyypKb8X9Vpc4ty1TNRoI/fV5+01JPw=", + "lastModified": 1717431387, + "narHash": "sha256-+VvWwBmxcgePV1L6kU2mSkg3emMiMgpdQnCqvQJkRPk=", "owner": "holochain", - "repo": "launcher", - "rev": "75ecdd0aa191ed830cc209a984a6030e656042ff", + "repo": "hc-launch", + "rev": "9d9cab5e6b57e1c278113921ff203e515c8bbd2e", "type": "github" }, "original": { "owner": "holochain", - "ref": "holochain-0.2", - "repo": "launcher", - "type": "github" - } - }, - "launcher_2": { - "flake": false, - "locked": { - "lastModified": 1684183666, - "narHash": "sha256-rOE/W/BBYyZKOyypKb8X9Vpc4ty1TNRoI/fV5+01JPw=", - "owner": "holochain", - "repo": "launcher", - "rev": "75ecdd0aa191ed830cc209a984a6030e656042ff", - "type": "github" - }, - "original": { - "owner": "holochain", - "ref": "holochain-0.2", - "repo": "launcher", + "ref": "holochain-0.3", + "repo": "hc-launch", "type": "github" } }, "nix-filter": { "locked": { - "lastModified": 1705332318, - "narHash": "sha256-kcw1yFeJe9N4PjQji9ZeX47jg0p9A0DuU4djKvg1a7I=", + "lastModified": 1710156097, + "narHash": "sha256-1Wvk8UP7PXdf8bCCaEoMnOT1qe5/Duqgj+rL8sRQsSM=", "owner": "numtide", "repo": "nix-filter", - "rev": "3449dc925982ad46246cfc36469baf66e1b64f17", + "rev": "3342559a24e85fc164b295c3444e8a139924675b", "type": "github" }, "original": { @@ -354,11 +262,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1713248628, - "narHash": "sha256-NLznXB5AOnniUtZsyy/aPWOk8ussTuePp2acb9U+ISA=", + "lastModified": 1721138476, + "narHash": "sha256-+W5eZOhhemLQxelojLxETfbFbc19NWawsXBlapYpqIA=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "5672bc9dbf9d88246ddab5ac454e82318d094bb8", + "rev": "ad0b5eed1b6031efaed382844806550c3dcb4206", "type": "github" }, "original": { @@ -369,30 +277,24 @@ }, "nixpkgs-lib": { "locked": { - "dir": "lib", - "lastModified": 1706550542, - "narHash": "sha256-UcsnCG6wx++23yeER4Hg18CXWbgNpqNXcHIo5/1Y+hc=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "97b17f32362e475016f942bbdfda4a4a72a8a652", - "type": "github" + "lastModified": 1719876945, + "narHash": "sha256-Fm2rDDs86sHy0/1jxTOKB1118Q0O3Uc7EC0iXvXKpbI=", + "type": "tarball", + "url": "https://github.com/NixOS/nixpkgs/archive/5daf0514482af3f97abaefc78a6606365c9108e2.tar.gz" }, "original": { - "dir": "lib", - "owner": "NixOS", - "ref": "nixos-unstable", - "repo": "nixpkgs", - "type": "github" + "type": "tarball", + "url": "https://github.com/NixOS/nixpkgs/archive/5daf0514482af3f97abaefc78a6606365c9108e2.tar.gz" } }, "pre-commit-hooks-nix": { "flake": false, "locked": { - "lastModified": 1707297608, - "narHash": "sha256-ADjo/5VySGlvtCW3qR+vdFF4xM9kJFlRDqcC9ZGI8EA=", + "lastModified": 1721042469, + "narHash": "sha256-6FPUl7HVtvRHCCBQne7Ylp4p+dpP3P/OYuzjztZ4s70=", "owner": "cachix", "repo": "pre-commit-hooks.nix", - "rev": "0db2e67ee49910adfa13010e7f012149660af7f0", + "rev": "f451c19376071a90d8c58ab1a953c6e9840527fd", "type": "github" }, "original": { @@ -415,12 +317,7 @@ }, "root": { "inputs": { - "flake-parts": [ - "holochain-flake", - "flake-parts" - ], "holochain-flake": "holochain-flake", - "holochain-nix-versions": "holochain-nix-versions", "nixpkgs": [ "holochain-flake", "nixpkgs" @@ -429,18 +326,17 @@ }, "rust-overlay": { "inputs": { - "flake-utils": "flake-utils", "nixpkgs": [ "holochain-flake", "nixpkgs" ] }, "locked": { - "lastModified": 1713406362, - "narHash": "sha256-85f70DM03RWqzahxXChSWcbnUYAKYBDBvyQ4P+kXVBk=", + "lastModified": 1721355572, + "narHash": "sha256-I4TQ2guV9jTmZsXeWt5HMojcaqNZHII4zu0xIKZEovM=", "owner": "oxalica", "repo": "rust-overlay", - "rev": "05a4f1b28ee59f589c8a0ad877741de3c3bf894d", + "rev": "d5bc7b1b21cf937fb8ff108ae006f6776bdb163d", "type": "github" }, "original": { @@ -452,52 +348,20 @@ "scaffolding": { "flake": false, "locked": { - "lastModified": 1708376918, - "narHash": "sha256-zjjAmu8t566/PUxo2g0EFZ4GAdUu/UbkGA8hsVbFEoQ=", - "owner": "holochain", - "repo": "scaffolding", - "rev": "ddb8b5a950e7be81d704000e662564696bef5d6b", - "type": "github" - }, - "original": { - "owner": "holochain", - "ref": "holochain-0.2", - "repo": "scaffolding", - "type": "github" - } - }, - "scaffolding_2": { - "flake": false, - "locked": { - "lastModified": 1712668734, - "narHash": "sha256-XE+zErQBAu7UxSGCrYMHa3YDiuB+dqSEVyuLP/dDO9E=", + "lastModified": 1721322247, + "narHash": "sha256-HtYc28vwS2+YzgE5ZHq+U9vg0W1/mvFblGkLUhMx5wA=", "owner": "holochain", "repo": "scaffolding", - "rev": "8c1631200b6168d8e14fdfefb453762ae8feb14c", + "rev": "fa5f502eed7fe4438105e0cca6c22f8eed999c52", "type": "github" }, "original": { "owner": "holochain", - "ref": "holochain-0.2", + "ref": "holochain-0.3", "repo": "scaffolding", "type": "github" } }, - "systems": { - "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", - "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default", - "type": "github" - } - }, "versions": { "inputs": { "holochain": "holochain_2", @@ -506,16 +370,16 @@ "scaffolding": "scaffolding" }, "locked": { - "dir": "versions/0_2", - "lastModified": 1708423819, - "narHash": "sha256-/Z0Yg+raaBqlYvH4W7wOrcUrtTUeJXXhLx1DEoGL9SM=", + "dir": "versions/0_3", + "lastModified": 1721403618, + "narHash": "sha256-SO9MOHuuuQE5PXnCngwbWB0M47QH8rN7GHWVUWnHx80=", "owner": "holochain", "repo": "holochain", - "rev": "58df5bebca1564f3b4c340326aeaf4d5df7e3c39", + "rev": "cfacdd7dace3b78b47daecd69e7d3249d154f1d6", "type": "github" }, "original": { - "dir": "versions/0_2", + "dir": "versions/0_3", "owner": "holochain", "repo": "holochain", "type": "github" diff --git a/flake.nix b/flake.nix index 4ca9284..63d081d 100644 --- a/flake.nix +++ b/flake.nix @@ -3,36 +3,25 @@ inputs = { nixpkgs.follows = "holochain-flake/nixpkgs"; - flake-parts.follows = "holochain-flake/flake-parts"; - holochain-nix-versions.url = "github:holochain/holochain/?dir=versions/0_2"; - holochain-flake = { url = "github:holochain/holochain"; - inputs.holochain.url = "github:holochain/holochain/holochain-0.4.0-dev.1"; + inputs.holochain.url = "github:holochain/holochain/holochain-0.4.0-dev.7"; inputs.lair.url = "github:holochain/lair/lair_keystore-v0.4.4"; }; }; outputs = inputs @ { ... }: - inputs.holochain-flake.inputs.flake-parts.lib.mkFlake - { - inherit inputs; - } - { - systems = builtins.attrNames inputs.holochain-flake.devShells; - perSystem = - { config - , pkgs - , system - , ... - }: { - devShells.default = pkgs.mkShell { - inputsFrom = [ inputs.holochain-flake.devShells.${system}.holonix ]; - packages = with pkgs; [ - nodejs-18_x - inotify-tools - ]; - }; - }; + inputs.holochain-flake.inputs.flake-parts.lib.mkFlake { + inherit inputs; + } { + systems = builtins.attrNames inputs.holochain-flake.devShells; + perSystem = { config, pkgs, system, ... }: { + devShells.default = pkgs.mkShell { + inputsFrom = [ inputs.holochain-flake.devShells.${system}.holonix ]; + packages = with pkgs; [ + nodejs_22 + ]; + }; }; + }; } diff --git a/package-lock.json b/package-lock.json index 886397b..4904f27 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,9 +12,9 @@ "@holochain/deepkey-zomelets": "file:dnas/deepkey/zomelets", "@noble/ed25519": "^2.0.0", "@noble/hashes": "^1.4.0", - "@spartan-hc/app-interface-client": "^0.7.0", + "@spartan-hc/app-interface-client": "^0.7.2", "@spartan-hc/holo-hash": "^0.7.0", - "@spartan-hc/holochain-backdrop": "^4.4.0", + "@spartan-hc/holochain-backdrop": "^4.4.1", "@whi/json": "^0.1.7", "@whi/weblogger": "^0.4.0", "chai": "^4.3.4", @@ -1861,6 +1861,7 @@ "resolved": "https://registry.npmjs.org/@colors/colors/-/colors-1.6.0.tgz", "integrity": "sha512-Ir+AOibqzrIsL6ajt3Rz3LskB7OiMVHqltZmspbW/TJuTVuyOMirVqAkjfY6JISiLHgyNqicAC8AyHHGzNd/dA==", "dev": true, + "license": "MIT", "engines": { "node": ">=0.1.90" } @@ -1892,6 +1893,7 @@ "resolved": "https://registry.npmjs.org/@dabh/diagnostics/-/diagnostics-2.0.3.tgz", "integrity": "sha512-hrlQOIi7hAfzsMqlGSFyVucrx38O+j6wiGOf//H2ecvIEqYN4ADBSS2iLMh5UFyDunCNniUIPk/q3riFv45xRA==", "dev": true, + "license": "MIT", "dependencies": { "colorspace": "1.1.x", "enabled": "2.0.x", @@ -1999,16 +2001,17 @@ } }, "node_modules/@spartan-hc/app-interface-client": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/@spartan-hc/app-interface-client/-/app-interface-client-0.7.0.tgz", - "integrity": "sha512-Kw8SgK8yx4C84KLPWCKFNfMd9HAVkuMf7FS96yNQRtc0/as5BrVpzV5+zyCOTBJw9Z7TyeRMU871Wm7XVT4lEA==", + "version": "0.7.2", + "resolved": "https://registry.npmjs.org/@spartan-hc/app-interface-client/-/app-interface-client-0.7.2.tgz", + "integrity": "sha512-GiQ+YxZBDK0DPe9UYHZtENSGQoS7G0hQct9jiycfiuu2OJ3yOLfr5mVabiG73pLwmzBE1xuKbDFAn+Dd1sw8FQ==", "dev": true, + "license": "ISC", "dependencies": { "@msgpack/msgpack": "^2.7.0", "@noble/ed25519": "^2.0.0", "@spartan-hc/holo-hash": "^0.6.1", "@spartan-hc/holochain-serialization": "^0.1.4", - "@spartan-hc/holochain-websocket": "^1.3.1", + "@spartan-hc/holochain-websocket": "^1.3.2", "@spartan-hc/zomelets": "^0.2.0", "@whi/json": "^0.1.7", "emittery": "^1.0.1" @@ -2019,6 +2022,7 @@ "resolved": "https://registry.npmjs.org/@spartan-hc/holo-hash/-/holo-hash-0.6.1.tgz", "integrity": "sha512-atPgjCfGPXkCDRhb5V9mHZbGAwu5qgo5GKnGv0dxft2c3L8pvG5O+ihsp2jTq3X9x4npjUUt175pd6NY6nAqdw==", "dev": true, + "license": "ISC", "dependencies": { "@whi/xor-digest": "^0.1.0" } @@ -2033,14 +2037,24 @@ } }, "node_modules/@spartan-hc/holochain-admin-client": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/@spartan-hc/holochain-admin-client/-/holochain-admin-client-1.3.0.tgz", - "integrity": "sha512-et+yPMIi67nNOVkMoRwZdbccO0dXSws+2yXrFAdZENi61mbfgQFSfTxm8xZ98Hdjcs3g2t4kTj5pVJ50TYrp3Q==", + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/@spartan-hc/holochain-admin-client/-/holochain-admin-client-1.4.2.tgz", + "integrity": "sha512-9ltqPJHiO0l67Yw7CBEarHdpvz/q/fIGw2B4A8OxwQNZf/260itg0+IBMJgt9UOUx3isEPe6JbbShd1iV4Islg==", "dev": true, + "license": "ISC", "dependencies": { "@msgpack/msgpack": "^2.7.0", "@spartan-hc/holo-hash": "^0.6.1", - "@spartan-hc/holochain-websocket": "^1.3.1" + "@spartan-hc/holochain-websocket": "^1.3.2", + "@whi/bytes-class": "^0.1.0", + "@whi/json": "^0.1.7", + "@whi/weblogger": "^0.4.0", + "chalk": "^5.3.0", + "commander": "^12.1.0", + "sprintf-js": "^1.1.3" + }, + "bin": { + "hc-admin": "bin/lib/index.js" } }, "node_modules/@spartan-hc/holochain-admin-client/node_modules/@spartan-hc/holo-hash": { @@ -2048,24 +2062,48 @@ "resolved": "https://registry.npmjs.org/@spartan-hc/holo-hash/-/holo-hash-0.6.1.tgz", "integrity": "sha512-atPgjCfGPXkCDRhb5V9mHZbGAwu5qgo5GKnGv0dxft2c3L8pvG5O+ihsp2jTq3X9x4npjUUt175pd6NY6nAqdw==", "dev": true, + "license": "ISC", "dependencies": { "@whi/xor-digest": "^0.1.0" } }, + "node_modules/@spartan-hc/holochain-admin-client/node_modules/chalk": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.3.0.tgz", + "integrity": "sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^12.17.0 || ^14.13 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/@spartan-hc/holochain-admin-client/node_modules/commander": { + "version": "12.1.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-12.1.0.tgz", + "integrity": "sha512-Vw8qHK3bZM9y/P10u3Vib8o/DdkvA2OtPtZvD871QKjy74Wj1WSKFILMPRPSdUSx5RFK1arlJzEtA4PkFgnbuA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + } + }, "node_modules/@spartan-hc/holochain-backdrop": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/@spartan-hc/holochain-backdrop/-/holochain-backdrop-4.4.0.tgz", - "integrity": "sha512-9RTHYHZmmfTg9K3X3G89FqNgDJh3epS6RoflbC9crGOovSYVDJ/1KsNi/TiJ8LlG0/GtWPewa4kXexLt4qj+Xg==", + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/@spartan-hc/holochain-backdrop/-/holochain-backdrop-4.4.1.tgz", + "integrity": "sha512-S4k6neBHXL3oxydhBSGCCeDSka5kgcuBpkhS8sYuCLNpK5pZs2WhfVZP6eFWrxRkCEnruLtU9fDBH33cJChu6Q==", "dev": true, + "license": "ISC", "dependencies": { "@spartan-hc/holo-hash": "^0.6.1", - "@spartan-hc/holochain-admin-client": "^1.3.0", + "@spartan-hc/holochain-admin-client": "^1.3.1", "@whi/promise-timeout": "^0.2.2", "@whi/subprocess": "^0.2.1", "@whi/weblogger": "^0.2.1", "commander": "^8.0.0", "get-port": "^5.1.1", - "ws": "^8.11.0", "yaml": "^1.10.2" }, "bin": { @@ -2077,6 +2115,7 @@ "resolved": "https://registry.npmjs.org/@spartan-hc/holo-hash/-/holo-hash-0.6.1.tgz", "integrity": "sha512-atPgjCfGPXkCDRhb5V9mHZbGAwu5qgo5GKnGv0dxft2c3L8pvG5O+ihsp2jTq3X9x4npjUUt175pd6NY6nAqdw==", "dev": true, + "license": "ISC", "dependencies": { "@whi/xor-digest": "^0.1.0" } @@ -2085,26 +2124,30 @@ "version": "0.2.1", "resolved": "https://registry.npmjs.org/@whi/weblogger/-/weblogger-0.2.1.tgz", "integrity": "sha512-ToIBS7sgLZul4Xp7Pu7eFBi0ZbsPanqhYZ3NrGeeGvUmLVL8oEQo3ohqB+44qlvU2ozIjPp0+ycr1XF1rkz4Cw==", - "dev": true + "dev": true, + "license": "ISC" }, "node_modules/@spartan-hc/holochain-serialization": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/@spartan-hc/holochain-serialization/-/holochain-serialization-0.1.4.tgz", "integrity": "sha512-521P+xv8T32/Lyjx8rqYka9YVO3zIYjQ6FsM2GOqThx0s/AeZv7QVdRaQGj+WvUouvYbT3YrOMNn9waeB8bYOA==", "dev": true, + "license": "ISC", "dependencies": { "@msgpack/msgpack": "^2.7.0" } }, "node_modules/@spartan-hc/holochain-websocket": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/@spartan-hc/holochain-websocket/-/holochain-websocket-1.3.1.tgz", - "integrity": "sha512-RnLZN154MGmJ10N+brd6jaVB+s9uGLmbSykeIXfNlHjujPEE05ylW+XMZ+IpgN2jjRUlm3klDpekQpqzdgQbwg==", + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/@spartan-hc/holochain-websocket/-/holochain-websocket-1.3.2.tgz", + "integrity": "sha512-6Xo0DxqbnytA4OgVmcWjEFPibyXG6D+Qvl5qfv1PplXTAqGxBKwgj3IM8eW/Gj+nabLJG5VlK8x++YksNzdrnw==", "dev": true, + "license": "ISC", "dependencies": { "@msgpack/msgpack": "^2.7.0", "@spartan-hc/holo-hash": "^0.7.0", "@whi/promise-timeout": "^0.1.1", + "defaults": "^3.0.0", "emittery": "^1.0.1", "ws": "^8.16.0" } @@ -2115,6 +2158,19 @@ "integrity": "sha512-PmmnuPAtG90l0aGC7Vc8AEed7/3r6kui1kdulFveQZh/UneOW7No7bP2tnUWQ27OVVVtFYiYDmI6YGudsEK/yg==", "dev": true }, + "node_modules/@spartan-hc/holochain-websocket/node_modules/defaults": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/defaults/-/defaults-3.0.0.tgz", + "integrity": "sha512-RsqXDEAALjfRTro+IFNKpcPCt0/Cy2FqHSIlnomiJp9YGadpQnrtbRpSgN2+np21qHcIKiva4fiOQGjS9/qR/A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/@spartan-hc/zomelets": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/@spartan-hc/zomelets/-/zomelets-0.2.0.tgz", @@ -2211,7 +2267,8 @@ "version": "1.3.5", "resolved": "https://registry.npmjs.org/@types/triple-beam/-/triple-beam-1.3.5.tgz", "integrity": "sha512-6WaYesThRMCl19iryMYP7/x2OVgCtbIVflDGFpWnb9irXI3UjYE4AzmYuiUKY1AJstGijoY+MgUszMgRxIYTYw==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/@webassemblyjs/ast": { "version": "1.12.1", @@ -2443,7 +2500,8 @@ "version": "0.2.2", "resolved": "https://registry.npmjs.org/@whi/promise-timeout/-/promise-timeout-0.2.2.tgz", "integrity": "sha512-/8bVSq1kQA1GvE5tQMj6WASeWNDsOPyg7RXqFRoGAdNsH3fM3rUjqgLDHjNWuE5gyyr4VmgPIiVuexPQaPrOlQ==", - "dev": true + "dev": true, + "license": "ISC" }, "node_modules/@whi/repr": { "version": "0.1.0", @@ -2456,6 +2514,7 @@ "resolved": "https://registry.npmjs.org/@whi/stdlog/-/stdlog-0.3.4.tgz", "integrity": "sha512-yjA7N4n2PHtAhDNSe52tmqIGdkkFVYH1/OgqEkV6e2lMkOqdIWx9wxpRbupX6JPzaCjg83QppoO98LZF9s0BmQ==", "dev": true, + "license": "ISC", "dependencies": { "sprintf-js": "^1.1.2", "winston": "^3.3.3" @@ -2466,6 +2525,7 @@ "resolved": "https://registry.npmjs.org/@whi/subprocess/-/subprocess-0.2.1.tgz", "integrity": "sha512-eVDFjrmlCKASGcjT0antIbAE0IFVF5GV04H8bRAuZfkEORWOX0NPXC1EObdJQuScuTeoMz3PjNprliY4KQb4xA==", "dev": true, + "license": "ISC", "dependencies": { "@whi/promise-timeout": "^0.1.0", "@whi/stdlog": "^0.3.4" @@ -2475,7 +2535,8 @@ "version": "0.1.1", "resolved": "https://registry.npmjs.org/@whi/promise-timeout/-/promise-timeout-0.1.1.tgz", "integrity": "sha512-PmmnuPAtG90l0aGC7Vc8AEed7/3r6kui1kdulFveQZh/UneOW7No7bP2tnUWQ27OVVVtFYiYDmI6YGudsEK/yg==", - "dev": true + "dev": true, + "license": "ISC" }, "node_modules/@whi/weblogger": { "version": "0.4.0", @@ -2623,7 +2684,8 @@ "version": "3.2.5", "resolved": "https://registry.npmjs.org/async/-/async-3.2.5.tgz", "integrity": "sha512-baNZyqaaLhyLVKm/DlvdW051MSgO6b8eVfIezl9E5PqWxFgzLm/wQntEW4zOytVburDEr0JlALEpdOFwvErLsg==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/babel-plugin-polyfill-corejs2": { "version": "0.4.11", @@ -2980,6 +3042,7 @@ "resolved": "https://registry.npmjs.org/color/-/color-3.2.1.tgz", "integrity": "sha512-aBl7dZI9ENN6fUGC7mWpMTPNHmWUSNan9tuWN6ahh5ZLNk9baLJOnSMlrQkHcrfFgz2/RigjUVAjdx36VcemKA==", "dev": true, + "license": "MIT", "dependencies": { "color-convert": "^1.9.3", "color-string": "^1.6.0" @@ -3006,6 +3069,7 @@ "resolved": "https://registry.npmjs.org/color-string/-/color-string-1.9.1.tgz", "integrity": "sha512-shrVawQFojnZv6xM40anx4CkoDP+fZsw/ZerEMsW/pyzsRbElpsL/DBVW7q3ExxwusdNXI3lXpuhEZkzs8p5Eg==", "dev": true, + "license": "MIT", "dependencies": { "color-name": "^1.0.0", "simple-swizzle": "^0.2.2" @@ -3016,6 +3080,7 @@ "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", "dev": true, + "license": "MIT", "dependencies": { "color-name": "1.1.3" } @@ -3024,7 +3089,8 @@ "version": "1.1.3", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/colorette": { "version": "2.0.20", @@ -3037,6 +3103,7 @@ "resolved": "https://registry.npmjs.org/colorspace/-/colorspace-1.1.4.tgz", "integrity": "sha512-BgvKJiuVu1igBUF2kEjRCZXol6wiiGbY5ipL/oVPwm0BL9sIpMIzM8IK7vwuxIIzOXMV3Ey5w+vxhm0rR/TN8w==", "dev": true, + "license": "MIT", "dependencies": { "color": "^3.1.3", "text-hex": "1.0.x" @@ -3047,6 +3114,7 @@ "resolved": "https://registry.npmjs.org/commander/-/commander-8.3.0.tgz", "integrity": "sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww==", "dev": true, + "license": "MIT", "engines": { "node": ">= 12" } @@ -3186,7 +3254,8 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/enabled/-/enabled-2.0.0.tgz", "integrity": "sha512-AKrN98kuwOzMIdAizXGI86UFBoo26CL21UM763y1h/GMSJ4/OHU9k2YlsmBpyScFo/wbLzWQJBMCW4+IO3/+OQ==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/enhanced-resolve": { "version": "5.17.0", @@ -3324,7 +3393,8 @@ "version": "4.2.3", "resolved": "https://registry.npmjs.org/fecha/-/fecha-4.2.3.tgz", "integrity": "sha512-OP2IUU6HeYKJi3i0z4A19kHMQoLVs4Hc+DPqqxI2h/DPZHTm/vjsfC6P0b4jCMy14XizLBqvndQ+UilD7707Jw==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/fill-range": { "version": "7.1.1", @@ -3365,7 +3435,8 @@ "version": "1.1.0", "resolved": "https://registry.npmjs.org/fn.name/-/fn.name-1.1.0.tgz", "integrity": "sha512-GRnmB5gPyJpAhTQdSZTSp9uaPSvl09KoYcMQtsB9rQoOmzs9dH6ffeccH+Z+cv6P68Hu5bC6JjRh4Ah/mHSNRw==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/fs-extra": { "version": "10.1.0", @@ -3439,6 +3510,7 @@ "resolved": "https://registry.npmjs.org/get-port/-/get-port-5.1.1.tgz", "integrity": "sha512-g/Q1aTSDOxFpchXC4i8ZWvxA1lnPqx/JHqcpIw0/LX9T8x/GBbi6YnlN5nhaKIFkT8oFsscUKgDJYxfwfS6QsQ==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" }, @@ -3590,7 +3662,8 @@ "version": "0.3.2", "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.3.2.tgz", "integrity": "sha512-eVRqCvVlZbuw3GrM63ovNSNAeA1K16kaR/LRY/92w0zxQ5/1YzwblUX652i4Xs9RwAGjW9d9y6X88t8OaAJfWQ==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/is-binary-path": { "version": "2.1.0", @@ -3685,6 +3758,7 @@ "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" }, @@ -3810,7 +3884,8 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/kuler/-/kuler-2.0.0.tgz", "integrity": "sha512-Xq9nH7KlWZmXAtodXDDRE7vs6DU1gTU8zYDHDiWLSip45Egwq3plLHzPn27NgvzL2r1LMPC1vdqh98sQxtqj4A==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/loader-runner": { "version": "4.3.0", @@ -3857,10 +3932,11 @@ } }, "node_modules/logform": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/logform/-/logform-2.6.0.tgz", - "integrity": "sha512-1ulHeNPp6k/LD8H91o7VYFBng5i1BDE7HoKxVbZiGFidS1Rj65qcywLxX+pVfAPoQJEjRdvKcusKwOupHCVOVQ==", + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/logform/-/logform-2.6.1.tgz", + "integrity": "sha512-CdaO738xRapbKIMVn2m4F6KTj4j7ooJ8POVnebSgKo3KBz5axNXRAL7ZdRjIV6NOr2Uf4vjtRkxrFETOioCqSA==", "dev": true, + "license": "MIT", "dependencies": { "@colors/colors": "1.6.0", "@types/triple-beam": "^1.3.2", @@ -4154,6 +4230,7 @@ "resolved": "https://registry.npmjs.org/one-time/-/one-time-1.0.0.tgz", "integrity": "sha512-5DXOiRKwuSEcQ/l0kGCF6Q3jcADFv5tSmRaJck/OqkVFcOzutB134KRSfF0xDrL39MNnqxbHBbUUcjZIhTgb2g==", "dev": true, + "license": "MIT", "dependencies": { "fn.name": "1.x.x" } @@ -4562,6 +4639,7 @@ "resolved": "https://registry.npmjs.org/safe-stable-stringify/-/safe-stable-stringify-2.4.3.tgz", "integrity": "sha512-e2bDA2WJT0wxseVd4lsDP4+3ONX6HpMXQa1ZhFQ7SU+GjvORCmShbCMltrtIDfkYhVHrOcPtj+KhmDBdPdZD1g==", "dev": true, + "license": "MIT", "engines": { "node": ">=10" } @@ -4650,6 +4728,7 @@ "resolved": "https://registry.npmjs.org/simple-swizzle/-/simple-swizzle-0.2.2.tgz", "integrity": "sha512-JA//kQgZtbuY83m+xT+tXJkmJncGMTFT+C+g2h2R9uxkYIrE2yy9sgmcLhCnw57/WSD+Eh3J97FPEDFnbXnDUg==", "dev": true, + "license": "MIT", "dependencies": { "is-arrayish": "^0.3.1" } @@ -4677,13 +4756,15 @@ "version": "1.1.3", "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.1.3.tgz", "integrity": "sha512-Oo+0REFV59/rz3gfJNKQiBlwfHaSESl1pcGyABQsnnIfWOFt6JNj5gCog2U6MLZ//IGYD+nA8nI+mTShREReaA==", - "dev": true + "dev": true, + "license": "BSD-3-Clause" }, "node_modules/stack-trace": { "version": "0.0.10", "resolved": "https://registry.npmjs.org/stack-trace/-/stack-trace-0.0.10.tgz", "integrity": "sha512-KGzahc7puUKkzyMt+IqAep+TVNbKP+k2Lmwhub39m1AsTSkaDutx56aDCo+HLDzf/D26BIHTJWNiTG1KAJiQCg==", "dev": true, + "license": "MIT", "engines": { "node": "*" } @@ -4852,7 +4933,8 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/text-hex/-/text-hex-1.0.0.tgz", "integrity": "sha512-uuVGNWzgJ4yhRaNSiubPY7OjISw4sw4E5Uv0wbjp+OzcbmVU/rsT8ujgcXJhn9ypzsgr5vlzpPqP+MBBKcGvbg==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/to-fast-properties": { "version": "2.0.0", @@ -4880,6 +4962,7 @@ "resolved": "https://registry.npmjs.org/triple-beam/-/triple-beam-1.4.1.tgz", "integrity": "sha512-aZbgViZrg1QNcG+LULa7nhZpJTZSLm/mXnHXnbAbjmN5aSa0y7V+wvv6+4WaBtpISJzThKy+PIPxc1Nq1EJ9mg==", "dev": true, + "license": "MIT", "engines": { "node": ">= 14.0.0" } @@ -5387,16 +5470,17 @@ "dev": true }, "node_modules/winston": { - "version": "3.13.0", - "resolved": "https://registry.npmjs.org/winston/-/winston-3.13.0.tgz", - "integrity": "sha512-rwidmA1w3SE4j0E5MuIufFhyJPBDG7Nu71RkZor1p2+qHvJSZ9GYDA81AyleQcZbh/+V6HjeBdfnTZJm9rSeQQ==", + "version": "3.13.1", + "resolved": "https://registry.npmjs.org/winston/-/winston-3.13.1.tgz", + "integrity": "sha512-SvZit7VFNvXRzbqGHsv5KSmgbEYR5EiQfDAL9gxYkRqa934Hnk++zze0wANKtMHcy/gI4W/3xmSDwlhf865WGw==", "dev": true, + "license": "MIT", "dependencies": { "@colors/colors": "^1.6.0", "@dabh/diagnostics": "^2.0.2", "async": "^3.2.3", "is-stream": "^2.0.0", - "logform": "^2.4.0", + "logform": "^2.6.0", "one-time": "^1.0.0", "readable-stream": "^3.4.0", "safe-stable-stringify": "^2.3.1", @@ -5409,13 +5493,14 @@ } }, "node_modules/winston-transport": { - "version": "4.7.0", - "resolved": "https://registry.npmjs.org/winston-transport/-/winston-transport-4.7.0.tgz", - "integrity": "sha512-ajBj65K5I7denzer2IYW6+2bNIVqLGDHqDw3Ow8Ohh+vdW+rv4MZ6eiDvHoKhfJFZ2auyN8byXieDDJ96ViONg==", + "version": "4.7.1", + "resolved": "https://registry.npmjs.org/winston-transport/-/winston-transport-4.7.1.tgz", + "integrity": "sha512-wQCXXVgfv/wUPOfb2x0ruxzwkcZfxcktz6JIMUaPLmcNhO4bZTwA/WtDWK74xV3F2dKu8YadrFv0qhwYjVEwhA==", "dev": true, + "license": "MIT", "dependencies": { - "logform": "^2.3.2", - "readable-stream": "^3.6.0", + "logform": "^2.6.1", + "readable-stream": "^3.6.2", "triple-beam": "^1.3.0" }, "engines": { @@ -5449,10 +5534,11 @@ "license": "ISC" }, "node_modules/ws": { - "version": "8.17.0", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.17.0.tgz", - "integrity": "sha512-uJq6108EgZMAl20KagGkzCKfMEjxmKvZHG7Tlq0Z6nOky7YF7aq4mOx6xK8TJ/i1LeK4Qus7INktacctDgY8Ow==", + "version": "8.18.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.18.0.tgz", + "integrity": "sha512-8VbfWfHLbbwu3+N6OKsOMpBdT4kXPDDB9cJk2bJ6mh9ucxdlnNvH1e+roYkKmN9Nxw2yjz7VzeO9oOz2zJ04Pw==", "dev": true, + "license": "MIT", "engines": { "node": ">=10.0.0" }, @@ -5488,6 +5574,7 @@ "resolved": "https://registry.npmjs.org/yaml/-/yaml-1.10.2.tgz", "integrity": "sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==", "dev": true, + "license": "ISC", "engines": { "node": ">= 6" } diff --git a/package.json b/package.json index 774589f..27898eb 100644 --- a/package.json +++ b/package.json @@ -11,9 +11,9 @@ "@holochain/deepkey-zomelets": "file:dnas/deepkey/zomelets", "@noble/ed25519": "^2.0.0", "@noble/hashes": "^1.4.0", - "@spartan-hc/app-interface-client": "^0.7.0", + "@spartan-hc/app-interface-client": "^0.7.2", "@spartan-hc/holo-hash": "^0.7.0", - "@spartan-hc/holochain-backdrop": "^4.4.0", + "@spartan-hc/holochain-backdrop": "^4.4.1", "@whi/json": "^0.1.7", "@whi/weblogger": "^0.4.0", "chai": "^4.3.4", From 720f5d9921fac5225efbc2dbc6e1bc7050984f41 Mon Sep 17 00:00:00 2001 From: Matthew Brisebois Date: Mon, 5 Aug 2024 09:14:20 -0600 Subject: [PATCH 03/10] Update for Holochain v0.4.0-dev.15 --- Cargo.lock | 650 +++++++++++++++++++++++++--------- Cargo.toml | 12 +- dnas/deepkey/sdk/Cargo.toml | 4 +- dnas/deepkey/types/Cargo.toml | 8 +- flake.lock | 378 +------------------- flake.nix | 42 ++- pkgs.nix | 11 + zomes/deepkey/Cargo.toml | 1 - zomes/deepkey_csr/Cargo.toml | 1 - 9 files changed, 546 insertions(+), 561 deletions(-) create mode 100644 pkgs.nix diff --git a/Cargo.lock b/Cargo.lock index 78c466d..1ea9940 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -52,6 +52,12 @@ dependencies = [ "libc", ] +[[package]] +name = "anyhow" +version = "1.0.86" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da" + [[package]] name = "arbitrary" version = "1.3.2" @@ -197,8 +203,8 @@ version = "0.6.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3db406d29fbcd95542e92559bed4d8ad92636d1ca8b3b72ede10b4bcc010e659" dependencies = [ - "proc-macro2 1.0.85", - "quote 1.0.36", + "proc-macro2", + "quote", "syn 1.0.109", ] @@ -213,6 +219,18 @@ name = "bytes" version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "514de17de45fdb8dc022b1a7975556c53c86f9f0aa5f534b98977b171857c2c9" +dependencies = [ + "serde", +] + +[[package]] +name = "bytesize" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3e368af43e418a04d52505cf3dbc23dda4e3407ae2fa99fd0e4f308ce546acc" +dependencies = [ + "serde", +] [[package]] name = "camino" @@ -410,6 +428,15 @@ version = "0.91.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "393bc73c451830ff8dbb3a07f61843d6cb41a084f9996319917c0b291ed785bb" +[[package]] +name = "crc32fast" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" +dependencies = [ + "cfg-if", +] + [[package]] name = "crossbeam-deque" version = "0.8.5" @@ -477,8 +504,8 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" dependencies = [ - "proc-macro2 1.0.85", - "quote 1.0.36", + "proc-macro2", + "quote", "syn 2.0.66", ] @@ -510,8 +537,8 @@ checksum = "109c1ca6e6b7f82cc233a97004ea8ed7ca123a9af07a8230878fcfda9b158bf0" dependencies = [ "fnv", "ident_case", - "proc-macro2 1.0.85", - "quote 1.0.36", + "proc-macro2", + "quote", "strsim", "syn 1.0.109", ] @@ -524,8 +551,8 @@ checksum = "622687fe0bac72a04e5599029151f5796111b90f1baaa9b544d807a5e31cd120" dependencies = [ "fnv", "ident_case", - "proc-macro2 1.0.85", - "quote 1.0.36", + "proc-macro2", + "quote", "syn 2.0.66", ] @@ -536,7 +563,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a4aab4dbc9f7611d8b55048a3a16d2d010c2c8334e46304b40ac1cc14bf3b48e" dependencies = [ "darling_core 0.14.4", - "quote 1.0.36", + "quote", "syn 1.0.109", ] @@ -547,7 +574,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "733cabb43482b1a1b53eee8583c2b9e8684d592215ea83efd305dd31bc2f0178" dependencies = [ "darling_core 0.20.9", - "quote 1.0.36", + "quote", "syn 2.0.66", ] @@ -610,8 +637,8 @@ version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" dependencies = [ - "proc-macro2 1.0.85", - "quote 1.0.36", + "proc-macro2", + "quote", "syn 1.0.109", ] @@ -621,11 +648,42 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "67e77553c4162a157adbf834ebae5b415acbecbeafc7a74b0e886657506a7611" dependencies = [ - "proc-macro2 1.0.85", - "quote 1.0.36", + "proc-macro2", + "quote", "syn 2.0.66", ] +[[package]] +name = "derive_builder" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d67778784b508018359cbc8696edb3db78160bab2c2a28ba7f56ef6932997f8" +dependencies = [ + "derive_builder_macro", +] + +[[package]] +name = "derive_builder_core" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c11bdc11a0c47bc7d37d582b5285da6849c96681023680b906673c5707af7b0f" +dependencies = [ + "darling 0.14.4", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "derive_builder_macro" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebcda35c7a396850a55ffeac740804b40ffec779b98fffbb1738f4033f0ee79e" +dependencies = [ + "derive_builder_core", + "syn 1.0.109", +] + [[package]] name = "derive_more" version = "0.99.18" @@ -633,8 +691,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5f33878137e4dafd7fa914ad4e259e18a4e8e532b9617a2d0150262bf53abfce" dependencies = [ "convert_case", - "proc-macro2 1.0.85", - "quote 1.0.36", + "proc-macro2", + "quote", "rustc_version", "syn 2.0.66", ] @@ -649,12 +707,27 @@ dependencies = [ "crypto-common", ] +[[package]] +name = "document-features" +version = "0.2.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb6969eaabd2421f8a2775cfd2471a2b634372b4a25d41e3bd647b79912850a0" +dependencies = [ + "litrs", +] + [[package]] name = "dunce" version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "56ce8c6da7551ec6c462cbaf3bfbc75131ebbfa1c944aeaa9dab51ca1c5f0c3b" +[[package]] +name = "dyn-clone" +version = "1.0.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d6ef0072f8a535281e4876be788938b528e9a1d43900b82c2569af7da799125" + [[package]] name = "ed25519" version = "2.2.3" @@ -701,8 +774,8 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c134c37760b27a871ba422106eedbb8247da973a09e82558bf26d619c882b159" dependencies = [ - "proc-macro2 1.0.85", - "quote 1.0.36", + "proc-macro2", + "quote", "syn 1.0.109", ] @@ -722,8 +795,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e08b6c6ab82d70f08844964ba10c7babb716de2ecaeab9be5717918a5177d3af" dependencies = [ "darling 0.20.9", - "proc-macro2 1.0.85", - "quote 1.0.36", + "proc-macro2", + "quote", "syn 2.0.66", ] @@ -761,12 +834,43 @@ version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "28dea519a9695b9977216879a3ebfddf92f1c08c05d984f8996aecd6ecdc811d" +[[package]] +name = "filetime" +version = "0.2.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ee447700ac8aa0b2f2bd7bc4462ad686ba06baa6727ac149a2d6277f0d240fd" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall 0.4.1", + "windows-sys 0.52.0", +] + +[[package]] +name = "flate2" +version = "1.0.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f211bbe8e69bbd0cfdea405084f128ae8b4aaa6b0b522fc8f2b009084797920" +dependencies = [ + "crc32fast", + "miniz_oxide", +] + [[package]] name = "fnv" version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" +[[package]] +name = "form_urlencoded" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" +dependencies = [ + "percent-encoding", +] + [[package]] name = "funty" version = "2.0.0" @@ -827,8 +931,8 @@ version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ - "proc-macro2 1.0.85", - "quote 1.0.36", + "proc-macro2", + "quote", "syn 2.0.66", ] @@ -900,8 +1004,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" dependencies = [ "cfg-if", + "js-sys", "libc", "wasi", + "wasm-bindgen", ] [[package]] @@ -921,6 +1027,12 @@ version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "40ecd4077b5ae9fd2e9e169b102c6c330d0605168eb0e8bf79952b256dbefffd" +[[package]] +name = "half" +version = "1.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b43ede17f21864e81be2fa654110bf1e793774238d86ef8555c37e6519c0403" + [[package]] name = "hashbrown" version = "0.12.3" @@ -961,9 +1073,9 @@ dependencies = [ [[package]] name = "hdi" -version = "0.5.0-dev.5" +version = "0.5.0-dev.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff15f519955feed397b6c1b79ce0b2062dab2f67b626d8e46c76a7f9de694e63" +checksum = "9dd62de0d29f215642cb2481ec5cdde81233c3fabe97157c8a35118b69dd821d" dependencies = [ "getrandom", "hdk_derive", @@ -979,9 +1091,9 @@ dependencies = [ [[package]] name = "hdk" -version = "0.4.0-dev.6" +version = "0.4.0-dev.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3e4a4ac76aadc261e2a513f8ffb345504a7d667d3a02f65f349b801c4aaa33e" +checksum = "b63439a2fa623ae819ad41037c00216f1d62dc78aa9e9e5458f987866c08254f" dependencies = [ "getrandom", "hdi", @@ -999,17 +1111,17 @@ dependencies = [ [[package]] name = "hdk_derive" -version = "0.4.0-dev.5" +version = "0.4.0-dev.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6adaaddb9883624c159cd89049f545f065b9c5eaf46172a1f42f35fa88f6a98" +checksum = "fbfd717793514df9e0c44d698e820e68692792fa38c2d721c97c201e5376476e" dependencies = [ "darling 0.14.4", "heck 0.5.0", "holochain_integrity_types", "paste", "proc-macro-error", - "proc-macro2 1.0.85", - "quote 1.0.36", + "proc-macro2", + "quote", "syn 1.0.109", ] @@ -1033,9 +1145,9 @@ checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" [[package]] name = "holo_hash" -version = "0.4.0-dev.5" +version = "0.4.0-dev.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80b84303db38ecc1c5a3b5334b3da34201cf04dc231b37e7fda01e418e160089" +checksum = "51425a83caa336a4bd8e6bf4f9b0374ee315fcf4b4c7a103aa2e0c54bb872cad" dependencies = [ "arbitrary", "base64", @@ -1048,7 +1160,7 @@ dependencies = [ "kitsune_p2p_dht_arc", "must_future", "proptest", - "proptest-derive 0.4.0", + "proptest-derive", "serde", "serde_bytes", "thiserror", @@ -1063,9 +1175,9 @@ dependencies = [ [[package]] name = "holochain_integrity_types" -version = "0.4.0-dev.5" +version = "0.4.0-dev.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c41780c1d157026b8730e45877960238a976f72bef3d832d14d2d6dc24716187" +checksum = "12e2d557cc479814090f4724264880ee7ee5e31e5009c98fe23fcc07857ff724" dependencies = [ "arbitrary", "holo_hash", @@ -1074,7 +1186,7 @@ dependencies = [ "holochain_util", "kitsune_p2p_timestamp", "proptest", - "proptest-derive 0.4.0", + "proptest-derive", "serde", "serde_bytes", "subtle", @@ -1105,14 +1217,14 @@ dependencies = [ [[package]] name = "holochain_serialized_bytes" -version = "0.0.54" +version = "0.0.55" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fad1068180811f3a23c340894cb98b0710244ffac76427664239545f162619c5" +checksum = "719fa847cf9f772f7e8e1a6f11d801e1383cc5af043292042665da9a6ce5c742" dependencies = [ "arbitrary", "holochain_serialized_bytes_derive", "proptest", - "proptest-derive 0.3.0", + "proptest-derive", "rmp-serde", "serde", "serde-transcode", @@ -1123,19 +1235,19 @@ dependencies = [ [[package]] name = "holochain_serialized_bytes_derive" -version = "0.0.54" +version = "0.0.55" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71cc7f19017233d644abc4a23cbe19220effc05aea057f93db1be00348b89464" +checksum = "3e6a221b5650251e09ef0b9223cf39e72b5222492cffc6bb4bdf36b2a6bc91aa" dependencies = [ - "quote 1.0.36", + "quote", "syn 1.0.109", ] [[package]] name = "holochain_util" -version = "0.4.0-dev.1" +version = "0.4.0-dev.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9e2622406b6150319518901f1d4ecbb58a3f16ec097cba3ac898a18ff7900c1" +checksum = "79b89c3542e1fe783d9505d14a83497abadcf84d5d87e73fe1dbff3ac21cfce8" dependencies = [ "cfg-if", "colored", @@ -1147,9 +1259,9 @@ dependencies = [ [[package]] name = "holochain_wasmer_common" -version = "0.0.94" +version = "0.0.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9f7d17668e4a4997b5e121c7a951ea9606331ef206b991f1e81420c84d98485" +checksum = "81862ba8234412864273d21983c99af4e8b97739a5e4c354030470acdc6b431c" dependencies = [ "holochain_serialized_bytes", "serde", @@ -1161,9 +1273,9 @@ dependencies = [ [[package]] name = "holochain_wasmer_guest" -version = "0.0.94" +version = "0.0.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e292e12fda0716ce36b566c7cf3dad8443fdc7c56950e42c5a3ba81988e792d0" +checksum = "fce20cd8eb137a355394e57612cf2cf7836dab57948d56af9f9fe080ea168d41" dependencies = [ "holochain_serialized_bytes", "holochain_wasmer_common", @@ -1175,9 +1287,9 @@ dependencies = [ [[package]] name = "holochain_zome_types" -version = "0.4.0-dev.6" +version = "0.4.0-dev.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2afa8b7ee86e8f1c6c91e74a462cefc0cba5ef12cb84d39ed24ed9dfa27743cb" +checksum = "f62ed18d860b34574edcc76a467e456775142d3e5ca86fb31907f25680cee965" dependencies = [ "derive_more", "holo_hash", @@ -1232,6 +1344,16 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" +[[package]] +name = "idna" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" +dependencies = [ + "unicode-bidi", + "unicode-normalization", +] + [[package]] name = "if_chain" version = "1.0.2" @@ -1246,6 +1368,7 @@ checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" dependencies = [ "autocfg", "hashbrown 0.12.3", + "serde", ] [[package]] @@ -1256,6 +1379,7 @@ checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" dependencies = [ "equivalent", "hashbrown 0.14.5", + "serde", ] [[package]] @@ -1297,9 +1421,9 @@ dependencies = [ [[package]] name = "kitsune_p2p_bin_data" -version = "0.4.0-dev.6" +version = "0.4.0-dev.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac73a427e32c148036bb09187a75a761f7f6775302582448a2bd60148ff93fcb" +checksum = "82a36538316e8289894aef8b60b857ea3d05fc8cb447c3bac45f0b22aa9901ce" dependencies = [ "base64", "derive_more", @@ -1312,9 +1436,9 @@ dependencies = [ [[package]] name = "kitsune_p2p_block" -version = "0.4.0-dev.6" +version = "0.4.0-dev.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a099279b4020e0b887eb3376d360a443359b0e49e7e8f9e243c797a5dfd80065" +checksum = "9caf6d341d99e05c0d1261632d8667f27bad5243889a9675865c6ebce8be975a" dependencies = [ "kitsune_p2p_bin_data", "kitsune_p2p_timestamp", @@ -1323,9 +1447,9 @@ dependencies = [ [[package]] name = "kitsune_p2p_dht_arc" -version = "0.4.0-dev.6" +version = "0.4.0-dev.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73c84d983eff94d6d25b8836c855597f2ac38b80a4d29ba0a628b29368942ba0" +checksum = "241ded259c121ee17b34f95c81f6b0a11e3d28f379486c47b089102698a83556" dependencies = [ "derive_more", "gcollections", @@ -1345,7 +1469,7 @@ dependencies = [ "chrono", "once_cell", "proptest", - "proptest-derive 0.4.0", + "proptest-derive", "rand", "serde", ] @@ -1380,6 +1504,12 @@ version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" +[[package]] +name = "litrs" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4ce301924b7887e9d637144fdade93f9dfff9b60981d4ac161db09720d39aa5" + [[package]] name = "lock_api" version = "0.4.12" @@ -1524,7 +1654,7 @@ checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" dependencies = [ "cfg-if", "libc", - "redox_syscall", + "redox_syscall 0.5.2", "smallvec", "windows-targets 0.52.5", ] @@ -1535,6 +1665,12 @@ version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" +[[package]] +name = "percent-encoding" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" + [[package]] name = "pest" version = "2.7.10" @@ -1587,8 +1723,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" dependencies = [ "proc-macro-error-attr", - "proc-macro2 1.0.85", - "quote 1.0.36", + "proc-macro2", + "quote", "syn 1.0.109", "version_check", ] @@ -1599,20 +1735,11 @@ version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" dependencies = [ - "proc-macro2 1.0.85", - "quote 1.0.36", + "proc-macro2", + "quote", "version_check", ] -[[package]] -name = "proc-macro2" -version = "0.4.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf3d2011ab5c909338f7887f4fc896d35932e29146c12c8d01da6b22a80ba759" -dependencies = [ - "unicode-xid", -] - [[package]] name = "proc-macro2" version = "1.0.85" @@ -1642,25 +1769,14 @@ dependencies = [ "unarray", ] -[[package]] -name = "proptest-derive" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90b46295382dc76166cb7cf2bb4a97952464e4b7ed5a43e6cd34e1fec3349ddc" -dependencies = [ - "proc-macro2 0.4.30", - "quote 0.6.13", - "syn 0.15.44", -] - [[package]] name = "proptest-derive" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9cf16337405ca084e9c78985114633b6827711d22b9e6ef6c6c0d665eb3f0b6e" dependencies = [ - "proc-macro2 1.0.85", - "quote 1.0.36", + "proc-macro2", + "quote", "syn 1.0.109", ] @@ -1679,8 +1795,8 @@ version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "16b845dbfca988fa33db069c0e230574d15a3088f147a87b64c7589eb662c9ac" dependencies = [ - "proc-macro2 1.0.85", - "quote 1.0.36", + "proc-macro2", + "quote", "syn 1.0.109", ] @@ -1690,22 +1806,13 @@ version = "1.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" -[[package]] -name = "quote" -version = "0.6.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ce23b6b870e8f94f81fb0a363d65d86675884b34a09043c81e5562f11c1f8e1" -dependencies = [ - "proc-macro2 0.4.30", -] - [[package]] name = "quote" version = "1.0.36" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" dependencies = [ - "proc-macro2 1.0.85", + "proc-macro2", ] [[package]] @@ -1773,6 +1880,15 @@ dependencies = [ "crossbeam-utils", ] +[[package]] +name = "redox_syscall" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" +dependencies = [ + "bitflags 1.3.2", +] + [[package]] name = "redox_syscall" version = "0.5.2" @@ -1869,8 +1985,8 @@ version = "0.7.44" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a7dddfff8de25e6f62b9d64e6e432bf1c6736c57d20323e15ee10435fbda7c65" dependencies = [ - "proc-macro2 1.0.85", - "quote 1.0.36", + "proc-macro2", + "quote", "syn 1.0.109", ] @@ -1887,9 +2003,9 @@ dependencies = [ [[package]] name = "rmp-serde" -version = "1.1.2" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bffea85eea980d8a74453e5d02a8d93028f3c34725de143085a844ebe953258a" +checksum = "52e599a477cf9840e92f2cde9a7189e67b42c57532749bf90aea6ec10facd4db" dependencies = [ "byteorder", "rmp", @@ -1969,6 +2085,31 @@ dependencies = [ "winapi-util", ] +[[package]] +name = "schemars" +version = "0.8.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09c024468a378b7e36765cd36702b7a90cc3cba11654f6685c8f233408e89e92" +dependencies = [ + "dyn-clone", + "schemars_derive", + "serde", + "serde_json", + "url", +] + +[[package]] +name = "schemars_derive" +version = "0.8.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1eee588578aff73f856ab961cd2f79e36bc45d7ded33a7562adba4667aecc0e" +dependencies = [ + "proc-macro2", + "quote", + "serde_derive_internals", + "syn 2.0.66", +] + [[package]] name = "scopeguard" version = "1.2.0" @@ -2016,9 +2157,9 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.197" +version = "1.0.203" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fb1c873e1b9b056a4dc4c0c198b24c3ffa059243875552b2bd0933b1aee4ce2" +checksum = "7253ab4de971e72fb7be983802300c30b5a7f0c2e56fab8abfc6a214307c0094" dependencies = [ "serde_derive", ] @@ -2052,14 +2193,35 @@ dependencies = [ "serde", ] +[[package]] +name = "serde_cbor" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bef2ebfde456fb76bbcf9f59315333decc4fda0b2b44b420243c11e0f5ec1f5" +dependencies = [ + "half", + "serde", +] + [[package]] name = "serde_derive" -version = "1.0.197" +version = "1.0.203" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "500cbc0ebeb6f46627f50f3f5811ccf6bf00643be300b4c3eabc0ef55dc5b5ba" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.66", +] + +[[package]] +name = "serde_derive_internals" +version = "0.29.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7eb0b34b42edc17f6b7cac84a52a1c5f0e1bb2227e997ca9011ea3dd34e8610b" +checksum = "18d26a20a969b9e3fdf2fc2d9f21eda6c40e2de84c9408bb5d3b05d499aae711" dependencies = [ - "proc-macro2 1.0.85", - "quote 1.0.36", + "proc-macro2", + "quote", "syn 2.0.66", ] @@ -2075,6 +2237,28 @@ dependencies = [ "serde", ] +[[package]] +name = "serde_spanned" +version = "0.6.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eb5b1b31579f3811bf615c144393417496f152e12ac8b7663bf664f4a815306d" +dependencies = [ + "serde", +] + +[[package]] +name = "serde_yaml" +version = "0.9.34+deprecated" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a8b1a1a2ebf674015cc02edccce75287f1a0130d394307b36743c2f5d504b47" +dependencies = [ + "indexmap 2.2.6", + "itoa", + "ryu", + "serde", + "unsafe-libyaml", +] + [[package]] name = "sha-1" version = "0.10.1" @@ -2115,8 +2299,8 @@ checksum = "e63e6744142336dfb606fe2b068afa2e1cca1ee6a5d8377277a92945d81fa331" dependencies = [ "bitflags 1.3.2", "itertools", - "proc-macro2 1.0.85", - "quote 1.0.36", + "proc-macro2", + "quote", "syn 1.0.109", ] @@ -2185,8 +2369,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e385be0d24f186b4ce2f9982191e7101bb737312ad61c1f2f984f34bcf85d59" dependencies = [ "heck 0.4.1", - "proc-macro2 1.0.85", - "quote 1.0.36", + "proc-macro2", + "quote", "rustversion", "syn 1.0.109", ] @@ -2207,25 +2391,14 @@ version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" -[[package]] -name = "syn" -version = "0.15.44" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ca4b3b69a77cbe1ffc9e198781b7acb0c7365a883670e8f1c1bc66fba79a5c5" -dependencies = [ - "proc-macro2 0.4.30", - "quote 0.6.13", - "unicode-xid", -] - [[package]] name = "syn" version = "1.0.109" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" dependencies = [ - "proc-macro2 1.0.85", - "quote 1.0.36", + "proc-macro2", + "quote", "unicode-ident", ] @@ -2235,8 +2408,8 @@ version = "2.0.66" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c42f3f41a2de00b01c0aaad383c5a45241efc8b2d1eda5661812fda5f3cdcff5" dependencies = [ - "proc-macro2 1.0.85", - "quote 1.0.36", + "proc-macro2", + "quote", "unicode-ident", ] @@ -2246,6 +2419,17 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" +[[package]] +name = "tar" +version = "0.4.41" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb797dad5fb5b76fcf519e702f4a589483b5ef06567f160c392832c1f5e44909" +dependencies = [ + "filetime", + "libc", + "xattr", +] + [[package]] name = "target-lexicon" version = "0.12.14" @@ -2283,8 +2467,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "58071dc2471840e9f374eeb0f6e405a31bccb3cc5d59bb4598f02cafc274b5c4" dependencies = [ "cargo_metadata", - "proc-macro2 1.0.85", - "quote 1.0.36", + "proc-macro2", + "quote", "serde", "strum_macros", ] @@ -2298,8 +2482,8 @@ dependencies = [ "darling 0.14.4", "if_chain", "lazy_static", - "proc-macro2 1.0.85", - "quote 1.0.36", + "proc-macro2", + "quote", "subprocess", "syn 1.0.109", "test-fuzz-internal", @@ -2336,8 +2520,8 @@ version = "1.0.61" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "46c3384250002a6d5af4d114f2845d37b57521033f30d5c3f46c4d70e1197533" dependencies = [ - "proc-macro2 1.0.85", - "quote 1.0.36", + "proc-macro2", + "quote", "syn 2.0.66", ] @@ -2356,6 +2540,40 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" +[[package]] +name = "toml" +version = "0.8.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1ed1f98e3fdc28d6d910e6737ae6ab1a93bf1985935a1193e68f93eeb68d24e" +dependencies = [ + "serde", + "serde_spanned", + "toml_datetime", + "toml_edit", +] + +[[package]] +name = "toml_datetime" +version = "0.6.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0dd7358ecb8fc2f8d014bf86f6f638ce72ba252a2c3a2572f2a795f1d23efb41" +dependencies = [ + "serde", +] + +[[package]] +name = "toml_edit" +version = "0.22.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "583c44c02ad26b0c3f3066fe629275e50627026c51ac2e595cca4c230ce1ce1d" +dependencies = [ + "indexmap 2.2.6", + "serde", + "serde_spanned", + "toml_datetime", + "winnow", +] + [[package]] name = "toolchain_find" version = "0.2.0" @@ -2386,8 +2604,8 @@ version = "0.1.27" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ - "proc-macro2 1.0.85", - "quote 1.0.36", + "proc-macro2", + "quote", "syn 2.0.66", ] @@ -2425,12 +2643,27 @@ version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eaea85b334db583fe3274d12b4cd1880032beab409c0d774be044d4480ab9a94" +[[package]] +name = "unicode-bidi" +version = "0.3.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" + [[package]] name = "unicode-ident" version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" +[[package]] +name = "unicode-normalization" +version = "0.1.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a56d1686db2308d901306f92a263857ef59ea39678a5458e7cb17f01415101f5" +dependencies = [ + "tinyvec", +] + [[package]] name = "unicode-width" version = "0.1.13" @@ -2438,10 +2671,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0336d538f7abc86d282a4189614dfaa90810dfc2c6f6427eaf88e16311dd225d" [[package]] -name = "unicode-xid" -version = "0.1.0" +name = "unsafe-libyaml" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc72304796d0818e357ead4e000d19c9c174ab23dc11093ac919054d20a6a7fc" +checksum = "673aac59facbab8a9007c7f6108d11f63b603f7cabff99fabf650fea5c32b861" [[package]] name = "unzip-n" @@ -2449,11 +2682,23 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c2e7e85a0596447f0f2ac090e16bc4c516c6fe91771fb0c0ccf7fa3dae896b9c" dependencies = [ - "proc-macro2 1.0.85", - "quote 1.0.36", + "proc-macro2", + "quote", "syn 1.0.109", ] +[[package]] +name = "url" +version = "2.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22784dbdf76fdde8af1aeda5622b546b422b6fc585325248a2bf9f5e41e94d6c" +dependencies = [ + "form_urlencoded", + "idna", + "percent-encoding", + "serde", +] + [[package]] name = "uuid" version = "1.8.0" @@ -2516,8 +2761,8 @@ dependencies = [ "bumpalo", "log", "once_cell", - "proc-macro2 1.0.85", - "quote 1.0.36", + "proc-macro2", + "quote", "syn 2.0.66", "wasm-bindgen-shared", ] @@ -2528,7 +2773,7 @@ version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" dependencies = [ - "quote 1.0.36", + "quote", "wasm-bindgen-macro-support", ] @@ -2538,8 +2783,8 @@ version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" dependencies = [ - "proc-macro2 1.0.85", - "quote 1.0.36", + "proc-macro2", + "quote", "syn 2.0.66", "wasm-bindgen-backend", "wasm-bindgen-shared", @@ -2562,9 +2807,9 @@ dependencies = [ [[package]] name = "wasmer" -version = "4.2.8" +version = "4.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4014573f108a246858299eb230031e268316fd57207bd2e8afc79b20fc7ce983" +checksum = "6ce4a267a570e121c9375136adefa2c48810273907de9c6817bc19db4d6144bc" dependencies = [ "bytes", "cfg-if", @@ -2591,9 +2836,9 @@ dependencies = [ [[package]] name = "wasmer-compiler" -version = "4.2.8" +version = "4.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a77bfe259f08e8ec9e77f8f772ebfb4149f799d1f637231c5a5a6a90c447256" +checksum = "b9c23098e86ef1038155684fe50f0c1079a0e2a2e70f115b789df17e6ba98d20" dependencies = [ "backtrace", "bytes", @@ -2614,13 +2859,14 @@ dependencies = [ "wasmer-vm", "wasmparser", "winapi", + "xxhash-rust", ] [[package]] name = "wasmer-compiler-cranelift" -version = "4.2.8" +version = "4.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9280c47ebc754f95357745a38a995dd766f149e16b26e1b7e35741eb23c03d12" +checksum = "95287b79973ad5f485215733ef9f0d4bb951a6b7e655585d2bd3d4a4ba1253c9" dependencies = [ "cranelift-codegen", "cranelift-entity", @@ -2635,39 +2881,66 @@ dependencies = [ "wasmer-types", ] +[[package]] +name = "wasmer-config" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4b4a632496950fde9ad821e195ef1a301440076f7c7d80de55239a140359bcbd" +dependencies = [ + "anyhow", + "bytesize", + "derive_builder", + "hex", + "indexmap 2.2.6", + "schemars", + "semver 1.0.23", + "serde", + "serde_cbor", + "serde_json", + "serde_yaml", + "thiserror", + "toml", + "url", +] + [[package]] name = "wasmer-derive" -version = "4.2.8" +version = "4.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9352877c4f07fc59146d21b56ae6dc469caf342587f49c81b4fbeafead31972" +checksum = "e48f36aeeecb655f15fdd358bdf6e4cec27df181468fa4226084157e8462bd5e" dependencies = [ "proc-macro-error", - "proc-macro2 1.0.85", - "quote 1.0.36", + "proc-macro2", + "quote", "syn 1.0.109", ] [[package]] name = "wasmer-types" -version = "4.2.8" +version = "4.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "749214b6170f2b2fbbfe5b7e7f8d381e64930ac4122f3abceb33cde0292d45d2" +checksum = "83cb97b6b20084757a2a8d548dc0d4179c3fe9e2d711740423a1e6aa3f8b9091" dependencies = [ "bytecheck", "enum-iterator", "enumset", + "getrandom", + "hex", "indexmap 1.9.3", "more-asserts", "rkyv", + "sha2", "target-lexicon", "thiserror", + "webc", + "xxhash-rust", ] [[package]] name = "wasmer-vm" -version = "4.2.8" +version = "4.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "300215479de0deeb453e95aeb1b9c8ffd9bc7d9bd27c5f9e8a184e54db4d31a9" +checksum = "bc1e19d986844b17b927ec8b0c7f3da6a7a2c2cb3b0f8ca5d4cb1a1f71bfb124" dependencies = [ "backtrace", "cc", @@ -2723,11 +2996,40 @@ dependencies = [ "wast", ] +[[package]] +name = "webc" +version = "6.0.0-rc2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb3e2ccb43d303c5bd48f31db7a129481a9aaa5343d623f92951751df190df81" +dependencies = [ + "anyhow", + "base64", + "bytes", + "cfg-if", + "document-features", + "flate2", + "indexmap 1.9.3", + "libc", + "once_cell", + "semver 1.0.23", + "serde", + "serde_cbor", + "serde_json", + "sha2", + "shared-buffer", + "tar", + "tempfile", + "thiserror", + "toml", + "url", + "wasmer-config", +] + [[package]] name = "whi_hdi_extensions" -version = "0.9.0" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "072c0bb6e7bbb92a55bd764c7e864a3fdec4f661a7a9f8827c5cd6d4668e7125" +checksum = "33ac21545e93b405717f6aa5f5a5a1a2c9611ed78836fb7ecaff3be6fb84eb48" dependencies = [ "hdi", "holo_hash", @@ -2736,9 +3038,9 @@ dependencies = [ [[package]] name = "whi_hdk_extensions" -version = "0.9.0" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61d2cfb4f9575143c91f98ea507ff6a1e1514436af73ae44dfe931ca4fe78864" +checksum = "5ce917b5c5692b97611e2c93079de34290fcfbe7f45582318207c3adf86a493d" dependencies = [ "hdk", "serde", @@ -2968,6 +3270,15 @@ version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0" +[[package]] +name = "winnow" +version = "0.6.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68a9bda4691f099d435ad181000724da8e5899daa10713c2d432552b9ccd3a6f" +dependencies = [ + "memchr", +] + [[package]] name = "wyz" version = "0.5.1" @@ -2977,6 +3288,23 @@ dependencies = [ "tap", ] +[[package]] +name = "xattr" +version = "1.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8da84f1a25939b27f6820d92aed108f83ff920fdf11a7b19366c27c4cda81d4f" +dependencies = [ + "libc", + "linux-raw-sys", + "rustix", +] + +[[package]] +name = "xxhash-rust" +version = "0.8.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a5cbf750400958819fb6178eaa83bee5cd9c29a26a40cc241df8c70fdd46984" + [[package]] name = "zeroize" version = "1.8.1" diff --git a/Cargo.toml b/Cargo.toml index 98eafad..5166db8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -19,13 +19,13 @@ rmp-serde = "1" serde_bytes = "0.11" hc_deepkey_types = { version = "0.8.0-dev.1", path = "dnas/deepkey/types" } hc_deepkey_sdk = { version = "0.7.0-dev.1", path = "dnas/deepkey/sdk" } -holo_hash = { version = "=0.4.0-dev.5", features = ["hashing", "encoding"] } -holochain_integrity_types = { version = "=0.4.0-dev.5" } -hdi = { version = "=0.5.0-dev.5" } -hdk = { version = "=0.4.0-dev.6" } -whi_hdi_extensions = { version = "0.9" } +holo_hash = { version = "=0.4.0-dev.9", features = ["hashing", "encoding"] } +holochain_integrity_types = { version = "=0.4.0-dev.10" } +hdi = { version = "=0.5.0-dev.10" } +hdk = { version = "=0.4.0-dev.11" } +whi_hdi_extensions = { version = "0.10" } # whi_hdi_extensions = { path = "../whi_hdi_extensions" } -whi_hdk_extensions = { version = "0.9" } +whi_hdk_extensions = { version = "0.10" } # whi_hdk_extensions = { path = "../whi_hdk_extensions" } [workspace.dependencies.deepkey] diff --git a/dnas/deepkey/sdk/Cargo.toml b/dnas/deepkey/sdk/Cargo.toml index 58e11eb..4beb1d2 100644 --- a/dnas/deepkey/sdk/Cargo.toml +++ b/dnas/deepkey/sdk/Cargo.toml @@ -2,7 +2,7 @@ name = "hc_deepkey_sdk" version = "0.7.0-dev.1" authors = ["Matthew Brisebois "] -edition = "2018" +edition = "2021" license = "CAL-1.0" repository = "https://github.com/holochain/deepkey" description = "SDK for the Deepkey DNA Zomes" @@ -14,7 +14,7 @@ crate-type = ["cdylib", "rlib"] [dependencies] hc_deepkey_types = { version = "0.8.0-dev.1", path = "../types" } -hdk = "=0.4.0-dev.6" +hdk = "=0.4.0-dev.11" serde = "1" serde_bytes = "0.11" diff --git a/dnas/deepkey/types/Cargo.toml b/dnas/deepkey/types/Cargo.toml index 84ae5c7..08be9b5 100644 --- a/dnas/deepkey/types/Cargo.toml +++ b/dnas/deepkey/types/Cargo.toml @@ -2,7 +2,7 @@ name = "hc_deepkey_types" version = "0.8.0-dev.1" authors = ["Matthew Brisebois "] -edition = "2018" +edition = "2021" license = "CAL-1.0" repository = "https://github.com/holochain/deepkey" description = "Definitions used by the Deepkey DNA Zomes" @@ -13,9 +13,9 @@ name = "deepkey_types" crate-type = ["cdylib", "rlib"] [dependencies] -hdi = "=0.5.0-dev.5" -holo_hash = { version = "=0.4.0-dev.5", features = ["hashing", "encoding"] } -holochain_integrity_types = "=0.4.0-dev.5" +hdi = "=0.5.0-dev.10" +holo_hash = { version = "=0.4.0-dev.9", features = ["hashing", "encoding"] } +holochain_integrity_types = "=0.4.0-dev.10" rmpv = { version = "1", features = ["with-serde"] } serde = "1" diff --git a/flake.lock b/flake.lock index ac416c9..2fb54df 100644 --- a/flake.lock +++ b/flake.lock @@ -1,388 +1,24 @@ { "nodes": { - "cargo-chef": { - "flake": false, - "locked": { - "lastModified": 1716357509, - "narHash": "sha256-7iSxwTaJnDLqaFu4ydxkx7ivhDvSQQcXWKawv/e4NHE=", - "owner": "LukeMathWalker", - "repo": "cargo-chef", - "rev": "b468537839bfc7c23d744b85d7a5090954626550", - "type": "github" - }, - "original": { - "owner": "LukeMathWalker", - "ref": "main", - "repo": "cargo-chef", - "type": "github" - } - }, - "cargo-rdme": { - "flake": false, - "locked": { - "lastModified": 1675118998, - "narHash": "sha256-lrYWqu3h88fr8gG3Yo5GbFGYaq5/1Os7UtM+Af0Bg4k=", - "owner": "orium", - "repo": "cargo-rdme", - "rev": "f9dbb6bccc078f4869f45ae270a2890ac9a75877", - "type": "github" - }, - "original": { - "owner": "orium", - "ref": "v1.1.0", - "repo": "cargo-rdme", - "type": "github" - } - }, - "crane": { - "inputs": { - "nixpkgs": [ - "holochain-flake", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1721322122, - "narHash": "sha256-a0G1NvyXGzdwgu6e1HQpmK5R5yLsfxeBe07nNDyYd+g=", - "owner": "ipetkov", - "repo": "crane", - "rev": "8a68b987c476a33e90f203f0927614a75c3f47ea", - "type": "github" - }, - "original": { - "owner": "ipetkov", - "repo": "crane", - "type": "github" - } - }, - "crate2nix": { - "flake": false, - "locked": { - "lastModified": 1719760654, - "narHash": "sha256-L3VIJ9182wsYJqP27xO5qiWwfK+a00x0JHiy8ns3NQE=", - "owner": "kolloch", - "repo": "crate2nix", - "rev": "a6ca1e58132bab26fc08572f22a34bbb86f4d91d", - "type": "github" - }, - "original": { - "owner": "kolloch", - "repo": "crate2nix", - "type": "github" - } - }, - "empty": { - "flake": false, - "locked": { - "lastModified": 1683792623, - "narHash": "sha256-pQpattmS9VmO3ZIQUFn66az8GSmB4IvYhTTCFn6SUmo=", - "owner": "steveej", - "repo": "empty", - "rev": "8e328e450e4cd32e072eba9e99fe92cf2a1ef5cf", - "type": "github" - }, - "original": { - "owner": "steveej", - "repo": "empty", - "type": "github" - } - }, - "flake-compat": { - "flake": false, - "locked": { - "lastModified": 1696426674, - "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", - "owner": "edolstra", - "repo": "flake-compat", - "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", - "type": "github" - }, - "original": { - "owner": "edolstra", - "repo": "flake-compat", - "type": "github" - } - }, - "flake-parts": { - "inputs": { - "nixpkgs-lib": "nixpkgs-lib" - }, - "locked": { - "lastModified": 1719994518, - "narHash": "sha256-pQMhCCHyQGRzdfAkdJ4cIWiw+JNuWsTX7f0ZYSyz0VY=", - "owner": "hercules-ci", - "repo": "flake-parts", - "rev": "9227223f6d922fee3c7b190b2cc238a99527bbb7", - "type": "github" - }, - "original": { - "id": "flake-parts", - "type": "indirect" - } - }, - "holochain": { - "flake": false, - "locked": { - "lastModified": 1717619254, - "narHash": "sha256-iuhK1TA9tF5r3tfBfiwT1ruBMW8QAKfgZn7CIXWZs4w=", - "owner": "holochain", - "repo": "holochain", - "rev": "2ce54138e975104b7f6ea0d7c802265a34a2bf1b", - "type": "github" - }, - "original": { - "owner": "holochain", - "ref": "holochain-0.4.0-dev.7", - "repo": "holochain", - "type": "github" - } - }, - "holochain-flake": { - "inputs": { - "cargo-chef": "cargo-chef", - "cargo-rdme": "cargo-rdme", - "crane": "crane", - "crate2nix": "crate2nix", - "empty": "empty", - "flake-compat": "flake-compat", - "flake-parts": "flake-parts", - "holochain": "holochain", - "lair": "lair", - "launcher": [ - "holochain-flake", - "empty" - ], - "nix-filter": "nix-filter", - "nixpkgs": "nixpkgs", - "pre-commit-hooks-nix": "pre-commit-hooks-nix", - "repo-git": "repo-git", - "rust-overlay": "rust-overlay", - "scaffolding": [ - "holochain-flake", - "empty" - ], - "versions": "versions" - }, - "locked": { - "lastModified": 1721413603, - "narHash": "sha256-LrSUS7RQ4NiWTlaZ3QR8gdcOUdT+vfPcZVkOfG73tPM=", - "owner": "holochain", - "repo": "holochain", - "rev": "d36925c84609a36303c3b6439d03d07c46e71078", - "type": "github" - }, - "original": { - "owner": "holochain", - "repo": "holochain", - "type": "github" - } - }, - "holochain_2": { - "flake": false, - "locked": { - "lastModified": 1718142789, - "narHash": "sha256-Lam1hWLqi+zv0umdTIIHK9YKHVWQrI/Z4AySo97xK9E=", - "owner": "holochain", - "repo": "holochain", - "rev": "582f05b66b690448b1574d1aa6004114ff98187f", - "type": "github" - }, - "original": { - "owner": "holochain", - "ref": "holochain-0.3.1", - "repo": "holochain", - "type": "github" - } - }, - "lair": { - "flake": false, - "locked": { - "lastModified": 1709335027, - "narHash": "sha256-rKMhh7TLuR1lqze2YFWZCGYKZQoB4dZxjpX3sb7r7Jk=", - "owner": "holochain", - "repo": "lair", - "rev": "826be915efc839d1d1b8a2156b158999b8de8d5b", - "type": "github" - }, - "original": { - "owner": "holochain", - "ref": "lair_keystore-v0.4.4", - "repo": "lair", - "type": "github" - } - }, - "lair_2": { - "flake": false, - "locked": { - "lastModified": 1709335027, - "narHash": "sha256-rKMhh7TLuR1lqze2YFWZCGYKZQoB4dZxjpX3sb7r7Jk=", - "owner": "holochain", - "repo": "lair", - "rev": "826be915efc839d1d1b8a2156b158999b8de8d5b", - "type": "github" - }, - "original": { - "owner": "holochain", - "ref": "lair_keystore-v0.4.4", - "repo": "lair", - "type": "github" - } - }, - "launcher": { - "flake": false, - "locked": { - "lastModified": 1717431387, - "narHash": "sha256-+VvWwBmxcgePV1L6kU2mSkg3emMiMgpdQnCqvQJkRPk=", - "owner": "holochain", - "repo": "hc-launch", - "rev": "9d9cab5e6b57e1c278113921ff203e515c8bbd2e", - "type": "github" - }, - "original": { - "owner": "holochain", - "ref": "holochain-0.3", - "repo": "hc-launch", - "type": "github" - } - }, - "nix-filter": { - "locked": { - "lastModified": 1710156097, - "narHash": "sha256-1Wvk8UP7PXdf8bCCaEoMnOT1qe5/Duqgj+rL8sRQsSM=", - "owner": "numtide", - "repo": "nix-filter", - "rev": "3342559a24e85fc164b295c3444e8a139924675b", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "nix-filter", - "type": "github" - } - }, "nixpkgs": { "locked": { - "lastModified": 1721138476, - "narHash": "sha256-+W5eZOhhemLQxelojLxETfbFbc19NWawsXBlapYpqIA=", + "lastModified": 1720781449, + "narHash": "sha256-po3TZO9kcZwzvkyMJKb0WCzzDtiHWD34XeRaX1lWXp0=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "ad0b5eed1b6031efaed382844806550c3dcb4206", + "rev": "8b5a3d5a1d951344d683b442c0739010b80039db", "type": "github" }, "original": { - "id": "nixpkgs", - "ref": "nixos-unstable", - "type": "indirect" - } - }, - "nixpkgs-lib": { - "locked": { - "lastModified": 1719876945, - "narHash": "sha256-Fm2rDDs86sHy0/1jxTOKB1118Q0O3Uc7EC0iXvXKpbI=", - "type": "tarball", - "url": "https://github.com/NixOS/nixpkgs/archive/5daf0514482af3f97abaefc78a6606365c9108e2.tar.gz" - }, - "original": { - "type": "tarball", - "url": "https://github.com/NixOS/nixpkgs/archive/5daf0514482af3f97abaefc78a6606365c9108e2.tar.gz" - } - }, - "pre-commit-hooks-nix": { - "flake": false, - "locked": { - "lastModified": 1721042469, - "narHash": "sha256-6FPUl7HVtvRHCCBQne7Ylp4p+dpP3P/OYuzjztZ4s70=", - "owner": "cachix", - "repo": "pre-commit-hooks.nix", - "rev": "f451c19376071a90d8c58ab1a953c6e9840527fd", - "type": "github" - }, - "original": { - "owner": "cachix", - "repo": "pre-commit-hooks.nix", + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", "type": "github" } }, - "repo-git": { - "flake": false, - "locked": { - "narHash": "sha256-d6xi4mKdjkX2JFicDIv5niSzpyI0m/Hnm8GGAIU04kY=", - "type": "file", - "url": "file:/dev/null" - }, - "original": { - "type": "file", - "url": "file:/dev/null" - } - }, "root": { "inputs": { - "holochain-flake": "holochain-flake", - "nixpkgs": [ - "holochain-flake", - "nixpkgs" - ] - } - }, - "rust-overlay": { - "inputs": { - "nixpkgs": [ - "holochain-flake", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1721355572, - "narHash": "sha256-I4TQ2guV9jTmZsXeWt5HMojcaqNZHII4zu0xIKZEovM=", - "owner": "oxalica", - "repo": "rust-overlay", - "rev": "d5bc7b1b21cf937fb8ff108ae006f6776bdb163d", - "type": "github" - }, - "original": { - "owner": "oxalica", - "repo": "rust-overlay", - "type": "github" - } - }, - "scaffolding": { - "flake": false, - "locked": { - "lastModified": 1721322247, - "narHash": "sha256-HtYc28vwS2+YzgE5ZHq+U9vg0W1/mvFblGkLUhMx5wA=", - "owner": "holochain", - "repo": "scaffolding", - "rev": "fa5f502eed7fe4438105e0cca6c22f8eed999c52", - "type": "github" - }, - "original": { - "owner": "holochain", - "ref": "holochain-0.3", - "repo": "scaffolding", - "type": "github" - } - }, - "versions": { - "inputs": { - "holochain": "holochain_2", - "lair": "lair_2", - "launcher": "launcher", - "scaffolding": "scaffolding" - }, - "locked": { - "dir": "versions/0_3", - "lastModified": 1721403618, - "narHash": "sha256-SO9MOHuuuQE5PXnCngwbWB0M47QH8rN7GHWVUWnHx80=", - "owner": "holochain", - "repo": "holochain", - "rev": "cfacdd7dace3b78b47daecd69e7d3249d154f1d6", - "type": "github" - }, - "original": { - "dir": "versions/0_3", - "owner": "holochain", - "repo": "holochain", - "type": "github" + "nixpkgs": "nixpkgs" } } }, diff --git a/flake.nix b/flake.nix index 63d081d..54de870 100644 --- a/flake.nix +++ b/flake.nix @@ -2,25 +2,37 @@ description = "Holochain Development Env"; inputs = { - nixpkgs.follows = "holochain-flake/nixpkgs"; - holochain-flake = { - url = "github:holochain/holochain"; - inputs.holochain.url = "github:holochain/holochain/holochain-0.4.0-dev.7"; - inputs.lair.url = "github:holochain/lair/lair_keystore-v0.4.4"; - }; + nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; }; - outputs = inputs @ { ... }: - inputs.holochain-flake.inputs.flake-parts.lib.mkFlake { - inherit inputs; - } { - systems = builtins.attrNames inputs.holochain-flake.devShells; - perSystem = { config, pkgs, system, ... }: { - devShells.default = pkgs.mkShell { - inputsFrom = [ inputs.holochain-flake.devShells.${system}.holonix ]; - packages = with pkgs; [ + outputs = { self, nixpkgs }: + let + system = "x86_64-linux"; + pkgs = import ./pkgs.nix { + pkgs = nixpkgs.legacyPackages.${system}; + inherit system; + }; + in + { + devShells.${system} = { + default = pkgs.mkShell { + buildInputs = with pkgs; [ + holochain_0-4 + lair-keystore_0-4-5 + hc_0-4 + + rustup + cargo + rustc + nodejs_22 ]; + + shellHook = '' + export PS1="\[\e[1;32m\](flake-env)\[\e[0m\] \[\e[1;34m\]\u@\h:\w\[\e[0m\]$ " + rustup default stable + rustup target add wasm32-unknown-unknown + ''; }; }; }; diff --git a/pkgs.nix b/pkgs.nix new file mode 100644 index 0000000..3881add --- /dev/null +++ b/pkgs.nix @@ -0,0 +1,11 @@ +{ pkgs, system }: + +import (pkgs.fetchFromGitHub { + owner = "spartan-holochain-counsel"; + repo = "nix-overlay"; + rev = "9c0ed332596994faaacb35593a2d427f9ac38bf2"; + sha256 = "E8dKMuhnd51Rh1tLud/asf/4TTFuZaIs0fZbe/rsUuQ="; +}) { + inherit pkgs; + inherit system; +} diff --git a/zomes/deepkey/Cargo.toml b/zomes/deepkey/Cargo.toml index dcec083..e39e21b 100644 --- a/zomes/deepkey/Cargo.toml +++ b/zomes/deepkey/Cargo.toml @@ -2,7 +2,6 @@ name = "deepkey" version = "0.0.0" edition = "2021" -resolver = "2" [lib] crate-type = ["cdylib", "rlib"] diff --git a/zomes/deepkey_csr/Cargo.toml b/zomes/deepkey_csr/Cargo.toml index 565b0c3..cc08966 100644 --- a/zomes/deepkey_csr/Cargo.toml +++ b/zomes/deepkey_csr/Cargo.toml @@ -2,7 +2,6 @@ name = "deepkey_csr" version = "0.0.0" edition = "2021" -resolver = "2" [lib] crate-type = ["cdylib", "rlib"] From 0cb35c3d3b7503f3cad98cbd27e3ec6b2823b928 Mon Sep 17 00:00:00 2001 From: Matthew Brisebois Date: Mon, 5 Aug 2024 14:33:56 -0600 Subject: [PATCH 04/10] Add CI workflow for all tests --- .github/workflows/all-tests.yml | 41 +++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 .github/workflows/all-tests.yml diff --git a/.github/workflows/all-tests.yml b/.github/workflows/all-tests.yml new file mode 100644 index 0000000..2a30b25 --- /dev/null +++ b/.github/workflows/all-tests.yml @@ -0,0 +1,41 @@ +name: All Tests + +on: + push: + branches: + - master + - develop + pull_request: + branches: + - master + +jobs: + test: + runs-on: ubuntu-latest + + steps: + - name: Checkout Repository + uses: actions/checkout@v4 + + - name: Install Nix + uses: cachix/install-nix-action@v27 + with: + nix_path: nixpkgs=channel:nixos-unstable + + - name: Build Packages + run: | + nix develop --command make build + + - name: Run Tests + run: | + output=$(DEBUG_LEVEL=trace nix develop --command bash -c 'make test | tee >(cat >&2); exit ${PIPESTATUS[0]}'); + if [ ${PIPESTATUS[0]} -ne 0 ]; then exit ${PIPESTATUS[0]}; fi + passing=$(echo "$output" | grep -oP '\d+ passing' | grep -oP '\d+' | awk '{sum+=$1} END {print sum}') + failing=$(echo "$output" | grep -oP '\d+ failing' | grep -oP '\d+' | awk '{sum+=$1} END {print sum}') + pending=$(echo "$output" | grep -oP '\d+ pending' | grep -oP '\d+' | awk '{sum+=$1} END {print sum}') + echo "## Summary" >> $GITHUB_STEP_SUMMARY + echo "" >> $GITHUB_STEP_SUMMARY + echo "| Passed | Failed | Pending |" >> $GITHUB_STEP_SUMMARY + echo "|----------|----------|----------|" >> $GITHUB_STEP_SUMMARY + echo "| $passing | $failing | $pending |" >> $GITHUB_STEP_SUMMARY + if [ "$failing" -ne 0 ]; then exit 1; fi From beb15fe3164dfa08bc556e8743bc8297532f5683 Mon Sep 17 00:00:00 2001 From: Matthew Brisebois Date: Mon, 5 Aug 2024 14:36:42 -0600 Subject: [PATCH 05/10] .github/workflows/all-tests.yml: update branch triggers --- .github/workflows/all-tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/all-tests.yml b/.github/workflows/all-tests.yml index 2a30b25..7dc6d7d 100644 --- a/.github/workflows/all-tests.yml +++ b/.github/workflows/all-tests.yml @@ -3,11 +3,11 @@ name: All Tests on: push: branches: - - master + - main - develop pull_request: branches: - - master + - main jobs: test: From 36237758f32f78d90c631f291f3df02a6d05a49a Mon Sep 17 00:00:00 2001 From: Matthew Brisebois Date: Mon, 5 Aug 2024 14:40:10 -0600 Subject: [PATCH 06/10] .github/workflows/all-tests.yml: fix build step --- .github/workflows/all-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/all-tests.yml b/.github/workflows/all-tests.yml index 7dc6d7d..72dcb69 100644 --- a/.github/workflows/all-tests.yml +++ b/.github/workflows/all-tests.yml @@ -24,7 +24,7 @@ jobs: - name: Build Packages run: | - nix develop --command make build + nix develop --command make dnas/deepkey.dna - name: Run Tests run: | From 8719a9e2dfe7186dde905c4376f9d07bcccb8ad3 Mon Sep 17 00:00:00 2001 From: Matthew Brisebois Date: Tue, 6 Aug 2024 07:53:31 -0600 Subject: [PATCH 07/10] Log full chain before failing test --- dnas/deepkey/zomelets/src/index.js | 8 +++++++ dnas/deepkey/zomelets/src/types.js | 33 ++++++++++++++++++++++++-- package-lock.json | 9 +++---- package.json | 2 +- tests/integration/test_change_rules.js | 3 +++ zomes/deepkey_csr/src/lib.rs | 11 +++++++++ 6 files changed, 59 insertions(+), 7 deletions(-) diff --git a/dnas/deepkey/zomelets/src/index.js b/dnas/deepkey/zomelets/src/index.js index 50ca139..dd9fa81 100644 --- a/dnas/deepkey/zomelets/src/index.js +++ b/dnas/deepkey/zomelets/src/index.js @@ -94,6 +94,14 @@ const functions = { return new Signature( result ); }, + async query_whole_chain() { + const result = await this.call(); + + return result.map( record => { + record.signed_action = SignedAction(record.signed_action); + return record; + }); + }, // Public reading async get_keyset_root ( input ) { diff --git a/dnas/deepkey/zomelets/src/types.js b/dnas/deepkey/zomelets/src/types.js index 83708f7..d35a2fe 100644 --- a/dnas/deepkey/zomelets/src/types.js +++ b/dnas/deepkey/zomelets/src/types.js @@ -47,6 +47,25 @@ export const ActionBaseStruct = { "action_seq": Number, "prev_action": OptionType( ActionHash ), } +export const DnaActionStruct = { + "type": String, + "author": AgentPubKey, + "timestamp": Number, + "hash": DnaHash, +}; +export const AgentValidationPkgActionStruct = { + ...ActionBaseStruct, + "membrane_proof": Bytes, +}; +export const NativeCreateActionStruct = { + ...ActionBaseStruct, + "entry_type": String, + "entry_hash": EntryHash, + "weight": WeightStruct, +}; +export const InitZomesCompleteActionStruct = { + ...ActionBaseStruct, +}; export const CreateActionStruct = { ...ActionBaseStruct, "entry_type": EntryTypeEnum, @@ -80,8 +99,18 @@ export const CreateLinkActionStruct = { export class ActionEnum { constructor ( data ) { - if ( data.type === "Create" ) - return intoStruct( data, CreateActionStruct ); + if ( data.type === "Dna" ) + return intoStruct( data, DnaActionStruct ); + if ( data.type === "AgentValidationPkg" ) + return intoStruct( data, AgentValidationPkgActionStruct ); + if ( data.type === "InitZomesComplete" ) + return intoStruct( data, InitZomesCompleteActionStruct ); + if ( data.type === "Create" ) { + if ( typeof data.entry_type === "string" ) + return intoStruct( data, NativeCreateActionStruct ); + else + return intoStruct( data, CreateActionStruct ); + } if ( data.type === "Update" ) return intoStruct( data, UpdateActionStruct ); if ( data.type === "Delete" ) diff --git a/package-lock.json b/package-lock.json index 4904f27..206b730 100644 --- a/package-lock.json +++ b/package-lock.json @@ -15,7 +15,7 @@ "@spartan-hc/app-interface-client": "^0.7.2", "@spartan-hc/holo-hash": "^0.7.0", "@spartan-hc/holochain-backdrop": "^4.4.1", - "@whi/json": "^0.1.7", + "@whi/json": "^0.1.8", "@whi/weblogger": "^0.4.0", "chai": "^4.3.4", "markdown-doctest": "^1.1.0", @@ -2483,10 +2483,11 @@ "dev": true }, "node_modules/@whi/json": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/@whi/json/-/json-0.1.7.tgz", - "integrity": "sha512-Rhys8tpfzVW/xfXbbeJOtb4vdp4vfxbpD4L/twHuWWtD06OCVdSvWLPB/Jp9CnrXwxtdyVpOdj80nyilXWEswA==", + "version": "0.1.8", + "resolved": "https://registry.npmjs.org/@whi/json/-/json-0.1.8.tgz", + "integrity": "sha512-hn/6EMZtseuoXCBQqvQUCsy8N7N7Se1RiSOC2WbHkz3c1o/QBe6ZdabQNWalQo4kmCT/VoEt0+bAhxkgbCxPag==", "dev": true, + "license": "ISC", "dependencies": { "@whi/object-walk": "^0.1.4" } diff --git a/package.json b/package.json index 27898eb..9ab7244 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,7 @@ "@spartan-hc/app-interface-client": "^0.7.2", "@spartan-hc/holo-hash": "^0.7.0", "@spartan-hc/holochain-backdrop": "^4.4.1", - "@whi/json": "^0.1.7", + "@whi/json": "^0.1.8", "@whi/weblogger": "^0.4.0", "chai": "^4.3.4", "markdown-doctest": "^1.1.0", diff --git a/tests/integration/test_change_rules.js b/tests/integration/test_change_rules.js index 57a6b07..5b7c607 100644 --- a/tests/integration/test_change_rules.js +++ b/tests/integration/test_change_rules.js @@ -125,6 +125,9 @@ function basic_tests () { }); // log.normal("Constructed Authority Spec: %s", json.debug(auth_spec_package.authority_spec) ); + const chain = await alice1_deepkey.query_whole_chain(); + log.normal("CHAIN: %s", json.debug(chain) ); + const new_change_rule = await alice1_deepkey.update_change_rule({ "authority_spec": auth_spec_package.authority_spec, }); diff --git a/zomes/deepkey_csr/src/lib.rs b/zomes/deepkey_csr/src/lib.rs index f8cc8a7..565fb63 100644 --- a/zomes/deepkey_csr/src/lib.rs +++ b/zomes/deepkey_csr/src/lib.rs @@ -205,3 +205,14 @@ pub fn sign(bytes: serde_bytes::ByteBuf) -> ExternResult { bytes.into_vec(), ) } + + +#[hdk_extern] +pub fn query_whole_chain() -> ExternResult> { + Ok( + query( + ChainQueryFilter::new() + // .include_entries(true) + )? + ) +} From 10e5d9b5fcd8cca9acc38e8cc3bd5ca4794e5bfc Mon Sep 17 00:00:00 2001 From: Matthew Brisebois Date: Tue, 6 Aug 2024 08:21:49 -0600 Subject: [PATCH 08/10] Include entries in chain dump --- dnas/deepkey/zomelets/src/index.js | 11 +++++++++++ zomes/deepkey_csr/src/lib.rs | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/dnas/deepkey/zomelets/src/index.js b/dnas/deepkey/zomelets/src/index.js index dd9fa81..fedd4f0 100644 --- a/dnas/deepkey/zomelets/src/index.js +++ b/dnas/deepkey/zomelets/src/index.js @@ -7,6 +7,7 @@ import { Zomelet, CellZomelets, } from '@spartan-hc/zomelets'; // approx. 7kb +import msgpack from '@msgpack/msgpack'; import { Signature, SignedAction, @@ -99,6 +100,16 @@ const functions = { return result.map( record => { record.signed_action = SignedAction(record.signed_action); + + if ( record.entry?.Present?.entry ) { + if ( record.entry.Present.entry_type === "App" ) + record.entry.Present.content = msgpack.decode( record.entry.Present.entry ); + else if ( record.entry.Present.entry_type === "Agent" ) + record.entry.Present.content = new AgentPubKey( record.entry.Present.entry ); + else if ( record.entry.Present.entry_type === "CapGrant" ) + record.entry.Present.content = null; + } + return record; }); }, diff --git a/zomes/deepkey_csr/src/lib.rs b/zomes/deepkey_csr/src/lib.rs index 565fb63..6e6484c 100644 --- a/zomes/deepkey_csr/src/lib.rs +++ b/zomes/deepkey_csr/src/lib.rs @@ -212,7 +212,7 @@ pub fn query_whole_chain() -> ExternResult> { Ok( query( ChainQueryFilter::new() - // .include_entries(true) + .include_entries(true) )? ) } From 514889eb6d20e6485b3063caa5467d7ce3b30a53 Mon Sep 17 00:00:00 2001 From: Matthew Brisebois Date: Tue, 6 Aug 2024 12:03:54 -0600 Subject: [PATCH 09/10] types-0.8.0-dev.2 sdk-0.7.0-dev.2 --- Cargo.toml | 4 ++-- Makefile | 1 + crates/holochain_deepkey_dna/Cargo.toml | 2 +- dnas/deepkey/sdk/Cargo.toml | 4 ++-- dnas/deepkey/types/Cargo.toml | 2 +- 5 files changed, 7 insertions(+), 6 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 5166db8..b2b232a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -17,8 +17,8 @@ members = [ serde = "1" rmp-serde = "1" serde_bytes = "0.11" -hc_deepkey_types = { version = "0.8.0-dev.1", path = "dnas/deepkey/types" } -hc_deepkey_sdk = { version = "0.7.0-dev.1", path = "dnas/deepkey/sdk" } +hc_deepkey_types = { version = "0.8.0-dev.2", path = "dnas/deepkey/types" } +hc_deepkey_sdk = { version = "0.7.0-dev.2", path = "dnas/deepkey/sdk" } holo_hash = { version = "=0.4.0-dev.9", features = ["hashing", "encoding"] } holochain_integrity_types = { version = "=0.4.0-dev.10" } hdi = { version = "=0.5.0-dev.10" } diff --git a/Makefile b/Makefile index 8aaf4f5..72c37fd 100644 --- a/Makefile +++ b/Makefile @@ -157,6 +157,7 @@ docs-watch: # Publishing Types Packages # .cargo/credentials: + mkdir -p .cargo cp ~/$@ $@ preview-%-types-crate: .cargo/credentials cd dnas/$*; make preview-types-crate diff --git a/crates/holochain_deepkey_dna/Cargo.toml b/crates/holochain_deepkey_dna/Cargo.toml index e45d8de..5e2da32 100644 --- a/crates/holochain_deepkey_dna/Cargo.toml +++ b/crates/holochain_deepkey_dna/Cargo.toml @@ -17,7 +17,7 @@ name = "holochain_deepkey_dna" path = "src/lib.rs" [dependencies] -hc_deepkey_sdk = { version = "0.7.0-dev.1", path = "../../dnas/deepkey/sdk" } +hc_deepkey_sdk = { version = "0.7.0-dev.2", path = "../../dnas/deepkey/sdk" } [features] fuzzing = [ diff --git a/dnas/deepkey/sdk/Cargo.toml b/dnas/deepkey/sdk/Cargo.toml index 4beb1d2..3c6c208 100644 --- a/dnas/deepkey/sdk/Cargo.toml +++ b/dnas/deepkey/sdk/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "hc_deepkey_sdk" -version = "0.7.0-dev.1" +version = "0.7.0-dev.2" authors = ["Matthew Brisebois "] edition = "2021" license = "CAL-1.0" @@ -13,7 +13,7 @@ name = "deepkey_sdk" crate-type = ["cdylib", "rlib"] [dependencies] -hc_deepkey_types = { version = "0.8.0-dev.1", path = "../types" } +hc_deepkey_types = { version = "0.8.0-dev.2", path = "../types" } hdk = "=0.4.0-dev.11" serde = "1" serde_bytes = "0.11" diff --git a/dnas/deepkey/types/Cargo.toml b/dnas/deepkey/types/Cargo.toml index 08be9b5..3c7865d 100644 --- a/dnas/deepkey/types/Cargo.toml +++ b/dnas/deepkey/types/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "hc_deepkey_types" -version = "0.8.0-dev.1" +version = "0.8.0-dev.2" authors = ["Matthew Brisebois "] edition = "2021" license = "CAL-1.0" From 8b3c8138ad35332766b67557d91aed48bae70456 Mon Sep 17 00:00:00 2001 From: Matthew Brisebois Date: Tue, 20 Aug 2024 10:12:29 -0600 Subject: [PATCH 10/10] Add 60s delay for change rules tests to pass --- .gitignore | 1 + Cargo.lock | 4 +- Makefile | 9 +++-- dnas/deepkey/zomelets/src/types.js | 2 +- flake.lock | 33 ++++++++++++++++ flake.nix | 55 +++++++++++++------------- tests/integration/test_change_rules.js | 7 ++-- 7 files changed, 73 insertions(+), 38 deletions(-) diff --git a/.gitignore b/.gitignore index 3d1dce9..6a7c339 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ /.cargo +/.rustup /target /node_modules /dnas/*/zomelets/node_modules diff --git a/Cargo.lock b/Cargo.lock index 1ea9940..7e7fbbf 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1050,7 +1050,7 @@ checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" [[package]] name = "hc_deepkey_sdk" -version = "0.7.0-dev.1" +version = "0.7.0-dev.2" dependencies = [ "arbitrary", "hc_deepkey_types", @@ -1061,7 +1061,7 @@ dependencies = [ [[package]] name = "hc_deepkey_types" -version = "0.8.0-dev.1" +version = "0.8.0-dev.2" dependencies = [ "arbitrary", "hdi", diff --git a/Makefile b/Makefile index 72c37fd..d4bf5fb 100644 --- a/Makefile +++ b/Makefile @@ -84,6 +84,7 @@ npm-use-backdrop-%: # DEBUG_LEVEL ?= warn TEST_ENV_VARS = LOG_LEVEL=$(DEBUG_LEVEL) +MOCHA_OPTS = -n enable-source-maps -t 5000 TEST_DEPS = node_modules dnas/deepkey/zomelets/node_modules %/package-lock.json: %/package.json @@ -110,13 +111,13 @@ test-integration: make -s test-integration-key-management test-integration-basic: $(DEEPKEY_DNA) $(TEST_DEPS) - cd tests; $(TEST_ENV_VARS) npx mocha ./integration/test_basic.js + cd tests; $(TEST_ENV_VARS) npx mocha $(MOCHA_OPTS) ./integration/test_basic.js test-integration-change-rules: $(DEEPKEY_DNA) $(TEST_DEPS) - cd tests; $(TEST_ENV_VARS) npx mocha ./integration/test_change_rules.js + cd tests; $(TEST_ENV_VARS) npx mocha $(MOCHA_OPTS) ./integration/test_change_rules.js test-integration-key-management: $(DEEPKEY_DNA) $(TEST_DEPS) - cd tests; $(TEST_ENV_VARS) npx mocha ./integration/test_key_management.js + cd tests; $(TEST_ENV_VARS) npx mocha $(MOCHA_OPTS) ./integration/test_key_management.js test-integration-claim-unmanaged-key: $(DEEPKEY_DNA) $(TEST_DEPS) - cd tests; $(TEST_ENV_VARS) npx mocha ./integration/test_claim_unmanaged_key.js + cd tests; $(TEST_ENV_VARS) npx mocha $(MOCHA_OPTS) ./integration/test_claim_unmanaged_key.js # diff --git a/dnas/deepkey/zomelets/src/types.js b/dnas/deepkey/zomelets/src/types.js index d35a2fe..8c10adf 100644 --- a/dnas/deepkey/zomelets/src/types.js +++ b/dnas/deepkey/zomelets/src/types.js @@ -55,7 +55,7 @@ export const DnaActionStruct = { }; export const AgentValidationPkgActionStruct = { ...ActionBaseStruct, - "membrane_proof": Bytes, + "membrane_proof": OptionType( Bytes ), }; export const NativeCreateActionStruct = { ...ActionBaseStruct, diff --git a/flake.lock b/flake.lock index 2fb54df..ff0d1b1 100644 --- a/flake.lock +++ b/flake.lock @@ -1,5 +1,22 @@ { "nodes": { + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1710146030, + "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", + "type": "github" + }, + "original": { + "id": "flake-utils", + "type": "indirect" + } + }, "nixpkgs": { "locked": { "lastModified": 1720781449, @@ -18,8 +35,24 @@ }, "root": { "inputs": { + "flake-utils": "flake-utils", "nixpkgs": "nixpkgs" } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } } }, "root": "root", diff --git a/flake.nix b/flake.nix index 54de870..6afbcd9 100644 --- a/flake.nix +++ b/flake.nix @@ -5,35 +5,36 @@ nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; }; - outputs = { self, nixpkgs }: - let - system = "x86_64-linux"; - pkgs = import ./pkgs.nix { - pkgs = nixpkgs.legacyPackages.${system}; - inherit system; - }; - in - { - devShells.${system} = { - default = pkgs.mkShell { - buildInputs = with pkgs; [ - holochain_0-4 - lair-keystore_0-4-5 - hc_0-4 + outputs = { self, nixpkgs, flake-utils }: + flake-utils.lib.eachDefaultSystem (system: + let + pkgs = import ./pkgs.nix { + pkgs = nixpkgs.legacyPackages.${system}; + inherit system; + }; + in + { + devShell = pkgs.mkShell { + buildInputs = with pkgs; [ + holochain_0-4 + lair-keystore_0-4-5 + hc_0-4 - rustup - cargo - rustc + rustup + cargo + rustc - nodejs_22 - ]; + nodejs_22 + ]; - shellHook = '' - export PS1="\[\e[1;32m\](flake-env)\[\e[0m\] \[\e[1;34m\]\u@\h:\w\[\e[0m\]$ " - rustup default stable - rustup target add wasm32-unknown-unknown - ''; + shellHook = '' + export PS1="\[\e[1;32m\](flake-env)\[\e[0m\] \[\e[1;34m\]\u@\h:\w\[\e[0m\]$ " + export CARGO_HOME=$(pwd)/.cargo + export RUSTUP_HOME=$(pwd)/.rustup + rustup default stable + rustup target add wasm32-unknown-unknown + ''; }; - }; - }; + } + ); } diff --git a/tests/integration/test_change_rules.js b/tests/integration/test_change_rules.js index 5b7c607..835e99b 100644 --- a/tests/integration/test_change_rules.js +++ b/tests/integration/test_change_rules.js @@ -92,7 +92,7 @@ function basic_tests () { let ksr1_addr; before(async function () { - this.timeout( 30_000 ); + this.timeout( 120_000 ); client = new AppInterfaceClient( app_port, { "logging": process.env.LOG_LEVEL || "normal", @@ -112,6 +112,8 @@ function basic_tests () { } ksr1_addr = await alice1_deepkey.query_keyset_authority_action_hash(); + + await new Promise( f => setTimeout(f, 60_000) ); }); it("should update change rule for (alice1) KSR", async function () { @@ -125,9 +127,6 @@ function basic_tests () { }); // log.normal("Constructed Authority Spec: %s", json.debug(auth_spec_package.authority_spec) ); - const chain = await alice1_deepkey.query_whole_chain(); - log.normal("CHAIN: %s", json.debug(chain) ); - const new_change_rule = await alice1_deepkey.update_change_rule({ "authority_spec": auth_spec_package.authority_spec, });