ssh_jwt

package
v0.0.0-...-d138ab2 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2024 License: MIT Imports: 16 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetMatchingKeys

func GetMatchingKeys(a agent.Agent, keyText string) ([]*agent.Key, error)

GetMatchingKeys retrieves public keys from an agent which contain keyText as a substring.

func SetupSigningMethod

func SetupSigningMethod(namespace string, a agent.Agent) (jwt.SigningMethod, error)

SetupSigningMethod creates and registers a JWT signing method using SSH keys

func SignSSH

func SignSSH(signingString, namespace, authorizedKey string, a agent.Agent) (string, error)

func VerifySSHSignature

func VerifySSHSignature(signingString, signature, namespace, authorizedKey string) error

Types

type Handler

type Handler struct {
	AuthorizedKeys []string
	CookieName     string
	HeaderName     string
	SigningMethod  jwt.SigningMethod
	Handler        http.Handler
	StrictPaths    []string
}

func (*Handler) ServeHTTP

func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request)

type SSHAgent

type SSHAgent struct {
	agent.ExtendedAgent
	// contains filtered or unexported fields
}

func GetSSHAgent

func GetSSHAgent(keyFile string) (*SSHAgent, error)

GetSSHAgent either connects to a running agent if keyFile is empty, or creates a new agent and loads the specified key into it.

func (*SSHAgent) Close

func (a *SSHAgent) Close() error

Close closes the agent's underlying connection

Jump to

Keyboard shortcuts

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