registryv1alpha1api

package
v0.52.0 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthnService added in v0.50.0

type AuthnService interface {
	// GetCurrentUser gets information associated with the current user.
	//
	// The user's ID is retrieved from the request's authentication header.
	GetCurrentUser(ctx context.Context) (user *v1alpha1.User, err error)
	// GetCurrentUserSubject gets the currently logged in users subject.
	//
	// The user's ID is retrieved from the request's authentication header.
	GetCurrentUserSubject(ctx context.Context) (subject string, err error)
}

AuthnService supplies authenication helpers.

type AuthzService added in v0.50.0

type AuthzService interface {
	// UserCanAddUserOrganizationScopes returns whether the user is authorized
	// to remove user scopes from an organization.
	UserCanAddUserOrganizationScopes(ctx context.Context, organizationId string) (authorized bool, err error)
	// UserCanRemoveUserOrganizationScopes returns whether the user is authorized
	// to remove user scopes from an organization.
	UserCanRemoveUserOrganizationScopes(ctx context.Context, organizationId string) (authorized bool, err error)
	// UserCanCreateOrganizationRepository returns whether the user is authorized
	// to create repositories in an organization.
	UserCanCreateOrganizationRepository(ctx context.Context, organizationId string) (authorized bool, err error)
	// UserCanCreateOrganizationTeam returns whether the user is authorized
	// to create teams in an organization.
	UserCanCreateOrganizationTeam(ctx context.Context, organizationId string) (authorized bool, err error)
	// UserCanListOrganizationTeams returns whether the user is authorized
	// to list teams in an organization.
	UserCanListOrganizationTeams(ctx context.Context, organizationId string) (authorized bool, err error)
	// UserCanSeeRepositorySettings returns whether the user is authorized
	// to see repository settings.
	UserCanSeeRepositorySettings(ctx context.Context, repositoryId string) (authorized bool, err error)
	// UserCanSeeOrganizationSettings returns whether the user is authorized
	// to see organization settings.
	UserCanSeeOrganizationSettings(ctx context.Context, organizationId string) (authorized bool, err error)
	// UserCanReadPlugin returns whether the user has read access to the specified plugin.
	UserCanReadPlugin(
		ctx context.Context,
		owner string,
		name string,
	) (authorized bool, err error)
	// UserCanCreatePluginVersion returns whether the user is authorized
	// to create a plugin version under the specified plugin.
	UserCanCreatePluginVersion(
		ctx context.Context,
		owner string,
		name string,
	) (authorized bool, err error)
	// UserCanCreateTemplateVersion returns whether the user is authorized
	// to create a template version under the specified template.
	UserCanCreateTemplateVersion(
		ctx context.Context,
		owner string,
		name string,
	) (authorized bool, err error)
	// UserCanCreateOrganizationPlugin returns whether the user is authorized to create
	// a plugin in an organization.
	UserCanCreateOrganizationPlugin(ctx context.Context, organizationId string) (authorized bool, err error)
	// UserCanCreateOrganizationPlugin returns whether the user is authorized to create
	// a template in an organization.
	UserCanCreateOrganizationTemplate(ctx context.Context, organizationId string) (authorized bool, err error)
	// UserCanSeePluginSettings returns whether the user is authorized
	// to see plugin settings.
	UserCanSeePluginSettings(
		ctx context.Context,
		owner string,
		name string,
	) (authorized bool, err error)
	// UserCanSeeTemplateSettings returns whether the user is authorized
	// to see template settings.
	UserCanSeeTemplateSettings(
		ctx context.Context,
		owner string,
		name string,
	) (authorized bool, err error)
}

AuthzService supplies authorization helpers.

type DocService added in v0.50.0

