Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
This project contains source code and supporting files for the Open Finance Africa Payment Score API. The API is available for consumption at https//api.openfinance.africa and its reference is here. Although the current functionality could have been bundled and utilized as a library, the current plan is to examine its application as an API and, over time, expand it to incorporate data sources where a library would not be suitable.
TL;DR: Head over to the simulator to see how the scoring works.
A credit score usually takes several factors into account. These factors range from previous loan repayment behavior, down to an individuals age. Banks and credit bureaus (CRBs) already have the ability to aggregate this data and use it to evaluate loans terms for example. But accessing standardized external payment data, easily accessible via API is what this project is about. For now, the code in this repo simply calculates a payment score. And this score can be used as a datapoint among the factors that lenders (or other financial institutions) may use to determine an individuals creditworthiness. Banks and credit bureaus aren't the only entities that can find this useful. If you're a business that wants to keep track of payment behaviour, this is for you! E.g. if you're a property management company that want's to keep track of rent payment behavior.
To get a score, you'll need the following:
The following factors influence that value of a score.
The score includes scored months which are aggregated into an overall score. The overall score can range from 0 to 1 (with 1 being an excellent score). Monthly scores may be outside of the 0 to 1 range. The main pieces of information in a score are:
In order to test the API locally, you'll use the Serverless Application Model Command Line Interface (SAM CLI) which is an extension of the AWS CLI that adds functionality for building and testing Lambda applications. It uses Docker to run your functions in an Amazon Linux environment that matches Lambda. It can also emulate your application's build environment and API.
To use the SAM CLI, you need the following tools.
Build your application with the sam build --use-container
command.
scoreapi$ sam build --use-container
The SAM CLI installs dependencies defined in src/requirements.txt
, creates a deployment package, and saves it in the .aws-sam/build
folder.
Test a single function by invoking it directly with a test event. An event is a JSON document that represents the input that the function receives from the event source. Test events are included in the events
folder in this project.
Run functions locally and invoke them with the sam local invoke
command.
scoreapi$ sam local invoke ScoreApiFunction --event events/event.json
The SAM CLI can also emulate the API. Use the command below to run the API locally on port 3001.
scoreapi$ sam local start-api -p 3001
To simplify troubleshooting, SAM CLI has a command called sam logs
. sam logs
lets you fetch logs generated by your deployed Lambda function from the command line. In addition to printing the logs on the terminal, this command has several nifty features to help you quickly find the bug.
NOTE
: This command works for all AWS Lambda functions; not just the ones you deploy using SAM.
scoreapi$ sam logs -n ScoreApiFunction --stack-name scoreapi --tail
You can find more information and examples about filtering Lambda function logs in the SAM CLI Documentation.
Tests are defined in the tests
folder in this project. Use PIP to install the test dependencies and run tests.
scoreapi$ pip install -r tests/requirements.txt --user
# unit tests
scoreapi$ python -m pytest tests/unit -v
scoreapi$ pip install black
scoreapi$ black .
We welcome contributions both big and small ❤️
Any questions or feedback? Create an issue
Want to modify code or docs? Ask to get added as a contributor by emailing hello@openfinance.africa or simply fork the repo to create pull requests
FAQs
Payment Score API
We found that scoreapi demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.