common

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: May 18, 2023 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FilterOverriddenSecrets added in v0.3.0

func FilterOverriddenSecrets(secrets []*csapitypes.Secret) []*csapitypes.Secret

func FilterOverriddenVariables

func FilterOverriddenVariables(variables []*csapitypes.Variable) []*csapitypes.Variable

func GenBaseRunGroup added in v0.7.0

func GenBaseRunGroup(baseGroupType GroupType, baseGroupID string) string

func GenRunGroup

func GenRunGroup(baseGroupType GroupType, baseGroupID string, groupType GroupType, group string) string

func GenerateGenericJWTToken

func GenerateGenericJWTToken(sd *TokenSigningData, claims jwt.Claims) (string, error)

func GenerateLoginJWTToken

func GenerateLoginJWTToken(sd *TokenSigningData, userID string) (string, error)

func GenerateOauth2JWTToken

func GenerateOauth2JWTToken(sd *TokenSigningData, remoteSourceName, requestType string, request interface{}) (string, error)

func GetAccessToken

func GetAccessToken(rs *cstypes.RemoteSource, userAccessToken, oauth2AccessToken string) (string, error)

func GetAccessTokenUserSource added in v0.8.0

func GetAccessTokenUserSource(rs *cstypes.RemoteSource, accessToken string) (gitsource.UserSource, error)

func GetOauth2Client added in v0.8.0

func GetOauth2Client(rs *cstypes.RemoteSource) (gitsource.Oauth2Client, error)

func GetOauth2Source

func GetOauth2Source(rs *cstypes.RemoteSource, accessToken string) (gitsource.Oauth2Source, error)

func GetPasswordSource

func GetPasswordSource(rs *cstypes.RemoteSource, username, password string) (gitsource.PasswordSource, error)

func GetUserSource

func GetUserSource(rs *cstypes.RemoteSource, remoteUsername, remotePassword, accessToken string) (gitsource.UserSource, error)

func GetVarValueMatchingSecret

func GetVarValueMatchingSecret(varval cstypes.VariableValue, varParentPath string, secrets []*csapitypes.Secret) *csapitypes.Secret

func WebHookEventToRunRefType

func WebHookEventToRunRefType(we types.WebhookEvent) types.RunRefType

Types

type CookieSigningConfig added in v0.8.0

type CookieSigningConfig struct {
	Duration time.Duration
	Key      string
}

type CookieSigningData added in v0.8.0

type CookieSigningData struct {
	Duration     time.Duration
	SecureCookie *securecookie.SecureCookie
}

func NewCookieSigningData added in v0.8.0

func NewCookieSigningData(c *CookieSigningConfig) *CookieSigningData

type GroupType

type GroupType string
const (
	// base groups
	GroupTypeProject GroupType = "project"
	GroupTypeUser    GroupType = "user"

	// sub groups
	GroupTypeBranch      GroupType = "branch"
	GroupTypeTag         GroupType = "tag"
	GroupTypePullRequest GroupType = "pr"

	ApproversAnnotation = "approvers"
)

func GroupTypeIDFromRunGroup

func GroupTypeIDFromRunGroup(group string) (GroupType, string, error)

type TokenSigningData

type TokenSigningData struct {
	Duration   time.Duration
	Method     jwt.SigningMethod
	PrivateKey *rsa.PrivateKey
	PublicKey  *rsa.PublicKey
	Key        []byte
}

Jump to

Keyboard shortcuts

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