html

package
v0.0.26 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2023 License: MPL-2.0 Imports: 36 Imported by: 0

Documentation

Overview

Package html provides the otf web app, serving up HTML formatted pages and associated assets (CSS, JS, etc).

Index

Constants

View Source
const (
	FlashSuccess flashType = "success"
	FlashError   flashType = "error"
)
View Source
const DefaultPathPrefix = "/"

Variables

View Source
var ErrOAuthCredentialsIncomplete = errors.New("must specify both client ID and client secret")

Functions

func AddRoutes

func AddRoutes(logger logr.Logger, opts ApplicationOptions) error

AddRoutes adds routes for the html web app.

Types

type Application

type Application struct {
	otf.Application // otf service accessors

	logr.Logger // logger for logging messages
	*sse.Server // server-side-events server
	// contains filtered or unexported fields
}

Application is the otf web app.

type ApplicationOptions added in v0.0.19

type ApplicationOptions struct {
	DevMode      bool
	CloudConfigs []*cloud.CloudOAuthConfig // for configuring authenticators

	*otfhttp.ServerConfig
	*otfhttp.Router
	otf.Application
}

ApplicationOptions are options for configuring the web app

type Authenticator

type Authenticator struct {
	otf.Application
	// contains filtered or unexported fields
}

Authenticator logs people onto the system using an OAuth handshake with an Identity provider before synchronising their user account and various organization and team memberships from the provider.

type NewOAuthClientConfig added in v0.0.19

type NewOAuthClientConfig struct {
	*cloud.CloudOAuthConfig
	// contains filtered or unexported fields
}

NewOAuthClientConfig is configuration for constructing an OAuth client

type OAuthClient added in v0.0.19

type OAuthClient struct {
	*oauth2.Config
	// contains filtered or unexported fields
}

OAuthClient performs the client role in an oauth handshake, requesting authorization from the user to access their account details on a particular cloud.

func NewOAuthClient added in v0.0.19

func NewOAuthClient(cfg NewOAuthClientConfig) (*OAuthClient, error)

func (*OAuthClient) CallbackHandler added in v0.0.19

func (a *OAuthClient) CallbackHandler(r *http.Request) (*oauth2.Token, error)

func (*OAuthClient) CallbackPath added in v0.0.19

func (a *OAuthClient) CallbackPath() string

func (*OAuthClient) NewClient added in v0.0.19

func (a *OAuthClient) NewClient(ctx context.Context, token *oauth2.Token) (cloud.Client, error)

NewClient constructs a cloud client configured with the given oauth token for authentication.

func (*OAuthClient) RequestHandler added in v0.0.19

func (a *OAuthClient) RequestHandler(w http.ResponseWriter, r *http.Request)

RequestHandler initiates the oauth flow, redirecting user to the auth server

func (*OAuthClient) RequestPath added in v0.0.19

func (a *OAuthClient) RequestPath() string

func (*OAuthClient) String added in v0.0.19

func (a *OAuthClient) String() string

String provides a human-readable identifier for the oauth client, using the name of its underlying cloud provider

Directories

Path Synopsis
Package paths provides rails-style path helpers for use with the web app.
Package paths provides rails-style path helpers for use with the web app.

Jump to

Keyboard shortcuts

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