Skip to content

Conversation

@SuJiaKuan
Copy link
Member

Licensing is one important phase of Verpix pay system. Users want to use viewer should fill an API key associated to them. The viewer uses the API key to generate an authorization message, sends the message to Verpix servers, and get a response which contains a verification message and related resources. In this PR, I implemented the licensing protocol and the test cases.

SuJiaKuan added 10 commits April 20, 2017 18:27
API key is a necessary component in SDK licensing. Users must fill
the API key belong to them when using SDK.

In this commit, we add a new parameter "apiKey" to fill their API
key, and implement client-side authentication message when sending
request to get media resource. We also write tests about "apiKey"
parameter.
The original signature generating method is time costing. To make
performance better, we removed the pbkdf2-hashed part and only
used bcrypt-hashed part.
To make the SDK licensing protocol more secure, we should also
verify the verification message from response. In implementation,
we use bcrypt to verify the message.
Originally, the response timestamp is stored in "timestamp" field
of body. The new version of response stores timestamp in "X-Date"
field of header. We modified the method of getting timestamp in
response in this commit.
- Minimize bcryptjs:
When we use bcryptjs, the built file size increases dramatically
(~100KB in gzip) bacause Webpack detects it may uses crypto
library and load the whole browserified version of crypto. To
prevent from loading the whole crypto library, we maintained our
bcryptjs which does not require it. The size of bcryptjs in built
file is only about 10KB in gzip.

- Minimize Bluebird
We use promisify function in Bluebird and the size of Bluebird in
built file size is about 20KB. To reduce the size, we use our own
promisify function instead of Bluebird.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant