github_team_reconciler

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: 24 Imported by: 0

Documentation

Index

Constants

Variables

This section is empty.

Functions

func New

func New(database db.Database, auditLogger auditlogger.AuditLogger, org, domain string, teamsService TeamsService, graphClient GraphClient, log logger.Logger) *githubTeamReconciler

func NewFromConfig

func NewFromConfig(ctx context.Context, database db.Database, cfg *config.Config, log logger.Logger) (reconcilers.Reconciler, error)

func NewGitHubAuthClient

func NewGitHubAuthClient(ctx context.Context, authEndpoint string, tokenSource oauth2.TokenSource) *http.Client

Types

type ExternalIdentity

type ExternalIdentity struct {
	User         GitHubUser
	SamlIdentity ExternalIdentitySamlAttributes
}

type ExternalIdentitySamlAttributes

type ExternalIdentitySamlAttributes struct {
	Username githubv4.String
}

type GitHubUser

type GitHubUser struct {
	Login githubv4.String
}

type GraphClient

type GraphClient interface {
	Query(ctx context.Context, q interface{}, variables map[string]interface{}) error
}

type LookupGitHubSamlUserByEmail

type LookupGitHubSamlUserByEmail struct {
	Organization struct {
		SamlIdentityProvider struct {
			ExternalIdentities struct {
				Nodes []ExternalIdentity
			} `graphql:"externalIdentities(first: 1, userName: $username)"`
		}
	} `graphql:"organization(login: $org)"`
}

type LookupGitHubSamlUserByGitHubUsername

type LookupGitHubSamlUserByGitHubUsername struct {
	Organization struct {
		SamlIdentityProvider struct {
			ExternalIdentities struct {
				Nodes []ExternalIdentity
			} `graphql:"externalIdentities(first: 1, login: $login)"`
		}
	} `graphql:"organization(login: $org)"`
}

type MockGraphClient

type MockGraphClient struct {
	mock.Mock
}

MockGraphClient is an autogenerated mock type for the GraphClient type

func NewMockGraphClient

func NewMockGraphClient(t interface {
	mock.TestingT
	Cleanup(func())
},
) *MockGraphClient

NewMockGraphClient creates a new instance of MockGraphClient. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.

func (*MockGraphClient) EXPECT

func (*MockGraphClient) Query

func (_m *MockGraphClient) Query(ctx context.Context, q interface{}, variables map[string]interface{}) error

Query provides a mock function with given fields: ctx, q, variables

type MockGraphClient_Expecter

type MockGraphClient_Expecter struct {
	// contains filtered or unexported fields
}

func (*MockGraphClient_Expecter) Query

func (_e *MockGraphClient_Expecter) Query(ctx interface{}, q interface{}, variables interface{}) *MockGraphClient_Query_Call

Query is a helper method to define mock.On call

  • ctx context.Context
  • q interface{}
  • variables map[string]interface{}

type MockGraphClient_Query_Call

type MockGraphClient_Query_Call struct {
	*mock.Call
}

MockGraphClient_Query_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Query'

func (*MockGraphClient_Query_Call) Return

func (*MockGraphClient_Query_Call) Run

func (_c *MockGraphClient_Query_Call) Run(run func(ctx context.Context, q interface{}, variables map[string]interface{})) *MockGraphClient_Query_Call

func (*MockGraphClient_Query_Call) RunAndReturn

func (_c *MockGraphClient_Query_Call) RunAndReturn(run func(context.Context, interface{}, map[string]interface{}) error) *MockGraphClient_Query_Call

type MockTeamsService

type MockTeamsService struct {
	mock.Mock
}

MockTeamsService is an autogenerated mock type for the TeamsService type

func NewMockTeamsService

func NewMockTeamsService(t interface {
	mock.TestingT
	Cleanup(func())
},
) *MockTeamsService

NewMockTeamsService creates a new instance of MockTeamsService. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.

func (*MockTeamsService) AddTeamMembershipBySlug

