generated

package
v0.0.0-...-96f7096 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2024 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewExecutableSchema

func NewExecutableSchema(cfg Config) graphql.ExecutableSchema

NewExecutableSchema creates an ExecutableSchema from the ResolverRoot interface.

Types

type AuditLogResolver

type AuditLogResolver interface {
	Action(ctx context.Context, obj *db.AuditLog) (types.AuditAction, error)
	ComponentName(ctx context.Context, obj *db.AuditLog) (types.ComponentName, error)

	TargetType(ctx context.Context, obj *db.AuditLog) (types.AuditLogsTargetType, error)
}

type ComplexityRoot

type ComplexityRoot struct {
	AuditLog struct {
		Action           func(childComplexity int) int
		Actor            func(childComplexity int) int
		ComponentName    func(childComplexity int) int
		CorrelationID    func(childComplexity int) int
		CreatedAt        func(childComplexity int) int
		ID               func(childComplexity int) int
		Message          func(childComplexity int) int
		TargetIdentifier func(childComplexity int) int
		TargetType       func(childComplexity int) int
	}

	GcpProject struct {
		Environment func(childComplexity int) int
		ProjectID   func(childComplexity int) int
		ProjectName func(childComplexity int) int
	}

	GitHubRepository struct {
		Archived       func(childComplexity int) int
		Authorizations func(childComplexity int) int
		Name           func(childComplexity int) int
		Permissions    func(childComplexity int) int
		RoleName       func(childComplexity int) int
	}

	GitHubRepositoryPermission struct {
		Granted func(childComplexity int) int
		Name    func(childComplexity int) int
	}

	Mutation struct {
		AddReconcilerOptOut          func(childComplexity int, teamSlug *slug.Slug, userID *uuid.UUID, reconciler sqlc.ReconcilerName) int
		AddTeamMember                func(childComplexity int, slug *slug.Slug, member model.TeamMemberInput) int
		AddTeamMembers               func(childComplexity int, slug *slug.Slug, userIds []*uuid.UUID) int
		AddTeamOwners                func(childComplexity int, slug *slug.Slug, userIds []*uuid.UUID) int
		AuthorizeRepository          func(childComplexity int, authorization model.RepositoryAuthorization, teamSlug *slug.Slug, repoName string) int
		ConfigureReconciler          func(childComplexity int, name sqlc.ReconcilerName, config []*model.ReconcilerConfigInput) int
		ConfirmTeamDeletion          func(childComplexity int, key *uuid.UUID) int
		CreateTeam                   func(childComplexity int, input model.CreateTeamInput) int
		DeauthorizeRepository        func(childComplexity int, authorization model.RepositoryAuthorization, teamSlug *slug.Slug, repoName string) int
		DisableReconciler            func(childComplexity int, name sqlc.ReconcilerName) int
		EnableReconciler             func(childComplexity int, name sqlc.ReconcilerName) int
		RemoveReconcilerOptOut       func(childComplexity int, teamSlug *slug.Slug, userID *uuid.UUID, reconciler sqlc.ReconcilerName) int
		RemoveUserFromTeam           func(childComplexity int, slug *slug.Slug, userID *uuid.UUID) int
		RemoveUsersFromTeam          func(childComplexity int, slug *slug.Slug, userIds []*uuid.UUID) int
		RequestTeamDeletion          func(childComplexity int, slug *slug.Slug) int
		ResetReconciler              func(childComplexity int, name sqlc.ReconcilerName) int
		SetAzureADGroupID            func(childComplexity int, teamSlug *slug.Slug, azureADGroupID *uuid.UUID) int
		SetGcpProjectID              func(childComplexity int, teamSlug *slug.Slug, gcpEnvironment string, gcpProjectID string) int
		SetGitHubTeamSlug            func(childComplexity int, teamSlug *slug.Slug, gitHubTeamSlug *slug.Slug) int
		SetGoogleWorkspaceGroupEmail func(childComplexity int, teamSlug *slug.Slug, googleWorkspaceGroupEmail string) int
		SetNaisNamespace             func(childComplexity int, teamSlug *slug.Slug, gcpEnvironment string, naisNamespace *slug.Slug) int
		SetTeamMemberRole            func(childComplexity int, slug *slug.Slug, userID *uuid.UUID, role model.TeamRole) int
		SynchronizeAllTeams          func(childComplexity int) int
		SynchronizeTeam              func(childComplexity int, slug *slug.Slug) int
		SynchronizeUsers             func(childComplexity int) int
		UpdateTeam                   func(childComplexity int, slug *slug.Slug, input model.UpdateTeamInput) int
	}

	NaisNamespace struct {
		Environment func(childComplexity int) int
		Namespace   func(childComplexity int) int
	}

	Query struct {
		DeployKey                       func(childComplexity int, slug *slug.Slug) int
		IsRepositoryAuthorized          func(childComplexity int, repoName string, authorization model.RepositoryAuthorization, teamSlug *slug.Slug) int
		Me                              func(childComplexity int) int
		Reconcilers                     func(childComplexity int) int
		Roles                           func(childComplexity int) int
		Team                            func(childComplexity int, slug *slug.Slug) int
		TeamDeleteKey                   func(childComplexity int, key *uuid.UUID) int
		Teams                           func(childComplexity int) int
		TeamsWithPermissionInGitHubRepo func(childComplexity int, repoName *string, permissionName *string) int
		User                            func(childComplexity int, id *uuid.UUID) int
		UserByEmail                     func(childComplexity int, email string) int
		UserSync                        func(childComplexity int) int
		Users                           func(childComplexity int) int
	}

	Reconciler struct {
		AuditLogs           func(childComplexity int) int
		Config              func(childComplexity int) int
		Configured          func(childComplexity int) int
		Description         func(childComplexity int) int
		DisplayName         func(childComplexity int) int
		Enabled             func(childComplexity int) int
		Name                func(childComplexity int) int
		RunOrder            func(childComplexity int) int
		UsesTeamMemberships func(childComplexity int) int
	}

	ReconcilerConfig struct {
		Configured  func(childComplexity int) int
		Description func(childComplexity int) int
		DisplayName func(childComplexity int) int
		Key         func(childComplexity int) int
		Secret      func(childComplexity int) int
		Value       func(childComplexity int) int
	}

	ReconcilerState struct {
		AzureADGroupID            func(childComplexity int) int
		GarRepositoryName         func(childComplexity int) int
		GcpProjects               func(childComplexity int) int
		GitHubTeamSlug            func(childComplexity int) int
		GoogleWorkspaceGroupEmail func(childComplexity int) int
		NaisDeployKeyProvisioned  func(childComplexity int) int
		NaisNamespaces            func(childComplexity int) int
	}

	Role struct {
		IsGlobal               func(childComplexity int) int
		Name                   func(childComplexity int) int
		TargetServiceAccountID func(childComplexity int) int
		TargetTeamSlug         func(childComplexity int) int
	}

	ServiceAccount struct {
		ID    func(childComplexity int) int
		Name  func(childComplexity int) int
		Roles func(childComplexity int) int
	}

	SlackAlertsChannel struct {
		ChannelName func(childComplexity int) int
		Environment func(childComplexity int) int
	}

	SyncError struct {
		CreatedAt  func(childComplexity int) int
		Error      func(childComplexity int) int
		Reconciler func(childComplexity int) int
	}

	Team struct {
		AuditLogs           func(childComplexity int) int
		DeletionInProgress  func(childComplexity int) int
		GitHubRepositories  func(childComplexity int) int
		LastSuccessfulSync  func(childComplexity int) int
		Members             func(childComplexity int) int
		Purpose             func(childComplexity int) int
		ReconcilerState     func(childComplexity int) int
		SlackAlertsChannels func(childComplexity int) int
		SlackChannel        func(childComplexity int) int
		Slug                func(childComplexity int) int
		SyncErrors          func(childComplexity int) int
	}

	TeamDeleteKey struct {
		CreatedAt func(childComplexity int) int
		CreatedBy func(childComplexity int) int
		Expires   func(childComplexity int) int
		Key       func(childComplexity int) int
		Team      func(childComplexity int) int
	}

	TeamMember struct {
		Reconcilers func(childComplexity int) int
		Role        func(childComplexity int) int
		Team        func(childComplexity int) int
		User        func(childComplexity int) int
	}

	TeamMemberReconciler struct {
		Enabled    func(childComplexity int) int
		Reconciler func(childComplexity int) int
	}

	TeamSync struct {
		CorrelationID func(childComplexity int) int
	}

	User struct {
		Email      func(childComplexity int) int
		ExternalID func(childComplexity int) int
		ID         func(childComplexity int) int
		Name       func(childComplexity int) int
		Roles      func(childComplexity int) int
		Teams      func(childComplexity int) int
	}

	UserSyncRun struct {
		CorrelationID func(childComplexity int) int
		Error         func(childComplexity int) int
		FinishedAt    func(childComplexity int) int
		LogEntries    func(childComplexity int) int
		StartedAt     func(childComplexity int) int
		Status        func(childComplexity int) int
	}
}

