├── .circleci └── config.yml ├── LICENSE ├── README.md ├── docker-compose.yaml ├── go.mod ├── go.sum ├── go └── v1beta1 │ ├── main │ └── main.go │ └── storage │ ├── filter.go │ ├── filter_test.go │ ├── pgsqlstore.go │ ├── pgsqlstore_functional_test.go │ ├── pgsqlstore_test.go │ └── queries.go ├── postgres ├── Dockerfile └── init.sh └── server ├── Dockerfile ├── config.yaml ├── start.sh └── wait.sh /.circleci/config.yml: -------------------------------------------------------------------------------- 1 | # Check https://circleci.com/docs/2.0/language-go/ for more details 2 | version: 2 3 | jobs: 4 | build: 5 | machine: true 6 | steps: 7 | - checkout 8 | - run: 9 | name: Start Grafeas with PostreSQL and verify it is working 10 | command: | 11 | docker-compose up -d 12 | docker ps -all 13 | sleep 30 14 | curl --retry 10 --retry-delay 5 -v http://localhost:8080/v1beta1/projects > /tmp/a 15 | cat /tmp/a 16 | workflows: 17 | version: 2 18 | commit: 19 | jobs: 20 | - build 21 | nightly: 22 | triggers: 23 | - schedule: 24 | # Every day at midnight. 25 | cron: "0 0 * * *" 26 | filters: 27 | branches: 28 | only: 29 | - master 30 | jobs: 31 | - build 32 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright 2017 The Grafeas Authors 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # grafeas-pgsql 2 | 3 | [Grafeas](https://github.com/grafeas/grafeas) with PostgreSQL backend as a Docker Compose, provides a standalone instance of the Grafeas server with PostgreSQL as the storage layer. 4 | 5 | ## Running Standalone Grafeas with PostgreSQL 6 | 7 | To start the standalone instance of Grafeas with PostgreSQL, follow these steps: 8 | 9 | 1. Install [Docker Compose](https://docs.docker.com/compose/install/). 10 | 1. Pull the Grafeas Server image: 11 | 12 | ```bash 13 | docker pull us.gcr.io/grafeas/grafeas-server:v0.1.0 14 | ``` 15 | 16 | 1. Build the images and run the containers: 17 | 18 | ```bash 19 | docker-compose build && docker-compose up 20 | ``` 21 | 22 | 1. Ensure you can reach the server: 23 | 24 | ```bash 25 | curl http://localhost:8080/v1beta1/projects 26 | ``` 27 | 28 | ## Support 29 | 30 | Please refer to [Grafeas Support](https://github.com/grafeas/grafeas#support) page. 31 | 32 | ## Contributing 33 | 34 | Pull requests and feature requests as GH issues are welcome! 35 | 36 | ## License 37 | Grafeas is under the Apache 2.0 license. See the [LICENSE](LICENSE) file for details. 38 | -------------------------------------------------------------------------------- /docker-compose.yaml: -------------------------------------------------------------------------------- 1 | version: '3' 2 | services: 3 | server: 4 | build: 'server' 5 | ports: 6 | - '8080:8080' 7 | depends_on: 8 | - db 9 | db: 10 | build: 'postgres' 11 | environment: 12 | POSTGRES_DB: postgres 13 | POSTGRES_USER: postgres 14 | POSTGRES_PASSWORD: password -------------------------------------------------------------------------------- /go.mod: -------------------------------------------------------------------------------- 1 | module github.com/grafeas/grafeas-pgsql 2 | 3 | go 1.18 4 | 5 | require ( 6 | github.com/DATA-DOG/go-sqlmock v1.5.0 7 | github.com/fernet/fernet-go v0.0.0-20191111064656-eff2850e6001 8 | github.com/google/uuid v1.3.0 9 | github.com/grafeas/grafeas v0.2.1 10 | github.com/lib/pq v1.10.6 11 | golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4 12 | google.golang.org/genproto v0.0.0-20220118154757-00ab72f36ad5 13 | google.golang.org/grpc v1.47.0 14 | google.golang.org/protobuf v1.28.0 15 | ) 16 | 17 | require ( 18 | github.com/antlr/antlr4 v0.0.0-20201029161626-9a95f0cc3d7c // indirect 19 | github.com/boltdb/bolt v1.3.1 // indirect 20 | github.com/cockroachdb/cmux v0.0.0-20170110192607-30d10be49292 // indirect 21 | github.com/fsnotify/fsnotify v1.4.7 // indirect 22 | github.com/golang/protobuf v1.5.2 // indirect 23 | github.com/google/go-cmp v0.5.7 // indirect 24 | github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.3 // indirect 25 | github.com/hashicorp/hcl v1.0.0 // indirect 26 | github.com/magiconair/properties v1.8.1 // indirect 27 | github.com/mitchellh/mapstructure v1.1.2 // indirect 28 | github.com/pelletier/go-toml v1.2.0 // indirect 29 | github.com/rs/cors v1.7.0 // indirect 30 | github.com/spf13/afero v1.1.2 // indirect 31 | github.com/spf13/cast v1.3.0 // indirect 32 | github.com/spf13/jwalterweatherman v1.0.0 // indirect 33 | github.com/spf13/pflag v1.0.3 // indirect 34 | github.com/spf13/viper v1.7.1 // indirect 35 | github.com/subosito/gotenv v1.2.0 // indirect 36 | golang.org/x/sys v0.0.0-20210510120138-977fb7262007 // indirect 37 | golang.org/x/text v0.3.5 // indirect 38 | golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect 39 | gopkg.in/ini.v1 v1.51.0 // indirect 40 | gopkg.in/yaml.v2 v2.4.0 // indirect 41 | ) 42 | -------------------------------------------------------------------------------- /go.sum: -------------------------------------------------------------------------------- 1 | cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= 2 | cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= 3 | cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= 4 | cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= 5 | cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= 6 | cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= 7 | cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= 8 | cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= 9 | cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4= 10 | cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M= 11 | cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc= 12 | cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk= 13 | cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs= 14 | cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc= 15 | cloud.google.com/go v0.63.0/go.mod h1:GmezbQc7T2snqkEXWfZ0sy0VfkB/ivI2DdtJL2DEmlg= 16 | cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= 17 | cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= 18 | cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= 19 | cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= 20 | cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= 21 | cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= 22 | cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= 23 | cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= 24 | cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= 25 | cloud.google.com/go/firestore v1.1.0/go.mod h1:ulACoGHTpvq5r8rxGJ4ddJZBZqakUQqClKRT5SZwBmk= 26 | cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= 27 | cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= 28 | cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= 29 | cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU= 30 | cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= 31 | cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= 32 | cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= 33 | cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= 34 | cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= 35 | dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= 36 | github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= 37 | github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= 38 | github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= 39 | github.com/DATA-DOG/go-sqlmock v1.5.0 h1:Shsta01QNfFxHCfpW6YH2STWB0MudeXXEWMr20OEh60= 40 | github.com/DATA-DOG/go-sqlmock v1.5.0/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM= 41 | github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= 42 | github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= 43 | github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= 44 | github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= 45 | github.com/antlr/antlr4 v0.0.0-20201029161626-9a95f0cc3d7c h1:j/C2kxPfyE0d87/ggAjIsCV5Cdkqmjb+O0W8W+1J+IY= 46 | github.com/antlr/antlr4 v0.0.0-20201029161626-9a95f0cc3d7c/go.mod h1:T7PbCXFs94rrTttyxjbyT5+/1V8T2TYDejxUfHJjw1Y= 47 | github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= 48 | github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= 49 | github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= 50 | github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= 51 | github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= 52 | github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= 53 | github.com/bketelsen/crypt v0.0.3-0.20200106085610-5cbc8cc4026c/go.mod h1:MKsuJmJgSg28kpZDP6UIiPt0e0Oz0kqKNGyRaWEPv84= 54 | github.com/boltdb/bolt v1.3.1 h1:JQmyP4ZBrce+ZQu0dY660FMfatumYDLun9hBCUVIkF4= 55 | github.com/boltdb/bolt v1.3.1/go.mod h1:clJnj/oiGkjum5o1McbSZDSLxVThjynRyGBgiAx27Ps= 56 | github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= 57 | github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= 58 | github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= 59 | github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= 60 | github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= 61 | github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= 62 | github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= 63 | github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= 64 | github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= 65 | github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= 66 | github.com/cncf/xds/go v0.0.0-20210312221358-fbca930ec8ed/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= 67 | github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= 68 | github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= 69 | github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= 70 | github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= 71 | github.com/cockroachdb/cmux v0.0.0-20170110192607-30d10be49292 h1:dzj1/xcivGjNPwwifh/dWTczkwcuqsXXFHY1X/TZMtw= 72 | github.com/cockroachdb/cmux v0.0.0-20170110192607-30d10be49292/go.mod h1:qRiX68mZX1lGBkTWyp3CLcenw9I94W2dLeRvMzcn9N4= 73 | github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= 74 | github.com/coreos/etcd v3.3.13+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= 75 | github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= 76 | github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= 77 | github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= 78 | github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= 79 | github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= 80 | github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= 81 | github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= 82 | github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= 83 | github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= 84 | github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= 85 | github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= 86 | github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= 87 | github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ= 88 | github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= 89 | github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1/go.mod h1:KJwIaB5Mv44NWtYuAOFCVOjcI94vtpEz2JU/D2v6IjE= 90 | github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= 91 | github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= 92 | github.com/fernet/fernet-go v0.0.0-20191111064656-eff2850e6001 h1:/UMxx5lGDg30aioUL9e7xJnbJfJeX7vhcm57fa5udaI= 93 | github.com/fernet/fernet-go v0.0.0-20191111064656-eff2850e6001/go.mod h1:2H9hjfbpSMHwY503FclkV/lZTBh2YlOmLLSda12uL8c= 94 | github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I= 95 | github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= 96 | github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= 97 | github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= 98 | github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= 99 | github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= 100 | github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= 101 | github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= 102 | github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= 103 | github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= 104 | github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= 105 | github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= 106 | github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= 107 | github.com/golang/glog v1.0.0 h1:nfP3RFugxnNRyKgeWd4oI1nYvXpxrx8ck8ZrcizshdQ= 108 | github.com/golang/glog v1.0.0/go.mod h1:EWib/APOK0SL3dFbYqvxE3UYd8E6s1ouQ7iEp/0LWV4= 109 | github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= 110 | github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= 111 | github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= 112 | github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= 113 | github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= 114 | github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= 115 | github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= 116 | github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= 117 | github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= 118 | github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= 119 | github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= 120 | github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= 121 | github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= 122 | github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= 123 | github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= 124 | github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= 125 | github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk= 126 | github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= 127 | github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= 128 | github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= 129 | github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= 130 | github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= 131 | github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= 132 | github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= 133 | github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= 134 | github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= 135 | github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= 136 | github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= 137 | github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= 138 | github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= 139 | github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= 140 | github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= 141 | github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= 142 | github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= 143 | github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= 144 | github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= 145 | github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= 146 | github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= 147 | github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= 148 | github.com/google/go-cmp v0.5.7 h1:81/ik6ipDQS2aGcBfIN5dHDB36BwrStyeAQquSYCV4o= 149 | github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= 150 | github.com/google/logger v1.1.0/go.mod h1:w7O8nrRr0xufejBlQMI83MXqRusvREoJdaAxV+CoAB4= 151 | github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= 152 | github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= 153 | github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= 154 | github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= 155 | github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= 156 | github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= 157 | github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= 158 | github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= 159 | github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= 160 | github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= 161 | github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= 162 | github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= 163 | github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= 164 | github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= 165 | github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= 166 | github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 h1:EGx4pi6eqNxGaHF6qqu48+N2wcFQ5qg5FXgOdqsJ5d8= 167 | github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= 168 | github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= 169 | github.com/grafeas/grafeas v0.2.1 h1:Nnlhqxz7vJbKeZpIbwt2bgjWAXv7LyF0Fk0NYTC0StU= 170 | github.com/grafeas/grafeas v0.2.1/go.mod h1:JpYK420ve4jQ7KUjxZQ/Mh4B1a2oiQIwysff+oqXTnc= 171 | github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= 172 | github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= 173 | github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= 174 | github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= 175 | github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.3 h1:I8MsauTJQXZ8df8qJvEln0kYNc3bSapuaSsEsnFdEFU= 176 | github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.3/go.mod h1:lZdb/YAJUSj9OqrCHs2ihjtoO3+xK3G53wTYXFWRGDo= 177 | github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q= 178 | github.com/hashicorp/consul/sdk v0.1.1/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= 179 | github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= 180 | github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= 181 | github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= 182 | github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= 183 | github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= 184 | github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU= 185 | github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= 186 | github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4= 187 | github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= 188 | github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= 189 | github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90= 190 | github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= 191 | github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= 192 | github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= 193 | github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= 194 | github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= 195 | github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= 196 | github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= 197 | github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= 198 | github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= 199 | github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= 200 | github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= 201 | github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= 202 | github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= 203 | github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo= 204 | github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= 205 | github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= 206 | github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= 207 | github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= 208 | github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= 209 | github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= 210 | github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= 211 | github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= 212 | github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= 213 | github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= 214 | github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= 215 | github.com/lib/pq v1.8.0/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= 216 | github.com/lib/pq v1.10.6 h1:jbk+ZieJ0D7EVGJYpL9QTz7/YW6UHbmdnZWYyK5cdBs= 217 | github.com/lib/pq v1.10.6/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= 218 | github.com/magiconair/properties v1.8.1 h1:ZC2Vc7/ZFkGmsVC9KvOjumD+G5lXy2RtTKyzRKO2BQ4= 219 | github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= 220 | github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= 221 | github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= 222 | github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= 223 | github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= 224 | github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= 225 | github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= 226 | github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= 227 | github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS42BGNg= 228 | github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY= 229 | github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= 230 | github.com/mitchellh/mapstructure v1.1.2 h1:fmNYVwqnSfB9mZU6OS2O6GsXM+wcskZDuKQzvN1EDeE= 231 | github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= 232 | github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= 233 | github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= 234 | github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= 235 | github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= 236 | github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= 237 | github.com/pelletier/go-toml v1.2.0 h1:T5zMGML61Wp+FlcbWjRDT7yAxhJNAiPPLOFECq181zc= 238 | github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= 239 | github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= 240 | github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= 241 | github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= 242 | github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= 243 | github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= 244 | github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= 245 | github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= 246 | github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= 247 | github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= 248 | github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= 249 | github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= 250 | github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= 251 | github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= 252 | github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= 253 | github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= 254 | github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= 255 | github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= 256 | github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= 257 | github.com/rs/cors v1.7.0 h1:+88SsELBHx5r+hZ8TCkggzSstaWNbDvThkVK8H6f9ik= 258 | github.com/rs/cors v1.7.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= 259 | github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= 260 | github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= 261 | github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= 262 | github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d h1:zE9ykElWQ6/NYmHa3jpm/yHnI4xSofP+UP6SpjHcSeM= 263 | github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= 264 | github.com/smartystreets/goconvey v1.6.4 h1:fv0U8FUIMPNf1L9lnHLvLhgicrIVChEkdzIKYqbNC9s= 265 | github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= 266 | github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= 267 | github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= 268 | github.com/spf13/afero v1.1.2 h1:m8/z1t7/fwjysjQRYbP0RD+bUIF/8tJwPdEZsI83ACI= 269 | github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= 270 | github.com/spf13/cast v1.3.0 h1:oget//CVOEoFewqQxwr0Ej5yjygnqGkvggSE/gB35Q8= 271 | github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= 272 | github.com/spf13/jwalterweatherman v1.0.0 h1:XHEdyB+EcvlqZamSM4ZOMGlc93t6AcsBEu9Gc1vn7yk= 273 | github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= 274 | github.com/spf13/pflag v1.0.3 h1:zPAT6CGy6wXeQ7NtTnaTerfKOsV6V6F8agHXFiazDkg= 275 | github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= 276 | github.com/spf13/viper v1.7.1 h1:pM5oEahlgWv/WnHXpgbKz7iLIxRf65tye2Ci+XFK5sk= 277 | github.com/spf13/viper v1.7.1/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= 278 | github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= 279 | github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= 280 | github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= 281 | github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= 282 | github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= 283 | github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= 284 | github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= 285 | github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= 286 | github.com/subosito/gotenv v1.2.0 h1:Slr1R9HxAlEKefgq5jn9U+DnETlIUa6HfgEzj0g5d7s= 287 | github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= 288 | github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= 289 | github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= 290 | github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= 291 | github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= 292 | github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= 293 | go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= 294 | go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= 295 | go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= 296 | go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= 297 | go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= 298 | go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= 299 | go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= 300 | go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= 301 | go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= 302 | go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= 303 | golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= 304 | golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= 305 | golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= 306 | golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= 307 | golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= 308 | golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= 309 | golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= 310 | golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= 311 | golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= 312 | golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= 313 | golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= 314 | golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= 315 | golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= 316 | golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= 317 | golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= 318 | golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= 319 | golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= 320 | golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= 321 | golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= 322 | golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= 323 | golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= 324 | golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= 325 | golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= 326 | golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= 327 | golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= 328 | golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= 329 | golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= 330 | golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= 331 | golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= 332 | golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= 333 | golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= 334 | golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= 335 | golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= 336 | golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= 337 | golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= 338 | golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= 339 | golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= 340 | golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= 341 | golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= 342 | golang.org/x/net v0.0.0-20181023162649-9b4f9f5ad519/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= 343 | golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= 344 | golang.org/x/net v0.0.0-20181201002055-351d144fa1fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= 345 | golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= 346 | golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= 347 | golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= 348 | golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= 349 | golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= 350 | golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= 351 | golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= 352 | golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= 353 | golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= 354 | golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= 355 | golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= 356 | golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= 357 | golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= 358 | golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= 359 | golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= 360 | golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= 361 | golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= 362 | golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= 363 | golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= 364 | golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= 365 | golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= 366 | golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= 367 | golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= 368 | golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= 369 | golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= 370 | golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= 371 | golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4 h1:4nGaVu0QrbjT/AK2PRLuQfQuh6DJve+pELhqTdAj3x0= 372 | golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= 373 | golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= 374 | golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= 375 | golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= 376 | golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= 377 | golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= 378 | golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= 379 | golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 380 | golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 381 | golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 382 | golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 383 | golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 384 | golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 385 | golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 386 | golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 387 | golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 388 | golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 389 | golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 390 | golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 391 | golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 392 | golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 393 | golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 394 | golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 395 | golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 396 | golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 397 | golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 398 | golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 399 | golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 400 | golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 401 | golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 402 | golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 403 | golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 404 | golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 405 | golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 406 | golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 407 | golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 408 | golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 409 | golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 410 | golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 411 | golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 412 | golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 413 | golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 414 | golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 415 | golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 416 | golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 417 | golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 418 | golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 419 | golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 420 | golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 421 | golang.org/x/sys v0.0.0-20210510120138-977fb7262007 h1:gG67DSER+11cZvqIMb8S8bt0vZtiN6xWYARwirrOSfE= 422 | golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= 423 | golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= 424 | golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= 425 | golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= 426 | golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= 427 | golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= 428 | golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= 429 | golang.org/x/text v0.3.5 h1:i6eZZ+zk0SOf0xgBpEpPD18qWcJda6q1sxt3S0kzyUQ= 430 | golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= 431 | golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= 432 | golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= 433 | golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= 434 | golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= 435 | golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= 436 | golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= 437 | golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= 438 | golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= 439 | golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= 440 | golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= 441 | golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= 442 | golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= 443 | golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= 444 | golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= 445 | golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= 446 | golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= 447 | golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= 448 | golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= 449 | golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= 450 | golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= 451 | golang.org/x/tools v0.0.0-20191112195655-aa38f8e97acc/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= 452 | golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= 453 | golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= 454 | golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= 455 | golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= 456 | golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= 457 | golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= 458 | golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= 459 | golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= 460 | golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= 461 | golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= 462 | golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= 463 | golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= 464 | golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= 465 | golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= 466 | golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= 467 | golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= 468 | golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= 469 | golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= 470 | golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= 471 | golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= 472 | golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= 473 | golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= 474 | golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= 475 | golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= 476 | golang.org/x/tools v0.0.0-20200806022845-90696ccdc692/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= 477 | golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= 478 | golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= 479 | golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= 480 | golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= 481 | golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= 482 | golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= 483 | google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= 484 | google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= 485 | google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= 486 | google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= 487 | google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= 488 | google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= 489 | google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= 490 | google.golang.org/api v0.17.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= 491 | google.golang.org/api v0.18.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= 492 | google.golang.org/api v0.19.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= 493 | google.golang.org/api v0.20.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= 494 | google.golang.org/api v0.22.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= 495 | google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= 496 | google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= 497 | google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM= 498 | google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc= 499 | google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= 500 | google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= 501 | google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= 502 | google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= 503 | google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= 504 | google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= 505 | google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= 506 | google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= 507 | google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= 508 | google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= 509 | google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= 510 | google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= 511 | google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= 512 | google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= 513 | google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= 514 | google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= 515 | google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= 516 | google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= 517 | google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= 518 | google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= 519 | google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA= 520 | google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= 521 | google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= 522 | google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= 523 | google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= 524 | google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= 525 | google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= 526 | google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= 527 | google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= 528 | google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= 529 | google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= 530 | google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= 531 | google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= 532 | google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= 533 | google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= 534 | google.golang.org/genproto v0.0.0-20200806141610-86f49bd18e98/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= 535 | google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= 536 | google.golang.org/genproto v0.0.0-20220118154757-00ab72f36ad5 h1:zzNejm+EgrbLfDZ6lu9Uud2IVvHySPl8vQzf04laR5Q= 537 | google.golang.org/genproto v0.0.0-20220118154757-00ab72f36ad5/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= 538 | google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= 539 | google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= 540 | google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= 541 | google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= 542 | google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= 543 | google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= 544 | google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= 545 | google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= 546 | google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= 547 | google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= 548 | google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= 549 | google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= 550 | google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= 551 | google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= 552 | google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= 553 | google.golang.org/grpc v1.43.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= 554 | google.golang.org/grpc v1.47.0 h1:9n77onPX5F3qfFCqjy9dhn8PbNQsIKeVU04J9G7umt8= 555 | google.golang.org/grpc v1.47.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= 556 | google.golang.org/grpc/examples v0.0.0-20201112215255-90f1b3ee835b h1:NuxyvVZoDfHZwYW9LD4GJiF5/nhiSyP4/InTrvw9Ibk= 557 | google.golang.org/grpc/examples v0.0.0-20201112215255-90f1b3ee835b/go.mod h1:IBqQ7wSUJ2Ep09a8rMWFsg4fmI2r38zwsq8a0GgxXpM= 558 | google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= 559 | google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= 560 | google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= 561 | google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= 562 | google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= 563 | google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= 564 | google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= 565 | google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= 566 | google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= 567 | google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= 568 | google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= 569 | google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= 570 | google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= 571 | google.golang.org/protobuf v1.28.0 h1:w43yiav+6bVFTBQFZX0r7ipe9JQ1QsbMgHwbBziscLw= 572 | google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= 573 | gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= 574 | gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= 575 | gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= 576 | gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= 577 | gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= 578 | gopkg.in/ini.v1 v1.51.0 h1:AQvPpx3LzTDM0AjnIRlVFwFFGC+npRopjZxLJj6gdno= 579 | gopkg.in/ini.v1 v1.51.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= 580 | gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= 581 | gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= 582 | gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= 583 | gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= 584 | gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= 585 | gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= 586 | gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= 587 | gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= 588 | gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= 589 | gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= 590 | honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= 591 | honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= 592 | honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= 593 | honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= 594 | honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= 595 | honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= 596 | honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= 597 | rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= 598 | rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= 599 | rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= 600 | sigs.k8s.io/yaml v1.3.0/go.mod h1:GeOyir5tyXNByN85N/dRIT9es5UQNerPYEKK56eTBm8= 601 | -------------------------------------------------------------------------------- /go/v1beta1/main/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "log" 5 | 6 | "github.com/grafeas/grafeas/go/v1beta1/server" 7 | grafeasStorage "github.com/grafeas/grafeas/go/v1beta1/storage" 8 | 9 | "github.com/grafeas/grafeas-pgsql/go/v1beta1/storage" 10 | ) 11 | 12 | func main() { 13 | err := grafeasStorage.RegisterStorageTypeProvider("postgres", storage.PostgresqlStorageTypeProvider) 14 | if err != nil { 15 | log.Fatalf("Failed to registering postgres storage provider, %s", err) 16 | } 17 | 18 | err = server.StartGrafeas() 19 | if err != nil { 20 | log.Fatalf("Failed to start Grafeas server, %s", err) 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /go/v1beta1/storage/filter.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Grafeas Authors. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | package storage 16 | 17 | import ( 18 | "fmt" 19 | "log" 20 | "strings" 21 | 22 | expr "github.com/grafeas/grafeas/cel" 23 | "github.com/grafeas/grafeas/go/filtering/common" 24 | "github.com/grafeas/grafeas/go/filtering/operators" 25 | "github.com/grafeas/grafeas/go/filtering/parser" 26 | ) 27 | 28 | type FilterSQL struct { 29 | selects int 30 | } 31 | 32 | func (fs *FilterSQL) sqlFromCall(funcName string, args []*expr.Expr) string { 33 | var sqlOp string 34 | switch funcName { 35 | case operators.Equals: 36 | sqlOp = "=" 37 | case operators.Greater: 38 | sqlOp = ">" 39 | case operators.GreaterEquals: 40 | sqlOp = ">=" 41 | case operators.Less: 42 | sqlOp = "<" 43 | case operators.LessEquals: 44 | sqlOp = "<=" 45 | case operators.NotEquals: 46 | sqlOp = "!=" 47 | case operators.LogicalAnd: 48 | sqlOp = "AND" 49 | case operators.LogicalOr: 50 | sqlOp = "OR" 51 | case operators.Index: 52 | sqlOp = "[" 53 | default: 54 | sqlOp = "" 55 | } 56 | var argNames []string 57 | for _, arg := range args { 58 | argNames = append(argNames, fs.makeSQL(arg)) 59 | } 60 | if sqlOp == "[" { 61 | return fmt.Sprintf("%s[%s]", argNames[0], argNames[1]) 62 | } else if sqlOp != "" { 63 | return fmt.Sprintf("(%s %s %s)", argNames[0], sqlOp, argNames[1]) 64 | } 65 | return fmt.Sprintf("%s(%s)", funcName, strings.Join(argNames, ", ")) 66 | } 67 | 68 | func (fs *FilterSQL) sqlFromSelect(selectNode *expr.Expr_Select) string { 69 | operand := fs.makeSQL(selectNode.GetOperand()) 70 | field := selectNode.GetField() 71 | return fmt.Sprintf("%s.%s", operand, field) 72 | } 73 | 74 | func (fs *FilterSQL) getConstantValue(constExpr *expr.Constant) string { 75 | switch constExpr.GetConstantKind().(type) { 76 | case *expr.Constant_Int64Value: 77 | return fmt.Sprintf("%d", constExpr.GetInt64Value()) 78 | case *expr.Constant_Uint64Value: 79 | return fmt.Sprintf("%d", constExpr.GetUint64Value()) 80 | case *expr.Constant_DoubleValue: 81 | return fmt.Sprintf("%f", constExpr.GetDoubleValue()) 82 | case *expr.Constant_StringValue: 83 | return fmt.Sprintf("'%s'", constExpr.GetStringValue()) 84 | } 85 | return "NO CONST" 86 | } 87 | 88 | func (fs *FilterSQL) makeSQL(node *expr.Expr) string { 89 | switch node.GetExprKind().(type) { 90 | case *expr.Expr_CallExpr: 91 | funcNode := *node.GetCallExpr() 92 | return fs.sqlFromCall(funcNode.Function, funcNode.Args) 93 | case *expr.Expr_SelectExpr: 94 | selectNode := *node.GetSelectExpr() 95 | fs.selects++ 96 | retStr := fs.sqlFromSelect(&selectNode) 97 | fs.selects-- 98 | if fs.selects == 0 { 99 | spl := strings.Split(retStr, ".") 100 | retVal := "data" 101 | sep := "->'" 102 | sep2 := "->>'" 103 | for i := 0; i < len(spl); i++ { 104 | if i != len(spl)-1 { 105 | retVal = retVal + sep + spl[i] + "'" 106 | } else { 107 | retVal = retVal + sep2 + spl[i] + "'" 108 | } 109 | } 110 | 111 | //return "data->'$." + ret_str + "'" 112 | //return "data->'" + ret_str + "'" 113 | return retVal 114 | } 115 | return retStr 116 | case *expr.Expr_IdentExpr: 117 | i_expr := *node.GetIdentExpr() 118 | // I'm not entirely sure this is the right thing here. 119 | // We'll see though. 120 | if fs.selects > 0 { 121 | return i_expr.Name 122 | } 123 | //return "data->'$." + i_expr.Name + "'" 124 | return "data->>'" + i_expr.Name + "'" 125 | case *expr.Expr_ConstExpr: 126 | c_expr := *node.GetConstExpr() 127 | return fs.getConstantValue(&c_expr) 128 | } 129 | 130 | return "NO SQL" 131 | 132 | } 133 | 134 | // ParseFilter parses the incoming filter and returns a formatted SQL query. 135 | func (fs *FilterSQL) ParseFilter(filter string) string { 136 | s := common.NewStringSource(filter, "urlParam") // function 137 | result, err := parser.Parse(s) 138 | if err != nil { 139 | log.Println(err) 140 | return "" 141 | } 142 | sql := fs.makeSQL(result.Expr) 143 | return sql 144 | } 145 | -------------------------------------------------------------------------------- /go/v1beta1/storage/filter_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Grafeas Authors. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | package storage 16 | 17 | import ( 18 | "log" 19 | "testing" 20 | ) 21 | 22 | func TestPgsqlFilterSql_ParseFilter(t *testing.T) { 23 | fs := FilterSQL{} 24 | tests := map[string]struct { 25 | filter string 26 | want string 27 | }{ 28 | "check if resource uri equal to either one of the values": { 29 | filter: `resource.uri="a.rpm" OR resource.uri="https://a.com/b/c/a.rpm"`, 30 | want: `((data->'resource'->>'uri' = 'a.rpm') OR (data->'resource'->>'uri' = 'https://a.com/b/c/a.rpm'))`, 31 | }, 32 | "greater than": { 33 | filter: `resource.min_value>10 AND resource.max_value<100`, 34 | want: `((data->'resource'->>'min_value' > 10) AND (data->'resource'->>'max_value' < 100))`, 35 | }, 36 | } 37 | for label, tt := range tests { 38 | label, tt := label, tt 39 | t.Run(label, func(t *testing.T) { 40 | got := fs.ParseFilter(tt.filter) 41 | log.Printf("got: %s", got) 42 | if got != tt.want { 43 | t.Fatalf("%s: want: %q got: %q", label, tt.want, got) 44 | } 45 | }) 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /go/v1beta1/storage/pgsqlstore.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Grafeas Authors. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | package storage 16 | 17 | import ( 18 | "database/sql" 19 | "database/sql/driver" 20 | "errors" 21 | "fmt" 22 | "log" 23 | "strconv" 24 | "time" 25 | 26 | "github.com/fernet/fernet-go" 27 | "github.com/google/uuid" 28 | "github.com/grafeas/grafeas/go/config" 29 | "github.com/grafeas/grafeas/go/name" 30 | "github.com/grafeas/grafeas/go/v1beta1/storage" 31 | pb "github.com/grafeas/grafeas/proto/v1beta1/grafeas_go_proto" 32 | prpb "github.com/grafeas/grafeas/proto/v1beta1/project_go_proto" 33 | "github.com/lib/pq" 34 | "golang.org/x/net/context" 35 | fieldmaskpb "google.golang.org/genproto/protobuf/field_mask" 36 | "google.golang.org/grpc/codes" 37 | "google.golang.org/grpc/status" 38 | "google.golang.org/protobuf/encoding/protojson" 39 | "google.golang.org/protobuf/proto" 40 | "google.golang.org/protobuf/types/known/timestamppb" 41 | ) 42 | 43 | // Config is the configuration for PostgreSQL store. 44 | // json tags are required because 45 | // config.ConvertGenericConfigToSpecificType internally uses json package. 46 | type Config struct { 47 | Host string `json:"host"` 48 | Port int `json:"port"` 49 | // DBName has to alrady exist and can be accessed by User. 50 | DBName string `json:"db_name"` 51 | User string `json:"user"` 52 | Password string `json:"password"` 53 | // Valid sslmodes: disable, allow, prefer, require, verify-ca, verify-full. 54 | // See https://www.postgresql.org/docs/current/static/libpq-connect.html for details 55 | SSLMode string `json:"ssl_mode"` 56 | SSLRootCert string `json:"ssl_root_cert"` 57 | // PaginationKey is a 32-bit URL-safe base64 key used to encrypt pagination tokens. 58 | // If one is not provided, it will be generated. 59 | // Multiple grafeas instances in the same cluster need the same value, 60 | // and the reason follows: 61 | // A client sends all requests to a unified load balancer, 62 | // but it can contain multiple Grafeas instances. 63 | // Consequently, if they do not share the same pagination key, 64 | // the encrypted page returned by one instance cannot be successfully decrypted by another instance. 65 | // As a result, if requests are routed to different Grafeas instances, pagination will be broken. 66 | PaginationKey string `json:"pagination_key"` 67 | } 68 | 69 | // PgSQLStore provides functionalities to use PostgreSQL DB as a data store. 70 | type PgSQLStore struct { 71 | *sql.DB 72 | paginationKey string 73 | } 74 | 75 | // PostgresqlStorageTypeProvider creates and initializes a new grafeas v1beta1 storage compatible PgSQL store based on the specified config. 76 | func PostgresqlStorageTypeProvider(_ string, ci *config.StorageConfiguration) (*storage.Storage, error) { 77 | var c Config 78 | err := config.ConvertGenericConfigToSpecificType(ci, &c) 79 | if err != nil { 80 | return nil, fmt.Errorf("failed to convert to PostgreSQL-specific config, err: %v", err) 81 | } 82 | 83 | s, err := NewPgSQLStore(&c) 84 | if err != nil { 85 | return nil, err 86 | } 87 | 88 | return &storage.Storage{ 89 | Ps: s, 90 | Gs: s, 91 | }, nil 92 | } 93 | 94 | // NewPgSQLStore creates a new PgSQL store based on the passed-in config. 95 | func NewPgSQLStore(config *Config) (*PgSQLStore, error) { 96 | return NewStoreWithCustomConnector(newDSNConnector(*config), config.PaginationKey) 97 | } 98 | 99 | // dsnConnector references the implementation of sql.dsnConnector. 100 | type dsnConnector struct { 101 | dsn string 102 | driver driver.Driver 103 | } 104 | 105 | // newDSNConnector returns a connector which 106 | // simply parses the passed-in config into a DSN during initialization and reuses it forever. 107 | func newDSNConnector(conf Config) *dsnConnector { 108 | connector := &dsnConnector{ 109 | dsn: assembleDSN(conf), 110 | driver: &pq.Driver{}, 111 | } 112 | return connector 113 | } 114 | 115 | func assembleDSN(c Config) string { 116 | dsn := fmt.Sprintf("host=%s dbname=%s user=%s password=%s sslmode=%s", 117 | c.Host, c.DBName, c.User, c.Password, c.SSLMode, 118 | ) 119 | if c.SSLRootCert != "" { 120 | dsn = fmt.Sprintf("%s sslrootcert=%s", dsn, c.SSLRootCert) 121 | } 122 | return dsn 123 | } 124 | 125 | func (c *dsnConnector) Connect(context.Context) (driver.Conn, error) { 126 | return c.driver.Open(c.dsn) 127 | } 128 | 129 | func (c *dsnConnector) Driver() driver.Driver { 130 | return c.driver 131 | } 132 | 133 | // NewStoreWithCustomConnector creates a new PgSQL store using the custom connector. 134 | func NewStoreWithCustomConnector(connector driver.Connector, paginationKey string) (*PgSQLStore, error) { 135 | if paginationKey == "" { 136 | log.Println("pagination key is empty, generating...") 137 | var key fernet.Key 138 | if err := key.Generate(); err != nil { 139 | return nil, fmt.Errorf("failed to generate pagination key, %s", err) 140 | } 141 | paginationKey = key.Encode() 142 | } else { 143 | // Validate pagination key 144 | _, err := fernet.DecodeKey(paginationKey) 145 | if err != nil { 146 | return nil, errors.New("invalid pagination key; must be 256-bit URL-safe base64") 147 | } 148 | } 149 | db := sql.OpenDB(connector) 150 | if err := db.Ping(); err != nil { 151 | return nil, fmt.Errorf("failed to ping the database server, err: %v", err) 152 | } 153 | if _, err := db.Exec(createTables); err != nil { 154 | db.Close() 155 | return nil, fmt.Errorf("failed to create tables, err: %v", err) 156 | } 157 | return &PgSQLStore{ 158 | DB: db, 159 | paginationKey: paginationKey, 160 | }, nil 161 | } 162 | 163 | // CreateProject adds the specified project to the store 164 | func (pg *PgSQLStore) CreateProject(ctx context.Context, pID string, p *prpb.Project) (*prpb.Project, error) { 165 | _, err := pg.DB.ExecContext(ctx, insertProject, name.FormatProject(pID)) 166 | if err, ok := err.(*pq.Error); ok { 167 | // Check for unique_violation 168 | if err.Code == "23505" { 169 | return nil, status.Errorf(codes.AlreadyExists, "Project with name %q already exists", pID) 170 | } 171 | log.Println("Failed to insert Project in database", err) 172 | return nil, status.Error(codes.Internal, "Failed to insert Project in database") 173 | } 174 | return p, nil 175 | } 176 | 177 | // DeleteProject deletes the project with the given pID from the store 178 | func (pg *PgSQLStore) DeleteProject(ctx context.Context, pID string) error { 179 | pName := name.FormatProject(pID) 180 | result, err := pg.DB.ExecContext(ctx, deleteProject, pName) 181 | if err != nil { 182 | return status.Error(codes.Internal, "Failed to delete Project from database") 183 | } 184 | count, err := result.RowsAffected() 185 | if err != nil { 186 | return status.Error(codes.Internal, "Failed to delete Project from database") 187 | } 188 | if count == 0 { 189 | return status.Errorf(codes.NotFound, "Project with name %q does not Exist", pName) 190 | } 191 | return nil 192 | } 193 | 194 | // GetProject returns the project with the given pID from the store 195 | func (pg *PgSQLStore) GetProject(ctx context.Context, pID string) (*prpb.Project, error) { 196 | pName := name.FormatProject(pID) 197 | var exists bool 198 | err := pg.DB.QueryRowContext(ctx, projectExists, pName).Scan(&exists) 199 | if err != nil { 200 | return nil, status.Error(codes.Internal, "Failed to query Project from database") 201 | } 202 | if !exists { 203 | return nil, status.Errorf(codes.NotFound, "Project with name %q does not Exist", pName) 204 | } 205 | return &prpb.Project{Name: pName}, nil 206 | } 207 | 208 | // ListProjects returns up to pageSize number of projects beginning at pageToken (or from 209 | // start if pageToken is the empty string). 210 | func (pg *PgSQLStore) ListProjects(ctx context.Context, filter string, pageSize int, pageToken string) ([]*prpb.Project, string, error) { 211 | var filterQuery string 212 | if filter != "" { 213 | var fs FilterSQL 214 | filterQuery = " AND " + fs.ParseFilter(filter) 215 | } 216 | query := fmt.Sprintf(listProjects, filterQuery) 217 | id := decryptInt64(pageToken, pg.paginationKey, 0) 218 | rows, err := pg.DB.QueryContext(ctx, query, id, pageSize) 219 | if err != nil { 220 | return nil, "", status.Error(codes.Internal, "Failed to list Projects from database") 221 | } 222 | var projects []*prpb.Project 223 | var lastID int64 224 | for rows.Next() { 225 | var name string 226 | err := rows.Scan(&lastID, &name) 227 | if err != nil { 228 | return nil, "", status.Error(codes.Internal, "Failed to scan Project row") 229 | } 230 | projects = append(projects, &prpb.Project{Name: name}) 231 | } 232 | if len(projects) == 0 { 233 | return projects, "", nil 234 | } 235 | maxQuery := projectsMaxID 236 | if filterQuery != "" { 237 | maxQuery = fmt.Sprintf("%s WHERE %s", maxQuery, filterQuery) 238 | } 239 | maxID, err := pg.max(ctx, maxQuery) 240 | if err != nil { 241 | return nil, "", status.Error(codes.Internal, "Failed to query max project id from database") 242 | } 243 | if lastID >= maxID { 244 | return projects, "", nil 245 | } 246 | encryptedPage, err := encryptInt64(lastID, pg.paginationKey) 247 | if err != nil { 248 | return nil, "", status.Error(codes.Internal, "Failed to paginate projects") 249 | } 250 | return projects, encryptedPage, nil 251 | } 252 | 253 | // CreateOccurrence adds the specified occurrence 254 | func (pg *PgSQLStore) CreateOccurrence(ctx context.Context, pID, uID string, o *pb.Occurrence) (*pb.Occurrence, error) { 255 | o = proto.Clone(o).(*pb.Occurrence) 256 | o.CreateTime = timestamppb.Now() 257 | 258 | var id string 259 | if nr, err := uuid.NewRandom(); err != nil { 260 | return nil, status.Error(codes.Internal, "Failed to generate UUID") 261 | } else { 262 | id = nr.String() 263 | } 264 | o.Name = fmt.Sprintf("projects/%s/occurrences/%s", pID, id) 265 | 266 | nPID, nID, err := name.ParseNote(o.NoteName) 267 | if err != nil { 268 | log.Printf("Invalid note name: %v", o.NoteName) 269 | return nil, status.Error(codes.InvalidArgument, "Invalid note name") 270 | } 271 | 272 | occurrenceJson, err := protojson.Marshal(o) 273 | if err != nil { 274 | log.Printf("Failed to marshal occurrence to json") 275 | return nil, status.Error(codes.InvalidArgument, "Failed to marshal occurrence to json") 276 | } 277 | 278 | _, err = pg.DB.ExecContext(ctx, insertOccurrence, pID, id, nPID, nID, occurrenceJson) 279 | if err, ok := err.(*pq.Error); ok { 280 | // Check for unique_violation 281 | if err.Code == "23505" { 282 | return nil, status.Errorf(codes.AlreadyExists, "Occurrence with name %q already exists", o.Name) 283 | } 284 | log.Println("Failed to insert Occurrence in database", err) 285 | return nil, status.Error(codes.Internal, "Failed to insert Occurrence in database") 286 | } 287 | return o, nil 288 | } 289 | 290 | // BatchCreateOccurrences batch creates the specified occurrences in PostreSQL. 291 | func (pg *PgSQLStore) BatchCreateOccurrences(ctx context.Context, pID string, uID string, occs []*pb.Occurrence) ([]*pb.Occurrence, []error) { 292 | clonedOccs := []*pb.Occurrence{} 293 | for _, o := range occs { 294 | clonedOccs = append(clonedOccs, proto.Clone(o).(*pb.Occurrence)) 295 | } 296 | occs = clonedOccs 297 | 298 | errs := []error{} 299 | created := []*pb.Occurrence{} 300 | for _, o := range occs { 301 | occ, err := pg.CreateOccurrence(ctx, pID, uID, o) 302 | if err != nil { 303 | // Occurrence already exists, skipping. 304 | continue 305 | } else { 306 | created = append(created, occ) 307 | } 308 | } 309 | 310 | return created, errs 311 | } 312 | 313 | // DeleteOccurrence deletes the occurrence with the given pID and oID 314 | func (pg *PgSQLStore) DeleteOccurrence(ctx context.Context, pID, oID string) error { 315 | result, err := pg.DB.ExecContext(ctx, deleteOccurrence, pID, oID) 316 | if err != nil { 317 | return status.Error(codes.Internal, "Failed to delete Occurrence from database") 318 | } 319 | count, err := result.RowsAffected() 320 | if err != nil { 321 | return status.Error(codes.Internal, "Failed to delete Occurrence from database") 322 | } 323 | if count == 0 { 324 | return status.Errorf(codes.NotFound, "Occurrence with name %q/%q does not Exist", pID, oID) 325 | } 326 | return nil 327 | } 328 | 329 | // UpdateOccurrence updates the existing occurrence with the given projectID and occurrenceID 330 | func (pg *PgSQLStore) UpdateOccurrence(ctx context.Context, pID, oID string, o *pb.Occurrence, mask *fieldmaskpb.FieldMask) (*pb.Occurrence, error) { 331 | o = proto.Clone(o).(*pb.Occurrence) 332 | // TODO(#312): implement the update operation 333 | o.UpdateTime = timestamppb.Now() 334 | 335 | occurrenceJson, err := protojson.Marshal(o) 336 | if err != nil { 337 | log.Printf("Failed to marshal occurrence to json") 338 | return nil, status.Error(codes.InvalidArgument, "Failed to marshal occurrence to json") 339 | } 340 | 341 | result, err := pg.DB.ExecContext(ctx, updateOccurrence, occurrenceJson, pID, oID) 342 | if err != nil { 343 | return nil, status.Error(codes.Internal, "Failed to update Occurrence") 344 | } 345 | count, err := result.RowsAffected() 346 | if err != nil { 347 | return nil, status.Error(codes.Internal, "Failed to update Occurrence") 348 | } 349 | if count == 0 { 350 | return nil, status.Errorf(codes.NotFound, "Occurrence with name %q/%q does not Exist", pID, oID) 351 | } 352 | return o, nil 353 | } 354 | 355 | // GetOccurrence returns the occurrence with pID and oID 356 | func (pg *PgSQLStore) GetOccurrence(ctx context.Context, pID, oID string) (*pb.Occurrence, error) { 357 | var data []byte 358 | err := pg.DB.QueryRowContext(ctx, searchOccurrence, pID, oID).Scan(&data) 359 | switch { 360 | case err == sql.ErrNoRows: 361 | return nil, status.Errorf(codes.NotFound, "Occurrence with name %q/%q does not Exist", pID, oID) 362 | case err != nil: 363 | return nil, status.Error(codes.Internal, "Failed to query Occurrence from database") 364 | } 365 | var o pb.Occurrence 366 | if err = protojson.Unmarshal(data, &o); err != nil { 367 | return nil, status.Error(codes.Internal, "Failed to unmarshal Occurrence from database") 368 | } 369 | // Set the output-only field before returning 370 | o.Name = name.FormatOccurrence(pID, oID) 371 | return &o, nil 372 | } 373 | 374 | // ListOccurrences returns up to pageSize number of occurrences for this project beginning 375 | // at pageToken, or from start if pageToken is the empty string. 376 | func (pg *PgSQLStore) ListOccurrences(ctx context.Context, pID, filter, pageToken string, pageSize int32) ([]*pb.Occurrence, string, error) { 377 | var filterQuery string 378 | if filter != "" { 379 | var fs FilterSQL 380 | filterQuery = " AND " + fs.ParseFilter(filter) 381 | } 382 | 383 | query := fmt.Sprintf(listOccurrences, filterQuery) 384 | id := decryptInt64(pageToken, pg.paginationKey, 0) 385 | rows, err := pg.DB.QueryContext(ctx, query, pID, id, pageSize) 386 | if err != nil { 387 | return nil, "", status.Error(codes.Internal, "Failed to list Occurrences from database") 388 | } 389 | 390 | var os []*pb.Occurrence 391 | var lastID int64 392 | for rows.Next() { 393 | var data []byte 394 | err := rows.Scan(&lastID, &data) 395 | if err != nil { 396 | return nil, "", status.Error(codes.Internal, "Failed to scan Occurrences row") 397 | } 398 | var o pb.Occurrence 399 | if err = protojson.Unmarshal(data, &o); err != nil { 400 | return nil, "", status.Error(codes.Internal, "Failed to unmarshal Occurrence from database") 401 | } 402 | os = append(os, &o) 403 | } 404 | if len(os) == 0 { 405 | return os, "", nil 406 | } 407 | maxQuery := fmt.Sprintf(occurrenceMaxID, filterQuery) 408 | maxID, err := pg.max(ctx, maxQuery, pID) 409 | if err != nil { 410 | return nil, "", status.Error(codes.Internal, "Failed to query max occurrence id from database") 411 | } 412 | if lastID >= maxID { 413 | return os, "", nil 414 | } 415 | encryptedPage, err := encryptInt64(lastID, pg.paginationKey) 416 | if err != nil { 417 | return nil, "", status.Error(codes.Internal, "Failed to paginate occurrences") 418 | } 419 | return os, encryptedPage, nil 420 | } 421 | 422 | // CreateNote adds the specified note 423 | func (pg *PgSQLStore) CreateNote(ctx context.Context, pID, nID, uID string, n *pb.Note) (*pb.Note, error) { 424 | n = proto.Clone(n).(*pb.Note) 425 | nName := name.FormatNote(pID, nID) 426 | n.Name = nName 427 | n.CreateTime = timestamppb.Now() 428 | 429 | noteJson, err := protojson.Marshal(n) 430 | if err != nil { 431 | log.Printf("Failed to marshal note to json") 432 | return nil, status.Error(codes.InvalidArgument, "Failed to marshal note to json") 433 | } 434 | 435 | _, err = pg.DB.ExecContext(ctx, insertNote, pID, nID, noteJson) 436 | if err, ok := err.(*pq.Error); ok { 437 | // Check for unique_violation 438 | if err.Code == "23505" { 439 | return nil, status.Errorf(codes.AlreadyExists, "Note with name %q already exists", n.Name) 440 | } 441 | log.Println("Failed to insert Note in database", err) 442 | return nil, status.Error(codes.Internal, "Failed to insert Note in database") 443 | } 444 | return n, nil 445 | } 446 | 447 | // BatchCreateNotes batch creates the specified notes in memstore. 448 | func (pg *PgSQLStore) BatchCreateNotes(ctx context.Context, pID, uID string, notes map[string]*pb.Note) ([]*pb.Note, []error) { 449 | clonedNotes := map[string]*pb.Note{} 450 | for nID, n := range notes { 451 | clonedNotes[nID] = proto.Clone(n).(*pb.Note) 452 | } 453 | notes = clonedNotes 454 | 455 | errs := []error{} 456 | created := []*pb.Note{} 457 | for nID, n := range notes { 458 | note, err := pg.CreateNote(ctx, pID, nID, uID, n) 459 | if err != nil { 460 | // Note already exists, skipping. 461 | continue 462 | } else { 463 | created = append(created, note) 464 | } 465 | } 466 | return created, errs 467 | } 468 | 469 | // DeleteNote deletes the note with the given pID and nID 470 | func (pg *PgSQLStore) DeleteNote(ctx context.Context, pID, nID string) error { 471 | result, err := pg.DB.ExecContext(ctx, deleteNote, pID, nID) 472 | if err != nil { 473 | return status.Error(codes.Internal, "Failed to delete Note from database") 474 | } 475 | count, err := result.RowsAffected() 476 | if err != nil { 477 | return status.Error(codes.Internal, "Failed to delete Note from database") 478 | } 479 | if count == 0 { 480 | return status.Errorf(codes.NotFound, "Note with name %q/%q does not Exist", pID, nID) 481 | } 482 | return nil 483 | } 484 | 485 | // UpdateNote updates the existing note with the given pID and nID 486 | func (pg *PgSQLStore) UpdateNote(ctx context.Context, pID, nID string, n *pb.Note, mask *fieldmaskpb.FieldMask) (*pb.Note, error) { 487 | n = proto.Clone(n).(*pb.Note) 488 | nName := name.FormatNote(pID, nID) 489 | n.Name = nName 490 | // TODO(#312): implement the update operation 491 | n.UpdateTime = timestamppb.Now() 492 | 493 | noteJson, err := protojson.Marshal(n) 494 | if err != nil { 495 | log.Printf("Failed to marshal note to json") 496 | return nil, status.Error(codes.InvalidArgument, "Failed to marshal note to json") 497 | } 498 | 499 | result, err := pg.DB.ExecContext(ctx, updateNote, noteJson, pID, nID) 500 | if err != nil { 501 | return nil, status.Error(codes.Internal, "Failed to update Note") 502 | } 503 | count, err := result.RowsAffected() 504 | if err != nil { 505 | return nil, status.Error(codes.Internal, "Failed to update Note") 506 | } 507 | if count == 0 { 508 | return nil, status.Errorf(codes.NotFound, "Note with name %q/%q does not Exist", pID, nID) 509 | } 510 | return n, nil 511 | } 512 | 513 | // GetNote returns the note with project (pID) and note ID (nID) 514 | func (pg *PgSQLStore) GetNote(ctx context.Context, pID, nID string) (*pb.Note, error) { 515 | var data []byte 516 | err := pg.DB.QueryRowContext(ctx, searchNote, pID, nID).Scan(&data) 517 | switch { 518 | case err == sql.ErrNoRows: 519 | return nil, status.Errorf(codes.NotFound, "Note with name %q/%q does not Exist", pID, nID) 520 | case err != nil: 521 | return nil, status.Error(codes.Internal, "Failed to query Note from database") 522 | } 523 | var note pb.Note 524 | if err = protojson.Unmarshal(data, ¬e); err != nil { 525 | return nil, status.Error(codes.Internal, "Failed to unmarshal Note from database") 526 | } 527 | // Set the output-only field before returning 528 | note.Name = name.FormatNote(pID, nID) 529 | return ¬e, nil 530 | } 531 | 532 | // GetOccurrenceNote gets the note for the specified occurrence from PostgreSQL. 533 | func (pg *PgSQLStore) GetOccurrenceNote(ctx context.Context, pID, oID string) (*pb.Note, error) { 534 | o, err := pg.GetOccurrence(ctx, pID, oID) 535 | if err != nil { 536 | return nil, err 537 | } 538 | nPID, nID, err := name.ParseNote(o.NoteName) 539 | if err != nil { 540 | log.Printf("Error parsing name: %v", o.NoteName) 541 | return nil, status.Error(codes.InvalidArgument, "Invalid Note name") 542 | } 543 | n, err := pg.GetNote(ctx, nPID, nID) 544 | if err != nil { 545 | return nil, err 546 | } 547 | // Set the output-only field before returning 548 | n.Name = name.FormatNote(nPID, nID) 549 | return n, nil 550 | } 551 | 552 | // ListNotes returns up to pageSize number of notes for this project (pID) beginning 553 | // at pageToken (or from start if pageToken is the empty string). 554 | func (pg *PgSQLStore) ListNotes(ctx context.Context, pID, filter, pageToken string, pageSize int32) ([]*pb.Note, string, error) { 555 | var filterQuery string 556 | if filter != "" { 557 | var fs FilterSQL 558 | filterQuery = " AND " + fs.ParseFilter(filter) 559 | } 560 | 561 | query := fmt.Sprintf(listNotes, filterQuery) 562 | id := decryptInt64(pageToken, pg.paginationKey, 0) 563 | rows, err := pg.DB.QueryContext(ctx, query, pID, id, pageSize) 564 | if err != nil { 565 | return nil, "", status.Error(codes.Internal, "Failed to list Notes from database") 566 | } 567 | 568 | var ns []*pb.Note 569 | var lastID int64 570 | for rows.Next() { 571 | var data []byte 572 | err := rows.Scan(&lastID, &data) 573 | if err != nil { 574 | return nil, "", status.Error(codes.Internal, "Failed to scan Notes row") 575 | } 576 | var n pb.Note 577 | if err = protojson.Unmarshal(data, &n); err != nil { 578 | return nil, "", status.Error(codes.Internal, "Failed to unmarshal Note from database") 579 | } 580 | ns = append(ns, &n) 581 | } 582 | if len(ns) == 0 { 583 | return ns, "", nil 584 | } 585 | maxQuery := fmt.Sprintf(notesMaxID, filterQuery) 586 | maxID, err := pg.max(ctx, maxQuery, pID) 587 | if err != nil { 588 | return nil, "", status.Error(codes.Internal, "Failed to query max note id from database") 589 | } 590 | if lastID >= maxID { 591 | return ns, "", nil 592 | } 593 | encryptedPage, err := encryptInt64(lastID, pg.paginationKey) 594 | if err != nil { 595 | return nil, "", status.Error(codes.Internal, "Failed to paginate notes") 596 | } 597 | return ns, encryptedPage, nil 598 | } 599 | 600 | // ListNoteOccurrences returns up to pageSize number of occurrences on the particular note (nID) 601 | // for this project (pID) projects beginning at pageToken (or from start if pageToken is the empty string). 602 | func (pg *PgSQLStore) ListNoteOccurrences(ctx context.Context, pID, nID, filter, pageToken string, pageSize int32) ([]*pb.Occurrence, string, error) { 603 | // Verify that note exists 604 | if _, err := pg.GetNote(ctx, pID, nID); err != nil { 605 | return nil, "", err 606 | } 607 | id := decryptInt64(pageToken, pg.paginationKey, 0) 608 | rows, err := pg.DB.QueryContext(ctx, listNoteOccurrences, pID, nID, id, pageSize) 609 | if err != nil { 610 | return nil, "", status.Error(codes.Internal, "Failed to list Occurrences from database") 611 | } 612 | 613 | var os []*pb.Occurrence 614 | var lastID int64 615 | for rows.Next() { 616 | var data []byte 617 | err := rows.Scan(&lastID, &data) 618 | if err != nil { 619 | return nil, "", status.Error(codes.Internal, "Failed to scan Occurrences row") 620 | } 621 | var o pb.Occurrence 622 | if err = protojson.Unmarshal(data, &o); err != nil { 623 | return nil, "", status.Error(codes.Internal, "Failed to unmarshal Occurrence from database") 624 | } 625 | os = append(os, &o) 626 | } 627 | if len(os) == 0 { 628 | return os, "", nil 629 | } 630 | maxID, err := pg.max(ctx, NoteOccurrencesMaxID, pID, nID) 631 | if err != nil { 632 | return nil, "", status.Error(codes.Internal, "Failed to query max NoteOccurrences from database") 633 | } 634 | if lastID >= maxID { 635 | return os, "", nil 636 | } 637 | encryptedPage, err := encryptInt64(lastID, pg.paginationKey) 638 | if err != nil { 639 | return nil, "", status.Error(codes.Internal, "Failed to paginate note occurrences") 640 | } 641 | return os, encryptedPage, nil 642 | } 643 | 644 | // GetVulnerabilityOccurrencesSummary gets a summary of vulnerability occurrences from storage. 645 | func (pg *PgSQLStore) GetVulnerabilityOccurrencesSummary(ctx context.Context, projectID, filter string) (*pb.VulnerabilityOccurrencesSummary, error) { 646 | return &pb.VulnerabilityOccurrencesSummary{}, nil 647 | } 648 | 649 | // max returns the max ID of entries for the specified query (assuming SELECT(*) is used) 650 | func (pg *PgSQLStore) max(ctx context.Context, query string, args ...interface{}) (int64, error) { 651 | row := pg.DB.QueryRowContext(ctx, query, args...) 652 | var count int64 653 | err := row.Scan(&count) 654 | if err != nil { 655 | return 0, err 656 | } 657 | return count, err 658 | } 659 | 660 | // encryptInt64 encrypts int64 using provided key 661 | func encryptInt64(v int64, key string) (string, error) { 662 | k, err := fernet.DecodeKey(key) 663 | if err != nil { 664 | return "", err 665 | } 666 | bytes, err := fernet.EncryptAndSign([]byte(strconv.FormatInt(v, 10)), k) 667 | if err != nil { 668 | return "", err 669 | } 670 | return string(bytes), nil 671 | } 672 | 673 | // decryptInt64 decrypts encrypted int64 using provided key. Returns defaultValue if decryption fails. 674 | func decryptInt64(encrypted string, key string, defaultValue int64) int64 { 675 | k, err := fernet.DecodeKey(key) 676 | if err != nil { 677 | return defaultValue 678 | } 679 | bytes := fernet.VerifyAndDecrypt([]byte(encrypted), time.Hour, []*fernet.Key{k}) 680 | if bytes == nil { 681 | return defaultValue 682 | } 683 | decryptedValue, err := strconv.ParseInt(string(bytes), 10, 64) 684 | if err != nil { 685 | return defaultValue 686 | } 687 | return decryptedValue 688 | } 689 | -------------------------------------------------------------------------------- /go/v1beta1/storage/pgsqlstore_functional_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Grafeas Authors. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | //go:build functional 16 | // +build functional 17 | 18 | // Following tests are forked from https://github.com/grafeas/grafeas/blob/master/go/v1beta1/storage/pgsqlstore_test.go, 19 | // and they require a mock postgres instance in the environment. 20 | // We won't run these tests in SD for now. 21 | // TODO: migrate to go-dog func tests. 22 | 23 | package storage 24 | 25 | import ( 26 | "database/sql" 27 | "fmt" 28 | "io" 29 | "io/ioutil" 30 | "log" 31 | "net" 32 | "os" 33 | "os/exec" 34 | "path/filepath" 35 | "regexp" 36 | "runtime" 37 | "testing" 38 | 39 | "github.com/grafeas/grafeas/go/config" 40 | grafeas "github.com/grafeas/grafeas/go/v1beta1/api" 41 | "github.com/grafeas/grafeas/go/v1beta1/project" 42 | "github.com/grafeas/grafeas/go/v1beta1/storage" 43 | ) 44 | 45 | type testPgHelper struct { 46 | pgDataPath string 47 | pgBinPath string 48 | startedPg bool 49 | pgConfig *config.PgSQLConfig 50 | } 51 | 52 | var ( 53 | //Unfortunately, not a good way to pass this information around to tests except via a globally scoped var 54 | pgsqlstoreTestPgConfig *testPgHelper 55 | ) 56 | 57 | func startupPostgres(pgData *testPgHelper) error { 58 | //Create a test database instance directory 59 | if pgDataPath, err := ioutil.TempDir("", "pg-data-*"); err != nil { 60 | return err 61 | } else { 62 | pgData.pgDataPath = filepath.ToSlash(pgDataPath) 63 | } 64 | 65 | //Make password file 66 | passwordTempFile, err := ioutil.TempFile("", "pgpassword-*") 67 | if err != nil { 68 | return err 69 | } 70 | defer os.Remove(passwordTempFile.Name()) 71 | 72 | if _, err = io.WriteString(passwordTempFile, pgData.pgConfig.Password); err != nil { 73 | return err 74 | } 75 | 76 | if err := passwordTempFile.Sync(); err != nil { 77 | return err 78 | } 79 | 80 | port, err := findAvailablePort() 81 | if err != nil { 82 | return err 83 | } 84 | pgData.pgConfig.Host = fmt.Sprintf("127.0.0.1:%d", port) 85 | 86 | //Init db 87 | pgCtl := filepath.Join(pgData.pgBinPath, "pg_ctl") 88 | fmt.Fprintln(os.Stderr, "testing: intializing test postgres instance under", pgData.pgDataPath) 89 | pgCtlInitDBOptions := fmt.Sprintf("--username %s --pwfile %s", pgData.pgConfig.User, passwordTempFile.Name()) 90 | cmd := exec.Command(pgCtl, "--pgdata", pgData.pgDataPath, "-o", pgCtlInitDBOptions, "initdb") 91 | if err := cmd.Run(); err != nil { 92 | return err 93 | } 94 | 95 | //Start postgres 96 | fmt.Fprintln(os.Stderr, "testing: starting test postgres instance on port", port) 97 | pgCtlStartOptions := fmt.Sprintf("-p %d", port) 98 | cmd = exec.Command(pgCtl, "--pgdata", pgData.pgDataPath, "-o", pgCtlStartOptions, "start") 99 | if err := cmd.Run(); err != nil { 100 | return err 101 | } 102 | 103 | pgData.startedPg = true 104 | 105 | return nil 106 | } 107 | 108 | func findAvailablePort() (availablePort int, err error) { 109 | for availablePort = 5432; availablePort < 6000; availablePort++ { 110 | l, err := net.Listen("tcp", fmt.Sprintf(":%d", availablePort)) 111 | defer l.Close() 112 | if err == nil { 113 | return availablePort, nil 114 | } 115 | } 116 | 117 | return -1, fmt.Errorf("Unable to find an open port") 118 | } 119 | 120 | func isPostgresRunning(config *config.PgSQLConfig) bool { 121 | source := storage.CreateSourceString(config.User, config.Password, config.Host, "postgres", config.SSLMode) 122 | db, err := sql.Open("postgres", source) 123 | if err != nil { 124 | return false 125 | } 126 | defer db.Close() 127 | 128 | if db.Ping() != nil { 129 | return false 130 | } 131 | return true 132 | } 133 | 134 | func getPostgresBinPathFromSystemPath() (binPath string, err error) { 135 | cmd := exec.Command("which", "pg_ctl") 136 | output, err := cmd.Output() 137 | if output != nil && err == nil { 138 | binPath = filepath.ToSlash(filepath.Dir(string(output))) 139 | } 140 | 141 | //Deal with "which" Linux-style output on Windows, a bit of a corner case 142 | regex := regexp.MustCompile("^/([a-z])/(.*)$") 143 | regexMatches := regex.FindStringSubmatch(binPath) 144 | if runtime.GOOS == "windows" && regexMatches != nil && len(regexMatches) == 3 { 145 | binPath = fmt.Sprintf("%s:/%s", regexMatches[1], regexMatches[2]) 146 | } 147 | 148 | return 149 | } 150 | 151 | func setup() (pgData *testPgHelper, err error) { 152 | pgConfig := &config.PgSQLConfig{ 153 | Host: "127.0.0.1:5432", 154 | User: "postgres", 155 | Password: "password", 156 | SSLMode: "disable", 157 | } 158 | 159 | pgData = &testPgHelper{ 160 | startedPg: false, 161 | pgConfig: pgConfig, 162 | } 163 | 164 | //See if postgres is already available and running 165 | if isPostgresRunning(pgConfig) { 166 | return 167 | } 168 | 169 | //Check for a global installation 170 | if pgData.pgBinPath, err = getPostgresBinPathFromSystemPath(); err != nil { 171 | err = fmt.Errorf("Unable to find a running Postgres instance or Postgres binaries necessary for testing on the system PATH: %v", err) 172 | return 173 | } 174 | 175 | //Startup postgres 176 | if err = startupPostgres(pgData); err != nil { 177 | return 178 | } 179 | 180 | return pgData, nil 181 | } 182 | 183 | func stopPostgres(pgData *testPgHelper) error { 184 | if pgData != nil && pgData.startedPg { 185 | //Stop postgres 186 | pgCtl := filepath.Join(pgData.pgBinPath, "pg_ctl") 187 | 188 | fmt.Fprintln(os.Stderr, "testing: stopping test postgres instance") 189 | cmd := exec.Command(pgCtl, "--pgdata", pgData.pgDataPath, "stop") 190 | if err := cmd.Run(); err != nil { 191 | return err 192 | } 193 | 194 | //Cleanup 195 | if err := os.RemoveAll(pgData.pgDataPath); err != nil { 196 | return err 197 | } 198 | } 199 | 200 | return nil 201 | } 202 | 203 | func teardown(pgData *testPgHelper) error { 204 | return stopPostgres(pgData) 205 | } 206 | 207 | func dropDatabase(t *testing.T, config *config.PgSQLConfig) { 208 | t.Helper() 209 | // Open database 210 | source := storage.CreateSourceString(config.User, config.Password, config.Host, "postgres", config.SSLMode) 211 | db, err := sql.Open("postgres", source) 212 | if err != nil { 213 | t.Fatalf("Failed to open database: %v", err) 214 | } 215 | // Kill opened connection 216 | if _, err := db.Exec(` 217 | SELECT pg_terminate_backend(pid) 218 | FROM pg_stat_activity 219 | WHERE datname = $1`, config.DbName); err != nil { 220 | t.Fatalf("Failed to drop database: %v", err) 221 | } 222 | // Drop database 223 | if _, err := db.Exec("DROP DATABASE " + config.DbName); err != nil { 224 | t.Fatalf("Failed to drop database: %v", err) 225 | } 226 | } 227 | 228 | func TestMain(m *testing.M) { 229 | var err error 230 | pgsqlstoreTestPgConfig, err = setup() 231 | if err != nil { 232 | log.Fatal(err) 233 | } 234 | 235 | exitVal := m.Run() 236 | 237 | if err := teardown(pgsqlstoreTestPgConfig); err != nil { 238 | log.Fatal(err) 239 | } 240 | 241 | // os.Exit() does not respect defer statements 242 | os.Exit(exitVal) 243 | } 244 | 245 | func TestBetaPgSQLStore(t *testing.T) { 246 | createPgSQLStore := func(t *testing.T) (grafeas.Storage, project.Storage, func()) { 247 | t.Helper() 248 | config := &config.PgSQLConfig{ 249 | Host: pgsqlstoreTestPgConfig.pgConfig.Host, 250 | DbName: "test_db", 251 | User: pgsqlstoreTestPgConfig.pgConfig.User, 252 | Password: pgsqlstoreTestPgConfig.pgConfig.Password, 253 | SSLMode: pgsqlstoreTestPgConfig.pgConfig.SSLMode, 254 | PaginationKey: "XxoPtCUzrUv4JV5dS+yQ+MdW7yLEJnRMwigVY/bpgtQ=", 255 | } 256 | pg, err := storage.NewPgSQLStore(config) 257 | if err != nil { 258 | t.Errorf("Error creating PgSQLStore, %s", err) 259 | } 260 | var g grafeas.Storage = pg 261 | var gp project.Storage = pg 262 | return g, gp, func() { dropDatabase(t, config); pg.Close() } 263 | } 264 | 265 | storage.DoTestStorage(t, createPgSQLStore) 266 | } 267 | 268 | func TestPgSQLStoreWithUserAsEnv(t *testing.T) { 269 | createPgSQLStore := func(t *testing.T) (grafeas.Storage, project.Storage, func()) { 270 | t.Helper() 271 | config := &config.PgSQLConfig{ 272 | Host: pgsqlstoreTestPgConfig.pgConfig.Host, 273 | DbName: "test_db", 274 | User: "", 275 | Password: "", 276 | SSLMode: pgsqlstoreTestPgConfig.pgConfig.SSLMode, 277 | PaginationKey: "XxoPtCUzrUv4JV5dS+yQ+MdW7yLEJnRMwigVY/bpgtQ=", 278 | } 279 | _ = os.Setenv("PGUSER", pgsqlstoreTestPgConfig.pgConfig.User) 280 | _ = os.Setenv("PGPASSWORD", pgsqlstoreTestPgConfig.pgConfig.Password) 281 | pg, err := storage.NewPgSQLStore(config) 282 | if err != nil { 283 | t.Errorf("Error creating PgSQLStore, %s", err) 284 | } 285 | var g grafeas.Storage = pg 286 | var gp project.Storage = pg 287 | return g, gp, func() { dropDatabase(t, config); pg.Close() } 288 | } 289 | 290 | storage.DoTestStorage(t, createPgSQLStore) 291 | } 292 | 293 | func TestBetaPgSQLStoreWithNoPaginationKey(t *testing.T) { 294 | createPgSQLStore := func(t *testing.T) (grafeas.Storage, project.Storage, func()) { 295 | t.Helper() 296 | config := &config.PgSQLConfig{ 297 | Host: pgsqlstoreTestPgConfig.pgConfig.Host, 298 | DbName: "test_db", 299 | User: pgsqlstoreTestPgConfig.pgConfig.User, 300 | Password: pgsqlstoreTestPgConfig.pgConfig.Password, 301 | SSLMode: pgsqlstoreTestPgConfig.pgConfig.SSLMode, 302 | PaginationKey: "", 303 | } 304 | pg, err := storage.NewPgSQLStore(config) 305 | if err != nil { 306 | t.Errorf("Error creating PgSQLStore, %s", err) 307 | } 308 | var g grafeas.Storage = pg 309 | var gp project.Storage = pg 310 | return g, gp, func() { dropDatabase(t, config); pg.Close() } 311 | } 312 | 313 | storage.DoTestStorage(t, createPgSQLStore) 314 | } 315 | 316 | func TestBetaPgSQLStoreWithInvalidPaginationKey(t *testing.T) { 317 | config := &config.PgSQLConfig{ 318 | Host: pgsqlstoreTestPgConfig.pgConfig.Host, 319 | DbName: "test_db", 320 | User: pgsqlstoreTestPgConfig.pgConfig.User, 321 | Password: pgsqlstoreTestPgConfig.pgConfig.Password, 322 | SSLMode: pgsqlstoreTestPgConfig.pgConfig.SSLMode, 323 | PaginationKey: "INVALID_VALUE", 324 | } 325 | pg, err := storage.NewPgSQLStore(config) 326 | if pg != nil { 327 | pg.Close() 328 | } 329 | if err == nil { 330 | t.Errorf("expected error for invalid pagination key; got none") 331 | } 332 | if err.Error() != "invalid pagination key; must be 256-bit URL-safe base64" { 333 | t.Errorf("expected error message about invalid pagination key; got: %s", err.Error()) 334 | } 335 | } 336 | -------------------------------------------------------------------------------- /go/v1beta1/storage/pgsqlstore_test.go: -------------------------------------------------------------------------------- 1 | package storage 2 | 3 | import ( 4 | "fmt" 5 | "reflect" 6 | "testing" 7 | "time" 8 | 9 | "github.com/DATA-DOG/go-sqlmock" 10 | "github.com/grafeas/grafeas/go/name" 11 | prpb "github.com/grafeas/grafeas/proto/v1beta1/project_go_proto" 12 | "golang.org/x/net/context" 13 | ) 14 | 15 | const ( 16 | pid = "pid" 17 | nid = "nid" 18 | paginationKey = "nQi0NzMjerFtlMnbylnWzMrIlNCsuyzeq8LnBEkgxrk=" // go get -v github.com/fernet/fernet-go/cmd/fernet-keygen ; fernet-keygen 19 | ) 20 | 21 | func genTestDataProjects() ([]*prpb.Project, []string, error) { 22 | var prjs []*prpb.Project 23 | var prjsData []string 24 | for i := 1; i <= 5; i++ { 25 | s := name.FormatProject(fmt.Sprintf("projects/p%d", i)) 26 | p := &prpb.Project{ 27 | Name: s, 28 | } 29 | prjs = append(prjs, p) 30 | prjsData = append(prjsData, string(s)) 31 | } 32 | return prjs, prjsData, nil 33 | } 34 | 35 | func TestStore_ListProjects(t *testing.T) { 36 | projects, projectsData, err := genTestDataProjects() 37 | if err != nil { 38 | t.Fatalf("failed to genTestDataProjects, err: %v", err) 39 | } 40 | 41 | t.Parallel() 42 | ctx, cancel := context.WithTimeout(context.Background(), time.Minute) 43 | defer cancel() 44 | tests := []struct { 45 | name string 46 | getStore func(t *testing.T) (*PgSQLStore, func()) 47 | filter string 48 | pageToken string 49 | pageSize int 50 | want []*prpb.Project 51 | wantDecryptedID int64 52 | wantErr bool 53 | }{ 54 | { 55 | name: "happy path", 56 | getStore: func(t *testing.T) (*PgSQLStore, func()) { 57 | db, mock, err := sqlmock.New() 58 | if err != nil { 59 | t.Fatalf("an error '%s' was not expected when opening a stub database connection", err) 60 | } 61 | 62 | rows := sqlmock.NewRows([]string{"id", "data"}) 63 | for i, o := range projectsData { 64 | rows = rows.AddRow(i+1, o) // index id starts from 1 65 | } 66 | mock.ExpectQuery("SELECT id, name FROM projects"). 67 | WillReturnRows(rows) 68 | mock.ExpectQuery(`SELECT MAX\(id\) FROM projects`). 69 | WillReturnRows(sqlmock.NewRows([]string{"id"}).AddRow(int64(len(projectsData)))) 70 | s := &PgSQLStore{DB: db} 71 | return s, func() { db.Close() } 72 | }, 73 | want: projects, 74 | }, 75 | { 76 | name: "pagination", 77 | getStore: func(t *testing.T) (*PgSQLStore, func()) { 78 | db, mock, err := sqlmock.New() 79 | if err != nil { 80 | t.Fatalf("an error '%s' was not expected when opening a stub database connection", err) 81 | } 82 | 83 | rows := sqlmock.NewRows([]string{"id", "data"}) 84 | for i := 0; i < 2; i++ { 85 | rows = rows.AddRow(i+1, projectsData[i]) // index id starts from 1 86 | } 87 | mock.ExpectQuery("SELECT id, name FROM projects"). 88 | WillReturnRows(rows) 89 | mock.ExpectQuery(`SELECT MAX\(id\) FROM projects`). 90 | WillReturnRows(sqlmock.NewRows([]string{"id"}).AddRow(int64(len(projectsData)))) 91 | s := &PgSQLStore{DB: db, paginationKey: paginationKey} 92 | return s, func() { db.Close() } 93 | }, 94 | want: projects[0:2], 95 | wantDecryptedID: 2, 96 | }, 97 | } 98 | for _, tt := range tests { 99 | t.Run(tt.name, func(t *testing.T) { 100 | s, cancel := tt.getStore(t) 101 | defer cancel() 102 | got, nextToken, err := s.ListProjects(ctx, tt.filter, tt.pageSize, tt.pageToken) 103 | if (err != nil) != tt.wantErr { 104 | t.Errorf("ListProjects() error = %v, wantErr %v", err, tt.wantErr) 105 | return 106 | } 107 | if !reflect.DeepEqual(got, tt.want) { 108 | t.Errorf("ListProjects() got = %v, want %v", got, tt.want) 109 | } 110 | decryptedTokenID := decryptInt64(nextToken, s.paginationKey, 0) 111 | if decryptedTokenID != tt.wantDecryptedID { 112 | t.Errorf("ListProjects() got1 = %v, want %v", nextToken, tt.wantDecryptedID) 113 | } 114 | }) 115 | } 116 | } 117 | -------------------------------------------------------------------------------- /go/v1beta1/storage/queries.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Grafeas Authors. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | package storage 16 | 17 | const ( 18 | createTables = ` 19 | CREATE TABLE IF NOT EXISTS projects ( 20 | id SERIAL PRIMARY KEY, 21 | name TEXT NOT NULL UNIQUE 22 | ); 23 | CREATE TABLE IF NOT EXISTS notes ( 24 | id SERIAL PRIMARY KEY, 25 | project_name TEXT NOT NULL, 26 | note_name TEXT NOT NULL, 27 | data JSONB, 28 | UNIQUE (project_name, note_name) 29 | ); 30 | CREATE TABLE IF NOT EXISTS occurrences ( 31 | id SERIAL PRIMARY KEY, 32 | project_name TEXT NOT NULL, 33 | occurrence_name TEXT NOT NULL, 34 | data JSONB, 35 | note_id int REFERENCES notes NOT NULL, 36 | UNIQUE (project_name, occurrence_name) 37 | );` 38 | 39 | insertProject = `INSERT INTO projects(name) VALUES ($1)` 40 | projectExists = `SELECT EXISTS (SELECT 1 FROM projects WHERE name = $1)` 41 | deleteProject = `DELETE FROM projects WHERE name = $1` 42 | // "ORDER BY id" is required because the default select order of PostgreSQL is not guaranteed. 43 | listProjects = `SELECT id, name FROM projects WHERE %s id > $1 ORDER BY id LIMIT $2` 44 | projectsMaxID = `SELECT MAX(id) FROM projects` 45 | 46 | insertOccurrence = `INSERT INTO occurrences(project_name, occurrence_name, note_id, data) 47 | VALUES ($1, $2, (SELECT id FROM notes WHERE project_name = $3 AND note_name = $4), $5)` 48 | searchOccurrence = `SELECT data FROM occurrences WHERE project_name = $1 AND occurrence_name = $2` 49 | updateOccurrence = `UPDATE occurrences SET data = $1 WHERE project_name = $2 AND occurrence_name = $3` 50 | deleteOccurrence = `DELETE FROM occurrences WHERE project_name = $1 AND occurrence_name = $2` 51 | // "ORDER BY id" is required because the default select order of PostgreSQL is not guaranteed. 52 | listOccurrences = `SELECT id, data FROM occurrences WHERE project_name = $1 %s AND id > $2 ORDER BY id LIMIT $3` 53 | occurrenceMaxID = `SELECT MAX(id) FROM occurrences WHERE project_name = $1 %s` 54 | 55 | insertNote = `INSERT INTO notes(project_name, note_name, data) VALUES ($1, $2, $3)` 56 | searchNote = `SELECT data FROM notes WHERE project_name = $1 AND note_name = $2` 57 | updateNote = `UPDATE notes SET data = $1 WHERE project_name = $2 AND note_name = $3` 58 | deleteNote = `DELETE FROM notes WHERE project_name = $1 AND note_name = $2` 59 | listNotes = `SELECT id, data FROM notes WHERE project_name = $1 %s AND id > $2 ORDER BY id LIMIT $3` 60 | notesMaxID = `SELECT MAX(id) FROM notes WHERE project_name = $1 %s` 61 | listNoteOccurrences = `SELECT o.id, o.data FROM occurrences as o, notes as n 62 | WHERE n.id = o.note_id 63 | AND n.project_name = $1 64 | AND n.note_name = $2 65 | AND o.id > $3 66 | LIMIT $4` 67 | 68 | NoteOccurrencesMaxID = `SELECT MAX(o.id) FROM occurrences as o, notes as n 69 | WHERE n.id = o.note_id 70 | AND n.project_name = $1 71 | AND n.note_name = $2` 72 | ) 73 | -------------------------------------------------------------------------------- /postgres/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM postgres:latest 2 | WORKDIR / 3 | COPY ./init.sh /docker-entrypoint-initdb.d/init.sh 4 | EXPOSE 5432 5 | -------------------------------------------------------------------------------- /postgres/init.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | echo 'Setting up PostgreSQL database' 5 | 6 | # Replace with extracting username and password from config 7 | # Set password and utilize username from extracted var 8 | psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" <<-EOSQL 9 | CREATE USER grafeas WITH PASSWORD 'changeme'; 10 | ALTER ROLE grafeas WITH CREATEDB; 11 | CREATE DATABASE grafeas_db; 12 | GRANT ALL PRIVILEGES ON DATABASE grafeas_db TO grafeas; 13 | EOSQL 14 | 15 | echo 'Database is up' 16 | -------------------------------------------------------------------------------- /server/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM us.gcr.io/grafeas/grafeas-server:v0.1.0 2 | WORKDIR / 3 | COPY ./config.yaml /config.yaml 4 | COPY ./wait.sh /wait.sh 5 | COPY ./start.sh /start.sh 6 | EXPOSE 8080 7 | 8 | ENTRYPOINT ["./start.sh"] 9 | -------------------------------------------------------------------------------- /server/config.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2019 The Grafeas Authors. All rights reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | grafeas: 16 | # Grafeas api server config 17 | api: 18 | # Endpoint address 19 | address: "0.0.0.0:8080" 20 | # PKI configuration (optional) 21 | cafile: 22 | keyfile: 23 | certfile: 24 | # CORS configuration (optional) 25 | cors_allowed_origins: 26 | # - "http://example.net" 27 | storage_type: "postgres" 28 | # Postgres options 29 | postgres: 30 | # Database host 31 | host: "db:5432" 32 | # Database name 33 | dbname: "db" 34 | # Database username 35 | user: "grafeas" 36 | # Database password 37 | password: "changeme" 38 | # Valid sslmodes disable, allow, prefer, require, verify-ca, verify-full. 39 | # See https://www.postgresql.org/docs/current/static/libpq-connect.html for details 40 | sslmode: "disable" 41 | # 32-bit URL-safe base64 key used to encrypt pagination tokens 42 | # If one is not provided, it will be generated. 43 | # Multiple grafeas instances in the same cluster need the same value. 44 | paginationkey: 45 | 46 | -------------------------------------------------------------------------------- /server/start.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | config='config.yaml' 4 | timeout=10 5 | 6 | if [ -f $config ] 7 | then 8 | db=`grep -Eo "host:\s*\"(.+:[0-9]+)\"" $config | cut -d \" -f2` 9 | echo "Database: $db" 10 | 11 | $(./wait.sh $db $timeout) 12 | up=$? 13 | echo "Database up=0? $up" 14 | 15 | if [ $up -eq 0 ] ; then 16 | $(./grafeas-server --config $config) 17 | else 18 | echo "Database is down, exiting" 1>&2 19 | exit 1 20 | fi 21 | else 22 | echo "No config file is specified, exiting" 1>&2 23 | exit 1 24 | fi 25 | 26 | echo "Done" 27 | -------------------------------------------------------------------------------- /server/wait.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | HOST=$(printf "%s\n" "$1"| cut -d : -f 1) 4 | PORT=$(printf "%s\n" "$1"| cut -d : -f 2) 5 | TIMEOUT="$2" 6 | 7 | if [ "$HOST" = "" ]; then exit 1; fi 8 | if [ "$PORT" = "" ]; then exit 1; fi 9 | if [ "$TIMEOUT" = "" ]; then exit 1; fi 10 | 11 | for i in `seq $TIMEOUT` ; do 12 | nc -z "$HOST" "$PORT" 13 | out=$? 14 | if [ $out -eq 0 ]; then 15 | exit 0 16 | fi 17 | sleep 1 18 | done 19 | exit 1 20 | --------------------------------------------------------------------------------