FunctionStream/function-stream

Get token function

RobertIndie opened this issue · 1 comments

This function is responsible for validating the user name and password. It will return a token to the user.
Input event is as below:

{
    "userName": "user-a",
    "password": "pwd"
}

Output event is as below:

{
    "token": "xxx"
}

This function should only care about the fields that need to be cared about and should not change fields that are not related to it.
For example, when the input is :

{
    "requestId": "1",
    "userName": "user-a",
    "password": "pwd"
}

It should output the event as below:

{
    "requestId": "1",
    "token": "xxx"
}

As you can see, it did not change the field requestId.
This function validates the user login information through a database like MySQL.

  • Implement Get Token function
  • Unit tests

Implemented by #70