Documentation
¶
Index ¶
- Constants
- func DecodePrivateKey(path string, encoded []byte, interactive bool) (*interface{}, error)
- func EncodeAuthorizedKey(pub *ssh.PublicKey) (string, error)
- func ParseAuthorizedKey(encoded []byte) (*ssh.PublicKey, error)
- func VerifyECDSAHeader(pubKey interface{}, tokens []string, signature []byte, sigType string) (bool, error)
- func VerifyED25519Header(pubKey interface{}, tokens []string, signature []byte) error
- func VerifyRSAHeader(pubKey interface{}, tokens []string, signature []byte, hash string) error
- type Authorizer
- type Signer
Constants ¶
const CludoAuthHeader = "X-CLUDO-KEY"
Variables ¶
This section is empty.
Functions ¶
func DecodePrivateKey ¶
DecodePrivateKey tries to decode the given private key. It will try and handle passphrase-protected keys when encountered. It returns the decoded private key and any errors that were encountered.
func EncodeAuthorizedKey ¶
EncodeAuthorizedKey will encode the given public key into the authorized_key format It returns a string containing the authorized_key and any errors encountered.
func ParseAuthorizedKey ¶
ParseAuthorizedKey converts an authorized_key into a PublicKey It returns the PublicKey and any errors encountered.
func VerifyECDSAHeader ¶
func VerifyECDSAHeader(pubKey interface{}, tokens []string, signature []byte, sigType string) (bool, error)
VerifyECDSAHeader verifies a signature using the EDCSA algorithm. It returns nil if the signature is valid, or an error if it is invalid.
func VerifyED25519Header ¶
VerifyED25519Header verifies a signature using the ed25519 algorithm. It returns nil if the signature is valid, or an error if it is invalid.
Types ¶
type Authorizer ¶
type Authorizer struct {
// contains filtered or unexported fields
}
func NewAuthorizer ¶
func NewAuthorizer(users map[string]*ssh.PublicKey) *Authorizer
NewAuthorizer creates a new Authorizer struct. It returns a pointer to the Authorizer.
func (*Authorizer) CheckAuthHeader ¶
func (authz *Authorizer) CheckAuthHeader(header string) (string, bool, error)
CheckAuthHeader checks the given signature against the avaliable public keys. It returns the user ID if the signature is valid, in addition to a verification boolean and error.
type Signer ¶
type Signer struct {
// contains filtered or unexported fields
}
func NewDefaultSigner ¶
NewDefaultSigner runs the NewSigner() function It return the response from NewSigner()
func NewSigner ¶
NewSigner creates a new Signer that can be used to sign requests It returns a pointer to the signer.
func (*Signer) CludoAuth ¶
func (signer *Signer) CludoAuth() runtime.ClientAuthInfoWriter
CludoAuth provides an API key auth info writer