Documentation ¶
Index ¶
- Variables
- func ExtensionsRouter(_ extension.Extensions, testRouter bool) chi.Router
- func IsJSONRequest(contentType string) bool
- func PrintExtensions(w http.ResponseWriter, r *http.Request)
- func RefreshExtensionsTicker(extensionMapUpdater func())
- func UpdateExtensions(w http.ResponseWriter, r *http.Request)
- func WebStoreUpdateExtension(w http.ResponseWriter, r *http.Request)
Constants ¶
This section is empty.
Variables ¶
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.
var ExtensionUpdaterTimeout = time.Minute * 10
ExtensionUpdaterTimeout is the amount of time to wait between getting new updates from DynamoDB for the list of extensions
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
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(_ extension.Extensions, testRouter bool) chi.Router
ExtensionsRouter is the router for /extensions endpoints
func IsJSONRequest ¶
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.