github

package
v0.2023.21 Latest Latest
Warning

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

Go to latest
Published: May 22, 2023 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ViewerPermissionAdmin    ViewerPermission = "ADMIN"
	ViewerPermissionMaintain ViewerPermission = "MAINTAIN"
	ViewerPermissionWrite    ViewerPermission = "WRITE"
	ViewerPermissionTriage   ViewerPermission = "TRIAGE"
	ViewerPermissionRead     ViewerPermission = "READ"
	ScopeRepo                Scope            = "repo"
	ScopeRepoStatus          Scope            = "repo:status"
	ScopeRepoDeployment      Scope            = "repo_deployment"
	ScopePublicRepo          Scope            = "public_repo"
	ScopeRepoInvite          Scope            = "repo:invite"
	ScopeSecurityEvent       Scope            = "security_event"
	ScopeAdminRepoHook       Scope            = "admin:repo_hook"
	ScopeWriteRepoHook       Scope            = "write:repo_hook"
	ScopeReadRepoHook        Scope            = "read:repo_hook"
	ScopeAdminOrg            Scope            = "admin:org"
	ScopeWriteOrg            Scope            = "write:org"
	ScopeReadOrg             Scope            = "read:org"
	ScopeAdminPublicKey      Scope            = "admin:public_key"
	ScopeWritePublicKey      Scope            = "write:public_key"
	ScopeReadPublicKey       Scope            = "read:public_key"
	ScopeAdminOrgHook        Scope            = "admin:org_hook"
	ScopeGist                Scope            = "gist"
	ScopeNotifications       Scope            = "notifications"
	ScopeUser                Scope            = "user"
	ScopeReadUser            Scope            = "read:user"
	ScopeUserEmail           Scope            = "user:email"
	ScopeUserFollow          Scope            = "user:follow"
	ScopeDeleteRepo          Scope            = "delete_repo"
	ScopeWriteDiscussion     Scope            = "write:discussion"
	ScopeReadDiscussion      Scope            = "read:discussion"
	ScopeWritePackages       Scope            = "write:packages"
	ScopeReadPackages        Scope            = "read:packages"
	ScopeDeletePackages      Scope            = "delete:packages"
	ScopeAdminGpgKey         Scope            = "admin:gpg_key"
	ScopeWriteGpgKey         Scope            = "write:gpg_key"
	ScopeReadGpgKey          Scope            = "read:gpg_key"
	ScopeCodespace           Scope            = "codespace"
	ScopeWorkflow            Scope            = "workflow"
)

Variables

View Source
var Initializer = serviceprovider.Initializer{
	Probe:       githubProbe{},
	Constructor: serviceprovider.ConstructorFunc(newGithub),
}

Functions

func IsValidScope added in v0.5.5

func IsValidScope(scope string) bool

func NewDownloadFileCapability added in v0.2023.21

func NewDownloadFileCapability(httpClient *http.Client, ghClientBuilder githubClientBuilder, ghBaseUrl string) (serviceprovider.DownloadFileCapability, error)

Types

type AllAccessibleRepos

type AllAccessibleRepos struct{}

AllAccessibleRepos lists all the repositories accessible by the current user

func (*AllAccessibleRepos) FetchAll

func (r *AllAccessibleRepos) FetchAll(ctx context.Context, githubClient *github.Client, accessToken string, state *TokenState) error

type Github

type Github struct {
	Configuration *opconfig.OperatorConfiguration
	// contains filtered or unexported fields
}

func (*Github) CheckRepositoryAccess added in v0.5.1

func (g *Github) CheckRepositoryAccess(ctx context.Context, cl client.Client, accessCheck *api.SPIAccessCheck) (*api.SPIAccessCheckStatus, error)

func (*Github) GetBaseUrl

func (g *Github) GetBaseUrl() string

func (*Github) GetDownloadFileCapability added in v0.8.3

func (g *Github) GetDownloadFileCapability() serviceprovider.DownloadFileCapability

func (*Github) GetOAuthCapability added in v0.2023.21

func (g *Github) GetOAuthCapability() serviceprovider.OAuthCapability

func (*Github) GetRefreshTokenCapability added in v0.2023.21

func (g *Github) GetRefreshTokenCapability() serviceprovider.RefreshTokenCapability

func (*Github) GetType

func (g *Github) GetType() config.ServiceProviderType

func (*Github) LookupTokens added in v0.2023.21

func (g *Github) LookupTokens(ctx context.Context, cl client.Client, binding *api.SPIAccessTokenBinding) ([]api.SPIAccessToken, error)

func (*Github) MapToken added in v0.5.5

func (*Github) PersistMetadata

func (g *Github) PersistMetadata(ctx context.Context, _ client.Client, token *api.SPIAccessToken) error

func (*Github) Validate added in v0.5.5

type RepositoryRecord

type RepositoryRecord struct {
	ViewerPermission ViewerPermission `json:"viewerPermission"`
}

type RepositoryUrl

type RepositoryUrl string

type Scope

type Scope string

func (Scope) Implies

func (s Scope) Implies(other Scope) bool

type TokenState

type TokenState struct {
	AccessibleRepos map[RepositoryUrl]RepositoryRecord
}

type ViewerPermission

type ViewerPermission string

func (ViewerPermission) Enables

func (vp ViewerPermission) Enables(scope Scope) bool

Jump to

Keyboard shortcuts

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