ndidplatform / api Goto Github PK
View Code? Open in Web Editor NEWNDID API
License: GNU Affero General Public License v3.0
NDID API
License: GNU Affero General Public License v3.0
/ndid/initNDID
, if success, will respond with [true, <height>]. Instead, it should respond with success status (true/false) only.
As I have investigated, the issue seems to be caused by
Line 16 in 6fa394f
Since tendermint.transact() returns an array, the line should destructure the returned array and return only success status instead of the whole array.
So it should be something like:
const [ result, height ] = tendermint.transact(
...
init = result;
return init;
'bignum' dependency (C++ binding) is unable to compile successfully when using with NodeJS 10
I have two IDP, AS nodes and RP create request with data request (min_idp=1, min_as=2)
two IDP nodes are respond request at the same time and final callback request status to RP has duplicate response_valid_list like this.
response_valid_list: [ { idp_id: 'idp2', valid_proof: true, valid_ial: true },
{ idp_id: 'idp2', valid_proof: true, valid_ial: true } ]
debug: Query MQ destination for RP { rp_id: null }
[docker_mq-rp_1 exited with code 139
[docker_mq-as_1 exited with code 139
[mdocker_mq-idp-1_1 exited with code 139
[api-ndid_1] Segmentation fault (core dumped)
[docker_mq-idp-2_1] exited with code 139
docker compose up logs:
api-compose-up-with-mq-error.log
GetNodeMasterPublicKey
via Tendermint RPC{"master_public_key":""}
{"master_public_key":"<key_in_pem_format>"}
start-api.sh
when setting path to MASTER_PUBLIC_KEY_PATH
from mq.js
export const defaultMqBindingPort = (() => {
if (process.env.ROLE === 'as') return 5557;
if (process.env.ROLE === 'idp') return 5555;
if (process.env.ROLE === 'rp') return 5556;
})();
If we not set MQ_BINDING_PORT before start process as ndid role, the process will be crashed with
/home/circleci/project/node_modules/zeromq/lib/index.js:451
this._zmq.bindSync(addr);
^
Error: Invalid argument
at exports.Socket.Socket.bindSync (/home/circleci/project/node_modules/zeromq/lib/index.js:451:13)
at Object.<anonymous> (/home/circleci/project/src/mq/index.js:12:17)
at Module._compile (module.js:652:30)
at Object.Module._extensions..js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)
at Module.require (module.js:596:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (/home/circleci/project/src/core/rp.js:10:1)
at Module._compile (module.js:652:30)
at Object.Module._extensions..js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)
at Module.require (module.js:596:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (/home/circleci/project/src/routes/rp.js:4:1)
at Module._compile (module.js:652:30)
at Object.Module._extensions..js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
When starting a new tendermint node, it will sync/replay all the transactions.
Track chain sync status by checking the result returned from calling /status
to tendermint.
Add CALLBACK_RETRY_TIMEOUT
as an environment variable for configurable callback retry timeout.
This config applies ONLY to callback retries that have not set a pre-retry hook function (shouldRetry
function). The timeout value is in seconds. Default is 600 seconds or 10 minutes.
When AS handle request callback with status 200 (with data), they also provide the callback_url and reference_id for callback, to know if blockchain method signData is success, but no callback is fired.
RP should process request status update only once if there are multiple transactions with the same request ID in the same block. Related to issue #27.
Should handle error when sending an IdP response to a closed or timed out request and send back a correct error code/message.
Currently, messages sending over message queue are in JSON string format which causes the payload to be printable string. Hence, the payload is encoded in base64 string which makes the size bigger than it should.
It is more suitable to send data in raw bytes rather than bytes of UTF-8 string by using protobuf.
Scenario:
Create Request with
min_idp: 1
idp_id_list: [idp1, idp2]
mode: 3
When reject at idp1 and accept at idp2, the request was rejected.
I think this case the request status should be completed by 1 IdP accept.
When request for authentication status is completed, Request is "closed=false".
It should be "closed=true".
Having to wait for ABCI app output:
Commit
Commit
before starting api
server.
Listen for 'NewBlock' event from tendermint and check if height >= 2 (Genesis block committed and signed) before receiving/processing any requests.
When creating a new identity, the final request status is always "pending". It should be "completed".
Currently, request timeout trigger uses setTimeout() which support timeout up to only 2147483647 milliseconds (or about 24 days).
Need to come up with another way to trigger a timeout to support long scheduled request timeout.
error: Responded Internal Server Error with HTTP code 500 { responseBody:
api-idp-1_1 | { error:
api-idp-1_1 | { code: 10000,
api-idp-1_1 | message: 'Cannot destructure property `special` of \'undefined\' or \'null\'.',
api-idp-1_1 | stack: 'CustomError: Cannot get request details from blockchain\n at Object.getRequestDetail (/api/src/tendermint/ndid.js:410:11)\n at <anonymous>\n at process._tickCallback (internal/process/next_tick.js:188:7)\nCaused By: TypeError: Cannot destructure property `special` of \'undefined\' or \'null\'.\n at Object.getRequestDetail (/api/src/tendermint/ndid.js:396:5)\n at <anonymous>\n at process._tickCallback (internal/process/next_tick.js:188:7)' } } }
Throw an error if an expected value or object property returned from external crypto service is null or undefined.
Create API to toggle the crypto service choice on the fly.
I mentioned this to @taneekpek at Barcamp. I would like to propose that bcrypt is used as a hash algorithm instead of sha256.
To prevent downtime by accident (for hot standby).
Expose from smart contract
When GET /as/service/:service_id, response format is
{
"service_id": "string",
"url": "string"
"service_name": "string"
}
It should be (Swagger hub)
{
"min_ial": 1.1,
"min_aal": 1,
"url": "string"
}
If service is registered by NDID but not offered by any AS it correctly return 200 with empty array.
But if it's not registered by NDID it should return 404 but now return empty array.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.