Security News
The Risks of Misguided Research in Supply Chain Security
Snyk's use of malicious npm packages for research raises ethical concerns, highlighting risks in public deployment, data exfiltration, and unauthorized testing.
github.com/skjaldbaka17/quotes-api
This is the readme for the quotes API.
The API is a connection to the Database setup by https://github.com/skjaldbaka17/setup-quotes-db which contains around 800.000 quotes, over 25.000 authors and over 10.000 quotes sorted into 12 topics.
The primary motivation for this project was to learn to setup and manage SaaS on AWS, using EC2 and RDS and more.
After less then a month the API was ready but then we decided to scrap it and change it into a Serverless API using aws lambda and API Gateway. Which we did, see repo: https://github.com/Skjaldbaka17/quotel-sls-api/tree/main .
We use the testing
package that comes built-in in Golang. Before running the tests you need to create a .env
file in root with DATABASE_URL=YOUR_DB_URL
then you can simply run the following commands to test the various functionalities of the api:
For all tests:
make test
For all tests with verbose on:
make test-verbose
For a specific test function
make test-specific TEST_FUNCTION=<The_function_you_want>
For documenting the API we use Swagger (or OpenAPI) and document each endpoint inside the code with specific comments forexed with swagger:route
. To compile these comments into a swagger.yaml file you simply run:
make docs
This command will first check if you have the goswagger bin compiled. If it is not installed on your machine the command should install it with the command
go get -u github.com/go-swagger/go-swagger/cmd/swagger
The docs are then hosted at /docs
.
For setting up the EC2 you can use the setupEc2.sh as a guide... Of course it would have been best to do this using cloudformation and just creating an image of the EC2 environment we need and using that image in the cloudformation when spinning up a new instance, but hindsight is 2020. What.
FAQs
Unknown package
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.
Security News
Snyk's use of malicious npm packages for research raises ethical concerns, highlighting risks in public deployment, data exfiltration, and unauthorized testing.
Research
Security News
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.