type Config

type Config struct {
	Resolvers  ResolverRoot
	Directives DirectiveRoot
	Complexity ComplexityRoot
}

type DirectiveRoot

type DirectiveRoot struct {
	Admin func(ctx context.Context, obj interface{}, next graphql.Resolver) (res interface{}, err error)
	Auth  func(ctx context.Context, obj interface{}, next graphql.Resolver) (res interface{}, err error)
}

type GitHubRepositoryResolver

type GitHubRepositoryResolver interface {
	Authorizations(ctx context.Context, obj *reconcilers.GitHubRepository) ([]model.RepositoryAuthorization, error)
}

type MutationResolver

type MutationResolver interface {
	SetGitHubTeamSlug(ctx context.Context, teamSlug *slug.Slug, gitHubTeamSlug *slug.Slug) (*db.Team, error)
	SetGoogleWorkspaceGroupEmail(ctx context.Context, teamSlug *slug.Slug, googleWorkspaceGroupEmail string) (*db.Team, error)
	SetAzureADGroupID(ctx context.Context, teamSlug *slug.Slug, azureADGroupID *uuid.UUID) (*db.Team, error)
	SetGcpProjectID(ctx context.Context, teamSlug *slug.Slug, gcpEnvironment string, gcpProjectID string) (*db.Team, error)
	SetNaisNamespace(ctx context.Context, teamSlug *slug.Slug, gcpEnvironment string, naisNamespace *slug.Slug) (*db.Team, error)
	EnableReconciler(ctx context.Context, name sqlc.ReconcilerName) (*db.Reconciler, error)
	DisableReconciler(ctx context.Context, name sqlc.ReconcilerName) (*db.Reconciler, error)
	ConfigureReconciler(ctx context.Context, name sqlc.ReconcilerName, config []*model.ReconcilerConfigInput) (*db.Reconciler, error)
	ResetReconciler(ctx context.Context, name sqlc.ReconcilerName) (*db.Reconciler, error)
	AddReconcilerOptOut(ctx context.Context, teamSlug *slug.Slug, userID *uuid.UUID, reconciler sqlc.ReconcilerName) (*model.TeamMember, error)
	RemoveReconcilerOptOut(ctx context.Context, teamSlug *slug.Slug, userID *uuid.UUID, reconciler sqlc.ReconcilerName) (*model.TeamMember, error)
	CreateTeam(ctx context.Context, input model.CreateTeamInput) (*db.Team, error)
	UpdateTeam(ctx context.Context, slug *slug.Slug, input model.UpdateTeamInput) (*db.Team, error)
	RemoveUsersFromTeam(ctx context.Context, slug *slug.Slug, userIds []*uuid.UUID) (*db.Team, error)
	RemoveUserFromTeam(ctx context.Context, slug *slug.Slug, userID *uuid.UUID) (*db.Team, error)
	SynchronizeTeam(ctx context.Context, slug *slug.Slug) (*model.TeamSync, error)
	SynchronizeAllTeams(ctx context.Context) (*model.TeamSync, error)
	AddTeamMembers(ctx context.Context, slug *slug.Slug, userIds []*uuid.UUID) (*db.Team, error)
	AddTeamOwners(ctx context.Context, slug *slug.Slug, userIds []*uuid.UUID) (*db.Team, error)
	AddTeamMember(ctx context.Context, slug *slug.Slug, member model.TeamMemberInput) (*db.Team, error)
	SetTeamMemberRole(ctx context.Context, slug *slug.Slug, userID *uuid.UUID, role model.TeamRole) (*db.Team, error)
	RequestTeamDeletion(ctx context.Context, slug *slug.Slug) (*db.TeamDeleteKey, error)
	ConfirmTeamDeletion(ctx context.Context, key *uuid.UUID) (*uuid.UUID, error)
	AuthorizeRepository(ctx context.Context, authorization model.RepositoryAuthorization, teamSlug *slug.Slug, repoName string) (*db.Team, error)
	DeauthorizeRepository(ctx context.Context, authorization model.RepositoryAuthorization, teamSlug *slug.Slug, repoName string) (*db.Team, error)
	SynchronizeUsers(ctx context.Context) (*uuid.UUID, error)
}

