octosts

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2024 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewSecurityTokenServiceServer

func NewSecurityTokenServiceServer(atr *ghinstallation.AppsTransport, ceclient cloudevents.Client, domain string, metrics bool) pboidc.SecurityTokenServiceServer

func Revoke

func Revoke(ctx context.Context, tok string) error

Revoke revokes a security token.

Types

type Actor

type Actor struct {
	Issuer  string  `json:"iss"`
	Subject string  `json:"sub"`
	Claims  []Claim `json:"claims,omitempty"`
}

type Claim

type Claim struct {
	Name  string `json:"name"`
	Value string `json:"value"`
}

type Event

type Event struct {
	Actor          Actor           `json:"actor"`
	TrustPolicy    *OrgTrustPolicy `json:"trust_policy"`
	InstallationID int64           `json:"installation_id"`
	Scope          string          `json:"scope"`
	Identity       string          `json:"identity"`
	TokenSHA256    string          `json:"token_sha256"`
	Error          string          `json:"error,omitempty"`
}

type OrgTrustPolicy

type OrgTrustPolicy struct {
	TrustPolicy `json:",inline"`

	Repositories []string `json:"repositories,omitempty"`
}

type TrustPolicy

type TrustPolicy struct {
	Issuer        string `json:"issuer,omitempty"`
	IssuerPattern string `json:"issuer_pattern,omitempty"`

	Subject        string `json:"subject,omitempty"`
	SubjectPattern string `json:"subject_pattern,omitempty"`

	ClaimPattern map[string]string `json:"claim_pattern,omitempty"`

	Permissions github.InstallationPermissions `json:"permissions,omitempty"`
	// contains filtered or unexported fields
}

func (*TrustPolicy) CheckToken

func (tp *TrustPolicy) CheckToken(token *oidc.IDToken) (Actor, error)

CheckToken checks the token against the trust policy.

func (*TrustPolicy) Compile

func (tp *TrustPolicy) Compile() error

Compile checks the trust policy for validity, and prepares internal state for validating tokens.

Jump to

Keyboard shortcuts

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