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/pol-cova/go-url-shortener-api
The Go URL Shortener API allows users to create shortened URLs for easy sharing and management. It includes endpoints for user authentication, URL shortening, and user profile management, using JWT for authentication.
http://localhost:8080
Include the JWT token in the Authorization
header for protected endpoints.
Authorization: <your-token>
/auth/signup
POST
{
"email": "string",
"password": "string"
}
/auth/login
POST
{
"email": "string",
"password": "string"
}
{
"token": "your-jwt-token"
}
/auth/logout
GET
/short
POST
{
"url": "string"
}
{
"shortened_url": "http://localhost:8080/:key"
}
/:key
GET
These routes require authentication.
/user/short
POST
{
"url": "string"
}
/user/home
GET
[
{
"id": 1,
"url": "https://example.com",
"key": "abc123",
"created_at": "2023-01-01T00:00:00Z",
"clicks": 100,
"user_id": 1
},
{
"id": 2,
"url": "https://anotherexample.com",
"key": "xyz789",
"created_at": "2023-01-02T00:00:00Z",
"clicks": 50,
"user_id": 1
}
]
/user/me
GET
{
"email": "string"
}
/user/delete
DELETE
git clone https://github.com/pol-cova/go-url-shortener-api.git
cd <go-url-shortener-api>
go run .
The server will start on port 8080.
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.