type DocService interface {
	// GetSourceDirectoryInfo retrieves the directory and file structure for the
	// given owner, repository and reference.
	//
	// The purpose of this is to get a representation of the file tree for a given
	// module to enable exploring the module by navigating through its contents.
	GetSourceDirectoryInfo(
		ctx context.Context,
		owner string,
		repository string,
		reference string,
	) (root *v1alpha1.FileInfo, err error)
	// GetSourceFile retrieves the source contents for the given owner, repository,
	// reference, and path.
	GetSourceFile(
		ctx context.Context,
		owner string,
		repository string,
		reference string,
		path string,
	) (content []byte, err error)
	// GetModuleDocumentation retrieves the documentation for module based on the given
	// owner, repository, and reference.
	GetModuleDocumentation(
		ctx context.Context,
		owner string,
		repository string,
		reference string,
	) (moduleDocumentation *v1alpha1.ModuleDocumentation, err error)
	// GetPackageDocumentation retrieves a a slice of documentation structures
	// for the given owner, repository, reference, and package name.
	GetPackageDocumentation(
		ctx context.Context,
		owner string,
		repository string,
		reference string,
		packageName string,
	) (packageDocumentation *v1alpha1.PackageDocumentation, err error)
}

DocService defines a set of APIs that are intended for use by bufwebd only. This is not intended for general use; changes and use cases are subject to executive approval.

type DownloadService

type DownloadService interface {
	// Download downloads.
	Download(
		ctx context.Context,
		owner string,
		repository string,
		reference string,
	) (module *v1alpha1.Module, err error)
}

DownloadService is the download service.

type GenerateService added in v0.50.0

type GenerateService interface {
	// Generate generates an array of files given the provided
	// module reference and template version ID.
	Generate(
		ctx context.Context,
		image *v1.Image,
		templateOwner string,
		templateName string,
		templateVersion string,
	) (files []*v1alpha1.File, runtimeLibraries []*v1alpha1.RuntimeLibrary, err error)
}

GenerateService manages remote generation requests.

type ImageService added in v0.50.0

type ImageService interface {
	// GetImage serves a compiled image for the local module. It automatically
	// downloads dependencies if necessary.
	GetImage(
		ctx context.Context,
		owner string,
		repository string,
		reference string,
	) (image *v1.Image, err error)
}

ImageService serves compiled images.

type LocalResolveService added in v0.50.0

type LocalResolveService interface {
	// GetLocalModulePins gets the latest pins for the specified local module references.
	// It also includes all of the modules transitive dependencies for the specified references.
	//
	// We want this for two reasons:
	//
	// 1. It makes it easy to say "we know we're looking for owner/repo on this specific remote".
	//    While we could just do this in GetModulePins by being aware of what our remote is
	//    (something we probably still need to know, DNS problems aside, which are more
	//    theoretical), this helps.
	// 2. Having a separate method makes us able to say "do not make decisions about what
	//    wins between competing pins for the same repo". This should only be done in
	//    GetModulePins, not in this function, i.e. only done at the top level.
	GetLocalModulePins(
		ctx context.Context,
		localModuleReferences []*v1alpha11.LocalModuleReference,
	) (localModuleResolveResults []*v1alpha11.LocalModuleResolveResult, dependencies []*v1alpha1.ModulePin, err error)
}

LocalResolveService is the local resolve service.

This is called by ResolveService implementations, and is enterprise.

type OrganizationService

