Skip to content
This repository has been archived by the owner on Jan 7, 2020. It is now read-only.

Commit

Permalink
feat/Upgrade safe_client_libs to commit 57f3afb and adapt code to enc…
Browse files Browse the repository at this point in the history
…ode the app's id in the unregistered auth requests (#178)
  • Loading branch information
bochaco authored and hitman401 committed Nov 28, 2017
1 parent 1eb7e3e commit 8459e78
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
},
"safe_app": {
"mirror": "https://s3.eu-west-2.amazonaws.com/safe-client-libs",
"version": "d5d9253",
"version": "57f3afb",
"targetDir": "src/native",
"filename": "safe_app",
"filePattern": "^.*\\.(dll|so|dylib)$",
Expand Down
2 changes: 1 addition & 1 deletion src/api/auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ class AuthInterface {
*/
/* eslint-disable class-methods-use-this */
genConnUri() {
return lib.encode_unregistered_req()
return lib.encode_unregistered_req(this.app.appInfo.id)
.then(addSafeAuthProtocol);
}

Expand Down
7 changes: 5 additions & 2 deletions src/native/_auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ module.exports = {
encode_auth_req: [t.Void, [ ref.refType(AuthReq), 'pointer', 'pointer'] ],
encode_containers_req: [t.Void, [ref.refType(ContainerReq), 'pointer', 'pointer'] ],
encode_share_mdata_req: [t.Void, [ref.refType(ShareMDataReq), 'pointer', 'pointer'] ],
encode_unregistered_req: [t.Void, ['pointer', 'pointer'] ],
encode_unregistered_req: [t.Void, [t.u8Pointer, t.usize, 'pointer', 'pointer'] ],
decode_ipc_msg: [t.Void, [
'string', // (msg: *const c_char,
t.VoidPtr, // user_data: *mut c_void,
Expand Down Expand Up @@ -234,7 +234,10 @@ module.exports = {
encode_containers_req: helpers.Promisified(null, ['uint32', 'char *'], remapEncodeValues),
encode_auth_req: helpers.Promisified(null, ['uint32', 'char *'], remapEncodeValues),
encode_share_mdata_req: helpers.Promisified(null, ['uint32', 'char *'], remapEncodeValues),
encode_unregistered_req: helpers.Promisified(null, ['uint32', 'char *'], remapEncodeValues),
encode_unregistered_req: helpers.Promisified((appId) => {
let str = new Buffer(appId);
return [str, str.length];
}, ['uint32', 'char *'], remapEncodeValues),
decode_ipc_msg: (lib, fn) => {
return ((str) => {
return new Promise((resolve, reject) => {
Expand Down

0 comments on commit 8459e78

Please sign in to comment.