describers

package
v0.44.9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 15, 2025 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Overview

artifact_dockerfile.go

commit.go

Index

Constants

View Source
const MAX_DOCKERFILE_LEN = 500

MAX_DOCKERFILE_LEN is the maximum allowed number of lines in a Dockerfile.

View Source
const MAX_REPOS_TO_LIST = 250

MAX_REPOS_TO_LIST is how many repositories to fetch at most when listing.

View Source
const MAX_RESULTS = 500

MAX_RESULTS is the maximum number of Dockerfiles to collect or stream.

Variables

This section is empty.

Functions

func GetActionRunner

func GetActionRunner(ctx context.Context, githubClient model.GitHubClient, organizationName string, repositoryName string, resourceID string, stream *models.StreamSender) (*models.Resource, error)

func GetAllArtifacts

func GetAllArtifacts(ctx context.Context, githubClient model.GitHubClient, organizationName string, stream *models.StreamSender) ([]models.Resource, error)

func GetAllAuditLogs

func GetAllAuditLogs(ctx context.Context, githubClient model.GitHubClient, organizationName string, stream *models.StreamSender) ([]models.Resource, error)

func GetAllBranchProtections

func GetAllBranchProtections(ctx context.Context, githubClient model.GitHubClient, organizationName string, stream *models.StreamSender) ([]models.Resource, error)

func GetAllBranches

func GetAllBranches(ctx context.Context, githubClient model.GitHubClient, organizationName string, stream *models.StreamSender) ([]models.Resource, error)

func GetAllMembers

func GetAllMembers(ctx context.Context, githubClient model.GitHubClient, organizationName string, stream *models.StreamSender) ([]models.Resource, error)

func GetAllOrganizationsCollaborators

func GetAllOrganizationsCollaborators(ctx context.Context, githubClient model.GitHubClient, organizationName string, stream *models.StreamSender) ([]models.Resource, error)

func GetAllOrganizationsDependabotAlerts

func GetAllOrganizationsDependabotAlerts(ctx context.Context, githubClient model.GitHubClient, organizationName string, stream *models.StreamSender) ([]models.Resource, error)

func GetAllPullRequests

func GetAllPullRequests(ctx context.Context, githubClient model.GitHubClient, organizationName string, stream *models.StreamSender) ([]models.Resource, error)

func GetAllRepositoriesCollaborators

func GetAllRepositoriesCollaborators(ctx context.Context, githubClient model.GitHubClient, organizationName string, stream *models.StreamSender) ([]models.Resource, error)

func GetAllRepositoriesDependabotAlerts

func GetAllRepositoriesDependabotAlerts(ctx context.Context, githubClient model.GitHubClient, organizationName string, stream *models.StreamSender) ([]models.Resource, error)

func GetAllRepositoriesDeployments

func GetAllRepositoriesDeployments(ctx context.Context, githubClient model.GitHubClient, organizationName string, stream *models.StreamSender) ([]models.Resource, error)

func GetAllRepositoriesEnvironments

func GetAllRepositoriesEnvironments(ctx context.Context, githubClient model.GitHubClient, organizationName string, stream *models.StreamSender) ([]models.Resource, error)

func GetAllRepositoriesRuleSets

func GetAllRepositoriesRuleSets(ctx context.Context, githubClient model.GitHubClient, organizationName string, stream *models.StreamSender) ([]models.Resource, error)

func GetAllRepositoriesSBOMs

func GetAllRepositoriesSBOMs(ctx context.Context, githubClient model.GitHubClient, organizationName string, stream *models.StreamSender) ([]models.Resource, error)

func GetAllRepositoriesVulnerabilities

func GetAllRepositoriesVulnerabilities(ctx context.Context, githubClient model.GitHubClient, organizationName string, stream *models.StreamSender) ([]models.Resource, error)

func GetAllRunners

func GetAllRunners(ctx context.Context, githubClient model.GitHubClient, organizationName string, stream *models.StreamSender) ([]models.Resource, error)

