challenges

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2022 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckSignature

func CheckSignature(pub crypto.PublicKey, proof []byte, subject string) error

CheckSignature verifies a challenge, a signature over the subject or email of an OIDC token

func ParseCSR added in v0.4.0

func ParseCSR(csr []byte) (*x509.CertificateRequest, error)

TODO: Move to sigstore/sigstore

func ParsePublicKey added in v0.4.0

func ParsePublicKey(encodedPubKey string, csr *x509.CertificateRequest) (crypto.PublicKey, error)

ParsePublicKey parses a PEM or DER encoded public key, or extracts the public key from the provided CSR. Returns an error if decoding fails or if no public key is found.

Types

type AdditionalInfo added in v0.2.0

type AdditionalInfo int
const (
	GithubWorkflowTrigger AdditionalInfo = iota
	GithubWorkflowSha
	GithubWorkflowName
	GithubWorkflowRepository
	GithubWorkflowRef
)

Additional information that can be added as a cert extension.

type ChallengeResult

type ChallengeResult struct {
	Issuer    string
	TypeVal   ChallengeType
	PublicKey crypto.PublicKey
	Value     string
	// Extra information from the token that can be added to extensions.
	AdditionalInfo map[AdditionalInfo]string
}

func ExtractSubject added in v0.4.0

func ExtractSubject(ctx context.Context, tok *oidc.IDToken, publicKey crypto.PublicKey, csr *x509.CertificateRequest, challenge []byte) (*ChallengeResult, error)

type ChallengeType

type ChallengeType int
const (
	EmailValue ChallengeType = iota
	SpiffeValue
	GithubWorkflowValue
	KubernetesValue
	URIValue
	UsernameValue
)

Jump to

Keyboard shortcuts

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