Movatterモバイル変換


[0]ホーム

URL:


Alert GO-2024-3228: Coder vulnerable to post-auth URL redirection to untrusted site ('Open Redirect') in github.com/coder/coder
Notice  The highest tagged major version isv2.

proxyhealth

package
v0.27.3Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2023 License:AGPL-3.0Imports:18Imported by:0

Details

Repository

github.com/coder/coder

Links

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

typeOptions

type Options struct {// Interval is the interval at which the proxy health is checked.Intervaltime.DurationDBdatabase.StoreLoggerslog.LoggerClient     *http.ClientPrometheus *prometheus.Registry}

typeProxyHealth

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

ProxyHealth runs a go routine that periodically checks the health of allworkspace proxies. This information is stored in memory, so each coderdreplica has its own view of the health of the proxies. These views should beconsistent, and if they are not, it indicates a problem.

funcNew

func New(opts *Options) (*ProxyHealth,error)

func (*ProxyHealth)ForceUpdate

func (p *ProxyHealth) ForceUpdate(ctxcontext.Context)error

ForceUpdate runs a single health check and updates the cache. If the healthcheck fails, the cache is not updated and an error is returned. This is usefulto trigger an update when a proxy is created or deleted.

func (*ProxyHealth)HealthStatus

func (p *ProxyHealth) HealthStatus() map[uuid.UUID]ProxyStatus

HealthStatus returns the current health status of all proxies stored in thecache.

func (*ProxyHealth)ProxyHostsadded inv0.23.1

func (p *ProxyHealth) ProxyHosts() []string

ProxyHosts returns the host:port of all healthy proxies.This can be computed from HealthStatus, but is cached to avoid thecaller needing to loop over all proxies to compute this on allstatic web requests.

func (*ProxyHealth)Run

func (p *ProxyHealth) Run(ctxcontext.Context)

Run will block until the context is canceled. It will periodically check thehealth of all proxies and store the results in the cache.

typeProxyStatus

type ProxyStatus struct {// ProxyStatus includes the value of the proxy at the time of checking. This is// useful to know as it helps determine if the proxy checked has different values// then the proxy in hand. AKA if the proxy was updated, and the status was for// an older proxy.Proxydatabase.WorkspaceProxy// ProxyHost is the host:port of the proxy url. This is included in the status// to make sure the proxy url is a valid URL. It also makes it easier to// escalate errors if the url.Parse errors (should never happen).ProxyHoststringStatusStatusReportcodersdk.ProxyHealthReportCheckedAttime.Time}

typeStatus

type Statusstring
const (// Unknown should never be returned by the proxy health check.UnknownStatus = "unknown"// Healthy means the proxy access url is reachable and returns a healthy// status code.HealthyStatus = "ok"// Unreachable means the proxy access url is not responding.UnreachableStatus = "unreachable"// Unhealthy means the proxy access url is responding, but there is some// problem with the proxy. This problem may or may not be preventing functionality.UnhealthyStatus = "unhealthy"// Unregistered means the proxy has not registered a url yet. This means// the proxy was created with the cli, but has not yet been started.UnregisteredStatus = "unregistered")

Source Files

View all Source files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f orF : Jump to
y orY : Canonical URL
go.dev uses cookies from Google to deliver and enhance the quality of its services and to analyze traffic.Learn more.

[8]ページ先頭

©2009-2025 Movatter.jp