Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
github.com/bixlabs/go-layout
$ make
go get
$ make run
* Create: $ curl -H "Content-type: application/json" -d '{"i_am": "1", "title": "Some Todo Title", "the_rest": "description", "when_finish": "2018-12-06T14:26:40.623Z"}' "http://localhost:3000/todo"
* Read: $ curl -X GET "http://localhost:3000/todo/1"
* Update: $ curl -X PUT -H "Content-type: application/json" -d '{"i_am": "1", "title": "Some Todo Title", "the_rest": "description", "when_finish": "2018-12-06T14:26:40.623Z"}' "http://localhost:3000/todo"
* Delete: $ curl -X DELETE "http://localhost:3000/todo/1"
$ make api-docs
or
$ swag init -g ./api/main.go
Then we need to run the project as a web server and go to localhost:8080/swagger/
$ make run-cli
$ make build
or
$ go build -o ./tmp/web-server ./api/main.go
web-server
in folder tmp, that file is an executable with the main in ./api/main.gochmod +x ./tmp/web-server
./tmp/web-server
$ make build-for-mac
$ make build-for-windows
$ make run-dev
or
$ air -c .air.config
go vet
and go fmt
for simple linter and formatting, running make format
will do.$ make lint
or
$ golangci-lint run
InitializeLogger
InitializeLogger
before using the Log
function, here's an examplemake run-dev
we won't see the colors of the log message, with make run
we will..env
mechanism that we all know, for more information here's the library.env
file that's explain in the library above OR use this one in this other library.env
file.env
file with a different port than the default, you will see how the web server is initialize in the port you specified in the .env
, you can just change the name of .env-template
to .env
and that will do the trick.$ make test
or
$ go test -cover -v ./...
_test
, if you see the example in test folder you will get it right away.$ make test
$ make coverage
$ make coverage-html
$ make build
or $ go build -o <destination_of_executable_relative_to_root> <path_of_main_file_relative_to_root>
$ make run
or $ go run <path_of_main_file_relative_to_root>
$ chmod +x <path_to_executable_relative_to_root>
$ <path_to_executable_relative_to_root>
Go Report Card - It will scan your code with gofmt
, go vet
, gocyclo
, golint
, ineffassign
, license
and misspell
. Replace github.com/bixlabs/go-layout
with your project reference.
GoDoc - It will provide online version of your GoDoc generated documentation. Change the link to point to your project.
Release - It will show the latest release number for your project. Change the github link to point to your project.
If you want more information about all the folders being used in this project please refer to the original template. Thanks for the authors of this one!
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’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.