auth

package
v0.0.28 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2021 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Package auth collects structures and functions around the generation and processing of credentials.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateCertificate added in v0.0.16

func CreateCertificate(
	ctx context.Context,
	cluster *kubernetes.Cluster,
	cert CertParam,
	owner *metav1.OwnerReference,
) error

CreateCertificate creates a certificate resource, for the given cluster issuer

func ExtendLocalTrust added in v0.0.16

func ExtendLocalTrust(certs string)

ExtendLocalTrust makes the certs found in specified PEM string available as root CA certs, beyond the standard certs. It does this by creating an in-memory pool of certs filled from both the system pool and the argument, and setting this as the cert origin for net/http's default transport. Ditto for the websocket's default dialer.

func HashBcrypt

func HashBcrypt(password string) (hash string, err error)

HashBcrypt generates an Bcrypt hash for a password. See https://github.com/foomo/htpasswd for the origin of this code. MIT licensed, as per `blob/master/LICENSE.txt`

Types

type CertParam added in v0.0.19

type CertParam struct {
	Name      string
	Namespace string
	Domain    string
	Issuer    string
}

CertParam describes the cert-manager certificate CRD. It's passed to CreateCertificate to create the cert-manager certificate CR.

type PasswordAuth

type PasswordAuth struct {
	Username string
	Password string
}

PasswordAuth wraps a set of password-based credentials

func RandomPasswordAuth

func RandomPasswordAuth() (*PasswordAuth, error)

RandomPasswordAuth generates a random user+password combination. Both elements are random 16-character hex strings.

func (*PasswordAuth) Htpassword

func (auth *PasswordAuth) Htpassword() (string, error)

Htpasswd returns user+hash string suitable for use by Traefik's BasicAuth module.

Jump to

Keyboard shortcuts

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