Documentation ¶
Index ¶
- Variables
- func CompareVersions(version1 string, version2 string) int
- func GetComponentUpdaterHost() string
- func GetS3ExtensionBucketHost(id string) string
- func GetS3IPFSExtensionBucketHost() string
- func GetS3TorExtensionBucketHost() string
- func GetUpdateStatus(extension Extension) string
- type Extension
- type Extensions
- type ExtensionsMap
- type PatchInfo
- type UpdateRequest
- type UpdateResponse
- type WebStoreUpdateResponse
Constants ¶
This section is empty.
Variables ¶
var OfferedExtensions = Extensions{ { ID: "ldimlcelhnjgpjjemdjokpgeeikdinbm", Version: "1.0.0", SHA256: "1c714fadd4208c63f74b707e4c12b81b3ad0153c37de1348fa810dd47cfc5618", Title: "Brave Light Theme", URL: "", Blacklisted: false, }, { ID: "bfdgpgibhagkpdlnjonhkabjoijopoge", Version: "1.0.0", SHA256: "ae517d6273a4fc126961cb026e02946db4f9dbb58e3d9bc29f5e1270e3ce9834", Title: "Brave Dark Theme", URL: "", Blacklisted: false, }, { ID: "cffkpbalmllkdoenhmdmpbkajipdjfam", Version: "1.0.1", SHA256: "0820e12d9a229a2acce4d14fa98c4637d5f58a90eca0291394639bf51210ec43", Title: "Brave Ad Block Updater", URL: "", Blacklisted: false, }, { ID: "ghnjmapememheddlfgmklijahiofgkea", Version: "1.0.1", SHA256: "f2d787e4c4a62a76707ff28c77404eb797ffc6609d922a8cabda6fa2265072b2", Title: "Brave Ad Block Updater (JPN: ABP Japanese filters (日本用フィルタ))", URL: "", Blacklisted: false, }, { ID: "fnpjliiiicbbpkfihnggnmobcpppjhlj", Version: "1.0.1", SHA256: "a159b78efbf1388ba3cc3790e3ac8953dc702794ca3388eb354efbc080805e06", Title: "Brave Ad Block Updater (EST: Eesti saitidele kohandatud filter)", URL: "", Blacklisted: false, }, { ID: "dmoefgliihlcfplldbllllbofegmojne", Version: "1.0.1", SHA256: "454f2ce723594cd0d579fa09cb923236b8482f0a426d5a65496f72accf996bb4", Title: "Brave Ad Block Updater (RUS: Adguard Russian Filter)", URL: "", Blacklisted: false, }, { ID: "llhecljkijgcaalnbfadljdpkpbehakp", Version: "1.0.1", SHA256: "6d94625e247f2b3024cb3fa197211ab59356fdaaa221ed14f6977c17fc1788fe", Title: "Brave Ad Block Updater (CHN: EasyList China (中文))", URL: "", Blacklisted: false, }, { ID: "hmabmnondepbfogenlfklniehjedmicd", Version: "1.0.1", SHA256: "5774731d26026c49b72f3939a9ef852b2c5cd247fbcbeffb7d4d90cea5e264e0", Title: "Brave Ad Block Updater (LVA: Latvian List)", URL: "", Blacklisted: false, }, { ID: "oooemoeokehlgldpjjhcgbndjcekllim", Version: "1.0.1", SHA256: "9cfec4193ed84a0aee1cbf031ee609449f97792780a865bd07744795e27c24db", Title: "Brave Ad Block Updater (TUR: Adguard Turkish Filter)", URL: "", Blacklisted: false, }, { ID: "kdcalgmhljnckmnfcboeabeepgnlaemf", Version: "1.0.1", SHA256: "c21e9551a9e070e6be4fc47e4ad3807d3494799bf711ca575a769745725f0c88", Title: "Brave Ad Block Updater (FIN: Finnish Addition to Easylist)", URL: "", Blacklisted: false, }, { ID: "jboldinnegecjonfmaahihagfahjceoj", Version: "1.0.1", SHA256: "efb05a2f4f8f9c5f336bded3f4db033eebb00e5bedb48d87b94e95499c90d082", Title: "Brave Ad Block Updater (KOR: Korean Adblock List)", URL: "", Blacklisted: false, }, { ID: "lddghfaofadfpaajgncgkbjhalgohfkd", Version: "1.0.1", SHA256: "fe99c16892985ee001bcf7d3de1e6359782a8a70eb8bb3b4d188f6908c051688", Title: "Brave Ad Block Updater (SVN: Slovenian List)", URL: "", Blacklisted: false, }, { ID: "djhjpnilfflibdflbkgapjfldapkjcgl", Version: "1.0.1", SHA256: "15432ac88535387562b8134b6908c39c34af75f29a7a4b3909c9d20950bb9c2a", Title: "Brave Ad Block Updater (KOR: YousList)", URL: "", Blacklisted: false, }, { ID: "njhlaafgablgnekjaodhgbaomabjibaf", Version: "1.0.1", SHA256: "abb6c773ebcf8fefaf081b605d7f8c3432bdd4fea3bfbdfc5ce974a54730a79e", Title: "Brave Ad Block Updater (ISL: Icelandic ABP List)", URL: "", Blacklisted: false, }, { ID: "fijddbnggnpidebfbejillgbopcikfpi", Version: "1.0.1", SHA256: "77cee0614507ea3e348baaa07e147dc4b2942fb33a63ef95cb7d1595739847d0", Title: "Brave Ad Block Updater (IN: Fanboy's India Filters)", URL: "", Blacklisted: false, }, { ID: "ekodlgldheejnlkhiceghfgdcplpeoek", Version: "1.0.1", SHA256: "b01812b540c28b334b44b9664997a7f23aa3a55710979f43b049187fe0417598", Title: "Brave Ad Block Updater (LTU: Adblock Plus Lithuania)", URL: "", Blacklisted: false, }, { ID: "oidcknjcjepjgfpammgdalpnjefekhge", Version: "1.0.1", SHA256: "dcdfc47fe4a53b522ca4980b7c66d8ab9912708daef0b521df3012a68f50c0c4", Title: "Brave Ad Block Updater (KOR: Fanboy's Korean)", URL: "", Blacklisted: false, }, { ID: "abeicfkepbhgindohkebelkkhnnijcaf", Version: "1.0.1", SHA256: "038776ffea4e586e9f9b4f118076133d20030cf7f0a41b1110e5017e14b7a839", Title: "Brave Ad Block Updater (EU: Prebake - Filter Obtrusive Cookie Notices)", URL: "", Blacklisted: false, }, { ID: "cklgijeopkpaadeipkhdaodemoenlene", Version: "1.0.1", SHA256: "4bcffe9b663271c3be9f8f033250896b6b8134871772c9a5ff2a9c1634ace71d", Title: "Brave Ad Block Updater (VIE: Fanboy's Vietnamese)", URL: "", Blacklisted: false, }, { ID: "pmgkiiodjlmmpimpmphjhkodjnjfkeke", Version: "1.0.1", SHA256: "c7a333611b5be1f26f71079f1280756795793921e84544547caa1073891570a6", Title: "Brave Ad Block Updater (GRC: Greek AdBlock Filter)", URL: "", Blacklisted: false, }, { ID: "omkkefoeihpbpebhhbhmjekpnegokpbj", Version: "1.0.1", SHA256: "5877bb7ca417ae78c30427e0d0fe96ebafa68dfafadb772d974a4b4155fa8ce0", Title: "Brave Ad Block Updater (CZE, SVK: EasyList Czech and Slovak)", URL: "", Blacklisted: false, }, { ID: "oimfmeehpinnecjghphifehbbnddjkmf", Version: "1.0.1", SHA256: "7b125c09a45d09270d06c11a967eb786f99711279c228ca8ac3f3e2852568004", Title: "Brave Ad Block Updater (SWE: Frellwit's Filter List)", URL: "", Blacklisted: false, }, { ID: "enkheaiicpeffbfgjiklngbpkilnbkoi", Version: "1.0.1", SHA256: "dddc12b1c7ca9ab9075becf1e42d215c18c738413a367f6659a4ece53d0d34e0", Title: "Brave Ad Block Updater (RUS: RU AdList (Дополнительная региональная подписка))", URL: "", Blacklisted: false, }, { ID: "hjeidaaocognlgpdkfeenmiefipcffbo", Version: "1.0.1", SHA256: "b3084e8bd908d1b146ce51cfb15b9e6f386c0910f79954b012b009d2013b6137", Title: "Brave Ad Block Updater (ISR: EasyList Hebrew)", URL: "", Blacklisted: false, }, { ID: "lgfeompbgommiobcenmodekodmdajcal", Version: "1.0.1", SHA256: "0058e2661bdfb1c8b1257f643f924a99f73c1d259260e56eb96034608818e883", Title: "Brave Ad Block Updater (CHN: CJX's EasyList Lite (main focus on Chinese sites))", URL: "", Blacklisted: false, }, { ID: "egooomckhdgnfbpofhkbhbkiejaihdll", Version: "1.0.1", SHA256: "6e058804b6553465a17ee84fe2c6a03153473e46a1a9384739c0d18a8e194682", Title: "Brave Ad Block Updater (IDN: ABPindo)", URL: "", Blacklisted: false, }, { ID: "emaecjinaegfkoklcdafkiocjhoeilao", Version: "1.0.1", SHA256: "2709d1bee39fae701f0bb67b3b3b0fbc4065ca77f66c55ca729cc4a460daf74e", Title: "Brave Ad Block Updater (FRA: EasyList Liste FR)", URL: "", Blacklisted: false, }, { ID: "fbmjnabmpmfnfknjmbegjmjigmelggmf", Version: "1.0.1", SHA256: "c0a585c705e2d17954fd413b8d3abb277672dcfe5db5203a2d57d4f7bb1d60b3", Title: "Brave Ad Block Updater (NLD: EasyList Dutch)", URL: "", Blacklisted: false, }, { ID: "facajiciiepdpjnoifonbfgcnlbpbieo", Version: "1.0.1", SHA256: "9b4faad8fc79494286951e083094e6b8b6e2c551b29caac9e51926c4652edd56", Title: "Brave Ad Block Updater (DNK: Schacks Adblock Plus liste)", URL: "", Blacklisted: false, }, { ID: "gpgegghiabhggiplapgdfnfcmodkccji", Version: "1.0.1", SHA256: "9e088cb35985f25f6e7e645a86c2c13101d4cd15cbc6dd8443384abba20ca50e", Title: "Brave Ad Block Updater (ARA: Liste AR)", URL: "", Blacklisted: false, }, { ID: "agfanagdjcijocanbeednbhclejcjlfo", Version: "1.0.1", SHA256: "b0bb741d0164ebb433df864a481b2cf7ca5c2d665730be0d8e943bb662c2be0b", Title: "Brave Ad Block Updater (ITA: ABP X Files)", URL: "", Blacklisted: false, }, { ID: "nkmllpnhpfieajahfpfmjneipnddhimi", Version: "1.0.1", SHA256: "80e8ca373f5ad5c9d0c4f5563e0dd3ba4db4cac9f0607e856042c2e4b7fe909d", Title: "Brave Ad Block Updater (ITA: EasyList Italy)", URL: "", Blacklisted: false, }, { ID: "pdecoifadfkklajdlmndjpkhabpklldh", Version: "1.0.1", SHA256: "7e58eb27077f4c496d1a611fad654d39bca2d3c574c4cae56c14f49097848918", Title: "Brave Ad Block Updater (SPA: EasyList Spanish)", URL: "", Blacklisted: false, }, { ID: "paoecjnjjbclkgbempaeemcbeldldlbo", Version: "1.0.1", SHA256: "cfd0969b51d7f12de0c3af8f924907f59039d938ce583aaa225342a1e8902b6a", Title: "Brave Ad Block Updater (POL: polskie filtry do Adblocka i uBlocka)", URL: "", Blacklisted: false, }, { ID: "dbcccdegkijbppmeaihneimbghfghkdl", Version: "1.0.1", SHA256: "3060e20d3708d119d2038a2ff60c4f42e5178d5b451b8095d4e1f6fad97d0e57", Title: "Brave Ad Block Updater (IRN: AdBlock Iran Filter)", URL: "", Blacklisted: false, }, { ID: "llpoppgpcimnmhgehpipdmamalmpfbjd", Version: "1.0.1", SHA256: "41c4f79c5ee4525209a75edacd2a51ac9576e47a4ec95abdaab54995d5b4021f", Title: "Brave Ad Block Updater (CHN: CJX's Annoyance List)", URL: "", Blacklisted: false, }, { ID: "fmcofgdkijoanfaodpdfjipdgnjbiolk", Version: "1.0.1", SHA256: "4f1326bbcd0d6770df94871756074bf2637cf450da4e615fe4fe261f8f45d657", Title: "Brave Ad Block Updater (RUS: BitBlock List (Дополнительная подписка фильтров))", URL: "", Blacklisted: false, }, { ID: "jmomcjcilfpbaaklkifaijjcnancamde", Version: "1.0.1", SHA256: "d91fa87672d618fc9318ef9c1a82c174959b6e23e3ff06e0021b8b225c383701", Title: "Brave Ad Block Updater (DEU: EasyList Germany)", URL: "", Blacklisted: false, }, { ID: "gemncmbgjgcjjepjkindgdhdilnaanlc", Version: "1.0.1", SHA256: "49cb8905690793c5f3357f614ce80e12c225e5dc3ef0cec050b7fa0548116997", Title: "Brave Ad Block Updater (HUN: hufilter)", URL: "", Blacklisted: false, }, { ID: "coofeapfgmpkchclgdphgpmfhmnplbpn", Version: "1.0.1", SHA256: "992a7a2147cc1593c638de7c1e80903a0f77e24088ee105f8c841b325b957519", Title: "Brave Ad Block Updater (BGR: Bulgarian Adblock list)", URL: "", Blacklisted: false, }, { ID: "oofiananboodjbbmdelgdommihjbkfag", Version: "1.0.1", SHA256: "c3c40af8bff5aacf90cb4176b820644756665de82c5e37170c7ad6f2878fea36", Title: "Brave HTTPS Everywhere Updater", URL: "", Blacklisted: false, }, { ID: "afalakplffnnnlkncjhbmahjfjhmlkal", Version: "1.0.1", SHA256: "190866dbaa189c463fded59130deaa8f950e0bead46b4340b3beeb05129e3a76", Title: "Brave Tracking Protection Updater", URL: "", Blacklisted: false, }, { ID: "cldoidikboihgcjfkhdeidbpclkineef", Version: "1.0.1", SHA256: "fd623c12f6063698a6670b1f4bcbf3150fca83057b0f46e12738da35009243f7", Title: "Brave Tor Client Updater (Mac)", URL: "", Blacklisted: false, }, { ID: "cpoalefficncklhjfpglfiplenlpccdb", Version: "1.0.1", SHA256: "fd623c12f6063698a6670b1f4bcbf3150fca83057b0f46e12738da35009243f7", Title: "Brave Tor Client Updater (Mac)", URL: "", Blacklisted: false, }, { ID: "biahpgbdmdkfgndcmfiipgcebobojjkp", Version: "1.0.1", SHA256: "fd623c12f6063698a6670b1f4bcbf3150fca83057b0f46e12738da35009243f7", Title: "Brave Tor Client Updater (Mac)", URL: "", Blacklisted: false, }, { ID: "nljcddpbnaianmglkpkneakjaapinabi", Version: "1.0.1", SHA256: "1bfdea8bd9fcac4a7109e85cbfe76670f9cb1f716fb36d36e2d5f1bbaafb734a", Title: "Brave Ipfs Daemon Updater (Mac)", URL: "", Blacklisted: false, }, { ID: "lnbclahgobmjphilkalbhebakmblnbij", Version: "1.0.1", SHA256: "efc1b8a1ade508e2028c918c5b3451a568ec3ecce1703f01c09659403bc91526", Title: "Brave Ipfs Daemon Updater (Windows)", URL: "", Blacklisted: false, }, { ID: "oecghfpdmkjlhnfpmmjegjacfimiafjp", Version: "1.0.1", SHA256: "6641042f9f75f16066d28741cd699fc3a04df3e414629a7cda33d8df2b15c717", Title: "Brave Ipfs Daemon Updater (Linux)", URL: "", Blacklisted: false, }, }
OfferedExtensions contains the extensions our server handles ourselves without redirecting to Google's component updater.
var TorClientExtensionIDs = []string{torClientMacExtensionID, torClientWindowsExtensionID, torClientLinuxExtensionID, torClientLinuxArm64ExtensionID}
TorClientExtensionIDs is used to add an exception to return the dedicated proxy url for downloading the tor client crx
var TorPluggableTransportsExtensionIDs = []string{torPluggableTransportsMacExtensionID, torPluggableTransportsWindowsExtensionID, torPluggableTransportsLinuxExtensionID}
Functions ¶
func CompareVersions ¶
CompareVersions compares 2 versions: returns 0 if both versions are the same. returns 1 if version1 is more recent. returns -1 if version2 is more recent.
func GetComponentUpdaterHost ¶
func GetComponentUpdaterHost() string
GetComponentUpdaterHost returns the url to use for extension updates
func GetS3ExtensionBucketHost ¶
GetS3ExtensionBucketHost returns the url to use for accessing crx files
func GetS3IPFSExtensionBucketHost ¶
func GetS3IPFSExtensionBucketHost() string
GetS3IPFSExtensionBucketHost returns the url to use for accessing go-ipfs client crx
func GetS3TorExtensionBucketHost ¶
func GetS3TorExtensionBucketHost() string
GetS3TorExtensionBucketHost returns the url to use for accessing tor client crx
func GetUpdateStatus ¶
GetUpdateStatus returns the status of an update response for an extension
Types ¶
type Extension ¶
type Extension struct { ID string FP string Version string SHA256 string Title string URL string Blacklisted bool Status string PatchList map[string]*PatchInfo }
Extension represents an extension which is both used in update checks and responses.
type ExtensionsMap ¶
ExtensionsMap is safe for use across goroutines.
func NewExtensionMap ¶
func NewExtensionMap() *ExtensionsMap
NewExtensionMap creates a new map of Extension structs where access is controlled by a RW mutex
func (*ExtensionsMap) Load ¶
func (m *ExtensionsMap) Load(key string) (extension Extension, ok bool)
Load looks up the Extension in the map by it's key
func (*ExtensionsMap) MarshalJSON ¶
func (m *ExtensionsMap) MarshalJSON() ([]byte, error)
MarshalJSON marshals the Extension map into a JSON byte slice
func (*ExtensionsMap) Store ¶
func (m *ExtensionsMap) Store(key string, extension Extension)
Store adds or overwrites the key in the map with the Extension
func (*ExtensionsMap) StoreExtensions ¶
func (m *ExtensionsMap) StoreExtensions(extensions *Extensions)
StoreExtensions converts a slice of extensions into a map from ID to extension.Extension
type UpdateRequest ¶
type UpdateRequest Extensions
UpdateRequest represents an extension XML request.
func (*UpdateRequest) FilterForUpdates ¶
func (updateRequest *UpdateRequest) FilterForUpdates(allExtensionsMap *ExtensionsMap) UpdateResponse
FilterForUpdates filters `extensions` down to only the extensions that are being checked, and only the ones that we have updates for.
func (*UpdateRequest) UnmarshalJSON ¶
func (updateRequest *UpdateRequest) UnmarshalJSON(b []byte) error
UnmarshalJSON decodes the update server request JSON data for a list of extensions
func (*UpdateRequest) UnmarshalXML ¶
func (updateRequest *UpdateRequest) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error
UnmarshalXML decodes the update server request XML data for a list of extensions
type UpdateResponse ¶
type UpdateResponse Extensions
UpdateResponse represents an extension XML response.
func (*UpdateResponse) MarshalJSON ¶
func (updateResponse *UpdateResponse) MarshalJSON() ([]byte, error)
MarshalJSON encodes the extension list into response JSON
func (*UpdateResponse) MarshalXML ¶
func (updateResponse *UpdateResponse) MarshalXML(e *xml.Encoder, _ xml.StartElement) error
MarshalXML encodes the extension list into response XML
type WebStoreUpdateResponse ¶
type WebStoreUpdateResponse Extensions
WebStoreUpdateResponse represents a webstore XML response. There is no symmetric WebStoreUpdateRequest because the request is URL query parameters.
func (*WebStoreUpdateResponse) MarshalJSON ¶
func (updateResponse *WebStoreUpdateResponse) MarshalJSON() ([]byte, error)
MarshalJSON encodes the extension list into response JSON
func (*WebStoreUpdateResponse) MarshalXML ¶
func (updateResponse *WebStoreUpdateResponse) MarshalXML(e *xml.Encoder, _ xml.StartElement) error
MarshalXML encodes the extension list into response XML