Documentation ¶
Index ¶
- Constants
- Variables
- func IsValidScope(scope string) bool
- 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) GetOAuthEndpoint() string
- func (g *Github) GetServiceProviderUrlForRepo(repoUrl string) (string, error)
- func (g *Github) GetType() api.ServiceProviderType
- func (g *Github) LookupToken(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) OAuthScopesFor(permissions *api.Permissions) []string
- 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
Types ¶
type AllAccessibleRepos ¶
type AllAccessibleRepos struct { Viewer struct { Repositories struct { Nodes []struct { ViewerPermission string `json:"viewerPermission"` Url string `json:"url"` } `json:"nodes"` } `json:"repositories"` } `json:"viewer"` }
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 config.Configuration // 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) GetOAuthEndpoint ¶
func (*Github) GetServiceProviderUrlForRepo ¶
func (*Github) GetType ¶
func (g *Github) GetType() api.ServiceProviderType
func (*Github) LookupToken ¶
func (g *Github) LookupToken(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) OAuthScopesFor ¶ added in v0.6.8
func (g *Github) OAuthScopesFor(permissions *api.Permissions) []string
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.