Documentation
¶
Overview ¶
Package html provides the otf web app, serving up HTML formatted pages and associated assets (CSS, JS, etc).
Index ¶
- Constants
- Variables
- func AddRoutes(logger logr.Logger, opts ApplicationOptions) error
- type Application
- type ApplicationOptions
- type Authenticator
- type NewOAuthClientConfig
- type OAuthClient
- func (a *OAuthClient) CallbackHandler(r *http.Request) (*oauth2.Token, error)
- func (a *OAuthClient) CallbackPath() string
- func (a *OAuthClient) NewClient(ctx context.Context, token *oauth2.Token) (cloud.Client, error)
- func (a *OAuthClient) RequestHandler(w http.ResponseWriter, r *http.Request)
- func (a *OAuthClient) RequestPath() string
- func (a *OAuthClient) String() string
Constants ¶
const ( FlashSuccess flashType = "success" FlashError flashType = "error" )
const DefaultPathPrefix = "/"
Variables ¶
var ErrOAuthCredentialsIncomplete = errors.New("must specify both client ID and client secret")
Functions ¶
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
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 (*OAuthClient) CallbackPath ¶ added in v0.0.19
func (a *OAuthClient) CallbackPath() string
func (*OAuthClient) NewClient ¶ added in v0.0.19
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
Source Files
¶
- agent_token.go
- app.go
- app_test_helper.go
- auth.go
- authenticator.go
- cache_buster.go
- context.go
- cookies.go
- error.go
- flash.go
- html.go
- middleware.go
- module.go
- oauth_client.go
- organization.go
- renderer.go
- run.go
- session.go
- static.go
- team.go
- token.go
- user.go
- variable.go
- vcs_provider.go
- view_engine.go
- workspace.go
- workspace_permission.go