
Research
/Security News
9 Malicious NuGet Packages Deliver Time-Delayed Destructive Payloads
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.
Library to display Swagger documentation in HTML format
go get github.com/werpas/ui-swagger
A valid Swagger document with a filename of swagger.json should exists under the api folder.
<GO project root>/api/swagger.json
To use Swagger UI, just pass MUX router and the API's base path.
Code:
package server
import (
"log"
"net/http"
"github.com/gorilla/mux"
sw "github.com/werpas/ui-swagger"
)
const base_path = "/api/v1/"
func SetupRestServer() {
// Register a handler for each route pattern
router := mux.NewRouter()
// attach the swagger routes
sw.AttachSwaggerUI(router, base_path)
// start listening on the configured port and routes
log.Fatal(http.ListenAndServe(":8080", router))
}
##How to view To view the swagger HTML endpoint, go to the following URL format.
<host url>/<base api path>/help
##Available Function
func AttachSwaggerUI (router *mux.Router, base_path string) (err error)
Sets the routes for the static page and the swagger document file. `
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.

Research
/Security News
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.

Security News
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.

Security News
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.