controller

package
v0.0.0-...-173b68a Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: MPL-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AllExtensionsMap = extension.NewExtensionMap()

AllExtensionsMap holds a mapping of extension ID to extension object. This list for tests is populated by extensions.OfferedExtensions. For normal operations of this server it is obtained from the AWS config of the host machine for DynamoDB.

View Source
var ExtensionUpdaterTimeout = time.Minute * 10

ExtensionUpdaterTimeout is the amount of time to wait between getting new updates from DynamoDB for the list of extensions

View Source
var PDFJSExtensionID = "oemmndcbldboiebfnladdacbdfmadadm"

PDFJSExtensionID will be used to add an exception to pass the request for PDF viewer extension install from chrome web store to the extension updater proxy

View Source
var WidivineExtensionID = "oimompecagnajdejgnnjijobebaeigek"

WidivineExtensionID is used to add an exception to pass the request for widivine directly to google servers

Functions

func ExtensionsRouter

func ExtensionsRouter(extensions extension.Extensions, testRouter bool) chi.Router

ExtensionsRouter is the router for /extensions endpoints

func IsJSONRequest

func IsJSONRequest(contentType string) bool

IsJSONRequest is used to check if JSON parser should be used

func PrintExtensions

func PrintExtensions(w http.ResponseWriter, r *http.Request)

PrintExtensions is just used for troubleshooting to see what the internal list of extensions DB holds It simply prints out text for all extensions when visiting /extensions/test. Since our internally maintained list is always small by design, this is not a big deal for performance.

func RefreshExtensionsTicker

func RefreshExtensionsTicker(extensionMapUpdater func())

RefreshExtensionsTicker updates the list of extensions by calling the specified extensionMapUpdater function

func UpdateExtensions

func UpdateExtensions(w http.ResponseWriter, r *http.Request)

UpdateExtensions is the handler for updating extensions

func WebStoreUpdateExtension

func WebStoreUpdateExtension(w http.ResponseWriter, r *http.Request)

WebStoreUpdateExtension is the handler for updating extensions made via the GET HTTP method. Get requests look like this: /extensions?os=mac&arch=x64&os_arch=x86_64&nacl_arch=x86-64&prod=chromiumcrx&prodchannel=&prodversion=69.0.54.0&lang=en-US&acceptformat=crx2,crx3&x=id%3Doemmndcbldboiebfnladdacbdfmadadm%26v%3D0.0.0.0%26installedby%3Dpolicy%26uc%26ping%3Dr%253D-1%2526e%253D1" The query parameter x contains the encoded extension information, there can be more than one x parameter.

Types

This section is empty.

Jump to

Keyboard shortcuts

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