gitlab_organizations

package
v0.0.0-...-c99d6ee Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2024 License: MIT Imports: 44 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// GitLabOrganizationsProjectSFIDColumn constant
	GitLabOrganizationsProjectSFIDColumn = "project_sfid"
	// GitLabOrganizationsOrganizationIDColumn constant
	GitLabOrganizationsOrganizationIDColumn = "organization_id"
	// GitLabOrganizationsOrganizationSFIDColumn constant
	GitLabOrganizationsOrganizationSFIDColumn = "organization_sfid"
	// GitLabOrganizationsOrganizationNameColumn constant
	GitLabOrganizationsOrganizationNameColumn = "organization_name"
	// GitLabOrganizationsOrganizationNameLowerColumn constant
	GitLabOrganizationsOrganizationNameLowerColumn = "organization_name_lower"
	// GitLabOrganizationsEnabledColumn constant
	GitLabOrganizationsEnabledColumn = "enabled"
	// GitLabOrganizationsAutoEnabledColumn constant
	GitLabOrganizationsAutoEnabledColumn = "auto_enabled"
	// GitLabOrganizationsAutoEnabledCLAGroupIDColumn constant
	GitLabOrganizationsAutoEnabledCLAGroupIDColumn = "auto_enabled_cla_group_id"
	// GitLabOrganizationsBranchProtectionEnabledColumn constant
	GitLabOrganizationsBranchProtectionEnabledColumn = "branch_protection_enabled"
	// GitLabOrganizationsAuthInfoColumn constant
	GitLabOrganizationsAuthInfoColumn = "auth_info"
	// GitLabOrganizationsOrganizationURLColumn constant
	GitLabOrganizationsOrganizationURLColumn = "organization_url"
	// GitLabOrganizationsOrganizationFullPathColumn constant
	GitLabOrganizationsOrganizationFullPathColumn = "organization_full_path"
	// GitLabOrganizationsNoteColumn constant
	GitLabOrganizationsNoteColumn = "note"
	// GitLabOrganizationsDateCreatedColumn constant
	GitLabOrganizationsDateCreatedColumn = "date_created"
	// GitLabOrganizationsDateModifiedColumn constant
	GitLabOrganizationsDateModifiedColumn = "date_modified"
	// GitLabOrganizationsExternalGitLabGroupIDColumn constant
	GitLabOrganizationsExternalGitLabGroupIDColumn = "external_gitlab_group_id"
	// GitLabOrganizationsAuthExpiryTimeColumn constant
	GitLabOrganizationsAuthExpiryTimeColumn = "auth_expiry_time"
)
View Source
const (
	// GitLabOrgOrganizationSFIDIndex the index for the Project Parent SFID
	GitLabOrgOrganizationSFIDIndex = "gitlab-org-sfid-index"
	// GitLabOrgProjectSFIDIndex the index for the Project SFID
	GitLabOrgProjectSFIDIndex = "gitlab-project-sfid-index"
	// GitLabOrgLowerNameIndex the index for the group/org name in lower case
	GitLabOrgLowerNameIndex = "gitlab-organization-name-lower-search-index"
	// GitLabExternalIDIndex the index for the external ID
	GitLabExternalIDIndex = "gitlab-external-group-id-index"
	// GitLabFullPathIndex the index for the full path
	GitLabFullPathIndex = "gitlab-full-path-index"
	// GitlabOrgURLIndex the index for the org url
	GitlabOrgURLIndex = "gitlab-org-url-index"
)

indexes

View Source
const (
	// SessionStoreKey for cla-gitlab
	SessionStoreKey = "cla-gitlab"
)

Variables

This section is empty.

Functions

func Configure

func Configure(api *operations.EasyclaAPI, service ServiceInterface, eventService events.Service, sessionStore *dynastore.Store, contributorConsoleV2Base string)

Configure setups handlers on api with service

Types

type Repository

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

Repository object/struct

func (*Repository) AddGitLabOrganization

func (repo *Repository) AddGitLabOrganization(ctx context.Context, input *common.GitLabAddOrganization, enabled bool) (*v2Models.GitlabOrganization, error)

AddGitLabOrganization adds the specified values to the GitLab Group/Org table

func (*Repository) DeleteGitLabOrganizationByFullPath

func (repo *Repository) DeleteGitLabOrganizationByFullPath(ctx context.Context, projectSFID, gitlabOrgFullPath string) error

DeleteGitLabOrganizationByFullPath deletes the specified GitLab organization

func (*Repository) GetGitLabOrganization

func (repo *Repository) GetGitLabOrganization(ctx context.Context, gitLabOrganizationID string) (*common.GitLabOrganization, error)

GetGitLabOrganization by organization name

func (*Repository) GetGitLabOrganizationByExternalID