func (_m *MockTeamsService) AddTeamMembershipBySlug(ctx context.Context, org string, slug string, user string, opts *github.TeamAddTeamMembershipOptions) (*github.Membership, *github.Response, error)

AddTeamMembershipBySlug provides a mock function with given fields: ctx, org, slug, user, opts

func (*MockTeamsService) CreateOrUpdateIDPGroupConnectionsBySlug

func (_m *MockTeamsService) CreateOrUpdateIDPGroupConnectionsBySlug(ctx context.Context, org string, team string, opts github.IDPGroupList) (*github.IDPGroupList, *github.Response, error)

CreateOrUpdateIDPGroupConnectionsBySlug provides a mock function with given fields: ctx, org, team, opts

func (*MockTeamsService) CreateTeam

func (_m *MockTeamsService) CreateTeam(ctx context.Context, org string, team github.NewTeam) (*github.Team, *github.Response, error)

CreateTeam provides a mock function with given fields: ctx, org, team

func (*MockTeamsService) DeleteTeamBySlug

func (_m *MockTeamsService) DeleteTeamBySlug(ctx context.Context, org string, slug string) (*github.Response, error)

DeleteTeamBySlug provides a mock function with given fields: ctx, org, slug

func (*MockTeamsService) EXPECT

func (*MockTeamsService) EditTeamBySlug

func (_m *MockTeamsService) EditTeamBySlug(ctx context.Context, org string, slug string, team github.NewTeam, removeParent bool) (*github.Team, *github.Response, error)

EditTeamBySlug provides a mock function with given fields: ctx, org, slug, team, removeParent

func (*MockTeamsService) GetTeamBySlug

func (_m *MockTeamsService) GetTeamBySlug(ctx context.Context, org string, slug string) (*github.Team, *github.Response, error)

GetTeamBySlug provides a mock function with given fields: ctx, org, slug

func (*MockTeamsService) ListTeamMembersBySlug

func (_m *MockTeamsService) ListTeamMembersBySlug(ctx context.Context, org string, slug string, opts *github.TeamListTeamMembersOptions) ([]*github.User, *github.Response, error)

ListTeamMembersBySlug provides a mock function with given fields: ctx, org, slug, opts

func (*MockTeamsService) ListTeamReposBySlug

func (_m *MockTeamsService) ListTeamReposBySlug(ctx context.Context, org string, slug string, opts *github.ListOptions) ([]*github.Repository, *github.Response, error)

ListTeamReposBySlug provides a mock function with given fields: ctx, org, slug, opts

func (*MockTeamsService) RemoveTeamMembershipBySlug

func (_m *MockTeamsService) RemoveTeamMembershipBySlug(ctx context.Context, org string, slug string, user string) (*github.Response, error)

RemoveTeamMembershipBySlug provides a mock function with given fields: ctx, org, slug, user

type MockTeamsService_AddTeamMembershipBySlug_Call

type MockTeamsService_AddTeamMembershipBySlug_Call struct {
	*mock.Call
}

MockTeamsService_AddTeamMembershipBySlug_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddTeamMembershipBySlug'

func (*MockTeamsService_AddTeamMembershipBySlug_Call) Return

func (*MockTeamsService_AddTeamMembershipBySlug_Call) Run

type MockTeamsService_CreateOrUpdateIDPGroupConnectionsBySlug_Call

type MockTeamsService_CreateOrUpdateIDPGroupConnectionsBySlug_Call struct {
	*mock.Call
}

MockTeamsService_CreateOrUpdateIDPGroupConnectionsBySlug_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateOrUpdateIDPGroupConnectionsBySlug'

func (*MockTeamsService_CreateOrUpdateIDPGroupConnectionsBySlug_Call) Return

func (*MockTeamsService_CreateOrUpdateIDPGroupConnectionsBySlug_Call) Run

type MockTeamsService_CreateTeam_Call

type MockTeamsService_CreateTeam_Call struct {
	*mock.Call
}

MockTeamsService_CreateTeam_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateTeam'

func (*MockTeamsService_CreateTeam_Call) Return

func (*MockTeamsService_CreateTeam_Call) Run