type QueryResolver

type QueryResolver interface {
	Me(ctx context.Context) (db.AuthenticatedUser, error)
	Reconcilers(ctx context.Context) ([]*db.Reconciler, error)
	Roles(ctx context.Context) ([]sqlc.RoleName, error)
	Teams(ctx context.Context) ([]*db.Team, error)
	Team(ctx context.Context, slug *slug.Slug) (*db.Team, error)
	DeployKey(ctx context.Context, slug *slug.Slug) (string, error)
	TeamDeleteKey(ctx context.Context, key *uuid.UUID) (*db.TeamDeleteKey, error)
	TeamsWithPermissionInGitHubRepo(ctx context.Context, repoName *string, permissionName *string) ([]*db.Team, error)
	IsRepositoryAuthorized(ctx context.Context, repoName string, authorization model.RepositoryAuthorization, teamSlug *slug.Slug) (bool, error)
	Users(ctx context.Context) ([]*db.User, error)
	User(ctx context.Context, id *uuid.UUID) (*db.User, error)
	UserByEmail(ctx context.Context, email string) (*db.User, error)
	UserSync(ctx context.Context) ([]*usersync.Run, error)
}

type ReconcilerResolver

type ReconcilerResolver interface {
	UsesTeamMemberships(ctx context.Context, obj *db.Reconciler) (bool, error)
	Config(ctx context.Context, obj *db.Reconciler) ([]*db.ReconcilerConfig, error)
	Configured(ctx context.Context, obj *db.Reconciler) (bool, error)

	AuditLogs(ctx context.Context, obj *db.Reconciler) ([]*db.AuditLog, error)
}

