suites

package
v1.0.12-0...-3a330c3 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2019 License: Apache-2.0 Imports: 21 Imported by: 0

README

Authelia Suites

A suite is a kind of virtual environment for Authelia. Please read the related documentation here to get more details.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AdminBaseURL = fmt.Sprintf("https://admin.%s", BaseDomain)

AdminBaseURL the base URL of the admin domain

View Source
var AutheliaBaseURL = "http://authelia.example.com:9091"

AutheliaBaseURL the base URL of Authelia service

View Source
var BaseDomain = "example.com:8080"

BaseDomain the base domain

View Source
var DevBaseURL = fmt.Sprintf("https://dev.%s", BaseDomain)

DevBaseURL the base URL of the dev domain

View Source
var DuoBaseURL = "https://duo.example.com"

DuoBaseURL the base URL of the Duo configuration API

View Source
var HomeBaseURL = fmt.Sprintf("https://home.%s", BaseDomain)

HomeBaseURL the base URL of the home domain

View Source
var LoginBaseURL = fmt.Sprintf("https://login.%s", BaseDomain)

LoginBaseURL the base URL of the login portal

View Source
var MX1MailBaseURL = fmt.Sprintf("https://mx1.mail.%s", BaseDomain)

MX1MailBaseURL the base URL of the mx1.mail domain

View Source
var MX2MailBaseURL = fmt.Sprintf("https://mx2.mail.%s", BaseDomain)

MX2MailBaseURL the base URL of the mx2.mail domain

View Source
var MailBaseURL = fmt.Sprintf("https://mail.%s", BaseDomain)

MailBaseURL the base URL of the mail domain

View Source
var PublicBaseURL = fmt.Sprintf("https://public.%s", BaseDomain)

PublicBaseURL the base URL of the public domain

View Source
var SecureBaseURL = fmt.Sprintf("https://secure.%s", BaseDomain)

SecureBaseURL the base URL of the secure domain

View Source
var SingleFactorBaseURL = fmt.Sprintf("https://singlefactor.%s", BaseDomain)

SingleFactorBaseURL the base URL of the singlefactor domain

Functions

func ConfigureDuo

func ConfigureDuo(t *testing.T, allowDeny DuoPolicy)

ConfigureDuo configure duo api to allow or block auth requests

func NewHTTPClient

func NewHTTPClient() *http.Client

NewHTTPClient create a new client skipping TLS verification and not redirecting

func WithWebdriver

func WithWebdriver(fn func(webdriver selenium.WebDriver) error) error

WithWebdriver run some actions against a webdriver

Types

type DockerEnvironment

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

DockerEnvironment represent a docker environment

func NewDockerEnvironment

func NewDockerEnvironment(files []string) *DockerEnvironment

NewDockerEnvironment create a new docker environment

func (*DockerEnvironment) Down

func (de *DockerEnvironment) Down() error

Down spawn a docker environment

func (*DockerEnvironment) Logs

func (de *DockerEnvironment) Logs(service string, flags []string) (string, error)

Logs get logs of a given service of the environment

func (*DockerEnvironment) Restart

func (de *DockerEnvironment) Restart(service string) error

Restart restarts a service

func (*DockerEnvironment) Up

func (de *DockerEnvironment) Up() error

Up spawn a docker environment

type DuoPolicy

type DuoPolicy int32

DuoPolicy a type of policy

const (
	// Deny deny policy
	Deny DuoPolicy = iota
	// Allow allow policy
	Allow DuoPolicy = iota
)

type Kind

type Kind struct{}

Kind used for running kind commands

func (Kind) ClusterExists

func (k Kind) ClusterExists() (bool, error)

ClusterExists check whether a cluster exists

func (Kind) CreateCluster

func (k Kind) CreateCluster() error

CreateCluster create a new Kubernetes cluster

func (Kind) DeleteCluster

func (k Kind) DeleteCluster() error

DeleteCluster delete a Kubernetes cluster

func (Kind) LoadImage

func (k Kind) LoadImage(imageName string) error

LoadImage load an image in the Kubernetes container

type Kubectl

type Kubectl struct{}

Kubectl used for running kubectl commands

func (Kubectl) DeployAuthelia

func (k Kubectl) DeployAuthelia() error

DeployAuthelia deploy Authelia application

func (Kubectl) DeployThirdparties

func (k Kubectl) DeployThirdparties() error

DeployThirdparties deploy thirdparty services (ldap, db, ingress controllers, etc...)