func (*MockTeamsService_CreateTeam_Call) RunAndReturn

type MockTeamsService_DeleteTeamBySlug_Call

type MockTeamsService_DeleteTeamBySlug_Call struct {
	*mock.Call
}

MockTeamsService_DeleteTeamBySlug_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteTeamBySlug'

func (*MockTeamsService_DeleteTeamBySlug_Call) Return

func (*MockTeamsService_DeleteTeamBySlug_Call) Run

func (*MockTeamsService_DeleteTeamBySlug_Call) RunAndReturn

type MockTeamsService_EditTeamBySlug_Call

type MockTeamsService_EditTeamBySlug_Call struct {
	*mock.Call
}

MockTeamsService_EditTeamBySlug_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'EditTeamBySlug'

func (*MockTeamsService_EditTeamBySlug_Call) Return

func (*MockTeamsService_EditTeamBySlug_Call) Run

func (*MockTeamsService_EditTeamBySlug_Call) RunAndReturn

type MockTeamsService_Expecter

type MockTeamsService_Expecter struct {
	// contains filtered or unexported fields
}

func (*MockTeamsService_Expecter) AddTeamMembershipBySlug

func (_e *MockTeamsService_Expecter) AddTeamMembershipBySlug(ctx interface{}, org interface{}, slug interface{}, user interface{}, opts interface{}) *MockTeamsService_AddTeamMembershipBySlug_Call

AddTeamMembershipBySlug is a helper method to define mock.On call

  • ctx context.Context
  • org string
  • slug string
  • user string
  • opts *github.TeamAddTeamMembershipOptions

func (*MockTeamsService_Expecter) CreateOrUpdateIDPGroupConnectionsBySlug

func (_e *MockTeamsService_Expecter) CreateOrUpdateIDPGroupConnectionsBySlug(ctx interface{}, org interface{}, team interface{}, opts interface{}) *MockTeamsService_CreateOrUpdateIDPGroupConnectionsBySlug_Call

CreateOrUpdateIDPGroupConnectionsBySlug is a helper method to define mock.On call

  • ctx context.Context
  • org string
  • team string
  • opts github.IDPGroupList

func (*MockTeamsService_Expecter) CreateTeam

func (_e *MockTeamsService_Expecter) CreateTeam(ctx interface{}, org interface{}, team interface{}) *MockTeamsService_CreateTeam_Call

CreateTeam is a helper method to define mock.On call

  • ctx context.Context
  • org string
  • team github.NewTeam

func (*MockTeamsService_Expecter) DeleteTeamBySlug

func (_e *MockTeamsService_Expecter) DeleteTeamBySlug(ctx interface{}, org interface{}, slug interface{}) *MockTeamsService_DeleteTeamBySlug_Call

DeleteTeamBySlug is a helper method to define mock.On call

  • ctx context.Context
  • org string
  • slug string

func (*MockTeamsService_Expecter) EditTeamBySlug

func (_e *MockTeamsService_Expecter) EditTeamBySlug(ctx interface{}, org interface{}, slug interface{}, team interface{}, removeParent interface{}) *MockTeamsService_EditTeamBySlug_Call

EditTeamBySlug is a helper method to define mock.On call

  • ctx context.Context
  • org string
  • slug string
  • team github.NewTeam
  • removeParent bool

func (*MockTeamsService_Expecter) GetTeamBySlug

func (_e *MockTeamsService_Expecter) GetTeamBySlug(ctx interface{}, org interface{}, slug interface{}) *MockTeamsService_GetTeamBySlug_Call

GetTeamBySlug is a helper method to define mock.On call

  • ctx context.Context
  • org string
  • slug string

func (*MockTeamsService_Expecter) ListTeamMembersBySlug

func (_e *MockTeamsService_Expecter) ListTeamMembersBySlug(ctx interface{}, org interface{}, slug interface{}, opts interface{}) *MockTeamsService_ListTeamMembersBySlug_Call

