Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckIntegrity ¶
Given a string URL to a file (generally a JS or CSS file) and the string of the integrity attribute, determine if the integrity attribute is valid Returns true for valid and false for invalid
func CheckPageIntegrity ¶
Given a string URL to a page, request that page (via HTTP GET) and note the script blocks with SRC attributes Check the Integrity attribute for any noted JS includes Return a boolean value based on the integrity checks - true when all integrity attributes are valid (or not present) and false when an integrity attribute does not check correctly.
func GenerateSriMap ¶
Given a string URL to a file (generally a JS or CSS file), generate a map of hashes for that data The index, or key, of the map will be a string of the hash algorithm The value of the map will be the base64 hash for the data
func PrintPageIntegrityCheckTable ¶
func PrintPageIntegrityCheckTable(pageUrl string)
Given a string URL to a page, request that page (via HTTP GET) and note the script blocks with SRC attributes Check the Integrity attribute for any noted JS includes Print a table summarizing all of the JS includes, their integrity attributes, and the validity of integrity attributes