type ResolverRoot

type ResolverRoot interface {
	AuditLog() AuditLogResolver
	GitHubRepository() GitHubRepositoryResolver
	Mutation() MutationResolver
	Query() QueryResolver
	Reconciler() ReconcilerResolver
	Role() RoleResolver
	ServiceAccount() ServiceAccountResolver
	Team() TeamResolver
	TeamDeleteKey() TeamDeleteKeyResolver
	TeamMemberReconciler() TeamMemberReconcilerResolver
	User() UserResolver
	UserSyncRun() UserSyncRunResolver
}

type RoleResolver

type RoleResolver interface {
	Name(ctx context.Context, obj *db.Role) (sqlc.RoleName, error)
}

type ServiceAccountResolver

type ServiceAccountResolver interface {
	Roles(ctx context.Context, obj *db.ServiceAccount) ([]*db.Role, error)
}

type TeamDeleteKeyResolver

type TeamDeleteKeyResolver interface {
	CreatedBy(ctx context.Context, obj *db.TeamDeleteKey) (*db.User, error)
	Team(ctx context.Context, obj *db.TeamDeleteKey) (*db.Team, error)
}

type TeamMemberReconcilerResolver

type TeamMemberReconcilerResolver interface {
	Reconciler(ctx context.Context, obj *sqlc.GetTeamMemberOptOutsRow) (*db.Reconciler, error)
}

type TeamResolver

type TeamResolver interface {
	AuditLogs(ctx context.Context, obj *db.Team) ([]*db.AuditLog, error)
	Members(ctx context.Context, obj *db.Team) ([]*model.TeamMember, error)
	SyncErrors(ctx context.Context, obj *db.Team) ([]*model.SyncError, error)

	ReconcilerState(ctx context.Context, obj *db.Team) (*model.ReconcilerState, error)

	SlackAlertsChannels(ctx context.Context, obj *db.Team) ([]*model.SlackAlertsChannel, error)
	GitHubRepositories(ctx context.Context, obj *db.Team) ([]*reconcilers.GitHubRepository, error)
	DeletionInProgress(ctx context.Context, obj *db.Team) (bool, error)
}

type UserResolver

type UserResolver interface {
	Teams(ctx context.Context, obj *db.User) ([]*model.TeamMember, error)
	Roles(ctx context.Context, obj *db.User) ([]*db.Role, error)
}

type UserSyncRunResolver

type UserSyncRunResolver interface {
	LogEntries(ctx context.Context, obj *usersync.Run) ([]*db.AuditLog, error)
	Status(ctx context.Context, obj *usersync.Run) (model.UserSyncRunStatus, error)
	Error(ctx context.Context, obj *usersync.Run) (*string, error)
}

Jump to

Keyboard shortcuts

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