gitlabtoken

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2022 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Factory

Factory is factory for backend

func LT24HourTTLWarning

func LT24HourTTLWarning(s string) string

func NoTTLWarning

func NoTTLWarning(s string) string

Types

type BaseTokenStorageEntry

type BaseTokenStorageEntry struct {
	// `json:"" structs:"" mapstructure:""`
	ID          int      `json:"id" structs:"id" mapstructure:"id"`
	Name        string   `json:"name" structs:"name" mapstructure:"name"`
	Scopes      []string `json:"scopes" structs:"scopes" mapstructure:"scopes"`
	AccessLevel int      `json:"access_level" structs:"access_level" mapstructure:"access_level,omitempty"`
}

type Client

type Client interface {
	// ListProjectAccessToken(int) ([]*PAT, error)
	CreateProjectAccessToken(*BaseTokenStorageEntry, *time.Time) (*PAT, error)
	// RevokeProjectAccessToken(*BaseTokenStorageEntry) error
	Valid() bool
}

func NewClient

func NewClient(config *ConfigStorageEntry) (Client, error)

type ConfigStorageEntry

type ConfigStorageEntry struct {
	BaseURL string        `json:"base_url" structs:"base_url" mapstructure:"base_url"`
	Token   string        `json:"token" structs:"token" mapstructure:"token"`
	MaxTTL  time.Duration `json:"max_ttl" structs:"max_ttl" mapstructure:"max_ttl"`
}

ConfigStorageEntry structure represents the config as it is stored within vault

type GitlabBackend

type GitlabBackend struct {
	*framework.Backend
	// contains filtered or unexported fields
}

GitlabBackend is the backend for Gitlab plugin

func Backend

func Backend(conf *logical.BackendConfig) *GitlabBackend

Backend export the function to create backend and configure

type PAT

type PAT = gitlab.ProjectAccessToken

type RoleStorageEntry

type RoleStorageEntry struct {
	// `json:"" structs:"" mapstructure:""`
	RoleName string `json:"role_name" structs:"role_name" mapstructure:"role_name"`
	// The TTL for your token
	TokenTTL         time.Duration `json:"token_ttl" structs:"token_ttl" mapstructure:"token_ttl"`
	BaseTokenStorage BaseTokenStorageEntry
}

type TokenStorageEntry

type TokenStorageEntry struct {
	BaseTokenStorage BaseTokenStorageEntry
	ExpiresAt        *time.Time `json:"expires_at" structs:"expires_at" mapstructure:"expires_at,omitempty"`
}

Jump to

Keyboard shortcuts

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