Documentation ¶
Index ¶
- Constants
- Variables
- func IsValidScope(scope string) bool
- func NewDownloadFileCapability(httpClient *http.Client, ghClientBuilder githubClientBuilder, ghBaseUrl string) (serviceprovider.DownloadFileCapability, error)
- type AllAccessibleRepos
- type Github
- func (g *Github) CheckRepositoryAccess(ctx context.Context, cl client.Client, accessCheck *api.SPIAccessCheck) (*api.SPIAccessCheckStatus, error)
- func (g *Github) GetBaseUrl() string
- func (g *Github) GetDownloadFileCapability() serviceprovider.DownloadFileCapability
- func (g *Github) GetOAuthCapability() serviceprovider.OAuthCapability
- func (g *Github) GetRefreshTokenCapability() serviceprovider.RefreshTokenCapability
- func (g *Github) GetType() config.ServiceProviderType
- func (g *Github) LookupTokens(ctx context.Context, cl client.Client, binding *api.SPIAccessTokenBinding) ([]api.SPIAccessToken, error)
- func (g *Github) MapToken(_ context.Context, _ *api.SPIAccessTokenBinding, token *api.SPIAccessToken, ...) (serviceprovider.AccessTokenMapper, error)
- func (g *Github) PersistMetadata(ctx context.Context, _ client.Client, token *api.SPIAccessToken) error
- func (g *Github) Validate(ctx context.Context, validated serviceprovider.Validated) (serviceprovider.ValidationResult, error)
- type RepositoryRecord
- type RepositoryUrl
- type Scope
- type TokenState
- type ViewerPermission
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 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 (*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 (g *Github) MapToken(_ context.Context, _ *api.SPIAccessTokenBinding, token *api.SPIAccessToken, tokenData *api.Token) (serviceprovider.AccessTokenMapper, error)
func (*Github) PersistMetadata ¶
func (*Github) Validate ¶ added in v0.5.5
func (g *Github) Validate(ctx context.Context, validated serviceprovider.Validated) (serviceprovider.ValidationResult, error)
type RepositoryRecord ¶
type RepositoryRecord struct {
ViewerPermission ViewerPermission `json:"viewerPermission"`
}
type RepositoryUrl ¶
type RepositoryUrl string
type TokenState ¶
type TokenState struct {
AccessibleRepos map[RepositoryUrl]RepositoryRecord
}
type ViewerPermission ¶
type ViewerPermission string
func (ViewerPermission) Enables ¶
func (vp ViewerPermission) Enables(scope Scope) bool
Click to show internal directories.
Click to hide internal directories.