Closed lurenpluto closed 1 year ago
@lizhihongTest
Why cyfs-ts-sdk cyfs.GlobalStatePathAccessItem constructor function can`t set parameter? And cyfs.AccessString not contain Handler type. Currently constructing GlobalStatePathGroupAccess::Handler access is very unfriendly
let item = GlobalStatePathAccessItem {
path: TEST_REQ_PATH.to_owned(),
access: GlobalStatePathGroupAccess::Handler,
};
let item1 : cyfs.GlobalStatePathAccessItem = cyfs.GlobalStatePathAccessItem.new("QATest",cyfs.AccessString.full());
item1.access = cyfs.GlobalStatePathGroupAccess.Handler();
let item2 : cyfs.GlobalStatePathAccessItem = new cyfs.GlobalStatePathAccessItem();
item2.access = cyfs.GlobalStatePathGroupAccess.Handler();
item2.path = "QATest";
@weiqiushi You set cyfs.GlobalStatePathAccessItem constructor private ,If use cyfs-ts-sdk source code ,I can use private constructor ,But if compile code as cyfs_node it will missing private function https://github.com/buckyos/cyfs-ts-sdk/blob/0c7d1d5360bc2e8e0019a5148eab044a07e02c08/src/sdk/cyfs-lib/rmeta/def.ts#L113
@weiqiushi You set cyfs.GlobalStatePathAccessItem constructor private ,If use cyfs-ts-sdk source code ,I can use private constructor ,But if compile code as cyfs_node it will missing private function
Yes. Unlike the rust language, there is no struct in typescript, only use class to approximate the GlobalStatePathAccessItem struct.
And because class must have a constructor, in order to simulate the behavior of new() and new_group() in rust, a private constructor is used, and the public static functions new() and new_group() are used to construct the GlobalStatePathAccessItem.
In fact, in the rust code, if you construct the GlobalStatePathAccessItem using only new() and new_group(), the written code will be the same as the ts version
When emit acl handler,It will maybe throw error "convert base58 str failed, str=undefined, Expected String"
[debug],[2023-04-27 17:20:24.658],<>,will emit handler: full_id=acl_acl_smoke-test-dynamic-token, param={"request":{"dec_id":"9tGpLNndR5tyui8DkYBpEz8mFHzjfqkCVmsFusa5roHd","permissions":"r--","req_path":"/QATest","req_query_string":"token=QATest-token","source":{"dec":"9tGpLNndR5tyui8DkYBpEz8mFHzjfqkCVmsFusa5roHd","protocol":"http-bdt","zone":{"device":"5aSixgMHNaHEBwwhu8VhSCSgynDSzzhSmEbh59DgZRsN","zone":"5r4MYfFQWVzRG9i88MgDEbmRtsdugbsCU81LmFE5cWGF","zone_category":"other-zone"}}}}, cyfs_node.js:85892
[error],[2023-04-27 17:20:24.659],<>,convert base58 str failed, str=undefined, Expected String, cyfs_node.js:35424
[error],[2023-04-27 17:20:25.217],<>,Trace: [trace],[2023-04-27 17:20:24.660],<>,convert base58 str failed, str=undefined, Expected String, cyfs_node.js:35425
at BLogConsoleTarget.output (E:\githubSpace\cyfs-test-lab\src\cyfs-test-dec-app\node_modules\cyfs-sdk-nightly\index.js:94068:13)
at E:\githubSpace\cyfs-test-lab\src\cyfs-test-dec-app\node_modules\cyfs-sdk-nightly\index.js:96145:20
at Array.forEach (
This feature has test finished.
We need to add support for the ts-sdk side of this feature https://github.com/buckyos/CYFS/issues/175, mainly including changes related to the cyfs-lib side, involving the following.