Security News
Supply Chain Attack Detected in Solana's web3.js Library
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
github.com/andygrunwald/cachet
Go(lang) client library for Cachet (open source status page system).
It is go gettable
$ go get github.com/andygrunwald/cachet
(optional) to run unit / example tests:
$ cd $GOPATH/src/github.com/andygrunwald/cachet
$ go test -v ./...
Please have a look at the GoDoc documentation for a detailed API description.
Cachet supports two different ways for authentication: BasicAuth and API Token. Both are supported by this library.
For BasicAuth you need to call the AuthenticationService and apply your email address and your password:
client.Authentication.SetBasicAuth("test@test.com", "test123")
To use the API Token way, you do nearly the same but use the SetTokenAuth
function:
client.Authentication.SetTokenAuth("MY-SECRET-TOKEN")
Further a few examples how the API can be used. A few more examples are available in the GoDoc examples section.
Call the API test endpoint. Example without error handling. Full example available in the GoDoc examples section.
package main
import (
"fmt"
"github.com/andygrunwald/cachet"
)
func main() {
client, _ := cachet.NewClient("https://demo.cachethq.io/", nil)
pong, resp, _ := client.General.Ping()
fmt.Printf("Result: %s\n", pong)
fmt.Printf("Status: %s\n", resp.Status)
// Output: Result: Pong!
// Status: 200 OK
}
Calling /components. Example without error handling. Full example available in the GoDoc examples section.
package main
import (
"fmt"
"github.com/andygrunwald/cachet"
)
func main() {
client, _ := cachet.NewClient("https://demo.cachethq.io/", nil)
client.Authentication.SetBasicAuth("test@test.com", "test123")
component := &cachet.Component{
Name: "Beer Fridge",
Description: "Status of the beer fridge in the kitchen",
Status: cachet.ComponentStatusOperational,
}
newComponent, resp, _ := client.Components.Create(component)
fmt.Printf("Result: %s\n", newComponent.Name)
if newComponent.ID > 0 {
fmt.Println("ID > 0!")
}
fmt.Printf("Status: %s\n", resp.Status)
// Output: Beer Fridge
// ID > 0!
// Status: 200 OK
}
Tested with v1.2.1 of Cachet. It may works with older and / or newer versions. Newer versions will be supported. Older versions not.
This project is released under the terms of the MIT license.
Contribution, in any kind of way, is highly welcome! It doesn't matter if you are not able to write code. Creating issues or holding talks and help other people to use cachet is contribution, too! A few examples:
If you are new to pull requests, checkout Collaborating on projects using issues and pull requests / Creating a pull request. If you've found a bug, a typo, have a question or a want to request new feature, please report it as a GitHub issue.
For other queries, i'm available on Twitter (@andygrunwald).
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
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
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.