proxy

package
v0.7.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const PrevVersion = "prev_version"

Variables

This section is empty.

Functions

func WriteCallError

func WriteCallError(w http.ResponseWriter, statusCode int, err error)

Types

type Proxy

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

func NewService

func NewService(mm *pluginapi.Client, aws upaws.Client, conf config.Service, store *store.Service, s3AssetBucket string, mutex *cluster.Mutex, httpOut httpout.Service) *Proxy

func (*Proxy) AddBuiltinUpstream

func (p *Proxy) AddBuiltinUpstream(appID apps.AppID, up upstream.Upstream)

func (*Proxy) AddLocalManifest

func (p *Proxy) AddLocalManifest(actingUserID string, m *apps.Manifest) (md.MD, error)

func (*Proxy) AppIsEnabled

func (p *Proxy) AppIsEnabled(app *apps.App) bool

func (*Proxy) Call

func (p *Proxy) Call(sessionID, actingUserID string, creq *apps.CallRequest) *apps.ProxyCallResponse

func (*Proxy) CompleteRemoteOAuth2 added in v0.3.0

func (p *Proxy) CompleteRemoteOAuth2(sessionID, actingUserID string, appID apps.AppID, urlValues map[string]interface{}) error

func (*Proxy) DisableApp

func (p *Proxy) DisableApp(cc *apps.Context, app *apps.App) (md.MD, error)

TODO: Context vetting needs to be done by the caller via cleanUserAgentContext.

func (*Proxy) EnableApp

func (p *Proxy) EnableApp(cc *apps.Context, app *apps.App) (md.MD, error)

TODO: Context vetting needs to be done by the caller via cleanUserAgentContext.

func (*Proxy) GetAsset

func (p *Proxy) GetAsset(appID apps.AppID, path string) (io.ReadCloser, int, error)

func (*Proxy) GetBindings

func (p *Proxy) GetBindings(sessionID, actingUserID string, cc *apps.Context) ([]*apps.Binding, error)

GetBindings fetches bindings for all apps. We should avoid unnecessary logging here as this route is called very often.

func (*Proxy) GetBindingsForApp added in v0.3.0

func (p *Proxy) GetBindingsForApp(sessionID, actingUserID string, cc *apps.Context, app *apps.App) []*apps.Binding

GetBindingsForApp fetches bindings for a specific apps. We should avoid unnecessary logging here as this route is called very often.

func (*Proxy) GetInstalledApp

func (p *Proxy) GetInstalledApp(appID apps.AppID) (*apps.App, error)

func (*Proxy) GetInstalledApps

func (p *Proxy) GetInstalledApps() []*apps.App

func (*Proxy) GetListedApps

func (p *Proxy) GetListedApps(filter string) []*apps.ListedApp

func (*Proxy) GetManifest

func (p *Proxy) GetManifest(appID apps.AppID) (*apps.Manifest, error)

func (*Proxy) GetManifestFromS3 added in v0.7.0

func (p *Proxy) GetManifestFromS3(appID apps.AppID, version apps.AppVersion) (*apps.Manifest, error)

func (*Proxy) GetRemoteOAuth2ConnectURL added in v0.3.0

func (p *Proxy) GetRemoteOAuth2ConnectURL(sessionID, actingUserID string, appID apps.AppID) (string, error)

func (*Proxy) InstallApp

func (p *Proxy) InstallApp(sessionID, actingUserID string, cc *apps.Context, trusted bool, secret string) (*apps.App, md.MD, error)

func (*Proxy) Notify

func (p *Proxy) Notify(cc *apps.Context, subj apps.Subject) error

func (*Proxy) NotifyRemoteWebhook added in v0.3.0

func (p *Proxy) NotifyRemoteWebhook(app *apps.App, data []byte, webhookPath string) error

func (*Proxy) SynchronizeInstalledApps

func (p *Proxy) SynchronizeInstalledApps() error

SynchronizeInstalledApps synchronizes installed apps with known manifests, performing OnVersionChanged call on the App as needed.

func (*Proxy) UninstallApp

func (p *Proxy) UninstallApp(sessionID, actingUserID string, appID apps.AppID) error

type Service

type Service interface {
	Call(sessionID, actingUserID string, creq *apps.CallRequest) *apps.ProxyCallResponse
	CompleteRemoteOAuth2(sessionID, actingUserID string, appID apps.AppID, urlValues map[string]interface{}) error
	GetAsset(appID apps.AppID, path string) (io.ReadCloser, int, error)
	GetBindings(sessionID, actingUserID string, cc *apps.Context) ([]*apps.Binding, error)
	GetRemoteOAuth2ConnectURL(sessionID, actingUserID string, appID apps.AppID) (string, error)
	Notify(cc *apps.Context, subj apps.Subject) error
	NotifyRemoteWebhook(app *apps.App, data []byte, path string) error

	AddLocalManifest(actingUserID string, m *apps.Manifest) (md.MD, error)
	AppIsEnabled(app *apps.App) bool
	DisableApp(cc *apps.Context, app *apps.App) (md.MD, error)
	EnableApp(cc *apps.Context, app *apps.App) (md.MD, error)
	GetInstalledApp(appID apps.AppID) (*apps.App, error)
	GetInstalledApps() []*apps.App
	GetListedApps(filter string) []*apps.ListedApp
	GetManifest(appID apps.AppID) (*apps.Manifest, error)
	GetManifestFromS3(appID apps.AppID, version apps.AppVersion) (*apps.Manifest, error)
	InstallApp(sessionID, actingUserID string, cc *apps.Context, trusted bool, secret string) (*apps.App, md.MD, error)
	SynchronizeInstalledApps() error
	UninstallApp(sessionID, actingUserID string, appID apps.AppID) error

	AddBuiltinUpstream(apps.AppID, upstream.Upstream)
}

Jump to

Keyboard shortcuts

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