type OrganizationService interface {
	// GetOrganization gets a organization by ID.
	GetOrganization(ctx context.Context, id string) (organization *v1alpha1.Organization, err error)
	// GetOrganizationByName gets a organization by name.
	GetOrganizationByName(ctx context.Context, name string) (organization *v1alpha1.Organization, err error)
	// ListOrganizations lists all organizations.
	ListOrganizations(
		ctx context.Context,
		pageSize uint32,
		pageToken string,
		reverse bool,
	) (organizations []*v1alpha1.Organization, nextPageToken string, err error)
	// ListUserOrganizations lists all organizations a user is member of.
	ListUserOrganizations(
		ctx context.Context,
		userId string,
		pageSize uint32,
		pageToken string,
		reverse bool,
	) (organizations []*v1alpha1.Organization, nextPageToken string, err error)
	// CreateOrganization creates a new organization.
	CreateOrganization(ctx context.Context, name string) (organization *v1alpha1.Organization, err error)
	// UpdateOrganizationName updates a organization's name.
	UpdateOrganizationName(
		ctx context.Context,
		id string,
		newName string,
	) (organization *v1alpha1.Organization, err error)
	// UpdateOrganizationNameByName updates a organization's name by name.
	UpdateOrganizationNameByName(
		ctx context.Context,
		name string,
		newName string,
	) (organization *v1alpha1.Organization, err error)
	// DeleteOrganization deletes a organization.
	DeleteOrganization(ctx context.Context, id string) (err error)
	// DeleteOrganizationByName deletes a organization by name.
	DeleteOrganizationByName(ctx context.Context, name string) (err error)
	// AddOrganizationBaseRepositoryScope adds a base repository scope to an organization by ID.
	AddOrganizationBaseRepositoryScope(
		ctx context.Context,
		id string,
		repositoryScope v1alpha1.RepositoryScope,
	) (err error)
	// AddOrganizationBaseRepositoryScopeByName adds a base repository scope to an organization by name.
	AddOrganizationBaseRepositoryScopeByName(
		ctx context.Context,
		name string,
		repositoryScope v1alpha1.RepositoryScope,
	) (err error)
	// RemoveOrganizationBaseRepositoryScope removes a base repository scope from an organization by ID.
	RemoveOrganizationBaseRepositoryScope(
		ctx context.Context,
		id string,
		repositoryScope v1alpha1.RepositoryScope,
	) (err error)
	// RemoveOrganizationBaseRepositoryScopeByName removes a base repository scope from an organization by name.
	RemoveOrganizationBaseRepositoryScopeByName(
		ctx context.Context,
		name string,
		repositoryScope v1alpha1.RepositoryScope,
	) (err error)
}

OrganizationService is the Organization service.

type OwnerService added in v0.44.0

type OwnerService interface {
	// GetOwnerByName takes an owner name and returns the owner as
	// either a user or organization.
	GetOwnerByName(ctx context.Context, name string) (owner *v1alpha1.Owner, err error)
}

OwnerService is a service that provides RPCs that allow the BSR to query for owner information.

type PluginService added in v0.45.0