func (repo *Repository) GetGitLabOrganizationByExternalID(ctx context.Context, gitLabGroupID int64) (*common.GitLabOrganization, error)

GetGitLabOrganizationByExternalID returns the GitLab Group/Org based on the external GitLab Group ID value

func (*Repository) GetGitLabOrganizationByFullPath

func (repo *Repository) GetGitLabOrganizationByFullPath(ctx context.Context, groupFullPath string) (*common.GitLabOrganization, error)

GetGitLabOrganizationByFullPath loads the organization based on the full path value

func (*Repository) GetGitLabOrganizationByName

func (repo *Repository) GetGitLabOrganizationByName(ctx context.Context, gitLabOrganizationName string) (*common.GitLabOrganization, error)

GetGitLabOrganizationByName get GitLab organization by name

func (*Repository) GetGitLabOrganizationByURL

func (repo *Repository) GetGitLabOrganizationByURL(ctx context.Context, url string) (*common.GitLabOrganization, error)

GetGitLabOrganizationByURL loads the organization based on the url

func (*Repository) GetGitLabOrganizations

func (repo *Repository) GetGitLabOrganizations(ctx context.Context) (*v2Models.GitlabOrganizations, error)

GetGitLabOrganizations returns the complete list of GitLab groups/organizations

func (*Repository) GetGitLabOrganizationsByFoundationSFID

func (repo *Repository) GetGitLabOrganizationsByFoundationSFID(ctx context.Context, foundationSFID string) (*v2Models.GitlabOrganizations, error)

GetGitLabOrganizationsByFoundationSFID returns the list of GitLab groups/organizations under the given foundation

func (*Repository) GetGitLabOrganizationsByProjectSFID

func (repo *Repository) GetGitLabOrganizationsByProjectSFID(ctx context.Context, projectSFID string) (*v2Models.GitlabOrganizations, error)

GetGitLabOrganizationsByProjectSFID get GitLab organizations based on the project SFID or parent project SFID

func (*Repository) GetGitLabOrganizationsEnabled

func (repo *Repository) GetGitLabOrganizationsEnabled(ctx context.Context) (*v2Models.GitlabOrganizations, error)

GetGitLabOrganizationsEnabled returns the list of GitLab groups/organizations that are enabled

func (*Repository) GetGitLabOrganizationsEnabledWithAutoEnabled

func (repo *Repository) GetGitLabOrganizationsEnabledWithAutoEnabled(ctx context.Context) (*v2Models.GitlabOrganizations, error)

GetGitLabOrganizationsEnabledWithAutoEnabled returns the list of GitLab groups/organizations that are enabled with the auto enabled flag set to true

func (*Repository) UpdateGitLabOrganization

func (repo *Repository) UpdateGitLabOrganization(ctx context.Context, input *common.GitLabAddOrganization, enabled bool) error

UpdateGitLabOrganization updates the GitLab group based on the specified values

func (*Repository) UpdateGitLabOrganizationAuth

func (repo *Repository) UpdateGitLabOrganizationAuth(ctx context.Context, organizationID string, gitLabGroupID int, authExpiryTime int64, authInfo, groupName, groupFullPath, organizationURL string) error

UpdateGitLabOrganizationAuth updates the specified Gitlab organization oauth info

type RepositoryInterface

type RepositoryInterface interface {
	AddGitLabOrganization(ctx context.Context, input *common.GitLabAddOrganization, enabled bool) (*v2Models.GitlabOrganization, error)
	GetGitLabOrganizations(ctx context.Context) (*v2Models.GitlabOrganizations, error)
	GetGitLabOrganizationsEnabled(ctx context.Context) (*v2Models.GitlabOrganizations, error)
	GetGitLabOrganizationsEnabledWithAutoEnabled(ctx context.Context) (*v2Models.GitlabOrganizations, error)
	GetGitLabOrganizationsByProjectSFID(ctx context.Context, projectSFID string) (*v2Models.GitlabOrganizations, error)
	GetGitLabOrganizationsByFoundationSFID(ctx context.Context, foundationSFID string) (*v2Models.GitlabOrganizations, error)
	GetGitLabOrganization(ctx context.Context, gitlabOrganizationID string) (*common.GitLabOrganization, error)
	GetGitLabOrganizationByName(ctx context.Context, gitLabOrganizationName string) (*common.GitLabOrganization, error)
	GetGitLabOrganizationByExternalID(ctx context.Context, gitLabGroupID int64) (*common.GitLabOrganization, error)
	GetGitLabOrganizationByFullPath(ctx context.Context, groupFullPath string) (*common.GitLabOrganization, error)
	GetGitLabOrganizationByURL(ctx context.Context, url string) (*common.GitLabOrganization, error)
	UpdateGitLabOrganizationAuth(ctx context.Context, organizationID string, gitLabGroupID int, authExpiryTime int64, authInfo, groupName, groupFullPath, organizationURL string) error
	UpdateGitLabOrganization(ctx context.Context, input *common.GitLabAddOrganization, enabled bool) error
	DeleteGitLabOrganizationByFullPath(ctx context.Context, projectSFID, gitlabOrgFullPath string) error
}