ListTeamMembersBySlug is a helper method to define mock.On call

  • ctx context.Context
  • org string
  • slug string
  • opts *github.TeamListTeamMembersOptions

func (*MockTeamsService_Expecter) ListTeamReposBySlug

func (_e *MockTeamsService_Expecter) ListTeamReposBySlug(ctx interface{}, org interface{}, slug interface{}, opts interface{}) *MockTeamsService_ListTeamReposBySlug_Call

ListTeamReposBySlug is a helper method to define mock.On call

  • ctx context.Context
  • org string
  • slug string
  • opts *github.ListOptions

func (*MockTeamsService_Expecter) RemoveTeamMembershipBySlug

func (_e *MockTeamsService_Expecter) RemoveTeamMembershipBySlug(ctx interface{}, org interface{}, slug interface{}, user interface{}) *MockTeamsService_RemoveTeamMembershipBySlug_Call

RemoveTeamMembershipBySlug is a helper method to define mock.On call

  • ctx context.Context
  • org string
  • slug string
  • user string

type MockTeamsService_GetTeamBySlug_Call

type MockTeamsService_GetTeamBySlug_Call struct {
	*mock.Call
}

MockTeamsService_GetTeamBySlug_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetTeamBySlug'

func (*MockTeamsService_GetTeamBySlug_Call) Return

func (*MockTeamsService_GetTeamBySlug_Call) Run

func (*MockTeamsService_GetTeamBySlug_Call) RunAndReturn

type MockTeamsService_ListTeamMembersBySlug_Call

type MockTeamsService_ListTeamMembersBySlug_Call struct {
	*mock.Call
}

MockTeamsService_ListTeamMembersBySlug_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListTeamMembersBySlug'

func (*MockTeamsService_ListTeamMembersBySlug_Call) Return

func (*MockTeamsService_ListTeamMembersBySlug_Call) Run

type MockTeamsService_ListTeamReposBySlug_Call

type MockTeamsService_ListTeamReposBySlug_Call struct {
	*mock.Call
}

MockTeamsService_ListTeamReposBySlug_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListTeamReposBySlug'

func (*MockTeamsService_ListTeamReposBySlug_Call) Return

func (*MockTeamsService_ListTeamReposBySlug_Call) Run

type MockTeamsService_RemoveTeamMembershipBySlug_Call

type MockTeamsService_RemoveTeamMembershipBySlug_Call struct {
	*mock.Call
}

MockTeamsService_RemoveTeamMembershipBySlug_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RemoveTeamMembershipBySlug'

func (*MockTeamsService_RemoveTeamMembershipBySlug_Call) Return

func (*MockTeamsService_RemoveTeamMembershipBySlug_Call) Run

func (*MockTeamsService_RemoveTeamMembershipBySlug_Call) RunAndReturn

type TeamsService

type TeamsService interface {
	AddTeamMembershipBySlug(ctx context.Context, org, slug, user string, opts *github.TeamAddTeamMembershipOptions) (*github.Membership, *github.Response, error)
	CreateTeam(ctx context.Context, org string, team github.NewTeam) (*github.Team, *github.Response, error)
	GetTeamBySlug(ctx context.Context, org, slug string) (*github.Team, *github.Response, error)
	EditTeamBySlug(ctx context.Context, org, slug string, team github.NewTeam, removeParent bool) (*github.Team, *github.Response, error)
	ListTeamMembersBySlug(ctx context.Context, org, slug string, opts *github.TeamListTeamMembersOptions) ([]*github.User, *github.Response, error)
	RemoveTeamMembershipBySlug(ctx context.Context, org, slug, user string) (*github.Response, error)
	CreateOrUpdateIDPGroupConnectionsBySlug(ctx context.Context, org, team string, opts github.IDPGroupList) (*github.IDPGroupList, *github.Response, error)
	ListTeamReposBySlug(ctx context.Context, org, slug string, opts *github.ListOptions) ([]*github.Repository, *github.Response, error)
	DeleteTeamBySlug(ctx context.Context, org, slug string) (*github.Response, error)
}

Jump to

Keyboard shortcuts

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