type PluginService interface {
	// ListPlugins returns all the plugins available to the user. This includes
	// public plugins, those uploaded to organizations the user is part of,
	// and any plugins uploaded directly by the user.
	ListPlugins(
		ctx context.Context,
		pageSize uint32,
		pageToken string,
		reverse bool,
	) (plugins []*v1alpha1.Plugin, nextPageToken string, err error)
	// ListUserPlugins lists all plugins belonging to a user.
	ListUserPlugins(
		ctx context.Context,
		owner string,
		pageSize uint32,
		pageToken string,
		reverse bool,
	) (plugins []*v1alpha1.Plugin, nextPageToken string, err error)
	// ListOrganizationPlugins lists all plugins for an organization.
	ListOrganizationPlugins(
		ctx context.Context,
		organization string,
		pageSize uint32,
		pageToken string,
		reverse bool,
	) (plugins []*v1alpha1.Plugin, nextPageToken string, err error)
	// ListPluginVersions lists all the versions available for the specified plugin.
	ListPluginVersions(
		ctx context.Context,
		owner string,
		name string,
		pageSize uint32,
		pageToken string,
		reverse bool,
	) (pluginVersions []*v1alpha1.PluginVersion, nextPageToken string, err error)
	// CreatePlugin creates a new plugin.
	CreatePlugin(
		ctx context.Context,
		owner string,
		name string,
		visibility v1alpha1.PluginVisibility,
	) (plugin *v1alpha1.Plugin, err error)
	// GetPlugin returns the plugin, if found.
	GetPlugin(
		ctx context.Context,
		owner string,
		name string,
	) (plugin *v1alpha1.Plugin, err error)
	// DeletePlugin deletes the plugin, if it exists. Note that deleting
	// a plugin may cause breaking changes for templates using that plugin,
	// and should be done with extreme care.
	DeletePlugin(
		ctx context.Context,
		owner string,
		name string,
	) (err error)
	// GetTemplate returns the template, if found.
	GetTemplate(
		ctx context.Context,
		owner string,
		name string,
	) (template *v1alpha1.Template, err error)
	// ListTemplates returns all the templates available to the user. This includes
	// public templates, those owned by organizations the user is part of,
	// and any created directly by the user.
	ListTemplates(
		ctx context.Context,
		pageSize uint32,
		pageToken string,
		reverse bool,
	) (templates []*v1alpha1.Template, nextPageToken string, err error)
	// ListUserPlugins lists all templates belonging to a user.
	ListUserTemplates(
		ctx context.Context,
		owner string,
		pageSize uint32,
		pageToken string,
		reverse bool,
	) (templates []*v1alpha1.Template, nextPageToken string, err error)
	// ListOrganizationTemplates lists all templates for an organization.
	ListOrganizationTemplates(
		ctx context.Context,
		organization string,
		pageSize uint32,
		pageToken string,
		reverse bool,
	) (templates []*v1alpha1.Template, nextPageToken string, err error)
	// GetTemplateVersion returns the template version, if found.
	GetTemplateVersion(
		ctx context.Context,
		owner string,
		name string,
		version string,
	) (templateVersion *v1alpha1.TemplateVersion, err error)
	// ListTemplateVersions lists all the template versions available for the specified template.
	ListTemplateVersions(
		ctx context.Context,
		owner string,
		name string,
		pageSize uint32,
		pageToken string,
		reverse bool,
	) (templateVersions []*v1alpha1.TemplateVersion, nextPageToken string, err error)
	// CreateTemplate creates a new template.
	CreateTemplate(
		ctx context.Context,
		owner string,
		name string,
		visibility v1alpha1.PluginVisibility,
		pluginConfigs []*v1alpha1.PluginConfig,
	) (template *v1alpha1.Template, err error)
	// DeleteTemplate deletes the template, if it exists.
	DeleteTemplate(
		ctx context.Context,
		owner string,
		name string,
	) (err error)
	// CreateTemplateVersion creates a new template version.
	CreateTemplateVersion(
		ctx context.Context,
		name string,
		templateOwner string,
		templateName string,
		pluginVersions []*v1alpha1.PluginVersionMapping,
	) (templateVersion *v1alpha1.TemplateVersion, err error)
}

PluginService manages plugins.

type PushService

type PushService interface {
	// Push pushes.
	Push(
		ctx context.Context,
		owner string,
		repository string,
		branch string,
		module *v1alpha1.Module,
		tags []string,
	) (localModulePin *v1alpha11.LocalModulePin, err error)
}

PushService is the Push service.

type RecommendationService added in v0.50.0

type RecommendationService interface {
	// RecommendedRepositories returns a list of recommended repositories.
	RecommendedRepositories(ctx context.Context) (repositories []*v1alpha1.RecommendedRepository, err error)
}

RecommendationService is the recommendation service.

type ReferenceService added in v0.44.0

type ReferenceService interface {
	// GetReferenceByName takes a reference name and returns the
	// reference either as a tag, branch, or commit.
	GetReferenceByName(
		ctx context.Context,
		name string,
		owner string,
		repositoryName string,
	) (reference *v1alpha1.Reference, err error)
}

ReferenceService is a service that provides RPCs that allow the BSR to query for reference information.

type RepositoryBranchService

type RepositoryBranchService interface {
	// CreateRepositoryBranch creates a new repository branch.
	CreateRepositoryBranch(
		ctx context.Context,
		repositoryId string,
		name string,
		parentBranch string,
	) (repositoryBranch *v1alpha1.RepositoryBranch, err error)
	// ListRepositoryBranches lists the repository branches associated with a Repository.
	ListRepositoryBranches(
		ctx context.Context,
		repositoryId string,
		pageSize uint32,
		pageToken string,
		reverse bool,
	) (repositoryBranches []*v1alpha1.RepositoryBranch, nextPageToken string, err error)
}