func GetAllSecrets

func GetAllSecrets(ctx context.Context, githubClient model.GitHubClient, organizationName string, stream *models.StreamSender) ([]models.Resource, error)

func GetAllTags

func GetAllTags(ctx context.Context, githubClient model.GitHubClient, organizationName string, stream *models.StreamSender) ([]models.Resource, error)

func GetAllTeamsMembers

func GetAllTeamsMembers(ctx context.Context, githubClient model.GitHubClient, organizationName string, stream *models.StreamSender) ([]models.Resource, error)

func GetAllWorkflowRuns

func GetAllWorkflowRuns(ctx context.Context, githubClient model.GitHubClient, organizationName string, stream *models.StreamSender) ([]models.Resource, error)

func GetAllWorkflows

func GetAllWorkflows(ctx context.Context, githubClient model.GitHubClient, organizationName string, stream *models.StreamSender) ([]models.Resource, error)

func GetArtifact

func GetArtifact(ctx context.Context, githubClient model.GitHubClient, organizationName string, repositoryName string, resourceID string, stream *models.StreamSender) (*models.Resource, error)

func GetContainerPackageList

func GetContainerPackageList(
	ctx context.Context,
	githubClient model.GitHubClient,
	organizationName string,
	stream *models.StreamSender,
) ([]models.Resource, error)

----------------------------------------------------------------------------- 1. GetContainerPackageList -----------------------------------------------------------------------------

func GetDockerfile

func GetDockerfile(
	ctx context.Context,
	githubClient model.GitHubClient,
	organizationName, repoFullName, filePath string,
	stream *models.StreamSender,
) (*models.Resource, error)

GetDockerfile fetches a single Dockerfile from GitHub, decodes the base64 content, checks line count, uses `utils.ExtractExternalBaseImagesFromBase64` to parse external images. If parse fails, we store an empty Images slice.

func GetIssue

func GetIssue(ctx context.Context, githubClient model.GitHubClient, organizationName string, repositoryName string, resourceID string, stream *models.StreamSender) (*models.Resource, error)

func GetIssueList

func GetIssueList(ctx context.Context, githubClient model.GitHubClient, organizationName string, stream *models.StreamSender) ([]models.Resource, error)

func GetLicense

func GetLicense(ctx context.Context, githubClient model.GitHubClient, organizationName string, repositoryName string, resourceID string, stream *models.StreamSender) (*models.Resource, error)

func GetLicenseList

func GetLicenseList(ctx context.Context, githubClient model.GitHubClient, organizationName string, stream *models.StreamSender) ([]models.Resource, error)

func GetLoggerFromContext

func GetLoggerFromContext(ctx context.Context) *zap.Logger

func GetMavenPackageList

func GetMavenPackageList(ctx context.Context, githubClient model.GitHubClient, organizationName string, stream *models.StreamSender) ([]models.Resource, error)

func GetNPMPackageList

func GetNPMPackageList(ctx context.Context, githubClient model.GitHubClient, organizationName string, stream *models.StreamSender) ([]models.Resource, error)

func GetNugetPackage

func GetNugetPackage(ctx context.Context, githubClient model.GitHubClient, organizationName string, repositoryName string, resourceID string, stream *models.StreamSender) (*models.Resource, error)

func GetNugetPackageList

func GetNugetPackageList(ctx context.Context, githubClient model.GitHubClient, organizationName string, stream *models.StreamSender) ([]models.Resource, error)

func GetOrganizationCollaborators

func GetOrganizationCollaborators(ctx context.Context, githubClient model.GitHubClient, stream *models.StreamSender, org string) ([]models.Resource, error)

func GetOrganizationDependabotAlerts

func GetOrganizationDependabotAlerts(ctx context.Context, githubClient model.GitHubClient, stream *models.StreamSender, org string) ([]models.Resource, error)

func GetOrganizationHooks

func GetOrganizationHooks(ctx context.Context, client *github.Client, org steampipemodels.OrganizationWithCounts) ([]*github.Hook, error)

