gitlab

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2025 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Config = config.GetConfig()
View Source
var Tracer = otel.Tracer("pkg/providers/gitlab")

Functions

func StringPtr

func StringPtr(s string) *string

Types

type GitlabProvider

type GitlabProvider struct {
	Client     *clientgo.Client
	Parameters GitlabProviderParameters
	Name       string `json:"name"`
}

GitlabProvider handles GitLab access management Credentials and configurations are specified in the ProviderConfig parameters

func NewGitlabProvider

func NewGitlabProvider(ctx context.Context, config models.ProviderConfig) (*GitlabProvider, error)

NewGitlabProvider initializes a new GitlabProvider with credentials from ProviderConfig

func (*GitlabProvider) GrantAccess

func (a *GitlabProvider) GrantAccess(ctx context.Context, request *models.AccessRequest) error

GrantAccess adds a user to a specified group based on the provider parameters

func (*GitlabProvider) IsAccessExpired

func (a *GitlabProvider) IsAccessExpired(ctx context.Context, request *models.AccessRequest) (bool, error)

IsAccessExpired checks whether the access for the given request has expired

func (*GitlabProvider) ListUsersWithAccess

func (a *GitlabProvider) ListUsersWithAccess(ctx context.Context, roleRef models.AccessRoleRef) ([]string, error)

ListUsersWithAccess lists users with access to the specified role

func (*GitlabProvider) RevokeAccess

func (a *GitlabProvider) RevokeAccess(ctx context.Context, request *models.AccessRequest) error

RevokeAccess removes a user from a specified group based on the provider parameters

type GitlabProviderParameters

type GitlabProviderParameters struct {
	Group    string                    `json:"group"`
	Username string                    `json:"username"`
	Token    string                    `json:"token"`
	Level    clientgo.AccessLevelValue `json:"string"`
}

parameters encapsulates extracted provider details

Jump to

Keyboard shortcuts

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