RepositoryBranchService is the Repository branch service.

type RepositoryCommitService

type RepositoryCommitService interface {
	// ListRepositoryCommitsByBranch lists the repository commits associated
	// with a repository branch on a repository, ordered by their create time.
	ListRepositoryCommitsByBranch(
		ctx context.Context,
		repositoryOwner string,
		repositoryName string,
		repositoryBranchName string,
		pageSize uint32,
		pageToken string,
		reverse bool,
	) (repositoryCommits []*v1alpha1.RepositoryCommit, nextPageToken string, err error)
	// ListRepositoryCommitsByReference returns repository commits up-to and including
	// the provided reference.
	ListRepositoryCommitsByReference(
		ctx context.Context,
		repositoryOwner string,
		repositoryName string,
		reference string,
		pageSize uint32,
		pageToken string,
		reverse bool,
	) (repositoryCommits []*v1alpha1.RepositoryCommit, nextPageToken string, err error)
	// GetRepositoryCommitByReference returns the repository commit matching
	// the provided reference, if it exists.
	GetRepositoryCommitByReference(
		ctx context.Context,
		repositoryOwner string,
		repositoryName string,
		reference string,
	) (repositoryCommit *v1alpha1.RepositoryCommit, err error)
	// GetRepositoryCommitBySequenceID returns the repository commit matching
	// the provided sequence ID and branch, if it exists.
	GetRepositoryCommitBySequenceID(
		ctx context.Context,
		repositoryOwner string,
		repositoryName string,
		repositoryBranchName string,
		commitSequenceId int64,
	) (repositoryCommit *v1alpha1.RepositoryCommit, err error)
}

RepositoryCommitService is the Repository commit service.

type RepositoryService

type RepositoryService interface {
	// GetRepository gets a repository by ID.
	GetRepository(ctx context.Context, id string) (repository *v1alpha1.Repository, err error)
	// GetRepositoryByFullName gets a repository by full name.
	GetRepositoryByFullName(ctx context.Context, fullName string) (repository *v1alpha1.Repository, err error)
	// ListRepositories lists all repositories.
	ListRepositories(
		ctx context.Context,
		pageSize uint32,
		pageToken string,
		reverse bool,
	) (repositories []*v1alpha1.Repository, nextPageToken string, err error)
	// ListUserRepositories lists all repositories belonging to a user.
	ListUserRepositories(
		ctx context.Context,
		userId string,
		pageSize uint32,
		pageToken string,
		reverse bool,
	) (repositories []*v1alpha1.Repository, nextPageToken string, err error)
	// ListUserRepositories lists all repositories a user can access.
	ListRepositoriesUserCanAccess(
		ctx context.Context,
		pageSize uint32,
		pageToken string,
		reverse bool,
	) (repositories []*v1alpha1.Repository, nextPageToken string, err error)
	// ListOrganizationRepositories lists all repositories for an organization.
	ListOrganizationRepositories(
		ctx context.Context,
		organizationId string,
		pageSize uint32,
		pageToken string,
		reverse bool,
	) (repositories []*v1alpha1.Repository, nextPageToken string, err error)
	// CreateRepositoryByFullName creates a new repository by full name.
	CreateRepositoryByFullName(
		ctx context.Context,
		fullName string,
		visibility v1alpha1.Visibility,
	) (repository *v1alpha1.Repository, err error)
	// UpdateRepositoryName updates a repository's name.
	UpdateRepositoryName(
		ctx context.Context,
		id string,
		newName string,
	) (repository *v1alpha1.Repository, err error)
	// UpdateRepositoryNameByFullName updates a repository's name by full name.
	UpdateRepositoryNameByFullName(
		ctx context.Context,
		fullName string,
		newName string,
	) (repository *v1alpha1.Repository, err error)
	// UpdateRepositoryVisibility updates a repository's visibility.
	UpdateRepositoryVisibility(
		ctx context.Context,
		id string,
		newVisibility v1alpha1.Visibility,
	) (repository *v1alpha1.Repository, err error)
	// UpdateRepositoryVisibilityByName updates a repository's visibility by name.
	UpdateRepositoryVisibilityByName(
		ctx context.Context,
		ownerName string,
		repositoryName string,
		newVisibility v1alpha1.Visibility,
	) (repository *v1alpha1.Repository, err error)
	// DeleteRepository deletes a repository.
	DeleteRepository(ctx context.Context, id string) (err error)
	// DeleteRepositoryByFullName deletes a repository by full name.
	DeleteRepositoryByFullName(ctx context.Context, fullName string) (err error)
}

