MCPcopy Index your code
hub / github.com/crashappsec/github-analyzer / AuditWebhooks

Method AuditWebhooks

pkg/github/org/org.go:457–486  ·  view source on GitHub ↗
(
	ctx context.Context)

Source from the content-addressed store, hash-verified

455}
456
457func (org *Organization) AuditWebhooks(
458 ctx context.Context) ([]issue.Issue, map[issue.IssueID]error, error) {
459
460 execStatus := make(map[issue.IssueID]error, 1)
461 var issues []issue.Issue
462
463 hooks, err := org.GetWebhooks(ctx)
464 if err != nil {
465 log.Logger.Error(err)
466 }
467
468 execStatus[issue.INF_DISC_HTTP_WEBHOOK] = err
469 for _, hook := range hooks {
470 if !*hook.Active {
471 continue
472 }
473 url, ok := hook.Config["url"]
474 if !ok {
475 continue
476 }
477 if !strings.HasPrefix(url.(string), "https") {
478 issues = append(
479 issues,
480 issue.InsecureWebhookPayloadURL(url.(string)),
481 )
482 }
483 }
484
485 return issues, execStatus, nil
486}
487
488func (org *Organization) AuditCoreStats(
489 ctx context.Context) ([]issue.Issue, map[issue.IssueID]error, error) {

Callers

nothing calls this directly

Calls 2

GetWebhooksMethod · 0.95

Tested by

no test coverage detected