Documentation ¶
Index ¶
- func GetEnvironmentVariable(e string) (string, error)
- func GetOIDCPublicKey(issueUrl string, kid string) (*rsa.PublicKey, error)
- func NewKeyPair() (*rsa.PrivateKey, error)
- func PemToPub(pemBytes []byte) (crypto.PublicKey, error)
- func PrettyPrintOpenPubKey(key *OpenPubKey)
- func PrivToPem(priv *rsa.PrivateKey) string
- func PubToPem(pub crypto.PublicKey) ([]byte, error)
- func QuitOnErr(e error)
- func SHA256(things ...[]byte) []byte
- func SHA512(things ...[]byte) []byte
- func VerifyOIDCSignature(sigWrapper OPKSignature, payloadStr string, provider OIDCProvider, ...) error
- func VerifyOPK(jwt *OpenPubKey, provider OIDCProvider, ids *[]Identity) error
- type ActionsJWT
- type ActionsOIDCClient
- type CIC
- type Claims
- type GetOIDCToken
- type GitHubOIDCProvider
- type Identity
- type OIDCProvider
- type OPKSignature
- type OpenPubKey
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetEnvironmentVariable ¶
func NewKeyPair ¶
func NewKeyPair() (*rsa.PrivateKey, error)
func PrettyPrintOpenPubKey ¶
func PrettyPrintOpenPubKey(key *OpenPubKey)
func PrivToPem ¶
func PrivToPem(priv *rsa.PrivateKey) string
func VerifyOIDCSignature ¶
func VerifyOIDCSignature(sigWrapper OPKSignature, payloadStr string, provider OIDCProvider, ids *[]Identity) error
func VerifyOPK ¶
func VerifyOPK(jwt *OpenPubKey, provider OIDCProvider, ids *[]Identity) error
Types ¶
type ActionsJWT ¶
func GetActionsToken ¶
func GetActionsToken(audience string) (*ActionsJWT, error)
func (*ActionsJWT) Parse ¶
func (j *ActionsJWT) Parse()
func (*ActionsJWT) PrettyPrintClaims ¶
func (j *ActionsJWT) PrettyPrintClaims() string
type ActionsOIDCClient ¶
type ActionsOIDCClient struct { // the url to fetch the jwt TokenRequestURL string // the audience for the jwt Audience string // the token used to retrieve the jwt, not the jwt RequestToken string }
func DefaultOIDCClient ¶
func DefaultOIDCClient(audience string) ActionsOIDCClient
func NewActionsOIDCClient ¶
func NewActionsOIDCClient(tokenURL string, audience string, token string) (ActionsOIDCClient, error)
construct a new ActionsOIDCClient
func (*ActionsOIDCClient) BuildTokenURL ¶
func (c *ActionsOIDCClient) BuildTokenURL() error
this function uses an ActionsOIDCClient to build the complete URL to request a jwt
func (*ActionsOIDCClient) GetJWT ¶
func (c *ActionsOIDCClient) GetJWT() (*ActionsJWT, error)
retrieve an actions oidc token
type CIC ¶
type CIC struct { Algorithm string `json:"alg"` PublicKey []byte `json:"pub"` RandomNoise []byte `json:"rz"` }
func Sign ¶
func Sign(payload *[]byte, provider OIDCProvider) (signature.SignerVerifier, *CIC, error)
func VerifyOPKSignature ¶
func VerifyOPKSignature(sigWrapper OPKSignature, payload string) (*CIC, error)
type GetOIDCToken ¶
type GetOIDCToken func(audience string) (*ActionsJWT, error)
type GitHubOIDCProvider ¶
type GitHubOIDCProvider struct { }
func (*GitHubOIDCProvider) GetJWT ¶
func (p *GitHubOIDCProvider) GetJWT(claims *Claims) (*ActionsJWT, error)
func (*GitHubOIDCProvider) GetPublicKey ¶
type OIDCProvider ¶
type OPKSignature ¶
type OpenPubKey ¶
type OpenPubKey struct { Payload string `json:"payload"` Signatures []OPKSignature `json:"signatures"` }
func NewOpenPubKey ¶
func NewOpenPubKey(jwt *ActionsJWT, sv signature.SignerVerifier, cic *CIC) *OpenPubKey
func SignedOpenPubKey ¶
func SignedOpenPubKey(payload *[]byte, provider OIDCProvider) (*OpenPubKey, error)
Click to show internal directories.
Click to hide internal directories.