mirror of
https://github.com/harness/drone.git
synced 2025-05-16 00:50:00 +08:00
enforce plugin whitelist for notifications
This commit is contained in:
parent
906bbe9cc5
commit
f76dcb1171
@ -54,6 +54,7 @@ func main() {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
log.Errorln("Error starting build server pod", err)
|
log.Errorln("Error starting build server pod", err)
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
|
return
|
||||||
}
|
}
|
||||||
ctx.client = client
|
ctx.client = client
|
||||||
defer client.Destroy()
|
defer client.Destroy()
|
||||||
@ -65,6 +66,7 @@ func main() {
|
|||||||
log.Errorln("Error processing .drone.yml file.", err)
|
log.Errorln("Error processing .drone.yml file.", err)
|
||||||
client.Destroy()
|
client.Destroy()
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
var execs []execFunc
|
var execs []execFunc
|
||||||
|
@ -196,6 +196,8 @@ func (r *Runner) Run(w *queue.Work) error {
|
|||||||
Netrc: w.Netrc,
|
Netrc: w.Netrc,
|
||||||
Yaml: w.Yaml,
|
Yaml: w.Yaml,
|
||||||
Build: build,
|
Build: build,
|
||||||
|
Env: w.Env,
|
||||||
|
Plugins: w.Plugins,
|
||||||
}
|
}
|
||||||
in, err := json.Marshal(work)
|
in, err := json.Marshal(work)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -77,10 +77,6 @@ func ParseSingle(raw string, opts *Opts) (*common.Config, error) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
err = LintPlugins(conf, opts)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
// apply rules / transofms
|
// apply rules / transofms
|
||||||
transformSetup(conf)
|
transformSetup(conf)
|
||||||
transformClone(conf)
|
transformClone(conf)
|
||||||
@ -96,6 +92,10 @@ func ParseSingle(raw string, opts *Opts) (*common.Config, error) {
|
|||||||
if !opts.Privileged {
|
if !opts.Privileged {
|
||||||
rmPrivileged(conf)
|
rmPrivileged(conf)
|
||||||
}
|
}
|
||||||
|
err = LintPlugins(conf, opts)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
return conf, err
|
return conf, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user