controller

package
v0.0.0-...-d9938a3 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2026 License: MPL-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AllExtensionsCache = middleware.NewJSONCache()

AllExtensionsCache is the global cache instance for all extensions JSON data

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 ProtocolFactory = &omaha.DefaultFactory{}

ProtocolFactory is the factory used to create protocol handlers

View Source
var WidevineExtensionID = "oimompecagnajdejgnnjijobebaeigek"

WidevineExtensionID is used to add an exception to pass the request for Widevine directly to google servers

Functions

func ExtensionsRouter

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

ExtensionsRouter is the router for /extensions endpoints

func PrintExtensions

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

PrintExtensions handles requests to /extensions/all by returning a JSON representation of all extensions in the database. This endpoint serves two purposes: 1. Troubleshooting - allows inspection of the current extension database state 2. Dashboard integration - provides data to populate the extensions dashboard (/dashboard)

Note: This function is only called on cache misses since the middleware handles cache hits.

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 installing extensions via the GET HTTP method. Supports both Web Store and Brave-hosted MV2 extensions.

Example request:

/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. More than one x parameter can be present.

Types

This section is empty.

Jump to

Keyboard shortcuts

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