func GetOrganizationList

func GetOrganizationList(ctx context.Context, githubClient model.GitHubClient, organizationName string, stream *models.StreamSender) ([]models.Resource, error)

func GetOrganizationMembers

func GetOrganizationMembers(ctx context.Context, githubClient model.GitHubClient, stream *models.StreamSender, org string) ([]models.Resource, error)

func GetOrganizationTeamList

func GetOrganizationTeamList(ctx context.Context, githubClient model.GitHubClient, organizationName string, stream *models.StreamSender) ([]models.Resource, error)

func GetParameterFromContext

func GetParameterFromContext(ctx context.Context, key string) any

func GetReleaseList

func GetReleaseList(ctx context.Context, githubClient model.GitHubClient, organizationName string, stream *models.StreamSender) ([]models.Resource, error)

func GetRepoActionSecret

func GetRepoActionSecret(ctx context.Context, githubClient model.GitHubClient, organizationName string, repositoryName string, resourceID string, stream *models.StreamSender) (*models.Resource, error)

func GetRepository

func GetRepository(
	ctx context.Context,
	githubClient model.GitHubClient,
	organizationName string,
	repositoryName string,
	resourceID string,
	stream *models.StreamSender,
) (*models.Resource, error)

GetRepository fetches a single repo, transforms it, fetches languages, enriches metrics, returns a single Resource.

func GetRepositoryArtifacts

func GetRepositoryArtifacts(ctx context.Context, githubClient model.GitHubClient, stream *models.StreamSender, owner, repo string) ([]models.Resource, error)

func GetRepositoryAuditLog

func GetRepositoryAuditLog(ctx context.Context, githubClient model.GitHubClient, stream *models.StreamSender, org string) ([]models.Resource, error)

func GetRepositoryBranchProtections

func GetRepositoryBranchProtections(ctx context.Context, githubClient model.GitHubClient, stream *models.StreamSender, owner, repo string) ([]models.Resource, error)

func GetRepositoryBranches

func GetRepositoryBranches(ctx context.Context, githubClient model.GitHubClient, stream *models.StreamSender, owner, repo string) ([]models.Resource, error)

func GetRepositoryCollaborators

func GetRepositoryCollaborators(ctx context.Context, githubClient model.GitHubClient, stream *models.StreamSender, owner, repo string) ([]models.Resource, error)

func GetRepositoryCommits

func GetRepositoryCommits(ctx context.Context, sdk *resilientbridge.ResilientBridge, stream *models.StreamSender, owner, repo string) ([]models.Resource, error)

GetRepositoryCommits fetches up to 50 commits for a single repository. If a stream is provided, commits are streamed; otherwise, returns them as a slice.

func GetRepositoryDependabotAlerts

func GetRepositoryDependabotAlerts(ctx context.Context, githubClient model.GitHubClient, stream *models.StreamSender, owner, repo string) ([]models.Resource, error)

func GetRepositoryDeployments

func GetRepositoryDeployments(ctx context.Context, githubClient model.GitHubClient, stream *models.StreamSender, owner, repo string) ([]models.Resource, error)

func GetRepositoryEnvironments

func GetRepositoryEnvironments(ctx context.Context, githubClient model.GitHubClient, stream *models.StreamSender, owner, repo string) ([]models.Resource, error)

func GetRepositoryList

func GetRepositoryList(
	ctx context.Context,
	githubClient model.GitHubClient,
	organizationName string,
	stream *models.StreamSender,
) ([]models.Resource, error)

GetRepositoryList calls GetRepositoryListWithOptions with default excludes (false, false).

func GetRepositoryListWithOptions

func GetRepositoryListWithOptions(
	ctx context.Context,
	githubClient model.GitHubClient,
	organizationName string,
	stream *models.StreamSender,
	excludeArchived bool,
	excludeDisabled bool,
) ([]models.Resource, error)

GetRepositoryListWithOptions enumerates org repositories, but *instead of streaming each raw JSON*, it calls GetRepository(...) for each repo, so that *only the final detail* from GetRepository is streamed and returned.

