From 70f322e30490ecf666d38aa46d6ee1b55de8bcf3 Mon Sep 17 00:00:00 2001 From: John Knollmeyer Date: Wed, 13 Nov 2019 18:57:54 -0800 Subject: [PATCH] Whitelist SageMakerRuntime InvokeEndpoint --- resources/AWSWhitelist.json | 9 +++ resources/bindata.go | 110 ++++++++++++++++++++++++------------ 2 files changed, 82 insertions(+), 37 deletions(-) diff --git a/resources/AWSWhitelist.json b/resources/AWSWhitelist.json index 73aa7032..9ec7b411 100644 --- a/resources/AWSWhitelist.json +++ b/resources/AWSWhitelist.json @@ -456,6 +456,15 @@ ] } } + }, + "runtime.sagemaker": { + "operations": { + "InvokeEndpoint": { + "request_parameters": [ + "EndpointName" + ] + } + } } } } diff --git a/resources/bindata.go b/resources/bindata.go index 65dac7a5..58330a0b 100644 --- a/resources/bindata.go +++ b/resources/bindata.go @@ -1,15 +1,15 @@ -// Code generated by go-bindata. +// Code generated by go-bindata. DO NOT EDIT. // sources: -// resources/AWSWhitelist.json -// resources/DefaultSamplingRules.json -// resources/ExampleSamplingRules.json -// DO NOT EDIT! +// resources/AWSWhitelist.json (11.191kB) +// resources/DefaultSamplingRules.json (97B) +// resources/ExampleSamplingRules.json (609B) package resources import ( "bytes" "compress/gzip" + "crypto/sha256" "fmt" "io" "io/ioutil" @@ -22,7 +22,7 @@ import ( func bindataRead(data []byte, name string) ([]byte, error) { gz, err := gzip.NewReader(bytes.NewBuffer(data)) if err != nil { - return nil, fmt.Errorf("Read %q: %v", name, err) + return nil, fmt.Errorf("read %q: %v", name, err) } var buf bytes.Buffer @@ -30,7 +30,7 @@ func bindataRead(data []byte, name string) ([]byte, error) { clErr := gz.Close() if err != nil { - return nil, fmt.Errorf("Read %q: %v", name, err) + return nil, fmt.Errorf("read %q: %v", name, err) } if clErr != nil { return nil, err @@ -40,8 +40,9 @@ func bindataRead(data []byte, name string) ([]byte, error) { } type asset struct { - bytes []byte - info os.FileInfo + bytes []byte + info os.FileInfo + digest [sha256.Size]byte } type bindataFileInfo struct { @@ -70,7 +71,7 @@ func (fi bindataFileInfo) Sys() interface{} { return nil } -var _resourcesAwswhitelistJson = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xec\x59\xcd\x72\xe2\x38\x10\xbe\xf3\x14\x2e\x9f\x73\xdb\x5b\x6e\x0c\x49\x28\x6a\xc9\x84\x04\x66\x73\xd8\xda\xa2\x64\xb9\x71\x34\xb1\x25\x47\x3f\x0c\xd4\x56\xde\x7d\x4b\x92\x21\x60\x8c\x2d\xe4\xc0\x90\x64\x0f\x53\x13\xac\xb6\xfa\xeb\xaf\x7f\xd4\x2d\xff\xdb\x09\x82\x50\x00\x9f\x13\x0c\x22\xbc\x0c\xf4\xef\x20\x08\xe3\x25\x45\x19\x8b\xa3\xf5\x93\x20\x08\x59\x0e\x1c\x49\xc2\xa8\xd8\x78\x1a\x04\xe1\x37\x24\xf1\x53\x1f\xe4\x40\x42\xb6\xb5\x12\x04\x21\x87\x17\x05\x42\x4e\x63\x10\x98\x93\x5c\x32\x2e\x4a\x22\x41\x10\x3e\x58\x21\xfd\xfe\xee\x6a\x10\x84\x19\xca\xc3\xcb\x40\x72\x05\x17\xe5\xa5\x04\xe4\xf4\x19\x96\x62\xdf\x3a\x07\x8a\x32\x98\x4a\x16\x5e\x06\xa1\x44\x51\x0a\x53\xfd\x40\x84\x5b\x82\xaf\x1b\xbf\x5e\x2f\xb6\xf1\x8b\x9c\x51\x01\xd3\x1c\x71\x94\x81\x04\x83\xff\xef\x6d\xfc\x3d\x46\x85\xca\x20\xee\xa1\x1c\x61\x22\x97\x9b\x9b\xff\xd3\xa9\xd8\xd8\x52\xf6\xc8\x89\x84\xff\x49\x5b\x91\xb6\x0d\x23\xd4\x86\xf5\x58\x9a\x02\xd6\x21\x77\x0b\x92\x13\x2c\x9a\x99\xed\x71\x40\x12\x26\x1a\xf4\x3e\x5a\xeb\x50\xf5\x53\x16\xa1\x74\x0c\x98\xd1\x18\xf1\xe5\x80\xc6\xb0\x00\x51\xc6\x36\x64\xb8\x59\x68\xc4\xd9\x9c\x08\xc2\x28\xc4\x93\x27\xce\x54\xf2\x94\x2b\x59\x16\x32\x40\xbf\xa3\x0c\x9a\x2d\xbb\x82\x14\xea\xe3\xa5\xce\xb0\x6a\x45\x67\xe3\x36\x6b\x9c\xb7\xdb\x0e\xa2\x51\x27\x55\x74\x12\x5d\x0d\x45\xb1\x89\x67\x22\x24\x50\xf9\x00\x28\xae\x88\xad\x9f\x96\xe1\xeb\x45\xce\x41\xe8\x30\x73\x0b\xad\x53\x54\xb7\x21\x11\xd2\x68\x2f\x17\x26\x27\xcb\xaf\x17\x38\x55\x82\xcc\x61\x2c\x11\x97\x6f\x56\x94\x73\x90\x64\x44\x3a\x98\x56\x5b\x44\xd7\xbb\x57\x96\xd0\x94\x08\x59\x57\x43\x31\x53\x74\xaf\x40\x45\x11\xb5\xf2\xfb\x8b\x68\x25\x99\x23\xe5\x1d\x43\x67\x9e\xf3\xf7\x0a\xf8\xd2\xc7\xae\xae\x94\x9c\x44\x4a\x82\x98\xb0\x3e\xec\xd4\xd4\xfa\xd4\x31\xd5\x7a\x7f\x40\x79\x24\xda\x18\x23\x6a\x76\xbd\x61\xfc\x17\xe2\x3b\x1a\xc7\xa0\x99\x39\x9f\xf4\xd4\x78\x3f\x03\xed\x90\x64\x40\x77\x5e\x6d\x62\xbb\xbc\xc0\xa4\x3e\xca\xcd\x56\xe2\xc8\x79\xd2\x33\xf9\x5f\x11\x3d\x14\xe2\x5e\xb9\x36\x54\xfb\xee\x47\x1e\xa3\x4f\xdb\x04\x58\xe3\xbc\x0f\xe6\x75\x7c\x5e\xc1\x8c\x50\x62\x27\x95\x8b\xe6\xfe\xce\xaa\x3d\x4e\xff\xd6\xd9\xfc\xbf\xb0\x35\x14\x2f\xc2\x65\xae\xea\xc6\xf1\x08\x78\x46\x6c\xf4\x7b\x10\x32\x44\x11\xa4\x65\xc4\xf7\x0a\x14\xfc\xe0\xa9\x43\x2b\xfd\x84\x68\x02\xb7\x20\x04\x4a\xe0\x2f\x22\x48\x44\x52\xed\x6c\x0f\x24\x6b\xa5\x25\x30\x6f\xbb\x4e\x48\x06\x4c\x39\x64\xc0\x1e\x54\x66\xa2\x6a\x05\xad\x5d\x4a\xdc\x20\x92\x42\xec\x3a\x9f\x18\xa5\xed\x6a\x70\xa5\x5f\x0f\x99\x24\x0a\x0a\xdf\x8d\xb3\x66\x55\x1f\xc5\x47\x16\xb4\xb7\x8f\xdc\xd9\xe9\x83\x34\xc2\x1b\x5e\xfd\x7d\xec\x6c\x80\x70\x06\xae\xb5\xfa\x22\xae\x3a\x8d\xcd\xc2\xdd\x2f\x0a\xbc\xfb\x38\xee\x62\xd3\x30\x0f\xe2\x96\x86\xb9\xfb\x43\x0f\x2e\x57\x80\xe2\x21\x48\x09\x7c\xcc\x14\xc7\x36\x0c\x7e\xa7\x5f\x56\xdb\x38\xb8\x45\xe3\x6f\x89\x57\x7b\x65\xc4\x61\x46\x16\x6d\x67\xab\x37\xdc\x47\x1d\xad\x5e\xb4\x1a\xdf\xd1\x8a\x27\xa7\x48\xf3\x07\xc0\x40\xe6\x6d\x0a\xee\x3a\x37\xed\xac\x5a\xca\x9a\x5b\xb4\xf8\xae\xb2\x08\xf8\xdd\xac\xd0\xb1\x2b\x62\x9f\xd7\xef\xe3\x7e\x4a\x97\x04\x1e\x11\x91\x7a\xc9\xf6\x55\x2e\x6d\x74\x6d\xe4\xac\x8d\x38\x6a\xe0\x64\x56\x8b\x5f\xe8\x3c\x40\xc6\xe6\xd0\xae\x3d\x73\x0f\xa0\x31\xd0\xb8\x45\xf4\x5c\x41\x8a\x96\x2b\xdf\xb8\xb4\x83\x17\x55\x1a\x5c\x5c\xb6\xf7\x20\x33\x42\xef\x75\x25\xbd\xf2\x1c\x5a\x69\x3b\xc2\xf5\x74\x61\xd0\xc0\xa1\x5d\xd8\xf0\xce\x51\x3b\x1c\x07\x37\x5c\x53\xc9\xc9\xb9\x24\x8e\x47\xe6\x17\x1d\xda\x51\xe1\xcf\x8c\x8e\x4a\xf4\xe5\xd1\x5c\x61\x0c\x42\xcc\x54\xb9\xc9\x79\x67\x44\x62\xad\xc7\xaf\x18\x8d\x4f\xd6\x46\x3a\x84\xe0\x69\x4a\x80\x7b\xea\x77\xca\x7f\x6d\xcf\xe2\x29\xca\xa2\x18\xb9\x8c\xe3\x03\x3a\x67\xcf\x5e\xf5\xf7\x46\x51\x73\x11\x52\xd5\xf1\xea\x5d\xb1\x51\x37\x59\xe6\xbb\x97\x63\x2c\xa9\x7a\x7c\xaf\x50\x4a\x66\x04\x78\xdb\x81\xa8\x00\x76\xcd\x39\xe3\x3b\x17\x53\x12\x49\x25\x7a\x2c\x76\x98\x28\x2d\x37\x5d\xb1\xa4\xb8\x35\x41\xed\x4c\xb2\xa8\x0f\xba\x8d\xf9\xc3\xc5\xfb\x76\x6e\xff\xa6\xf0\x33\x48\xaf\xef\xb5\x95\xaf\x9a\x95\x39\x4a\x4d\x07\xda\x1c\xf5\x91\xd9\xc3\x84\xfc\xa1\x35\xc2\xce\xb4\x1f\x17\x7f\x1f\xe4\x5d\xf4\x13\xf0\x5e\xf0\x75\x41\xf1\x27\x2c\x5b\x56\xb5\xb3\xf0\xde\xd7\x20\xe0\xf0\x9c\x2f\x2e\x99\x10\x7f\x2e\x55\xc4\x46\x2e\xf7\x1e\x94\x67\xcd\x45\x2d\x38\x6b\xde\x91\x7b\xa8\xd8\x2a\x99\x32\xc3\xa2\x5f\xd7\x32\x24\x42\x5a\x26\x2b\xbc\xe0\x62\x69\xf5\xcb\xef\x6c\x69\xe1\x27\x6f\x0b\x3f\x6d\x9c\xf5\x18\x95\xe6\x9b\xd9\x51\xe9\x6f\x13\x60\x23\xf5\x95\x8f\x8c\x91\x2a\xb2\x6b\xc8\x92\x84\xd0\xe4\xcc\x23\xb0\xde\x86\x11\x4b\x09\xf6\xfa\xf2\x54\xbc\xf9\x39\x5c\x39\x41\x1f\xcb\x95\xd5\xfd\x36\x75\xfa\xfa\x39\x52\x51\x4a\x84\xd7\x65\xca\x84\xe5\x04\x77\x39\x75\x9a\x02\x3a\xfa\xdf\x6b\xe7\xbf\x00\x00\x00\xff\xff\x94\xaf\x2f\x04\x08\x2b\x00\x00") +var _resourcesAwswhitelistJson = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xec\x59\x4b\x73\xe2\x38\x10\xbe\xf3\x2b\x5c\x3e\xa7\xf6\xb2\xb7\xdc\x18\xf2\xa8\xd4\x92\x09\x09\xcc\xe6\xb0\xb5\x45\xc9\x52\xe3\x68\x62\x4b\x8e\x1e\x4c\xa8\xad\xfc\xf7\x2d\x49\x86\x80\x31\xb6\x90\x43\x86\x64\xe6\x30\x35\xc1\x6a\xab\xbf\xfe\xfa\xa1\x6e\xf9\xbf\x5e\x14\xc5\x12\xc4\x9c\x62\x90\xf1\x69\x64\x7e\x47\x51\x4c\x16\x0c\xe5\x9c\x24\xab\x27\x51\x14\xf3\x02\x04\x52\x94\x33\xb9\xf6\x34\x8a\xe2\x2f\x48\xe1\x87\x4b\x50\x57\x0a\xf2\x8d\x95\x28\x8a\x05\x3c\x69\x90\x6a\x4a\x40\x62\x41\x0b\xc5\x85\xac\x88\x44\x51\x7c\xe7\x84\xcc\xfb\xdb\xab\x51\x14\xe7\xa8\x88\x4f\x23\x25\x34\x9c\x54\x97\x52\x50\xd3\x47\x58\xc8\x5d\xeb\x02\x18\xca\x61\xaa\x78\x7c\x1a\xc5\x0a\x25\x19\x4c\xcd\x03\x19\x6f\x08\xbe\xac\xfd\x7a\x39\xd9\xc4\x2f\x0b\xce\x24\x4c\x0b\x24\x50\x0e\x0a\x2c\xfe\x7f\x36\xf1\x0f\x38\x93\x3a\x07\x32\x40\x05\xc2\x54\x2d\xd6\x37\xff\xb7\x57\xb3\xb1\xa3\xec\x5e\x50\x05\xbf\x49\x5b\x92\xb6\x09\x23\x36\x86\x0d\x78\x96\x01\x36\x21\x77\x0d\x4a\x50\x2c\xdb\x99\x1d\x08\x40\x0a\x26\x06\xf4\x2e\x5a\x9b\x50\x5d\x66\x3c\x41\xd9\x18\x30\x67\x04\x89\xc5\x15\x23\xf0\x0c\xb2\x8a\x6d\xc8\x71\xbb\xd0\x48\xf0\x39\x95\x94\x33\x20\x93\x07\xc1\x75\xfa\x50\x68\x55\x15\xb2\x40\xbf\xa2\x1c\xda\x2d\x3b\x83\x0c\x9a\xe3\xa5\xc9\xb0\x7a\x45\x47\xe3\x36\x67\x5c\xb0\xdb\xf6\xa2\xd1\x24\x55\xf2\x2e\xba\x5a\x8a\x62\x1b\xcf\x54\x2a\x60\xea\x0e\x10\xa9\x89\xad\xef\x8e\xe1\xf3\xe7\x42\x80\x34\x61\xe6\x17\x5a\xef\x51\xdd\x86\x54\x2a\xab\xbd\x5a\x98\xbc\x2c\x3f\x7f\xc6\x99\x96\x74\x0e\x63\x85\x84\x7a\xb5\xa2\x9a\x83\x34\xa7\xca\xc3\xb4\xc6\x22\xba\xda\xbd\xb6\x84\x66\x54\xaa\xa6\x1a\x8a\xb9\x66\x3b\x05\x6a\x8a\xa8\x93\xdf\x5d\x44\x6b\xc9\x1c\xe9\xe0\x18\x3a\xf2\x9c\xbf\xd5\x20\x16\x21\x76\xf5\x95\x12\x34\xd1\x0a\xe4\x84\x5f\xc2\x56\x4d\x6d\x4e\x1d\x5b\xad\x77\x07\x54\x40\xa2\x8d\x31\x62\x76\xd7\x0b\x2e\x7e\x20\xb1\xa5\x71\x0c\x86\x99\xe3\x49\x4f\x83\xf7\x33\xd0\x0e\x69\x0e\x6c\xeb\xd5\x36\xb6\xab\x0b\x5c\x99\xa3\xdc\x6e\x25\x0f\x9c\x27\x03\x9b\xff\x35\xd1\xc3\x80\x0c\xaa\xb5\xa1\xde\x77\xdf\x0a\x82\x3e\x6d\x13\xe0\x8c\x0b\x3e\x98\x57\xf1\x79\x06\x33\xca\xa8\x9b\x54\x4e\xda\xfb\x3b\xa7\xf6\x30\xfd\x5b\x6f\xfd\xff\xd2\xd6\x58\x3e\x49\x9f\xb9\xaa\x4f\xc8\x08\x44\x4e\x5d\xf4\x07\x10\x32\x44\x09\x64\x55\xc4\xb7\x1a\x34\x7c\x13\x99\x47\x2b\xfd\x80\x58\x0a\xd7\x20\x25\x4a\xe1\x6f\x2a\x69\x42\x33\xe3\xec\x00\x24\x2b\xa5\x15\x30\xaf\xbb\x4e\x68\x0e\x5c\x7b\x64\xc0\x0e\x54\x76\xa2\xea\x04\xad\x5b\x4a\x5c\x20\x9a\x01\xf1\x9d\x4f\xac\xd2\x6e\x35\xb8\xd6\xaf\xfb\x4c\x12\x25\x85\x6f\xc6\x59\xbb\xaa\x8f\xe2\x23\x07\x3a\xd8\x47\xfe\xec\x5c\x82\xb2\xc2\x6b\x5e\xfd\x79\xec\xac\x81\xf0\x06\x6e\xb4\x86\x22\xae\x3b\x8d\xed\xc2\xcd\x0f\x06\xa2\x7f\x3f\xee\x63\xdb\x30\x5f\x91\x8e\x86\xf9\xfb\xc3\x0c\x2e\x67\x80\xc8\x10\x94\x02\x31\xe6\x5a\x60\x17\x06\x3f\xd3\x2f\xcb\x6d\x3c\xdc\x62\xf0\x77\xc4\x6b\xbc\x32\x12\x30\xa3\xcf\x5d\x67\xab\x57\xdc\x07\x1d\xad\x9e\x8c\x9a\xd0\xd1\x4a\xa4\xef\x91\xe6\x77\x80\x81\xce\xbb\x14\xdc\x55\x6e\xba\x59\xb5\x92\x35\xd7\xe8\xf9\xab\xce\x13\x10\x37\xb3\x52\xc7\xb6\x88\x7b\xde\xbc\x8f\xff\x29\x5d\x11\xb8\x47\x54\x99\x25\xd7\x57\xf9\xb4\xd1\x8d\x91\xb3\x32\xe2\xa0\x81\x93\x3b\x2d\x61\xa1\x73\x07\x39\x9f\x43\xb7\xf6\xcc\x3f\x80\xc6\xc0\x48\x87\xe8\x39\x83\x0c\x2d\x96\xbe\xf1\x69\x07\x4f\xea\x34\xf8\xb8\x6c\xe7\x41\x66\x85\xde\xea\x4a\x7a\xe9\x39\xb4\xd4\x76\x80\xeb\xe9\xd2\xa0\x2b\x8f\x76\x61\xcd\x3b\x07\xed\x70\x3c\xdc\x70\xce\x94\xa0\xc7\x92\x38\x01\x99\x5f\x76\x68\x07\x85\x3f\xb3\x3a\x6a\xd1\x57\x47\x73\x8d\x31\x48\x39\xd3\xd5\x26\xe7\x8d\x11\xc9\x95\x9e\xb0\x62\x34\x7e\xb7\x36\xd2\x23\x04\xdf\xa7\x04\xf8\xa7\x7e\xaf\xfa\xd7\xe6\x2c\x9e\xa1\x3c\x21\xc8\x67\x1c\xbf\x62\x73\xfe\x18\x54\x7f\x2f\x34\xb3\x17\x21\x75\x1d\xaf\xd9\x15\x5b\x75\x93\x45\xb1\x7d\x39\xc6\xd3\xba\xc7\xb7\x1a\x65\x74\x46\x41\x74\x1d\x88\x4a\x60\xe7\x42\x70\xb1\x75\x31\xa5\x90\xd2\x72\xc0\x89\xc7\x44\xe9\xb8\xe9\xcb\x05\xc3\x9d\x09\xea\x66\x92\x43\xbd\xd7\x6d\xcc\x9f\x3e\xde\x77\x73\xfb\x17\x8d\x1f\x41\x05\x7d\xaf\xad\x7d\xd5\xae\xcc\x51\x66\x3b\xd0\xf6\xa8\x4f\xec\x1e\x36\xe4\xf7\xad\x11\x6e\xa6\xfd\xb8\xf8\x2f\x41\xdd\x24\xdf\x01\xef\x04\xdf\x14\x14\x7f\xc1\xa2\x63\x55\x3b\x0a\xef\xfd\x1a\x04\xec\x9f\xf3\xe5\x25\x13\x12\x8f\x95\x8a\xd8\xca\xe5\xce\x83\xf2\xa8\xb9\x68\x04\xe7\xcc\x3b\x70\x0f\x45\x9c\x92\x29\xb7\x2c\x86\x75\x2d\x43\x2a\x95\x63\xb2\xc6\x0b\x3e\x96\xd6\xbf\xfc\xc6\x96\x96\x7e\x0a\xb6\xf0\xd3\xc6\xd9\x80\x33\x65\xbf\x99\x1d\x94\xfe\x2e\x01\x36\xd2\xbf\xf2\x91\x31\xd2\x65\x76\x0d\x79\x9a\x52\x96\x1e\x79\x04\x36\xdb\x30\xe2\x19\xc5\x41\x5f\x9e\xca\x37\x3f\x87\x2b\x27\xe8\x63\xb9\xb2\xbe\xdf\x66\x5e\x5f\x3f\x47\x3a\xc9\xa8\x0c\xba\x4c\x99\xf0\x82\xe2\xbe\x60\xfb\x4c\x01\x42\x33\x45\x73\xf8\x43\xa2\x14\x72\x64\x1a\x09\xef\x91\xf0\x9c\x91\x82\x53\x16\x54\x66\x96\xef\x7a\x7f\x42\xee\x99\x7f\x2f\xbd\xff\x03\x00\x00\xff\xff\x0e\x2e\x89\x4c\xb7\x2b\x00\x00") func resourcesAwswhitelistJsonBytes() ([]byte, error) { return bindataRead( @@ -85,8 +86,8 @@ func resourcesAwswhitelistJson() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "resources/AWSWhitelist.json", size: 11016, mode: os.FileMode(420), modTime: time.Unix(1562887628, 0)} - a := &asset{bytes: bytes, info: info} + info := bindataFileInfo{name: "resources/AWSWhitelist.json", size: 11191, mode: os.FileMode(0644), modTime: time.Unix(1573699810, 0)} + a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xc0, 0xee, 0x6f, 0x3d, 0xd1, 0x64, 0x48, 0xfb, 0xd4, 0xf7, 0x9, 0xda, 0x78, 0xfe, 0x46, 0xd, 0x67, 0xa6, 0xb3, 0xa7, 0x22, 0x68, 0xee, 0x2, 0x3c, 0x30, 0xe4, 0x51, 0xa6, 0xe1, 0x9b, 0x5a}} return a, nil } @@ -105,8 +106,8 @@ func resourcesDefaultsamplingrulesJson() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "resources/DefaultSamplingRules.json", size: 97, mode: os.FileMode(420), modTime: time.Unix(1562887430, 0)} - a := &asset{bytes: bytes, info: info} + info := bindataFileInfo{name: "resources/DefaultSamplingRules.json", size: 97, mode: os.FileMode(0644), modTime: time.Unix(1573698794, 0)} + a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xce, 0x2c, 0x7, 0xe9, 0x6a, 0x70, 0x3e, 0xab, 0x1, 0xcb, 0x1d, 0xc, 0x29, 0x18, 0x89, 0xf0, 0x34, 0xa, 0x26, 0x20, 0x2a, 0x2c, 0x60, 0xc3, 0xe8, 0x8c, 0x44, 0x23, 0xf8, 0xb9, 0x27, 0x69}} return a, nil } @@ -125,8 +126,8 @@ func resourcesExamplesamplingrulesJson() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "resources/ExampleSamplingRules.json", size: 609, mode: os.FileMode(420), modTime: time.Unix(1562887430, 0)} - a := &asset{bytes: bytes, info: info} + info := bindataFileInfo{name: "resources/ExampleSamplingRules.json", size: 609, mode: os.FileMode(0644), modTime: time.Unix(1573698794, 0)} + a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xd2, 0xb2, 0x3e, 0xf4, 0x1b, 0x71, 0xde, 0x47, 0x26, 0x3d, 0xba, 0xd4, 0x75, 0xf1, 0xb2, 0x19, 0x63, 0x88, 0x1d, 0x1b, 0x8b, 0xda, 0x21, 0xaf, 0x67, 0xcd, 0x20, 0x27, 0x59, 0x9c, 0xe1, 0x6c}} return a, nil } @@ -134,8 +135,8 @@ func resourcesExamplesamplingrulesJson() (*asset, error) { // It returns an error if the asset could not be found or // could not be loaded. func Asset(name string) ([]byte, error) { - cannonicalName := strings.Replace(name, "\\", "/", -1) - if f, ok := _bindata[cannonicalName]; ok { + canonicalName := strings.Replace(name, "\\", "/", -1) + if f, ok := _bindata[canonicalName]; ok { a, err := f() if err != nil { return nil, fmt.Errorf("Asset %s can't read by error: %v", name, err) @@ -145,6 +146,12 @@ func Asset(name string) ([]byte, error) { return nil, fmt.Errorf("Asset %s not found", name) } +// AssetString returns the asset contents as a string (instead of a []byte). +func AssetString(name string) (string, error) { + data, err := Asset(name) + return string(data), err +} + // MustAsset is like Asset but panics when Asset would return an error. // It simplifies safe initialization of global variables. func MustAsset(name string) []byte { @@ -156,12 +163,18 @@ func MustAsset(name string) []byte { return a } +// MustAssetString is like AssetString but panics when Asset would return an +// error. It simplifies safe initialization of global variables. +func MustAssetString(name string) string { + return string(MustAsset(name)) +} + // AssetInfo loads and returns the asset info for the given name. // It returns an error if the asset could not be found or // could not be loaded. func AssetInfo(name string) (os.FileInfo, error) { - cannonicalName := strings.Replace(name, "\\", "/", -1) - if f, ok := _bindata[cannonicalName]; ok { + canonicalName := strings.Replace(name, "\\", "/", -1) + if f, ok := _bindata[canonicalName]; ok { a, err := f() if err != nil { return nil, fmt.Errorf("AssetInfo %s can't read by error: %v", name, err) @@ -171,6 +184,33 @@ func AssetInfo(name string) (os.FileInfo, error) { return nil, fmt.Errorf("AssetInfo %s not found", name) } +// AssetDigest returns the digest of the file with the given name. It returns an +// error if the asset could not be found or the digest could not be loaded. +func AssetDigest(name string) ([sha256.Size]byte, error) { + canonicalName := strings.Replace(name, "\\", "/", -1) + if f, ok := _bindata[canonicalName]; ok { + a, err := f() + if err != nil { + return [sha256.Size]byte{}, fmt.Errorf("AssetDigest %s can't read by error: %v", name, err) + } + return a.digest, nil + } + return [sha256.Size]byte{}, fmt.Errorf("AssetDigest %s not found", name) +} + +// Digests returns a map of all known files and their checksums. +func Digests() (map[string][sha256.Size]byte, error) { + mp := make(map[string][sha256.Size]byte, len(_bindata)) + for name := range _bindata { + a, err := _bindata[name]() + if err != nil { + return nil, err + } + mp[name] = a.digest + } + return mp, nil +} + // AssetNames returns the names of the assets. func AssetNames() []string { names := make([]string, 0, len(_bindata)) @@ -182,7 +222,7 @@ func AssetNames() []string { // _bindata is a table, holding each asset generator, mapped to its name. var _bindata = map[string]func() (*asset, error){ - "resources/AWSWhitelist.json": resourcesAwswhitelistJson, + "resources/AWSWhitelist.json": resourcesAwswhitelistJson, "resources/DefaultSamplingRules.json": resourcesDefaultsamplingrulesJson, "resources/ExampleSamplingRules.json": resourcesExamplesamplingrulesJson, } @@ -196,15 +236,15 @@ var _bindata = map[string]func() (*asset, error){ // img/ // a.png // b.png -// then AssetDir("data") would return []string{"foo.txt", "img"} -// AssetDir("data/img") would return []string{"a.png", "b.png"} -// AssetDir("foo.txt") and AssetDir("notexist") would return an error +// then AssetDir("data") would return []string{"foo.txt", "img"}, +// AssetDir("data/img") would return []string{"a.png", "b.png"}, +// AssetDir("foo.txt") and AssetDir("notexist") would return an error, and // AssetDir("") will return []string{"data"}. func AssetDir(name string) ([]string, error) { node := _bintree if len(name) != 0 { - cannonicalName := strings.Replace(name, "\\", "/", -1) - pathList := strings.Split(cannonicalName, "/") + canonicalName := strings.Replace(name, "\\", "/", -1) + pathList := strings.Split(canonicalName, "/") for _, p := range pathList { node = node.Children[p] if node == nil { @@ -226,15 +266,16 @@ type bintree struct { Func func() (*asset, error) Children map[string]*bintree } + var _bintree = &bintree{nil, map[string]*bintree{ "resources": &bintree{nil, map[string]*bintree{ - "AWSWhitelist.json": &bintree{resourcesAwswhitelistJson, map[string]*bintree{}}, + "AWSWhitelist.json": &bintree{resourcesAwswhitelistJson, map[string]*bintree{}}, "DefaultSamplingRules.json": &bintree{resourcesDefaultsamplingrulesJson, map[string]*bintree{}}, "ExampleSamplingRules.json": &bintree{resourcesExamplesamplingrulesJson, map[string]*bintree{}}, }}, }} -// RestoreAsset restores an asset under the given directory +// RestoreAsset restores an asset under the given directory. func RestoreAsset(dir, name string) error { data, err := Asset(name) if err != nil { @@ -252,14 +293,10 @@ func RestoreAsset(dir, name string) error { if err != nil { return err } - err = os.Chtimes(_filePath(dir, name), info.ModTime(), info.ModTime()) - if err != nil { - return err - } - return nil + return os.Chtimes(_filePath(dir, name), info.ModTime(), info.ModTime()) } -// RestoreAssets restores an asset under the given directory recursively +// RestoreAssets restores an asset under the given directory recursively. func RestoreAssets(dir, name string) error { children, err := AssetDir(name) // File @@ -277,7 +314,6 @@ func RestoreAssets(dir, name string) error { } func _filePath(dir, name string) string { - cannonicalName := strings.Replace(name, "\\", "/", -1) - return filepath.Join(append([]string{dir}, strings.Split(cannonicalName, "/")...)...) + canonicalName := strings.Replace(name, "\\", "/", -1) + return filepath.Join(append([]string{dir}, strings.Split(canonicalName, "/")...)...) } -