common

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2019 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FilterOverriddenVariables

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

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 *types.RemoteSource, userAccessToken, oauth2AccessToken string) (string, error)

func GetOauth2Source

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

func GetPasswordSource

func GetPasswordSource(rs *types.RemoteSource, accessToken string) (gitsource.PasswordSource, error)

func GetUserSource

func GetUserSource(rs *types.RemoteSource, accessToken string) (gitsource.UserSource, error)

func GetVarValueMatchingSecret

func GetVarValueMatchingSecret(varval types.VariableValue, varParentPath string, secrets []*csapi.Secret) *csapi.Secret

func WebHookEventToRunRefType

func WebHookEventToRunRefType(we types.WebhookEvent) types.RunRefType

Types

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