func GetRepositoryRuleSets

func GetRepositoryRuleSets(ctx context.Context, githubClient model.GitHubClient, stream *models.StreamSender, owner, repo string) ([]models.Resource, error)

func GetRepositoryRunners

func GetRepositoryRunners(ctx context.Context, githubClient model.GitHubClient, stream *models.StreamSender, owner, repo string) ([]models.Resource, error)

func GetRepositorySBOMs

func GetRepositorySBOMs(ctx context.Context, githubClient model.GitHubClient, owner, repo string) (*models.Resource, error)

func GetRepositorySecrets

func GetRepositorySecrets(ctx context.Context, githubClient model.GitHubClient, stream *models.StreamSender, owner, repo string) ([]models.Resource, error)

func GetRepositoryTags

func GetRepositoryTags(ctx context.Context, githubClient model.GitHubClient, stream *models.StreamSender, owner, repo string) ([]models.Resource, error)

func GetRepositoryVulnerabilities

func GetRepositoryVulnerabilities(ctx context.Context, githubClient model.GitHubClient, stream *models.StreamSender, owner, repo string) ([]models.Resource, error)

func GetRepositoryWorkflow

func GetRepositoryWorkflow(ctx context.Context, githubClient model.GitHubClient, organizationName string, repositoryName string, resourceID string, stream *models.StreamSender) (*models.Resource, error)

func GetRepositoryWorkflowRuns

func GetRepositoryWorkflowRuns(ctx context.Context, sdk *resilientbridge.ResilientBridge, stream *models.StreamSender, owner, repo string, runNumbers []runNumberCriterion) ([]models.Resource, error)

func GetRepositoryWorkflows

func GetRepositoryWorkflows(ctx context.Context, githubClient model.GitHubClient, stream *models.StreamSender, owner, repo string) ([]models.Resource, error)

func GetStarList

func GetStarList(ctx context.Context, githubClient model.GitHubClient, organizationName string, stream *models.StreamSender) ([]models.Resource, error)

func GetTriggerTypeFromContext

func GetTriggerTypeFromContext(ctx context.Context) enums.DescribeTriggerType

func GetUser

func GetUser(ctx context.Context, githubClient model.GitHubClient, organizationName string, stream *models.StreamSender) ([]models.Resource, error)

func ListArtifactDockerFiles

func ListArtifactDockerFiles(
	ctx context.Context,
	githubClient model.GitHubClient,
	organizationName string,
	stream *models.StreamSender,
) ([]models.Resource, error)

ListArtifactDockerFiles performs a single code search across the organization for "filename:Dockerfile" and processes each result. Each Dockerfile is streamed immediately upon processing, and also added to the final slice.

func ListCommits

func ListCommits(ctx context.Context, githubClient model.GitHubClient, organizationName string, stream *models.StreamSender) ([]models.Resource, error)

ListCommits fetches commits from all active repositories under the specified organization. If a stream is provided, each commit is sent to the stream as it’s processed. Otherwise, commits are collected and returned as a slice.

func ListRepositoryPullRequests

func ListRepositoryPullRequests(ctx context.Context, githubClient model.GitHubClient, stream *models.StreamSender, owner, repo string) ([]models.Resource, error)

func WithLogger

func WithLogger(ctx context.Context, logger *zap.Logger) context.Context

Types

type CollaboratorEdge

type CollaboratorEdge struct {
	Permission githubv4.RepositoryPermission     `graphql:"permission @include(if:$includeOCPermission)" json:"permission"`
	Node       steampipemodels.CollaboratorLogin `graphql:"node @include(if:$includeOCNode)" json:"node"`
}

type FileContent

type FileContent struct {
	Repository string
	FilePath   string
	Content    string
}

type GitHubClient

type GitHubClient struct {
	RestClient    *github.Client
	GraphQLClient *githubv4.Client
	Token         string
}

model.GitHubClient custom struct for defining both rest and graphql clients

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL