This content applies to WaaS 1.0 only. We highly recommend that you upgrade to WaaS 2.0.
HTTP API
The callback server is an HTTP server that supports the following endpoints:- Path
- /v1/check
- Method
- POST
- Body
- Encoded with x-www-form-urlencoded
HTTP Request Parsing
The TSS Node will follow the steps below to send the HTTP request:- Generate CallbackRequest
- Serialize CallbackRequest to derive CallbackRequestJsonString
- Use CallbackRequestJsonString as the JWT payload and sign it using its RSA private key to create a JWT
- Submit the HTTP POST request via an HTML form with TSS_JWT_MSG as the key and JWT as the value
- Retrieve the data in the HTTP POST request using TSS_JWT_MSG as the key and the JWT as the value
- Use the TSS Node’s RSA public key to validate the signed JWT
- Retrieve the payload in the JWT and deserialize it using CallbackRequest
- Deserialize the meta field to retrieve the information in the request
Risk Control
You’ll need to perform a risk control for each CallbackRequest based on your organization’s business and security requirements to further validate the request.HTTP Response
The callback server will send the HTTP response as follows:- Generate CallbackResponse
- Serialize CallbackResponse to derive CallbackResponseJsonString
- Use CallbackResponseJsonString as the JWT payload and sign it using its RSA private key to create a JWT
- Use the JWT as the HTTP response and return it to the TSS Node
Callback API Request Description
Unique ID of the callback request.
The types of callback requests, which will be an enum:
TypeKeyGen = 1
TypeKeySign = 2
TypeKeyReshare = 3
The details of the callback request; each type of the callback requests corresponds to a different request_detail structure; the format is a serialized JSON string.
Other information associated with the callback request; each type of the callback requests corresponds to a different extra_info structure; the format is a serialized JSON string.
Callback API Response Description
Status; 0: callback server is normal; other values: callback server has an error
Request ID of the callback; the value must be the same as request_id in CallbackRequest
Instructions for task execution, which will be an enum: [APPROVE, REJECT]
APPROVE: task should be executed;
REJECT: task should be rejected, and the reason can be retrieved from the error field;
Error message;
If the returned status is not 0, it indicates an error within the callback server
If the returned status is 0 and action returns a “REJECT”, it indicates the reason for task rejection
Feel free to share your feedback to improve our documentation!