RepositoryService is the Repository service.

type RepositoryTagService added in v0.39.1

type RepositoryTagService interface {
	// CreateRepositoryTag creates a new repository tag.
	CreateRepositoryTag(
		ctx context.Context,
		repositoryId string,
		name string,
		commitName string,
	) (repositoryTag *v1alpha1.RepositoryTag, err error)
	// ListRepositoryTags lists the repository tags associated with a Repository.
	ListRepositoryTags(
		ctx context.Context,
		repositoryId string,
		pageSize uint32,
		pageToken string,
		reverse bool,
	) (repositoryTags []*v1alpha1.RepositoryTag, nextPageToken string, err error)
}

RepositoryTagService is the Repository tag service.

type ResolveService

type ResolveService interface {
	// GetModulePins finds all the latest digests and respective dependencies of
	// the provided module references and picks a set of distinct modules pins.
	//
	// Note that module references with commits should still be passed to this function
	// to make sure this function can do dependency resolution.
	//
	// This function also deals with tiebreaking what ModulePin wins for the same repository.
	GetModulePins(
		ctx context.Context,
		moduleReferences []*v1alpha1.ModuleReference,
		currentModulePins []*v1alpha1.ModulePin,
	) (modulePins []*v1alpha1.ModulePin, err error)
}

ResolveService is the resolve service.

This is the public service.

type SearchService added in v0.50.0

type SearchService interface {
	// Search searches the BSR.
	Search(
		ctx context.Context,
		query string,
		pageSize uint32,
		pageToken uint32,
	) (searchResults []*v1alpha1.SearchResult, nextPageToken uint32, err error)
}

SearchService is the search service.

type TeamService added in v0.50.0