RepositoryInterface is interface for gitlab org data model

func NewRepository

func NewRepository(awsSession *session.Session, stage string) RepositoryInterface

NewRepository creates a new instance of the gitlabOrganizations repository

type ServerError

type ServerError struct {
	ReqID           string
	GitLabGroupName string
	Error           error
}

ServerError Success

func NewServerError

func NewServerError(reqID string, gitLabGroupName string, theError error) *ServerError

NewServerError creates a new redirect handler

func (*ServerError) WriteResponse

func (o *ServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer)

WriteResponse to the client

type Service

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

Service data modelffGetGitLabOrganizationByID

func (*Service) AddGitLabOrganization

func (s *Service) AddGitLabOrganization(ctx context.Context, input *common.GitLabAddOrganization) (*v2Models.GitlabProjectOrganizations, error)

AddGitLabOrganization adds the specified GitLab organization

func (*Service) DeleteGitLabOrganizationByFullPath

func (s *Service) DeleteGitLabOrganizationByFullPath(ctx context.Context, projectSFID string, gitLabOrgFullPath string) error

DeleteGitLabOrganizationByFullPath deletes the specified GitLab organization by full path

func (*Service) GetGitLabGroupMembers

func (s *Service) GetGitLabGroupMembers(ctx context.Context, groupID string) (*v2Models.GitlabGroupMembersList, error)

GetGitLabGroupMembers gets group members

func (*Service) GetGitLabOrganization

func (s *Service) GetGitLabOrganization(ctx context.Context, gitlabOrganizationID string) (*v2Models.GitlabOrganization, error)

GetGitLabOrganization returns the GitLab organization based on the specified GitLab Organization ID

func (*Service) GetGitLabOrganizationByFullPath

func (s *Service) GetGitLabOrganizationByFullPath(ctx context.Context, gitLabOrganizationFullPath string) (*v2Models.GitlabOrganization, error)

GetGitLabOrganizationByFullPath returns the GitLab group/organization using the specified full path

func (*Service) GetGitLabOrganizationByGroupID

func (s *Service) GetGitLabOrganizationByGroupID(ctx context.Context, gitLabGroupID int64) (*v2Models.GitlabOrganization, error)

GetGitLabOrganizationByGroupID returns the GitLab group/organization using the specified group ID

func (*Service) GetGitLabOrganizationByID

func (s *Service) GetGitLabOrganizationByID(ctx context.Context, gitLabOrganizationID string) (*common.GitLabOrganization, error)

GetGitLabOrganizationByID returns the record associated with the GitLab Organization ID

func (*Service) GetGitLabOrganizationByName

func (s *Service) GetGitLabOrganizationByName(ctx context.Context, gitLabOrganizationName string) (*v2Models.GitlabOrganization, error)

GetGitLabOrganizationByName returns the gitlab organization based on the Group/Org name

func (*Service) GetGitLabOrganizationByState

func (s *Service) GetGitLabOrganizationByState(ctx context.Context, gitLabOrganizationID, authState string) (*v2Models.GitlabOrganization, error)

GetGitLabOrganizationByState returns the GitLab organization by the auth state

func (*Service) GetGitLabOrganizationByURL

func (s *Service) GetGitLabOrganizationByURL(ctx context.Context, URL string) (*v2Models.GitlabOrganization, error)

GetGitLabOrganizationByURL returns the GitLab group/organization using the specified full path

func (*Service) GetGitLabOrganizations

func (s *Service) GetGitLabOrganizations(ctx context.Context) (*v2Models.GitlabProjectOrganizations, error)

GetGitLabOrganizations returns the complete list of GitLab groups/organizations

func (*Service) GetGitLabOrganizationsByProjectSFID

func (s *Service) GetGitLabOrganizationsByProjectSFID(ctx context.Context, projectSFID string) (*v2Models.GitlabProjectOrganizations, error)

GetGitLabOrganizationsByProjectSFID returns a collection of GitLab organizations based on the specified project SFID value

func (*Service) GetGitLabOrganizationsEnabled

func (s *Service) GetGitLabOrganizationsEnabled(ctx context.Context) (*v2Models.GitlabProjectOrganizations, error)

GetGitLabOrganizationsEnabled returns the list of GitLab groups/organizations that are enabled

func (*Service) GetGitLabOrganizationsEnabledWithAutoEnabled

func (s *Service) GetGitLabOrganizationsEnabledWithAutoEnabled(ctx context.Context) (*v2Models.GitlabProjectOrganizations, error)