func (Kubectl) StartDashboard

func (k Kubectl) StartDashboard() error

StartDashboard start Kube dashboard

func (Kubectl) StartProxy

func (k Kubectl) StartProxy() error

StartProxy start a proxy

func (Kubectl) StopDashboard

func (k Kubectl) StopDashboard() error

StopDashboard stop kube dashboard

func (Kubectl) StopProxy

func (k Kubectl) StopProxy() error

StopProxy stop a proxy

func (Kubectl) WaitPodsReady

func (k Kubectl) WaitPodsReady(timeout time.Duration) error

WaitPodsReady wait for all pods to be ready

type Registry

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

Registry represent a registry of suite by name

var GlobalRegistry *Registry

GlobalRegistry a global registry used by Authelia tooling

func NewSuitesRegistry

func NewSuitesRegistry() *Registry

NewSuitesRegistry create a suites registry

func (*Registry) Get

func (sr *Registry) Get(name string) Suite

Get return a suite by name

func (*Registry) Register

func (sr *Registry) Register(name string, suite Suite)

Register register a suite by name

func (*Registry) Suites

func (sr *Registry) Suites() []string

Suites list available suites

type SeleniumSuite

type SeleniumSuite struct {
	suite.Suite

	*WebDriverSession
}

SeleniumSuite is a selenium suite

func (*SeleniumSuite) WebDriver

func (s *SeleniumSuite) WebDriver() selenium.WebDriver

WebDriver return the webdriver of the suite

type Suite

type Suite struct {
	SetUp          func(tmpPath string) error
	SetUpTimeout   time.Duration
	OnSetupTimeout func() error

	TestTimeout time.Duration

	TearDown        func(tmpPath string) error
	TearDownTimeout time.Duration

	// A textual description of the suite purpose.
	Description string
}

Suite the definition of a suite

type WebDriverSession

type WebDriverSession struct {
	WebDriver selenium.WebDriver
	// contains filtered or unexported fields
}

WebDriverSession binding a selenium service and a webdriver.

func StartWebDriver

func StartWebDriver() (*WebDriverSession, error)

StartWebDriver create a selenium session

func StartWebDriverWithProxy

func StartWebDriverWithProxy(proxy string, port int) (*WebDriverSession, error)

StartWebDriverWithProxy create a selenium session

func (*WebDriverSession) Stop

func (wds *WebDriverSession) Stop() error

Stop stop the selenium session

func (*WebDriverSession) Wait

func (wds *WebDriverSession) Wait(ctx context.Context, condition selenium.Condition) error

Wait wait until condition holds true

func (*WebDriverSession) WaitElementLocatedByCSSSelector

func (wds *WebDriverSession) WaitElementLocatedByCSSSelector(ctx context.Context, t *testing.T, cssSelector string) selenium.WebElement

WaitElementLocatedByCSSSelector wait an element is located by class name

func (*WebDriverSession) WaitElementLocatedByClassName

func (wds *WebDriverSession) WaitElementLocatedByClassName(ctx context.Context, t *testing.T, className string) selenium.WebElement

WaitElementLocatedByClassName wait an element is located by class name

func (*WebDriverSession) WaitElementLocatedByID

func (wds *WebDriverSession) WaitElementLocatedByID(ctx context.Context, t *testing.T, id string) selenium.WebElement

WaitElementLocatedByID wait an element is located by id

func (*WebDriverSession) WaitElementLocatedByLinkText

func (wds *WebDriverSession) WaitElementLocatedByLinkText(ctx context.Context, t *testing.T, linkText string) selenium.WebElement

WaitElementLocatedByLinkText wait an element is located by link text

func (*WebDriverSession) WaitElementLocatedByTagName

func (wds *WebDriverSession) WaitElementLocatedByTagName(ctx context.Context, t *testing.T, tagName string) selenium.WebElement

WaitElementLocatedByTagName wait an element is located by tag name

func (*WebDriverSession) WaitElementTextContains

func (wds *WebDriverSession) WaitElementTextContains(ctx context.Context, t *testing.T, element selenium.WebElement, pattern string)

WaitElementTextContains wait the text of an element contains a pattern

func (*WebDriverSession) WaitElementsLocatedByCSSSelector

func (wds *WebDriverSession) WaitElementsLocatedByCSSSelector(ctx context.Context, t *testing.T, cssSelector string) []selenium.WebElement

WaitElementsLocatedByCSSSelector wait an element is located by CSS selector

Jump to

Keyboard shortcuts

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