type TeamService interface {
	// GetTeam gets a team by ID.
	GetTeam(ctx context.Context, id string) (team *v1alpha1.Team, err error)
	// GetTeamByName gets a team by the combination of its name and organization.
	GetTeamByName(
		ctx context.Context,
		name string,
		organizationName string,
	) (team *v1alpha1.Team, err error)
	// ListOrganizationTeams lists all teams belonging to an organization.
	ListOrganizationTeams(
		ctx context.Context,
		organizationId string,
		pageSize uint32,
		pageToken string,
		reverse bool,
	) (teams []*v1alpha1.Team, nextPageToken string, err error)
	// CreateTeam creates a new team within an organization.
	CreateTeam(
		ctx context.Context,
		name string,
		organizationId string,
	) (team *v1alpha1.Team, err error)
	// CreateTeamByName creates a new team within an organization, looking up the organization by name.
	CreateTeamByName(
		ctx context.Context,
		name string,
		organizationName string,
	) (team *v1alpha1.Team, err error)
	// UpdateTeamName updates a team's name.
	UpdateTeamName(
		ctx context.Context,
		id string,
		newName string,
	) (team *v1alpha1.Team, err error)
	// AddUserToTeam adds a user to a team by their respective IDs.
	AddUserToTeam(
		ctx context.Context,
		id string,
		userId string,
	) (err error)
	// AddUserToTeamByName adds a user to a team, looking up the entities by user, team, and organization names.
	AddUserToTeamByName(
		ctx context.Context,
		name string,
		userName string,
		organizationName string,
	) (err error)
	// RemoveUserFromTeam removes a user from a team by their respective IDs.
	RemoveUserFromTeam(
		ctx context.Context,
		id string,
		userId string,
	) (err error)
	// RemoveUserFromTeamByName removes a user from a team, looking up the entities by user, team, and organization names.
	RemoveUserFromTeamByName(
		ctx context.Context,
		name string,
		userName string,
		organizationName string,
	) (err error)
	// DeleteTeam deletes a team by ID.
	DeleteTeam(ctx context.Context, id string) (err error)
	// DeleteTeamByName deletes a team by the combination of its name and organization.
	DeleteTeamByName(
		ctx context.Context,
		name string,
		organizationName string,
	) (err error)
	// AddTeamOrganizationScope adds an organization scope to a team by ID.
	AddTeamOrganizationScope(
		ctx context.Context,
		id string,
		organizationScope v1alpha1.OrganizationScope,
	) (err error)
	// AddTeamOrganizationScopeByName adds an organization scope to a team by name.
	AddTeamOrganizationScopeByName(
		ctx context.Context,
		name string,
		organizationName string,
		organizationScope v1alpha1.OrganizationScope,
	) (err error)
	// RemoveTeamOrganizationScope removes an organization scope from a team by ID.
	RemoveTeamOrganizationScope(
		ctx context.Context,
		id string,
		organizationScope v1alpha1.OrganizationScope,
	) (err error)
	// RemoveTeamOrganizationScopeByName removes an organization scope from a team by name.
	RemoveTeamOrganizationScopeByName(
		ctx context.Context,
		name string,
		organizationName string,
		organizationScope v1alpha1.OrganizationScope,
	) (err error)
	// AddTeamBaseRepositoryScope adds a base repository scope to a team by ID.
	AddTeamBaseRepositoryScope(
		ctx context.Context,
		id string,
		repositoryScope v1alpha1.RepositoryScope,
	) (err error)
	// AddTeamBaseRepositoryScopeByName adds a base repository scope to a team by name.
	AddTeamBaseRepositoryScopeByName(
		ctx context.Context,
		name string,
		organizationName string,
		repositoryScope v1alpha1.RepositoryScope,
	) (err error)
	// RemoveTeamBaseRepositoryScope removes a base repository scope from a team by ID.
	RemoveTeamBaseRepositoryScope(
		ctx context.Context,
		id string,
		repositoryScope v1alpha1.RepositoryScope,
	) (err error)
	// RemoveTeamBaseRepositoryScopeByName removes a base repository scope from a team by name.
	RemoveTeamBaseRepositoryScopeByName(
		ctx context.Context,
		name string,
		organizationName string,
		repositoryScope v1alpha1.RepositoryScope,
	) (err error)
	// AddTeamRepositoryScope adds a repository scope for a specific repository to a team by ID.
	AddTeamRepositoryScope(
		ctx context.Context,
		id string,
		repositoryId string,
		repositoryScope v1alpha1.RepositoryScope,
	) (err error)
	// AddTeamRepositoryScopeByName adds a repository scope for a specific repository to a team by name.
	AddTeamRepositoryScopeByName(
		ctx context.Context,
		name string,
		organizationName string,
		repositoryName string,
		repositoryScope v1alpha1.RepositoryScope,
	) (err error)
	// RemoveTeamRepositoryScope removes a repository scope for a specific repository from a team by ID.
	RemoveTeamRepositoryScope(
		ctx context.Context,
		id string,
		repositoryId string,
		repositoryScope v1alpha1.RepositoryScope,
	) (err error)
	// RemoveTeamRepositoryScopeByName removes a repository scope for a specific repository from a team by name.
	RemoveTeamRepositoryScopeByName(
		ctx context.Context,
		name string,
		organizationName string,
		repositoryName string,
		repositoryScope v1alpha1.RepositoryScope,
	) (err error)
}

TeamService is the Team service. All methods on the Team service require authentication.

