common

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2019 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 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 GetOauth2Source

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

func GetPasswordSource

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

func GetUserSource

func GetUserSource(rs *cstypes.RemoteSource, 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 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