providers

package
v0.0.0-...-eb19707 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2024 License: MIT, Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MockIssuer   = "me"
	MockAudience = "also_me"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type GithubOp

type GithubOp struct {
	// contains filtered or unexported fields
}

func NewGithubOp

func NewGithubOp(tokenURL string, token string) *GithubOp

func NewGithubOpFromEnvironment

func NewGithubOpFromEnvironment() (*GithubOp, error)

func (*GithubOp) Issuer

func (g *GithubOp) Issuer() string

func (*GithubOp) PublicKey

func (g *GithubOp) PublicKey(ctx context.Context, headers jws.Headers) (crypto.PublicKey, error)

func (*GithubOp) RequestTokens

func (g *GithubOp) RequestTokens(ctx context.Context, cicHash string) (*memguard.LockedBuffer, error)

func (*GithubOp) VerifyCICHash

func (g *GithubOp) VerifyCICHash(ctx context.Context, idt []byte, expectedCICHash string) error

func (*GithubOp) VerifyNonGQSig

func (*GithubOp) VerifyNonGQSig(context.Context, []byte, string) error

type GoogleOp

type GoogleOp struct {
	ClientID     string
	ClientSecret string
	Scopes       []string
	RedirURIPort string
	CallbackPath string
	RedirectURI  string
	// contains filtered or unexported fields
}

func (*GoogleOp) HookHTTPSession

func (g *GoogleOp) HookHTTPSession(h http.HandlerFunc)

HookHTTPSession provides a means to hook the HTTP Server session resulting from the OpenID Provider sending an authcode to the OIDC client by redirecting the user's browser with the authcode supplied in the URI. If this hook is set, it will be called after the receiving the authcode but before send an HTTP response to the user. The code which sets this hook can choose what HTTP response to server to the user.

We use this so that we can redirect the user web browser window to the MFA Cosigner URI after the user finishes the OIDC Auth flow. This method is only available to browser based providers.

func (*GoogleOp) Issuer

func (g *GoogleOp) Issuer() string

func (*GoogleOp) PublicKey

func (g *GoogleOp) PublicKey(ctx context.Context, headers jws.Headers) (crypto.PublicKey, error)

func (*GoogleOp) RequestTokens

func (g *GoogleOp) RequestTokens(ctx context.Context, cicHash string) (*memguard.LockedBuffer, error)

func (*GoogleOp) VerifyCICHash

func (g *GoogleOp) VerifyCICHash(ctx context.Context, idt []byte, expectedCICHash string) error

func (*GoogleOp) VerifyNonGQSig

func (g *GoogleOp) VerifyNonGQSig(ctx context.Context, idt []byte, expectedNonce string) error

type MockOpenIdProvider

type MockOpenIdProvider struct {
	// contains filtered or unexported fields
}

func NewMockOpenIdProvider

func NewMockOpenIdProvider() (*MockOpenIdProvider, error)

func (*MockOpenIdProvider) Issuer

func (m *MockOpenIdProvider) Issuer() string

func (*MockOpenIdProvider) PublicKey

func (m *MockOpenIdProvider) PublicKey(ctx context.Context, headers jws.Headers) (crypto.PublicKey, error)

func (*MockOpenIdProvider) RequestTokens

func (m *MockOpenIdProvider) RequestTokens(ctx context.Context, cicHash string) (*memguard.LockedBuffer, error)

func (*MockOpenIdProvider) VerifyCICHash

func (m *MockOpenIdProvider) VerifyCICHash(ctx context.Context, idt []byte, expectedCICHash string) error

func (*MockOpenIdProvider) VerifyNonGQSig

func (m *MockOpenIdProvider) VerifyNonGQSig(ctx context.Context, idt []byte, expectedNonce string) error

Jump to

Keyboard shortcuts

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