type TokenService added in v0.50.0

type TokenService interface {
	// CreateToken creates a new token suitable for machine-to-machine authentication.
	CreateToken(
		ctx context.Context,
		note string,
		expireTime *timestamppb.Timestamp,
	) (token string, err error)
	// GetToken gets the specific token for the user
	//
	// This method requires authentication.
	GetToken(ctx context.Context, tokenId string) (token *v1alpha1.Token, err error)
	// ListTokens lists the users active tokens
	//
	// This method requires authentication.
	ListTokens(
		ctx context.Context,
		pageSize uint32,
		pageToken string,
		reverse bool,
	) (tokens []*v1alpha1.Token, nextPageToken string, err error)
	// DeleteToken deletes an existing token.
	//
	// This method requires authentication.
	DeleteToken(ctx context.Context, tokenId string) (err error)
}

TokenService is the Token service.

type UserService

type UserService interface {
	// CreateUser creates a new user with the given username.
	CreateUser(ctx context.Context, username string) (user *v1alpha1.User, err error)
	// GetUser gets a user by ID.
	GetUser(ctx context.Context, id string) (user *v1alpha1.User, err error)
	// GetUserByUsername gets a user by username.
	GetUserByUsername(ctx context.Context, username string) (user *v1alpha1.User, err error)
	// ListUsers lists all users.
	ListUsers(
		ctx context.Context,
		pageSize uint32,
		pageToken string,
		reverse bool,
	) (users []*v1alpha1.User, nextPageToken string, err error)
	// ListOrganizationUsers lists all users for an organization.
	ListOrganizationUsers(
		ctx context.Context,
		organizationId string,
		pageSize uint32,
		pageToken string,
		reverse bool,
	) (users []*v1alpha1.User, nextPageToken string, err error)
	// UpdateUserUsername updates a user's username.
	UpdateUserUsername(ctx context.Context, newUsername string) (user *v1alpha1.User, err error)
	// DeleteUser deletes a user.
	DeleteUser(ctx context.Context) (err error)
	// AddUserOrganizationScope adds an organization scope for a specific organization to a user by ID.
	AddUserOrganizationScope(
		ctx context.Context,
		id string,
		organizationId string,
		organizationScope v1alpha1.OrganizationScope,
	) (err error)
	// AddUserOrganizationScopeByName adds an organization scope for a specific organization to a user by name.
	AddUserOrganizationScopeByName(
		ctx context.Context,
		name string,
		organizationName string,
		organizationScope v1alpha1.OrganizationScope,
	) (err error)
	// RemoveUserOrganizationScope removes an organization scope for a specific organization from a user by ID.
	RemoveUserOrganizationScope(
		ctx context.Context,
		id string,
		organizationId string,
		organizationScope v1alpha1.OrganizationScope,
	) (err error)
	// RemoveUserOrganizationScopeByName removes an organization scope for a specific organization from a user by name.
	RemoveUserOrganizationScopeByName(
		ctx context.Context,
		name string,
		organizationName string,
		organizationScope v1alpha1.OrganizationScope,
	) (err error)
	// AddUserServerScope adds a server scope for a user by ID.
	AddUserServerScope(
		ctx context.Context,
		id string,
		serverScope v1alpha1.ServerScope,
	) (err error)
	// AddUserServerScopeByName adds a server scope for a user by name.
	AddUserServerScopeByName(
		ctx context.Context,
		name string,
		serverScope v1alpha1.ServerScope,
	) (err error)
	// RemoveUserServerScope removes a server scope for a user by ID.
	RemoveUserServerScope(
		ctx context.Context,
		id string,
		serverScope v1alpha1.ServerScope,
	) (err error)
	// RemoveUserServerScopeByName removes a server scope for a user by name.
	RemoveUserServerScopeByName(
		ctx context.Context,
		name string,
		serverScope v1alpha1.ServerScope,
	) (err error)
}

UserService is the User service.

Jump to

Keyboard shortcuts

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