GetGitLabOrganizationsEnabledWithAutoEnabled returns the list of GitLab groups/organizations that are enabled with the auto enabled flag set to true

func (*Service) InitiateSignRequest

func (s *Service) InitiateSignRequest(ctx context.Context, req *http.Request, gitlabClient *goGitLab.Client, repositoryID, mergeRequestID, originURL, contributorBaseURL string, eventService events.Service) (*string, error)

InitiateSignRequest initiates sign request and returns easy cla redirect url

func (*Service) RefreshGitLabOrganizationAuth

func (s *Service) RefreshGitLabOrganizationAuth(ctx context.Context, gitLabOrg *common.GitLabOrganization) (*string, error)

RefreshGitLabOrganizationAuth refreshes the GitLab organization auth token in case of expired token

func (*Service) UpdateGitLabOrganization

func (s *Service) UpdateGitLabOrganization(ctx context.Context, input *common.GitLabAddOrganization) error

UpdateGitLabOrganization updates the GitLab organization

func (*Service) UpdateGitLabOrganizationAuth

func (s *Service) UpdateGitLabOrganizationAuth(ctx context.Context, gitLabOrganizationID string, oauthResp *gitlabApi.OauthSuccessResponse, authExpiryTime int64) error

UpdateGitLabOrganizationAuth updates the GitLab organization authentication information

type ServiceInterface

type ServiceInterface interface {
	AddGitLabOrganization(ctx context.Context, input *common.GitLabAddOrganization) (*v2Models.GitlabProjectOrganizations, error)
	GetGitLabOrganization(ctx context.Context, gitLabOrganizationID string) (*v2Models.GitlabOrganization, error)
	GetGitLabOrganizationByID(ctx context.Context, gitLabOrganizationID string) (*common.GitLabOrganization, error)
	GetGitLabOrganizationByName(ctx context.Context, gitLabOrganizationName string) (*v2Models.GitlabOrganization, error)
	GetGitLabOrganizationByFullPath(ctx context.Context, gitLabOrganizationFullPath string) (*v2Models.GitlabOrganization, error)
	GetGitLabOrganizationByURL(ctx context.Context, url string) (*v2Models.GitlabOrganization, error)
	GetGitLabOrganizationByGroupID(ctx context.Context, gitLabGroupID int64) (*v2Models.GitlabOrganization, error)
	GetGitLabOrganizations(ctx context.Context) (*v2Models.GitlabProjectOrganizations, error)
	GetGitLabOrganizationsEnabled(ctx context.Context) (*v2Models.GitlabProjectOrganizations, error)
	GetGitLabOrganizationsEnabledWithAutoEnabled(ctx context.Context) (*v2Models.GitlabProjectOrganizations, error)
	GetGitLabOrganizationsByProjectSFID(ctx context.Context, projectSFID string) (*v2Models.GitlabProjectOrganizations, error)
	GetGitLabOrganizationByState(ctx context.Context, gitLabOrganizationID, authState string) (*v2Models.GitlabOrganization, error)
	GetGitLabGroupMembers(ctx context.Context, groupID string) (*v2Models.GitlabGroupMembersList, error)
	UpdateGitLabOrganization(ctx context.Context, input *common.GitLabAddOrganization) error
	UpdateGitLabOrganizationAuth(ctx context.Context, gitLabOrganizationID string, oauthResp *gitlabApi.OauthSuccessResponse, authExpiryTime int64) error
	DeleteGitLabOrganizationByFullPath(ctx context.Context, projectSFID string, gitlabOrgFullPath string) error
	InitiateSignRequest(ctx context.Context, req *http.Request, gitlabClient *goGitLab.Client, repositoryID, mergeRequestID, originURL, contributorBaseURL string, eventService events.Service) (*string, error)
	RefreshGitLabOrganizationAuth(ctx context.Context, gitLabOrg *common.GitLabOrganization) (*string, error)
}

ServiceInterface contains functions of GitlabOrganizations service

func NewService

func NewService(repo RepositoryInterface, v2GitRepoService repositories.ServiceInterface, claGroupRepository projects_cla_groups.Repository, storeRepo store.Repository, userService users.Service, signaturesRepo signatures.SignatureRepository, companyRepository company.IRepository) ServiceInterface

NewService creates a new gitlab organization service

type SuccessResponse

type SuccessResponse struct {
	ReqID           string
	ProjectSFID     string
	GitLabGroupName string
}

SuccessResponse Success

func NewSuccessResponse

func NewSuccessResponse(reqID, projectSFID, gitLabGroupName string) *SuccessResponse

NewSuccessResponse creates a new redirect handler

func (*SuccessResponse) WriteResponse

func (o *SuccessResponse) WriteResponse(rw http.ResponseWriter, producer runtime.Producer)

WriteResponse to the client

Jump to

Keyboard shortcuts

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