Documentation ¶
Index ¶
- Constants
- func HasOrgScope(toCheck TokenScope, scopes TokenScopes, orgRole OrganizationRole) bool
- func HasRepoScope(toCheck TokenScope, scopes TokenScopes, repoRole RepositoryRole) bool
- func HasScope(requiredScope string, availableScopes TokenScopes, roles []Role) bool
- func IsOrgRole(role Role) bool
- func IsRepositoryRole(role Role) bool
- type OrganizationRole
- type RepositoryRole
- type Role
- type TokenScope
- type TokenScopes
Constants ¶
View Source
const ( OrgRoleNone OrganizationRole = "NONE" OrgRoleOwner = "OWNER" OrgRoleMember = "MEMBER" )
View Source
const ( RepoRoleNone RepositoryRole = "NONE" RepoRoleAdmin = "ADMIN" RepoRoleMaintainer = "MAINTAIN" RepoRoleWrite = "WRITE" RepoRoleTriage = "TRIAGE" RepoRoleRead = "READ" )
View Source
const ( ScopeNone TokenScope = "None" RepoAdmin = "repo" RepoRepoStatus = "repo:status" RepoRepoDeployment = "repo_deployment" RepoPublicRepo = "public_repo" RepoRepoInvite = "repo:invite" RepoSecurityEvents = "security_events" RepoDelete = "delete_repo" Workflow = "workflow" PackagesWrite = "write:packages" PackagesRead = "read:packages" PackagesDelete = "delete:packages" OrgAdmin = "admin:org" OrgWrite = "write:org" OrgRead = "read:org" PublicKeyAdmin = "admin:public_key" PublicKeyWrite = "write:public_key" PublicKeyRead = "read:public_key" OrgHookAdmin = "admin:org_hook" RepoHookAdmin = "admin:repo_hook" RepoHookWrite = "write:repo_hook" RepoHookRead = "read:repo_hook" Gist = "gist" Notifications = "notifications" UserAll = "user" UserRead = "read:user" UserEmail = "read:email" UserFollow = "user:follow" DiscussionWrite = "write:discussion" DiscussionRead = "read:discussion" EnterpriseAdmin = "admin:enterprise" EnterpriseManageRunners = "manage_runners:enterprise" EnterpriseManageBilling = "manage_billing:enterprise" EnterpriseRead = "read:enterprise" ProjectAll = "project" ProjectRead = "read:project" GpgKeyAdmin = "admin:gpg_key" GpgKeyWrite = "write:gpg_key" GpgKeyRead = "read:gpg_key" )
Variables ¶
This section is empty.
Functions ¶
func HasOrgScope ¶
func HasOrgScope(toCheck TokenScope, scopes TokenScopes, orgRole OrganizationRole) bool
func HasRepoScope ¶
func HasRepoScope(toCheck TokenScope, scopes TokenScopes, repoRole RepositoryRole) bool
func IsRepositoryRole ¶
Types ¶
type OrganizationRole ¶
type OrganizationRole = string
func GetOrgRole ¶
func GetOrgRole(canAdminister *bool) OrganizationRole
type RepositoryRole ¶
type RepositoryRole = string
type TokenScope ¶
type TokenScope = string
type TokenScopes ¶
type TokenScopes = map[TokenScope]bool
func ParseTokenScopes ¶
func ParseTokenScopes(scopesList []string) TokenScopes
Click to show internal directories.
Click to hide internal directories.