Affected by GO-2024-2998
and 1 other vulnerabilities
GO-2024-2998: Woodpecker's custom environment variables allow to alter execution flow of plugins in go.woodpecker-ci.org/woodpecker
GO-2024-2999: Woodpecker's custom workspace allow to overwrite plugin entrypoint executable in go.woodpecker-ci.org/woodpecker
directory
Version:
v2.4.1
Opens a new window with list of versions in this module.
Published: Mar 20, 2024
License: Apache-2.0, Apache-2.0
Opens a new window with license information.
README
¶
woodpecker-go
import (
"go.woodpecker-ci.org/woodpecker/v2/woodpecker-go/woodpecker"
"golang.org/x/oauth2"
)
const (
token = "dummyToken"
host = "http://woodpecker.company.tld"
)
func main() {
// create an http client with oauth authentication.
config := new(oauth2.Config)
authenticator := config.Client(
oauth2.NoContext,
&oauth2.Token{
AccessToken: token,
},
)
// create the woodpecker client with authenticator
client := woodpecker.NewClient(host, authenticator)
// gets the current user
user, err := client.Self()
fmt.Println(user, err)
// gets the named repository information
repo, err := client.RepoLookup("woodpecker-ci/woodpecker")
fmt.Println(repo, err)
}
Directories
¶
Click to show internal directories.
Click to hide internal directories.