diff --git a/.github/workflows/capabilities.yaml b/.github/workflows/capabilities.yaml index d2c95cf9..a20686e5 100644 --- a/.github/workflows/capabilities.yaml +++ b/.github/workflows/capabilities.yaml @@ -18,7 +18,9 @@ jobs: token: ${{ secrets.RELENG_GITHUB_TOKEN }} - name: Run Docker Compose as a Daemon (to start sql server) - run: docker-compose -f ./docker-compose.yml up --detach + run: docker compose -f ./docker-compose.yml up --detach + - name: Create another database + run: docker exec -t baton-sql-server-db-1 /opt/mssql-tools18/bin/sqlcmd -C -S localhost -U SA -P 'devP@ssw0rd' -Q 'create database [space test 1]' - name: Setup Go uses: actions/setup-go@v5 @@ -29,6 +31,8 @@ jobs: run: go build -o connector ./cmd/baton-sql-server - name: Run and save output + env: + BATON_DSN: server=127.0.0.1;user id=sa;password=devP@ssw0rd;port=1433 run: ./connector capabilities > baton_capabilities.json - name: Commit changes diff --git a/README.md b/README.md index cfb12a0f..905afca9 100644 --- a/README.md +++ b/README.md @@ -97,6 +97,7 @@ Flags: --log-format string The output format for logs: json, console ($BATON_LOG_FORMAT) (default "json") --log-level string The log level: debug, info, warn, error ($BATON_LOG_LEVEL) (default "info") -p, --provisioning This must be set in order for provisioning actions to be enabled ($BATON_PROVISIONING) + --skip-unavailable-databases Skip databases that are unavailable (offline, restoring, etc) ($BATON_SKIP_UNAVAILABLE_DATABASES) --ticketing This must be set to enable ticketing support ($BATON_TICKETING) -v, --version version for baton-sql-server diff --git a/cmd/baton-sql-server/config.go b/cmd/baton-sql-server/config.go index 46adbd7f..375e8c7b 100644 --- a/cmd/baton-sql-server/config.go +++ b/cmd/baton-sql-server/config.go @@ -1,28 +1,17 @@ package main import ( - "context" - "fmt" - "github.com/conductorone/baton-sdk/pkg/field" - "github.com/spf13/viper" ) var ( dsn = field.StringField("dsn", field.WithDescription("The connection string for connecting to SQL Server"), field.WithRequired(true)) + skipUnavailableDatabases = field.BoolField("skip-unavailable-databases", + field.WithDescription("Skip databases that are unavailable (offline, restoring, etc)")) ) var cfg = field.Configuration{ - Fields: []field.SchemaField{dsn}, -} - -// validateConfig is run after the configuration is loaded, and should return an error if it isn't valid. -func validateConfig(_ context.Context, v *viper.Viper) error { - if v.GetString(dsn.FieldName) == "" { - return fmt.Errorf("--dsn is required") - } - - return nil + Fields: []field.SchemaField{dsn, skipUnavailableDatabases}, } diff --git a/cmd/baton-sql-server/main.go b/cmd/baton-sql-server/main.go index 840f63ce..714b83a1 100644 --- a/cmd/baton-sql-server/main.go +++ b/cmd/baton-sql-server/main.go @@ -36,11 +36,7 @@ func main() { func getConnector(ctx context.Context, v *viper.Viper) (types.ConnectorServer, error) { l := ctxzap.Extract(ctx) - if err := validateConfig(ctx, v); err != nil { - return nil, err - } - - cb, err := connector.New(ctx, v.GetString(dsn.FieldName)) + cb, err := connector.New(ctx, v.GetString(dsn.FieldName), v.GetBool(skipUnavailableDatabases.FieldName)) if err != nil { l.Error("error creating connector", zap.Error(err)) return nil, err diff --git a/go.mod b/go.mod index 1f80717a..4f56af17 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/conductorone/baton-sql-server go 1.21 require ( - github.com/conductorone/baton-sdk v0.2.13 + github.com/conductorone/baton-sdk v0.2.35 github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 github.com/jmoiron/sqlx v1.3.5 github.com/microsoft/go-mssqldb v1.3.0 @@ -15,6 +15,7 @@ require ( require ( filippo.io/age v1.1.1 // indirect filippo.io/edwards25519 v1.1.0 // indirect + github.com/allegro/bigcache/v3 v3.1.0 // indirect github.com/aws/aws-sdk-go-v2 v1.26.1 // indirect github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.2 // indirect github.com/aws/aws-sdk-go-v2/config v1.27.11 // indirect diff --git a/go.sum b/go.sum index f4b97996..47f76008 100644 --- a/go.sum +++ b/go.sum @@ -10,6 +10,8 @@ github.com/AzureAD/microsoft-authentication-library-for-go v1.0.0/go.mod h1:kgDm github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/DATA-DOG/go-sqlmock v1.5.0 h1:Shsta01QNfFxHCfpW6YH2STWB0MudeXXEWMr20OEh60= github.com/DATA-DOG/go-sqlmock v1.5.0/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM= +github.com/allegro/bigcache/v3 v3.1.0 h1:H2Vp8VOvxcrB91o86fUSVJFqeuz8kpyyB02eH3bSzwk= +github.com/allegro/bigcache/v3 v3.1.0/go.mod h1:aPyh7jEvrog9zAwx5N7+JUQX5dZTSGpxF1LAR4dr35I= github.com/aws/aws-sdk-go-v2 v1.26.1 h1:5554eUqIYVWpU0YmeeYZ0wU64H2VLBs8TlhRB2L+EkA= github.com/aws/aws-sdk-go-v2 v1.26.1/go.mod h1:ffIFB97e2yNsv4aTSGkqtHnppsIJzw7G7BReUZ3jCXM= github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.2 h1:x6xsQXGSmW6frevwDA+vi/wqhp1ct18mVXYN08/93to= @@ -54,8 +56,8 @@ github.com/benbjohnson/clock v1.3.5/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZx github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= -github.com/conductorone/baton-sdk v0.2.13 h1:/9wJGlbiPxDQmjqKOTqyKpJ1Ui2+o7oYHInMqqR1PyQ= -github.com/conductorone/baton-sdk v0.2.13/go.mod h1:cg5FyUcJnD7xK5SPbHe/KNpwUVVlpHJ9rnmd3UwxSkU= +github.com/conductorone/baton-sdk v0.2.35 h1:aSdNvlM5HMti8WdhotrXTHWs+b+BmSqMxtGwsSUFxjY= +github.com/conductorone/baton-sdk v0.2.35/go.mod h1:hmd/Oz3DPIKD+9QmkusZaA18ZoiinnTDdrxh2skcdUc= github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= diff --git a/pkg/connector/connector.go b/pkg/connector/connector.go index f5a27870..b3bd112b 100644 --- a/pkg/connector/connector.go +++ b/pkg/connector/connector.go @@ -58,8 +58,8 @@ func (o *Mssqldb) ResourceSyncers(ctx context.Context) []connectorbuilder.Resour } } -func New(ctx context.Context, dsn string) (*Mssqldb, error) { - c, err := mssqldb.New(ctx, dsn) +func New(ctx context.Context, dsn string, skipUnavailableDatabases bool) (*Mssqldb, error) { + c, err := mssqldb.New(ctx, dsn, skipUnavailableDatabases) if err != nil { return nil, err } diff --git a/pkg/connector/internal_test.go b/pkg/connector/internal_test.go index 57eb87e9..9e250f8c 100644 --- a/pkg/connector/internal_test.go +++ b/pkg/connector/internal_test.go @@ -49,7 +49,7 @@ func TestClientListDatabasePermissions(t *testing.T) { t.Skip() } - cli, err := mssqldb.New(ctx, dsn) + cli, err := mssqldb.New(ctx, dsn, false) assert.Nil(t, err) for _, test := range tests { @@ -69,7 +69,7 @@ func TestClientListServerPermissions(t *testing.T) { t.Skip() } - cli, err := mssqldb.New(ctx, dsn) + cli, err := mssqldb.New(ctx, dsn, false) assert.Nil(t, err) for keepingPagination(pager.Token) { @@ -84,7 +84,7 @@ func TestClientListServerRoles(t *testing.T) { t.Skip() } - cli, err := mssqldb.New(ctx, dsn) + cli, err := mssqldb.New(ctx, dsn, false) assert.Nil(t, err) for keepingPagination(pager.Token) { @@ -129,7 +129,7 @@ func TestClientListDatabaseRoles(t *testing.T) { t.Skip() } - cli, err := mssqldb.New(ctx, dsn) + cli, err := mssqldb.New(ctx, dsn, false) assert.Nil(t, err) for _, test := range tests { @@ -176,7 +176,7 @@ func TestClientListDatabaseRolePrincipals(t *testing.T) { t.Skip() } - cli, err := mssqldb.New(ctx, dsn) + cli, err := mssqldb.New(ctx, dsn, false) assert.Nil(t, err) for _, test := range tests { @@ -197,7 +197,7 @@ func TestClientListServerRolePrincipals(t *testing.T) { t.Skip() } - cli, err := mssqldb.New(ctx, dsn) + cli, err := mssqldb.New(ctx, dsn, false) assert.Nil(t, err) for keepingPagination(pager.Token) { @@ -212,7 +212,7 @@ func TestClientListDatabases(t *testing.T) { t.Skip() } - cli, err := mssqldb.New(ctx, dsn) + cli, err := mssqldb.New(ctx, dsn, false) assert.Nil(t, err) for keepingPagination(pager.Token) { diff --git a/pkg/mssqldb/client.go b/pkg/mssqldb/client.go index 038197b4..a52b6642 100644 --- a/pkg/mssqldb/client.go +++ b/pkg/mssqldb/client.go @@ -9,7 +9,8 @@ import ( ) type Client struct { - db *sqlx.DB + db *sqlx.DB + skipUnavailableDatabases bool } // List databases @@ -20,7 +21,7 @@ type Client struct { // List users -func New(ctx context.Context, dsn string) (*Client, error) { +func New(ctx context.Context, dsn string, skipUnavailableDatabases bool) (*Client, error) { db, err := sqlx.Connect("sqlserver", dsn) if err != nil { return nil, err @@ -31,7 +32,8 @@ func New(ctx context.Context, dsn string) (*Client, error) { db.SetMaxIdleConns(1) c := &Client{ - db: db, + db: db, + skipUnavailableDatabases: skipUnavailableDatabases, } return c, nil diff --git a/pkg/mssqldb/databases.go b/pkg/mssqldb/databases.go index 166052d9..be43b52f 100644 --- a/pkg/mssqldb/databases.go +++ b/pkg/mssqldb/databases.go @@ -12,8 +12,9 @@ import ( const DatabaseType = "database" type DbModel struct { - ID int64 `db:"database_id"` - Name string `db:"name"` + ID int64 `db:"database_id"` + Name string `db:"name"` + StateDesc string `db:"state_desc"` } func (c *Client) GetDatabase(ctx context.Context, id int64) (*DbModel, error) { @@ -48,7 +49,7 @@ func (c *Client) ListDatabases(ctx context.Context, pager *Pager) ([]*DbModel, s args := []interface{}{offset, limit + 1} var sb strings.Builder - _, _ = sb.WriteString(`SELECT name, database_id FROM sys.databases + _, _ = sb.WriteString(`SELECT name, database_id, state_desc FROM sys.databases ORDER BY database_id ASC OFFSET @p1 ROWS FETCH NEXT @p2 ROWS ONLY`) @@ -68,6 +69,10 @@ func (c *Client) ListDatabases(ctx context.Context, pager *Pager) ([]*DbModel, s if err != nil { return nil, "", err } + if c.skipUnavailableDatabases && dbModel.StateDesc != "ONLINE" { + l.Info("Skipping sync of unavailable database", zap.String("name", dbModel.Name), zap.String("state", dbModel.StateDesc)) + continue + } ret = append(ret, &dbModel) } if rows.Err() != nil { diff --git a/pkg/mssqldb/users_test.go b/pkg/mssqldb/users_test.go index 3eb21df5..2a6549de 100644 --- a/pkg/mssqldb/users_test.go +++ b/pkg/mssqldb/users_test.go @@ -11,7 +11,7 @@ func TestClient_GetServerPrincipalForDatabaseUser(t *testing.T) { t.Skip("requires a running SQL Server instance") ctx := context.Background() - c, err := New(ctx, "server=127.0.0.1;user id=sa;password=devP@ssw0rd;port=1433") + c, err := New(ctx, "server=127.0.0.1;user id=sa;password=devP@ssw0rd;port=1433", false) require.NoError(t, err) u, err := c.GetServerPrincipalForDatabasePrincipal(ctx, "master", 7) diff --git a/vendor/github.com/allegro/bigcache/v3/.codecov.yml b/vendor/github.com/allegro/bigcache/v3/.codecov.yml new file mode 100644 index 00000000..d8c862ec --- /dev/null +++ b/vendor/github.com/allegro/bigcache/v3/.codecov.yml @@ -0,0 +1,28 @@ +--- +codecov: + require_ci_to_pass: true +comment: + behavior: default + layout: reach, diff, flags, files, footer + require_base: false + require_changes: false + require_head: true +coverage: + precision: 2 + range: + - 70 + - 100 + round: down + status: + changes: false + patch: true + project: true +parsers: + gcov: + branch_detection: + conditional: true + loop: true + macro: false + method: false + javascript: + enable_partials: false diff --git a/vendor/github.com/allegro/bigcache/v3/.gitignore b/vendor/github.com/allegro/bigcache/v3/.gitignore new file mode 100644 index 00000000..78869152 --- /dev/null +++ b/vendor/github.com/allegro/bigcache/v3/.gitignore @@ -0,0 +1,11 @@ +.idea +.DS_Store +/server/server.exe +/server/server +/server/server_dar* +/server/server_fre* +/server/server_win* +/server/server_net* +/server/server_ope* +/server/server_lin* +CHANGELOG.md diff --git a/vendor/github.com/allegro/bigcache/v3/LICENSE b/vendor/github.com/allegro/bigcache/v3/LICENSE new file mode 100644 index 00000000..8dada3ed --- /dev/null +++ b/vendor/github.com/allegro/bigcache/v3/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright {yyyy} {name of copyright owner} + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/vendor/github.com/allegro/bigcache/v3/README.md b/vendor/github.com/allegro/bigcache/v3/README.md new file mode 100644 index 00000000..253749be --- /dev/null +++ b/vendor/github.com/allegro/bigcache/v3/README.md @@ -0,0 +1,204 @@ +# BigCache [![Build Status](https://github.com/allegro/bigcache/workflows/build/badge.svg)](https://github.com/allegro/bigcache/actions?query=workflow%3Abuild) [![Coverage Status](https://coveralls.io/repos/github/allegro/bigcache/badge.svg?branch=master)](https://coveralls.io/github/allegro/bigcache?branch=master) [![GoDoc](https://godoc.org/github.com/allegro/bigcache/v3?status.svg)](https://godoc.org/github.com/allegro/bigcache/v3) [![Go Report Card](https://goreportcard.com/badge/github.com/allegro/bigcache/v3)](https://goreportcard.com/report/github.com/allegro/bigcache/v3) + +Fast, concurrent, evicting in-memory cache written to keep big number of entries without impact on performance. +BigCache keeps entries on heap but omits GC for them. To achieve that, operations on byte slices take place, +therefore entries (de)serialization in front of the cache will be needed in most use cases. + +Requires Go 1.12 or newer. + +## Usage + +### Simple initialization + +```go +import ( + "fmt" + "context" + "github.com/allegro/bigcache/v3" +) + +cache, _ := bigcache.New(context.Background(), bigcache.DefaultConfig(10 * time.Minute)) + +cache.Set("my-unique-key", []byte("value")) + +entry, _ := cache.Get("my-unique-key") +fmt.Println(string(entry)) +``` + +### Custom initialization + +When cache load can be predicted in advance then it is better to use custom initialization because additional memory +allocation can be avoided in that way. + +```go +import ( + "log" + + "github.com/allegro/bigcache/v3" +) + +config := bigcache.Config { + // number of shards (must be a power of 2) + Shards: 1024, + + // time after which entry can be evicted + LifeWindow: 10 * time.Minute, + + // Interval between removing expired entries (clean up). + // If set to <= 0 then no action is performed. + // Setting to < 1 second is counterproductive — bigcache has a one second resolution. + CleanWindow: 5 * time.Minute, + + // rps * lifeWindow, used only in initial memory allocation + MaxEntriesInWindow: 1000 * 10 * 60, + + // max entry size in bytes, used only in initial memory allocation + MaxEntrySize: 500, + + // prints information about additional memory allocation + Verbose: true, + + // cache will not allocate more memory than this limit, value in MB + // if value is reached then the oldest entries can be overridden for the new ones + // 0 value means no size limit + HardMaxCacheSize: 8192, + + // callback fired when the oldest entry is removed because of its expiration time or no space left + // for the new entry, or because delete was called. A bitmask representing the reason will be returned. + // Default value is nil which means no callback and it prevents from unwrapping the oldest entry. + OnRemove: nil, + + // OnRemoveWithReason is a callback fired when the oldest entry is removed because of its expiration time or no space left + // for the new entry, or because delete was called. A constant representing the reason will be passed through. + // Default value is nil which means no callback and it prevents from unwrapping the oldest entry. + // Ignored if OnRemove is specified. + OnRemoveWithReason: nil, + } + +cache, initErr := bigcache.New(context.Background(), config) +if initErr != nil { + log.Fatal(initErr) +} + +cache.Set("my-unique-key", []byte("value")) + +if entry, err := cache.Get("my-unique-key"); err == nil { + fmt.Println(string(entry)) +} +``` + +### `LifeWindow` & `CleanWindow` + +1. `LifeWindow` is a time. After that time, an entry can be called dead but not deleted. + +2. `CleanWindow` is a time. After that time, all the dead entries will be deleted, but not the entries that still have life. + +## [Benchmarks](https://github.com/allegro/bigcache-bench) + +Three caches were compared: bigcache, [freecache](https://github.com/coocood/freecache) and map. +Benchmark tests were made using an +i7-6700K CPU @ 4.00GHz with 32GB of RAM on Ubuntu 18.04 LTS (5.2.12-050212-generic). + +Benchmarks source code can be found [here](https://github.com/allegro/bigcache-bench) + +### Writes and reads + +```bash +go version +go version go1.13 linux/amd64 + +go test -bench=. -benchmem -benchtime=4s ./... -timeout 30m +goos: linux +goarch: amd64 +pkg: github.com/allegro/bigcache/v3/caches_bench +BenchmarkMapSet-8 12999889 376 ns/op 199 B/op 3 allocs/op +BenchmarkConcurrentMapSet-8 4355726 1275 ns/op 337 B/op 8 allocs/op +BenchmarkFreeCacheSet-8 11068976 703 ns/op 328 B/op 2 allocs/op +BenchmarkBigCacheSet-8 10183717 478 ns/op 304 B/op 2 allocs/op +BenchmarkMapGet-8 16536015 324 ns/op 23 B/op 1 allocs/op +BenchmarkConcurrentMapGet-8 13165708 401 ns/op 24 B/op 2 allocs/op +BenchmarkFreeCacheGet-8 10137682 690 ns/op 136 B/op 2 allocs/op +BenchmarkBigCacheGet-8 11423854 450 ns/op 152 B/op 4 allocs/op +BenchmarkBigCacheSetParallel-8 34233472 148 ns/op 317 B/op 3 allocs/op +BenchmarkFreeCacheSetParallel-8 34222654 268 ns/op 350 B/op 3 allocs/op +BenchmarkConcurrentMapSetParallel-8 19635688 240 ns/op 200 B/op 6 allocs/op +BenchmarkBigCacheGetParallel-8 60547064 86.1 ns/op 152 B/op 4 allocs/op +BenchmarkFreeCacheGetParallel-8 50701280 147 ns/op 136 B/op 3 allocs/op +BenchmarkConcurrentMapGetParallel-8 27353288 175 ns/op 24 B/op 2 allocs/op +PASS +ok github.com/allegro/bigcache/v3/caches_bench 256.257s +``` + +Writes and reads in bigcache are faster than in freecache. +Writes to map are the slowest. + +### GC pause time + +```bash +go version +go version go1.13 linux/amd64 + +go run caches_gc_overhead_comparison.go + +Number of entries: 20000000 +GC pause for bigcache: 1.506077ms +GC pause for freecache: 5.594416ms +GC pause for map: 9.347015ms +``` + +``` +go version +go version go1.13 linux/arm64 + +go run caches_gc_overhead_comparison.go +Number of entries: 20000000 +GC pause for bigcache: 22.382827ms +GC pause for freecache: 41.264651ms +GC pause for map: 72.236853ms +``` + +Test shows how long are the GC pauses for caches filled with 20mln of entries. +Bigcache and freecache have very similar GC pause time. + +### Memory usage + +You may encounter system memory reporting what appears to be an exponential increase, however this is expected behaviour. Go runtime allocates memory in chunks or 'spans' and will inform the OS when they are no longer required by changing their state to 'idle'. The 'spans' will remain part of the process resource usage until the OS needs to repurpose the address. Further reading available [here](https://utcc.utoronto.ca/~cks/space/blog/programming/GoNoMemoryFreeing). + +## How it works + +BigCache relies on optimization presented in 1.5 version of Go ([issue-9477](https://github.com/golang/go/issues/9477)). +This optimization states that if map without pointers in keys and values is used then GC will omit its content. +Therefore BigCache uses `map[uint64]uint32` where keys are hashed and values are offsets of entries. + +Entries are kept in byte slices, to omit GC again. +Byte slices size can grow to gigabytes without impact on performance +because GC will only see single pointer to it. + +### Collisions + +BigCache does not handle collisions. When new item is inserted and it's hash collides with previously stored item, new item overwrites previously stored value. + +## Bigcache vs Freecache + +Both caches provide the same core features but they reduce GC overhead in different ways. +Bigcache relies on `map[uint64]uint32`, freecache implements its own mapping built on +slices to reduce number of pointers. + +Results from benchmark tests are presented above. +One of the advantage of bigcache over freecache is that you don’t need to know +the size of the cache in advance, because when bigcache is full, +it can allocate additional memory for new entries instead of +overwriting existing ones as freecache does currently. +However hard max size in bigcache also can be set, check [HardMaxCacheSize](https://godoc.org/github.com/allegro/bigcache#Config). + +## HTTP Server + +This package also includes an easily deployable HTTP implementation of BigCache, which can be found in the [server](/server) package. + +## More + +Bigcache genesis is described in allegro.tech blog post: [writing a very fast cache service in Go](http://allegro.tech/2016/03/writing-fast-cache-service-in-go.html) + +## License + +BigCache is released under the Apache 2.0 license (see [LICENSE](LICENSE)) diff --git a/vendor/github.com/allegro/bigcache/v3/bigcache.go b/vendor/github.com/allegro/bigcache/v3/bigcache.go new file mode 100644 index 00000000..17e2aca7 --- /dev/null +++ b/vendor/github.com/allegro/bigcache/v3/bigcache.go @@ -0,0 +1,270 @@ +package bigcache + +import ( + "context" + "fmt" + "time" +) + +const ( + minimumEntriesInShard = 10 // Minimum number of entries in single shard +) + +// BigCache is fast, concurrent, evicting cache created to keep big number of entries without impact on performance. +// It keeps entries on heap but omits GC for them. To achieve that, operations take place on byte arrays, +// therefore entries (de)serialization in front of the cache will be needed in most use cases. +type BigCache struct { + shards []*cacheShard + lifeWindow uint64 + clock clock + hash Hasher + config Config + shardMask uint64 + close chan struct{} +} + +// Response will contain metadata about the entry for which GetWithInfo(key) was called +type Response struct { + EntryStatus RemoveReason +} + +// RemoveReason is a value used to signal to the user why a particular key was removed in the OnRemove callback. +type RemoveReason uint32 + +const ( + // Expired means the key is past its LifeWindow. + Expired = RemoveReason(1) + // NoSpace means the key is the oldest and the cache size was at its maximum when Set was called, or the + // entry exceeded the maximum shard size. + NoSpace = RemoveReason(2) + // Deleted means Delete was called and this key was removed as a result. + Deleted = RemoveReason(3) +) + +// New initialize new instance of BigCache +func New(ctx context.Context, config Config) (*BigCache, error) { + return newBigCache(ctx, config, &systemClock{}) +} + +// NewBigCache initialize new instance of BigCache +// +// Deprecated: NewBigCache is deprecated, please use New(ctx, config) instead, +// New takes in context and can gracefully +// shutdown with context cancellations +func NewBigCache(config Config) (*BigCache, error) { + return newBigCache(context.Background(), config, &systemClock{}) +} + +func newBigCache(ctx context.Context, config Config, clock clock) (*BigCache, error) { + if !isPowerOfTwo(config.Shards) { + return nil, fmt.Errorf("Shards number must be power of two") + } + if config.MaxEntrySize < 0 { + return nil, fmt.Errorf("MaxEntrySize must be >= 0") + } + if config.MaxEntriesInWindow < 0 { + return nil, fmt.Errorf("MaxEntriesInWindow must be >= 0") + } + if config.HardMaxCacheSize < 0 { + return nil, fmt.Errorf("HardMaxCacheSize must be >= 0") + } + + if config.Hasher == nil { + config.Hasher = newDefaultHasher() + } + + cache := &BigCache{ + shards: make([]*cacheShard, config.Shards), + lifeWindow: uint64(config.LifeWindow.Seconds()), + clock: clock, + hash: config.Hasher, + config: config, + shardMask: uint64(config.Shards - 1), + close: make(chan struct{}), + } + + var onRemove func(wrappedEntry []byte, reason RemoveReason) + if config.OnRemoveWithMetadata != nil { + onRemove = cache.providedOnRemoveWithMetadata + } else if config.OnRemove != nil { + onRemove = cache.providedOnRemove + } else if config.OnRemoveWithReason != nil { + onRemove = cache.providedOnRemoveWithReason + } else { + onRemove = cache.notProvidedOnRemove + } + + for i := 0; i < config.Shards; i++ { + cache.shards[i] = initNewShard(config, onRemove, clock) + } + + if config.CleanWindow > 0 { + go func() { + ticker := time.NewTicker(config.CleanWindow) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + fmt.Println("ctx done, shutting down bigcache cleanup routine") + return + case t := <-ticker.C: + cache.cleanUp(uint64(t.Unix())) + case <-cache.close: + return + } + } + }() + } + + return cache, nil +} + +// Close is used to signal a shutdown of the cache when you are done with it. +// This allows the cleaning goroutines to exit and ensures references are not +// kept to the cache preventing GC of the entire cache. +func (c *BigCache) Close() error { + close(c.close) + return nil +} + +// Get reads entry for the key. +// It returns an ErrEntryNotFound when +// no entry exists for the given key. +func (c *BigCache) Get(key string) ([]byte, error) { + hashedKey := c.hash.Sum64(key) + shard := c.getShard(hashedKey) + return shard.get(key, hashedKey) +} + +// GetWithInfo reads entry for the key with Response info. +// It returns an ErrEntryNotFound when +// no entry exists for the given key. +func (c *BigCache) GetWithInfo(key string) ([]byte, Response, error) { + hashedKey := c.hash.Sum64(key) + shard := c.getShard(hashedKey) + return shard.getWithInfo(key, hashedKey) +} + +// Set saves entry under the key +func (c *BigCache) Set(key string, entry []byte) error { + hashedKey := c.hash.Sum64(key) + shard := c.getShard(hashedKey) + return shard.set(key, hashedKey, entry) +} + +// Append appends entry under the key if key exists, otherwise +// it will set the key (same behaviour as Set()). With Append() you can +// concatenate multiple entries under the same key in an lock optimized way. +func (c *BigCache) Append(key string, entry []byte) error { + hashedKey := c.hash.Sum64(key) + shard := c.getShard(hashedKey) + return shard.append(key, hashedKey, entry) +} + +// Delete removes the key +func (c *BigCache) Delete(key string) error { + hashedKey := c.hash.Sum64(key) + shard := c.getShard(hashedKey) + return shard.del(hashedKey) +} + +// Reset empties all cache shards +func (c *BigCache) Reset() error { + for _, shard := range c.shards { + shard.reset(c.config) + } + return nil +} + +// ResetStats resets cache stats +func (c *BigCache) ResetStats() error { + for _, shard := range c.shards { + shard.resetStats() + } + return nil +} + +// Len computes number of entries in cache +func (c *BigCache) Len() int { + var len int + for _, shard := range c.shards { + len += shard.len() + } + return len +} + +// Capacity returns amount of bytes store in the cache. +func (c *BigCache) Capacity() int { + var len int + for _, shard := range c.shards { + len += shard.capacity() + } + return len +} + +// Stats returns cache's statistics +func (c *BigCache) Stats() Stats { + var s Stats + for _, shard := range c.shards { + tmp := shard.getStats() + s.Hits += tmp.Hits + s.Misses += tmp.Misses + s.DelHits += tmp.DelHits + s.DelMisses += tmp.DelMisses + s.Collisions += tmp.Collisions + } + return s +} + +// KeyMetadata returns number of times a cached resource was requested. +func (c *BigCache) KeyMetadata(key string) Metadata { + hashedKey := c.hash.Sum64(key) + shard := c.getShard(hashedKey) + return shard.getKeyMetadataWithLock(hashedKey) +} + +// Iterator returns iterator function to iterate over EntryInfo's from whole cache. +func (c *BigCache) Iterator() *EntryInfoIterator { + return newIterator(c) +} + +func (c *BigCache) onEvict(oldestEntry []byte, currentTimestamp uint64, evict func(reason RemoveReason) error) bool { + oldestTimestamp := readTimestampFromEntry(oldestEntry) + if currentTimestamp < oldestTimestamp { + return false + } + if currentTimestamp-oldestTimestamp > c.lifeWindow { + evict(Expired) + return true + } + return false +} + +func (c *BigCache) cleanUp(currentTimestamp uint64) { + for _, shard := range c.shards { + shard.cleanUp(currentTimestamp) + } +} + +func (c *BigCache) getShard(hashedKey uint64) (shard *cacheShard) { + return c.shards[hashedKey&c.shardMask] +} + +func (c *BigCache) providedOnRemove(wrappedEntry []byte, reason RemoveReason) { + c.config.OnRemove(readKeyFromEntry(wrappedEntry), readEntry(wrappedEntry)) +} + +func (c *BigCache) providedOnRemoveWithReason(wrappedEntry []byte, reason RemoveReason) { + if c.config.onRemoveFilter == 0 || (1< 0 { + c.config.OnRemoveWithReason(readKeyFromEntry(wrappedEntry), readEntry(wrappedEntry), reason) + } +} + +func (c *BigCache) notProvidedOnRemove(wrappedEntry []byte, reason RemoveReason) { +} + +func (c *BigCache) providedOnRemoveWithMetadata(wrappedEntry []byte, reason RemoveReason) { + hashedKey := c.hash.Sum64(readKeyFromEntry(wrappedEntry)) + shard := c.getShard(hashedKey) + c.config.OnRemoveWithMetadata(readKeyFromEntry(wrappedEntry), readEntry(wrappedEntry), shard.getKeyMetadata(hashedKey)) +} diff --git a/vendor/github.com/allegro/bigcache/v3/bytes.go b/vendor/github.com/allegro/bigcache/v3/bytes.go new file mode 100644 index 00000000..2bf2e9a9 --- /dev/null +++ b/vendor/github.com/allegro/bigcache/v3/bytes.go @@ -0,0 +1,11 @@ +// +build !appengine + +package bigcache + +import ( + "unsafe" +) + +func bytesToString(b []byte) string { + return *(*string)(unsafe.Pointer(&b)) +} diff --git a/vendor/github.com/allegro/bigcache/v3/bytes_appengine.go b/vendor/github.com/allegro/bigcache/v3/bytes_appengine.go new file mode 100644 index 00000000..3892f3b5 --- /dev/null +++ b/vendor/github.com/allegro/bigcache/v3/bytes_appengine.go @@ -0,0 +1,7 @@ +// +build appengine + +package bigcache + +func bytesToString(b []byte) string { + return string(b) +} diff --git a/vendor/github.com/allegro/bigcache/v3/clock.go b/vendor/github.com/allegro/bigcache/v3/clock.go new file mode 100644 index 00000000..195d01af --- /dev/null +++ b/vendor/github.com/allegro/bigcache/v3/clock.go @@ -0,0 +1,14 @@ +package bigcache + +import "time" + +type clock interface { + Epoch() int64 +} + +type systemClock struct { +} + +func (c systemClock) Epoch() int64 { + return time.Now().Unix() +} diff --git a/vendor/github.com/allegro/bigcache/v3/config.go b/vendor/github.com/allegro/bigcache/v3/config.go new file mode 100644 index 00000000..63a4e9b1 --- /dev/null +++ b/vendor/github.com/allegro/bigcache/v3/config.go @@ -0,0 +1,97 @@ +package bigcache + +import "time" + +// Config for BigCache +type Config struct { + // Number of cache shards, value must be a power of two + Shards int + // Time after which entry can be evicted + LifeWindow time.Duration + // Interval between removing expired entries (clean up). + // If set to <= 0 then no action is performed. Setting to < 1 second is counterproductive — bigcache has a one second resolution. + CleanWindow time.Duration + // Max number of entries in life window. Used only to calculate initial size for cache shards. + // When proper value is set then additional memory allocation does not occur. + MaxEntriesInWindow int + // Max size of entry in bytes. Used only to calculate initial size for cache shards. + MaxEntrySize int + // StatsEnabled if true calculate the number of times a cached resource was requested. + StatsEnabled bool + // Verbose mode prints information about new memory allocation + Verbose bool + // Hasher used to map between string keys and unsigned 64bit integers, by default fnv64 hashing is used. + Hasher Hasher + // HardMaxCacheSize is a limit for BytesQueue size in MB. + // It can protect application from consuming all available memory on machine, therefore from running OOM Killer. + // Default value is 0 which means unlimited size. When the limit is higher than 0 and reached then + // the oldest entries are overridden for the new ones. The max memory consumption will be bigger than + // HardMaxCacheSize due to Shards' s additional memory. Every Shard consumes additional memory for map of keys + // and statistics (map[uint64]uint32) the size of this map is equal to number of entries in + // cache ~ 2×(64+32)×n bits + overhead or map itself. + HardMaxCacheSize int + // OnRemove is a callback fired when the oldest entry is removed because of its expiration time or no space left + // for the new entry, or because delete was called. + // Default value is nil which means no callback and it prevents from unwrapping the oldest entry. + // ignored if OnRemoveWithMetadata is specified. + OnRemove func(key string, entry []byte) + // OnRemoveWithMetadata is a callback fired when the oldest entry is removed because of its expiration time or no space left + // for the new entry, or because delete was called. A structure representing details about that specific entry. + // Default value is nil which means no callback and it prevents from unwrapping the oldest entry. + OnRemoveWithMetadata func(key string, entry []byte, keyMetadata Metadata) + // OnRemoveWithReason is a callback fired when the oldest entry is removed because of its expiration time or no space left + // for the new entry, or because delete was called. A constant representing the reason will be passed through. + // Default value is nil which means no callback and it prevents from unwrapping the oldest entry. + // Ignored if OnRemove is specified. + OnRemoveWithReason func(key string, entry []byte, reason RemoveReason) + + onRemoveFilter int + + // Logger is a logging interface and used in combination with `Verbose` + // Defaults to `DefaultLogger()` + Logger Logger +} + +// DefaultConfig initializes config with default values. +// When load for BigCache can be predicted in advance then it is better to use custom config. +func DefaultConfig(eviction time.Duration) Config { + return Config{ + Shards: 1024, + LifeWindow: eviction, + CleanWindow: 1 * time.Second, + MaxEntriesInWindow: 1000 * 10 * 60, + MaxEntrySize: 500, + StatsEnabled: false, + Verbose: true, + Hasher: newDefaultHasher(), + HardMaxCacheSize: 0, + Logger: DefaultLogger(), + } +} + +// initialShardSize computes initial shard size +func (c Config) initialShardSize() int { + return max(c.MaxEntriesInWindow/c.Shards, minimumEntriesInShard) +} + +// maximumShardSizeInBytes computes maximum shard size in bytes +func (c Config) maximumShardSizeInBytes() int { + maxShardSize := 0 + + if c.HardMaxCacheSize > 0 { + maxShardSize = convertMBToBytes(c.HardMaxCacheSize) / c.Shards + } + + return maxShardSize +} + +// OnRemoveFilterSet sets which remove reasons will trigger a call to OnRemoveWithReason. +// Filtering out reasons prevents bigcache from unwrapping them, which saves cpu. +func (c Config) OnRemoveFilterSet(reasons ...RemoveReason) Config { + c.onRemoveFilter = 0 + for i := range reasons { + c.onRemoveFilter |= 1 << uint(reasons[i]) + } + + return c +} diff --git a/vendor/github.com/allegro/bigcache/v3/encoding.go b/vendor/github.com/allegro/bigcache/v3/encoding.go new file mode 100644 index 00000000..fc861251 --- /dev/null +++ b/vendor/github.com/allegro/bigcache/v3/encoding.go @@ -0,0 +1,83 @@ +package bigcache + +import ( + "encoding/binary" +) + +const ( + timestampSizeInBytes = 8 // Number of bytes used for timestamp + hashSizeInBytes = 8 // Number of bytes used for hash + keySizeInBytes = 2 // Number of bytes used for size of entry key + headersSizeInBytes = timestampSizeInBytes + hashSizeInBytes + keySizeInBytes // Number of bytes used for all headers +) + +func wrapEntry(timestamp uint64, hash uint64, key string, entry []byte, buffer *[]byte) []byte { + keyLength := len(key) + blobLength := len(entry) + headersSizeInBytes + keyLength + + if blobLength > len(*buffer) { + *buffer = make([]byte, blobLength) + } + blob := *buffer + + binary.LittleEndian.PutUint64(blob, timestamp) + binary.LittleEndian.PutUint64(blob[timestampSizeInBytes:], hash) + binary.LittleEndian.PutUint16(blob[timestampSizeInBytes+hashSizeInBytes:], uint16(keyLength)) + copy(blob[headersSizeInBytes:], key) + copy(blob[headersSizeInBytes+keyLength:], entry) + + return blob[:blobLength] +} + +func appendToWrappedEntry(timestamp uint64, wrappedEntry []byte, entry []byte, buffer *[]byte) []byte { + blobLength := len(wrappedEntry) + len(entry) + if blobLength > len(*buffer) { + *buffer = make([]byte, blobLength) + } + + blob := *buffer + + binary.LittleEndian.PutUint64(blob, timestamp) + copy(blob[timestampSizeInBytes:], wrappedEntry[timestampSizeInBytes:]) + copy(blob[len(wrappedEntry):], entry) + + return blob[:blobLength] +} + +func readEntry(data []byte) []byte { + length := binary.LittleEndian.Uint16(data[timestampSizeInBytes+hashSizeInBytes:]) + + // copy on read + dst := make([]byte, len(data)-int(headersSizeInBytes+length)) + copy(dst, data[headersSizeInBytes+length:]) + + return dst +} + +func readTimestampFromEntry(data []byte) uint64 { + return binary.LittleEndian.Uint64(data) +} + +func readKeyFromEntry(data []byte) string { + length := binary.LittleEndian.Uint16(data[timestampSizeInBytes+hashSizeInBytes:]) + + // copy on read + dst := make([]byte, length) + copy(dst, data[headersSizeInBytes:headersSizeInBytes+length]) + + return bytesToString(dst) +} + +func compareKeyFromEntry(data []byte, key string) bool { + length := binary.LittleEndian.Uint16(data[timestampSizeInBytes+hashSizeInBytes:]) + + return bytesToString(data[headersSizeInBytes:headersSizeInBytes+length]) == key +} + +func readHashFromEntry(data []byte) uint64 { + return binary.LittleEndian.Uint64(data[timestampSizeInBytes:]) +} + +func resetKeyFromEntry(data []byte) { + binary.LittleEndian.PutUint64(data[timestampSizeInBytes:], 0) +} diff --git a/vendor/github.com/allegro/bigcache/v3/entry_not_found_error.go b/vendor/github.com/allegro/bigcache/v3/entry_not_found_error.go new file mode 100644 index 00000000..8993384d --- /dev/null +++ b/vendor/github.com/allegro/bigcache/v3/entry_not_found_error.go @@ -0,0 +1,8 @@ +package bigcache + +import "errors" + +var ( + // ErrEntryNotFound is an error type struct which is returned when entry was not found for provided key + ErrEntryNotFound = errors.New("Entry not found") +) diff --git a/vendor/github.com/allegro/bigcache/v3/fnv.go b/vendor/github.com/allegro/bigcache/v3/fnv.go new file mode 100644 index 00000000..188c9aa6 --- /dev/null +++ b/vendor/github.com/allegro/bigcache/v3/fnv.go @@ -0,0 +1,28 @@ +package bigcache + +// newDefaultHasher returns a new 64-bit FNV-1a Hasher which makes no memory allocations. +// Its Sum64 method will lay the value out in big-endian byte order. +// See https://en.wikipedia.org/wiki/Fowler–Noll–Vo_hash_function +func newDefaultHasher() Hasher { + return fnv64a{} +} + +type fnv64a struct{} + +const ( + // offset64 FNVa offset basis. See https://en.wikipedia.org/wiki/Fowler–Noll–Vo_hash_function#FNV-1a_hash + offset64 = 14695981039346656037 + // prime64 FNVa prime value. See https://en.wikipedia.org/wiki/Fowler–Noll–Vo_hash_function#FNV-1a_hash + prime64 = 1099511628211 +) + +// Sum64 gets the string and returns its uint64 hash value. +func (f fnv64a) Sum64(key string) uint64 { + var hash uint64 = offset64 + for i := 0; i < len(key); i++ { + hash ^= uint64(key[i]) + hash *= prime64 + } + + return hash +} diff --git a/vendor/github.com/allegro/bigcache/v3/hash.go b/vendor/github.com/allegro/bigcache/v3/hash.go new file mode 100644 index 00000000..5f8ade77 --- /dev/null +++ b/vendor/github.com/allegro/bigcache/v3/hash.go @@ -0,0 +1,8 @@ +package bigcache + +// Hasher is responsible for generating unsigned, 64 bit hash of provided string. Hasher should minimize collisions +// (generating same hash for different strings) and while performance is also important fast functions are preferable (i.e. +// you can use FarmHash family). +type Hasher interface { + Sum64(string) uint64 +} diff --git a/vendor/github.com/allegro/bigcache/v3/iterator.go b/vendor/github.com/allegro/bigcache/v3/iterator.go new file mode 100644 index 00000000..db2a2ef4 --- /dev/null +++ b/vendor/github.com/allegro/bigcache/v3/iterator.go @@ -0,0 +1,146 @@ +package bigcache + +import ( + "sync" +) + +type iteratorError string + +func (e iteratorError) Error() string { + return string(e) +} + +// ErrInvalidIteratorState is reported when iterator is in invalid state +const ErrInvalidIteratorState = iteratorError("Iterator is in invalid state. Use SetNext() to move to next position") + +// ErrCannotRetrieveEntry is reported when entry cannot be retrieved from underlying +const ErrCannotRetrieveEntry = iteratorError("Could not retrieve entry from cache") + +var emptyEntryInfo = EntryInfo{} + +// EntryInfo holds informations about entry in the cache +type EntryInfo struct { + timestamp uint64 + hash uint64 + key string + value []byte + err error +} + +// Key returns entry's underlying key +func (e EntryInfo) Key() string { + return e.key +} + +// Hash returns entry's hash value +func (e EntryInfo) Hash() uint64 { + return e.hash +} + +// Timestamp returns entry's timestamp (time of insertion) +func (e EntryInfo) Timestamp() uint64 { + return e.timestamp +} + +// Value returns entry's underlying value +func (e EntryInfo) Value() []byte { + return e.value +} + +// EntryInfoIterator allows to iterate over entries in the cache +type EntryInfoIterator struct { + mutex sync.Mutex + cache *BigCache + currentShard int + currentIndex int + currentEntryInfo EntryInfo + elements []uint64 + elementsCount int + valid bool +} + +// SetNext moves to next element and returns true if it exists. +func (it *EntryInfoIterator) SetNext() bool { + it.mutex.Lock() + + it.valid = false + it.currentIndex++ + + if it.elementsCount > it.currentIndex { + it.valid = true + + empty := it.setCurrentEntry() + it.mutex.Unlock() + + if empty { + return it.SetNext() + } + return true + } + + for i := it.currentShard + 1; i < it.cache.config.Shards; i++ { + it.elements, it.elementsCount = it.cache.shards[i].copyHashedKeys() + + // Non empty shard - stick with it + if it.elementsCount > 0 { + it.currentIndex = 0 + it.currentShard = i + it.valid = true + + empty := it.setCurrentEntry() + it.mutex.Unlock() + + if empty { + return it.SetNext() + } + return true + } + } + it.mutex.Unlock() + return false +} + +func (it *EntryInfoIterator) setCurrentEntry() bool { + var entryNotFound = false + entry, err := it.cache.shards[it.currentShard].getEntry(it.elements[it.currentIndex]) + + if err == ErrEntryNotFound { + it.currentEntryInfo = emptyEntryInfo + entryNotFound = true + } else if err != nil { + it.currentEntryInfo = EntryInfo{ + err: err, + } + } else { + it.currentEntryInfo = EntryInfo{ + timestamp: readTimestampFromEntry(entry), + hash: readHashFromEntry(entry), + key: readKeyFromEntry(entry), + value: readEntry(entry), + err: err, + } + } + + return entryNotFound +} + +func newIterator(cache *BigCache) *EntryInfoIterator { + elements, count := cache.shards[0].copyHashedKeys() + + return &EntryInfoIterator{ + cache: cache, + currentShard: 0, + currentIndex: -1, + elements: elements, + elementsCount: count, + } +} + +// Value returns current value from the iterator +func (it *EntryInfoIterator) Value() (EntryInfo, error) { + if !it.valid { + return emptyEntryInfo, ErrInvalidIteratorState + } + + return it.currentEntryInfo, it.currentEntryInfo.err +} diff --git a/vendor/github.com/allegro/bigcache/v3/logger.go b/vendor/github.com/allegro/bigcache/v3/logger.go new file mode 100644 index 00000000..50e84abc --- /dev/null +++ b/vendor/github.com/allegro/bigcache/v3/logger.go @@ -0,0 +1,30 @@ +package bigcache + +import ( + "log" + "os" +) + +// Logger is invoked when `Config.Verbose=true` +type Logger interface { + Printf(format string, v ...interface{}) +} + +// this is a safeguard, breaking on compile time in case +// `log.Logger` does not adhere to our `Logger` interface. +// see https://golang.org/doc/faq#guarantee_satisfies_interface +var _ Logger = &log.Logger{} + +// DefaultLogger returns a `Logger` implementation +// backed by stdlib's log +func DefaultLogger() *log.Logger { + return log.New(os.Stdout, "", log.LstdFlags) +} + +func newLogger(custom Logger) Logger { + if custom != nil { + return custom + } + + return DefaultLogger() +} diff --git a/vendor/github.com/allegro/bigcache/v3/queue/bytes_queue.go b/vendor/github.com/allegro/bigcache/v3/queue/bytes_queue.go new file mode 100644 index 00000000..3ef0f6d9 --- /dev/null +++ b/vendor/github.com/allegro/bigcache/v3/queue/bytes_queue.go @@ -0,0 +1,269 @@ +package queue + +import ( + "encoding/binary" + "log" + "time" +) + +const ( + // Number of bytes to encode 0 in uvarint format + minimumHeaderSize = 17 // 1 byte blobsize + timestampSizeInBytes + hashSizeInBytes + // Bytes before left margin are not used. Zero index means element does not exist in queue, useful while reading slice from index + leftMarginIndex = 1 +) + +var ( + errEmptyQueue = &queueError{"Empty queue"} + errInvalidIndex = &queueError{"Index must be greater than zero. Invalid index."} + errIndexOutOfBounds = &queueError{"Index out of range"} +) + +// BytesQueue is a non-thread safe queue type of fifo based on bytes array. +// For every push operation index of entry is returned. It can be used to read the entry later +type BytesQueue struct { + full bool + array []byte + capacity int + maxCapacity int + head int + tail int + count int + rightMargin int + headerBuffer []byte + verbose bool +} + +type queueError struct { + message string +} + +// getNeededSize returns the number of bytes an entry of length need in the queue +func getNeededSize(length int) int { + var header int + switch { + case length < 127: // 1<<7-1 + header = 1 + case length < 16382: // 1<<14-2 + header = 2 + case length < 2097149: // 1<<21 -3 + header = 3 + case length < 268435452: // 1<<28 -4 + header = 4 + default: + header = 5 + } + + return length + header +} + +// NewBytesQueue initialize new bytes queue. +// capacity is used in bytes array allocation +// When verbose flag is set then information about memory allocation are printed +func NewBytesQueue(capacity int, maxCapacity int, verbose bool) *BytesQueue { + return &BytesQueue{ + array: make([]byte, capacity), + capacity: capacity, + maxCapacity: maxCapacity, + headerBuffer: make([]byte, binary.MaxVarintLen32), + tail: leftMarginIndex, + head: leftMarginIndex, + rightMargin: leftMarginIndex, + verbose: verbose, + } +} + +// Reset removes all entries from queue +func (q *BytesQueue) Reset() { + // Just reset indexes + q.tail = leftMarginIndex + q.head = leftMarginIndex + q.rightMargin = leftMarginIndex + q.count = 0 + q.full = false +} + +// Push copies entry at the end of queue and moves tail pointer. Allocates more space if needed. +// Returns index for pushed data or error if maximum size queue limit is reached. +func (q *BytesQueue) Push(data []byte) (int, error) { + neededSize := getNeededSize(len(data)) + + if !q.canInsertAfterTail(neededSize) { + if q.canInsertBeforeHead(neededSize) { + q.tail = leftMarginIndex + } else if q.capacity+neededSize >= q.maxCapacity && q.maxCapacity > 0 { + return -1, &queueError{"Full queue. Maximum size limit reached."} + } else { + q.allocateAdditionalMemory(neededSize) + } + } + + index := q.tail + + q.push(data, neededSize) + + return index, nil +} + +func (q *BytesQueue) allocateAdditionalMemory(minimum int) { + start := time.Now() + if q.capacity < minimum { + q.capacity += minimum + } + q.capacity = q.capacity * 2 + if q.capacity > q.maxCapacity && q.maxCapacity > 0 { + q.capacity = q.maxCapacity + } + + oldArray := q.array + q.array = make([]byte, q.capacity) + + if leftMarginIndex != q.rightMargin { + copy(q.array, oldArray[:q.rightMargin]) + + if q.tail <= q.head { + if q.tail != q.head { + // created slice is slightly larger then need but this is fine after only the needed bytes are copied + q.push(make([]byte, q.head-q.tail), q.head-q.tail) + } + + q.head = leftMarginIndex + q.tail = q.rightMargin + } + } + + q.full = false + + if q.verbose { + log.Printf("Allocated new queue in %s; Capacity: %d \n", time.Since(start), q.capacity) + } +} + +func (q *BytesQueue) push(data []byte, len int) { + headerEntrySize := binary.PutUvarint(q.headerBuffer, uint64(len)) + q.copy(q.headerBuffer, headerEntrySize) + + q.copy(data, len-headerEntrySize) + + if q.tail > q.head { + q.rightMargin = q.tail + } + if q.tail == q.head { + q.full = true + } + + q.count++ +} + +func (q *BytesQueue) copy(data []byte, len int) { + q.tail += copy(q.array[q.tail:], data[:len]) +} + +// Pop reads the oldest entry from queue and moves head pointer to the next one +func (q *BytesQueue) Pop() ([]byte, error) { + data, blockSize, err := q.peek(q.head) + if err != nil { + return nil, err + } + + q.head += blockSize + q.count-- + + if q.head == q.rightMargin { + q.head = leftMarginIndex + if q.tail == q.rightMargin { + q.tail = leftMarginIndex + } + q.rightMargin = q.tail + } + + q.full = false + + return data, nil +} + +// Peek reads the oldest entry from list without moving head pointer +func (q *BytesQueue) Peek() ([]byte, error) { + data, _, err := q.peek(q.head) + return data, err +} + +// Get reads entry from index +func (q *BytesQueue) Get(index int) ([]byte, error) { + data, _, err := q.peek(index) + return data, err +} + +// CheckGet checks if an entry can be read from index +func (q *BytesQueue) CheckGet(index int) error { + return q.peekCheckErr(index) +} + +// Capacity returns number of allocated bytes for queue +func (q *BytesQueue) Capacity() int { + return q.capacity +} + +// Len returns number of entries kept in queue +func (q *BytesQueue) Len() int { + return q.count +} + +// Error returns error message +func (e *queueError) Error() string { + return e.message +} + +// peekCheckErr is identical to peek, but does not actually return any data +func (q *BytesQueue) peekCheckErr(index int) error { + + if q.count == 0 { + return errEmptyQueue + } + + if index <= 0 { + return errInvalidIndex + } + + if index >= len(q.array) { + return errIndexOutOfBounds + } + return nil +} + +// peek returns the data from index and the number of bytes to encode the length of the data in uvarint format +func (q *BytesQueue) peek(index int) ([]byte, int, error) { + err := q.peekCheckErr(index) + if err != nil { + return nil, 0, err + } + + blockSize, n := binary.Uvarint(q.array[index:]) + return q.array[index+n : index+int(blockSize)], int(blockSize), nil +} + +// canInsertAfterTail returns true if it's possible to insert an entry of size of need after the tail of the queue +func (q *BytesQueue) canInsertAfterTail(need int) bool { + if q.full { + return false + } + if q.tail >= q.head { + return q.capacity-q.tail >= need + } + // 1. there is exactly need bytes between head and tail, so we do not need + // to reserve extra space for a potential empty entry when realloc this queue + // 2. still have unused space between tail and head, then we must reserve + // at least headerEntrySize bytes so we can put an empty entry + return q.head-q.tail == need || q.head-q.tail >= need+minimumHeaderSize +} + +// canInsertBeforeHead returns true if it's possible to insert an entry of size of need before the head of the queue +func (q *BytesQueue) canInsertBeforeHead(need int) bool { + if q.full { + return false + } + if q.tail >= q.head { + return q.head-leftMarginIndex == need || q.head-leftMarginIndex >= need+minimumHeaderSize + } + return q.head-q.tail == need || q.head-q.tail >= need+minimumHeaderSize +} diff --git a/vendor/github.com/allegro/bigcache/v3/shard.go b/vendor/github.com/allegro/bigcache/v3/shard.go new file mode 100644 index 00000000..e80a759a --- /dev/null +++ b/vendor/github.com/allegro/bigcache/v3/shard.go @@ -0,0 +1,454 @@ +package bigcache + +import ( + "fmt" + "sync" + "sync/atomic" + + "github.com/allegro/bigcache/v3/queue" +) + +type onRemoveCallback func(wrappedEntry []byte, reason RemoveReason) + +// Metadata contains information of a specific entry +type Metadata struct { + RequestCount uint32 +} + +type cacheShard struct { + hashmap map[uint64]uint32 + entries queue.BytesQueue + lock sync.RWMutex + entryBuffer []byte + onRemove onRemoveCallback + + isVerbose bool + statsEnabled bool + logger Logger + clock clock + lifeWindow uint64 + + hashmapStats map[uint64]uint32 + stats Stats + cleanEnabled bool +} + +func (s *cacheShard) getWithInfo(key string, hashedKey uint64) (entry []byte, resp Response, err error) { + currentTime := uint64(s.clock.Epoch()) + s.lock.RLock() + wrappedEntry, err := s.getWrappedEntry(hashedKey) + if err != nil { + s.lock.RUnlock() + return nil, resp, err + } + if entryKey := readKeyFromEntry(wrappedEntry); key != entryKey { + s.lock.RUnlock() + s.collision() + if s.isVerbose { + s.logger.Printf("Collision detected. Both %q and %q have the same hash %x", key, entryKey, hashedKey) + } + return nil, resp, ErrEntryNotFound + } + + entry = readEntry(wrappedEntry) + if s.isExpired(wrappedEntry, currentTime) { + resp.EntryStatus = Expired + } + s.lock.RUnlock() + s.hit(hashedKey) + return entry, resp, nil +} + +func (s *cacheShard) get(key string, hashedKey uint64) ([]byte, error) { + s.lock.RLock() + wrappedEntry, err := s.getWrappedEntry(hashedKey) + if err != nil { + s.lock.RUnlock() + return nil, err + } + if entryKey := readKeyFromEntry(wrappedEntry); key != entryKey { + s.lock.RUnlock() + s.collision() + if s.isVerbose { + s.logger.Printf("Collision detected. Both %q and %q have the same hash %x", key, entryKey, hashedKey) + } + return nil, ErrEntryNotFound + } + entry := readEntry(wrappedEntry) + s.lock.RUnlock() + s.hit(hashedKey) + + return entry, nil +} + +func (s *cacheShard) getWrappedEntry(hashedKey uint64) ([]byte, error) { + itemIndex := s.hashmap[hashedKey] + + if itemIndex == 0 { + s.miss() + return nil, ErrEntryNotFound + } + + wrappedEntry, err := s.entries.Get(int(itemIndex)) + if err != nil { + s.miss() + return nil, err + } + + return wrappedEntry, err +} + +func (s *cacheShard) getValidWrapEntry(key string, hashedKey uint64) ([]byte, error) { + wrappedEntry, err := s.getWrappedEntry(hashedKey) + if err != nil { + return nil, err + } + + if !compareKeyFromEntry(wrappedEntry, key) { + s.collision() + if s.isVerbose { + s.logger.Printf("Collision detected. Both %q and %q have the same hash %x", key, readKeyFromEntry(wrappedEntry), hashedKey) + } + + return nil, ErrEntryNotFound + } + s.hitWithoutLock(hashedKey) + + return wrappedEntry, nil +} + +func (s *cacheShard) set(key string, hashedKey uint64, entry []byte) error { + currentTimestamp := uint64(s.clock.Epoch()) + + s.lock.Lock() + + if previousIndex := s.hashmap[hashedKey]; previousIndex != 0 { + if previousEntry, err := s.entries.Get(int(previousIndex)); err == nil { + resetKeyFromEntry(previousEntry) + //remove hashkey + delete(s.hashmap, hashedKey) + } + } + + if !s.cleanEnabled { + if oldestEntry, err := s.entries.Peek(); err == nil { + s.onEvict(oldestEntry, currentTimestamp, s.removeOldestEntry) + } + } + + w := wrapEntry(currentTimestamp, hashedKey, key, entry, &s.entryBuffer) + + for { + if index, err := s.entries.Push(w); err == nil { + s.hashmap[hashedKey] = uint32(index) + s.lock.Unlock() + return nil + } + if s.removeOldestEntry(NoSpace) != nil { + s.lock.Unlock() + return fmt.Errorf("entry is bigger than max shard size") + } + } +} + +func (s *cacheShard) addNewWithoutLock(key string, hashedKey uint64, entry []byte) error { + currentTimestamp := uint64(s.clock.Epoch()) + + if !s.cleanEnabled { + if oldestEntry, err := s.entries.Peek(); err == nil { + s.onEvict(oldestEntry, currentTimestamp, s.removeOldestEntry) + } + } + + w := wrapEntry(currentTimestamp, hashedKey, key, entry, &s.entryBuffer) + + for { + if index, err := s.entries.Push(w); err == nil { + s.hashmap[hashedKey] = uint32(index) + return nil + } + if s.removeOldestEntry(NoSpace) != nil { + return fmt.Errorf("entry is bigger than max shard size") + } + } +} + +func (s *cacheShard) setWrappedEntryWithoutLock(currentTimestamp uint64, w []byte, hashedKey uint64) error { + if previousIndex := s.hashmap[hashedKey]; previousIndex != 0 { + if previousEntry, err := s.entries.Get(int(previousIndex)); err == nil { + resetKeyFromEntry(previousEntry) + } + } + + if !s.cleanEnabled { + if oldestEntry, err := s.entries.Peek(); err == nil { + s.onEvict(oldestEntry, currentTimestamp, s.removeOldestEntry) + } + } + + for { + if index, err := s.entries.Push(w); err == nil { + s.hashmap[hashedKey] = uint32(index) + return nil + } + if s.removeOldestEntry(NoSpace) != nil { + return fmt.Errorf("entry is bigger than max shard size") + } + } +} + +func (s *cacheShard) append(key string, hashedKey uint64, entry []byte) error { + s.lock.Lock() + wrappedEntry, err := s.getValidWrapEntry(key, hashedKey) + + if err == ErrEntryNotFound { + err = s.addNewWithoutLock(key, hashedKey, entry) + s.lock.Unlock() + return err + } + if err != nil { + s.lock.Unlock() + return err + } + + currentTimestamp := uint64(s.clock.Epoch()) + + w := appendToWrappedEntry(currentTimestamp, wrappedEntry, entry, &s.entryBuffer) + + err = s.setWrappedEntryWithoutLock(currentTimestamp, w, hashedKey) + s.lock.Unlock() + + return err +} + +func (s *cacheShard) del(hashedKey uint64) error { + // Optimistic pre-check using only readlock + s.lock.RLock() + { + itemIndex := s.hashmap[hashedKey] + + if itemIndex == 0 { + s.lock.RUnlock() + s.delmiss() + return ErrEntryNotFound + } + + if err := s.entries.CheckGet(int(itemIndex)); err != nil { + s.lock.RUnlock() + s.delmiss() + return err + } + } + s.lock.RUnlock() + + s.lock.Lock() + { + // After obtaining the writelock, we need to read the same again, + // since the data delivered earlier may be stale now + itemIndex := s.hashmap[hashedKey] + + if itemIndex == 0 { + s.lock.Unlock() + s.delmiss() + return ErrEntryNotFound + } + + wrappedEntry, err := s.entries.Get(int(itemIndex)) + if err != nil { + s.lock.Unlock() + s.delmiss() + return err + } + + delete(s.hashmap, hashedKey) + s.onRemove(wrappedEntry, Deleted) + if s.statsEnabled { + delete(s.hashmapStats, hashedKey) + } + resetKeyFromEntry(wrappedEntry) + } + s.lock.Unlock() + + s.delhit() + return nil +} + +func (s *cacheShard) onEvict(oldestEntry []byte, currentTimestamp uint64, evict func(reason RemoveReason) error) bool { + if s.isExpired(oldestEntry, currentTimestamp) { + evict(Expired) + return true + } + return false +} + +func (s *cacheShard) isExpired(oldestEntry []byte, currentTimestamp uint64) bool { + oldestTimestamp := readTimestampFromEntry(oldestEntry) + if currentTimestamp <= oldestTimestamp { // if currentTimestamp < oldestTimestamp, the result will out of uint64 limits; + return false + } + return currentTimestamp-oldestTimestamp > s.lifeWindow +} + +func (s *cacheShard) cleanUp(currentTimestamp uint64) { + s.lock.Lock() + for { + if oldestEntry, err := s.entries.Peek(); err != nil { + break + } else if evicted := s.onEvict(oldestEntry, currentTimestamp, s.removeOldestEntry); !evicted { + break + } + } + s.lock.Unlock() +} + +func (s *cacheShard) getEntry(hashedKey uint64) ([]byte, error) { + s.lock.RLock() + + entry, err := s.getWrappedEntry(hashedKey) + // copy entry + newEntry := make([]byte, len(entry)) + copy(newEntry, entry) + + s.lock.RUnlock() + + return newEntry, err +} + +func (s *cacheShard) copyHashedKeys() (keys []uint64, next int) { + s.lock.RLock() + keys = make([]uint64, len(s.hashmap)) + + for key := range s.hashmap { + keys[next] = key + next++ + } + + s.lock.RUnlock() + return keys, next +} + +func (s *cacheShard) removeOldestEntry(reason RemoveReason) error { + oldest, err := s.entries.Pop() + if err == nil { + hash := readHashFromEntry(oldest) + if hash == 0 { + // entry has been explicitly deleted with resetKeyFromEntry, ignore + return nil + } + delete(s.hashmap, hash) + s.onRemove(oldest, reason) + if s.statsEnabled { + delete(s.hashmapStats, hash) + } + return nil + } + return err +} + +func (s *cacheShard) reset(config Config) { + s.lock.Lock() + s.hashmap = make(map[uint64]uint32, config.initialShardSize()) + s.entryBuffer = make([]byte, config.MaxEntrySize+headersSizeInBytes) + s.entries.Reset() + s.lock.Unlock() +} + +func (s *cacheShard) resetStats() { + s.lock.Lock() + s.stats = Stats{} + s.lock.Unlock() +} + +func (s *cacheShard) len() int { + s.lock.RLock() + res := len(s.hashmap) + s.lock.RUnlock() + return res +} + +func (s *cacheShard) capacity() int { + s.lock.RLock() + res := s.entries.Capacity() + s.lock.RUnlock() + return res +} + +func (s *cacheShard) getStats() Stats { + var stats = Stats{ + Hits: atomic.LoadInt64(&s.stats.Hits), + Misses: atomic.LoadInt64(&s.stats.Misses), + DelHits: atomic.LoadInt64(&s.stats.DelHits), + DelMisses: atomic.LoadInt64(&s.stats.DelMisses), + Collisions: atomic.LoadInt64(&s.stats.Collisions), + } + return stats +} + +func (s *cacheShard) getKeyMetadataWithLock(key uint64) Metadata { + s.lock.RLock() + c := s.hashmapStats[key] + s.lock.RUnlock() + return Metadata{ + RequestCount: c, + } +} + +func (s *cacheShard) getKeyMetadata(key uint64) Metadata { + return Metadata{ + RequestCount: s.hashmapStats[key], + } +} + +func (s *cacheShard) hit(key uint64) { + atomic.AddInt64(&s.stats.Hits, 1) + if s.statsEnabled { + s.lock.Lock() + s.hashmapStats[key]++ + s.lock.Unlock() + } +} + +func (s *cacheShard) hitWithoutLock(key uint64) { + atomic.AddInt64(&s.stats.Hits, 1) + if s.statsEnabled { + s.hashmapStats[key]++ + } +} + +func (s *cacheShard) miss() { + atomic.AddInt64(&s.stats.Misses, 1) +} + +func (s *cacheShard) delhit() { + atomic.AddInt64(&s.stats.DelHits, 1) +} + +func (s *cacheShard) delmiss() { + atomic.AddInt64(&s.stats.DelMisses, 1) +} + +func (s *cacheShard) collision() { + atomic.AddInt64(&s.stats.Collisions, 1) +} + +func initNewShard(config Config, callback onRemoveCallback, clock clock) *cacheShard { + bytesQueueInitialCapacity := config.initialShardSize() * config.MaxEntrySize + maximumShardSizeInBytes := config.maximumShardSizeInBytes() + if maximumShardSizeInBytes > 0 && bytesQueueInitialCapacity > maximumShardSizeInBytes { + bytesQueueInitialCapacity = maximumShardSizeInBytes + } + return &cacheShard{ + hashmap: make(map[uint64]uint32, config.initialShardSize()), + hashmapStats: make(map[uint64]uint32, config.initialShardSize()), + entries: *queue.NewBytesQueue(bytesQueueInitialCapacity, maximumShardSizeInBytes, config.Verbose), + entryBuffer: make([]byte, config.MaxEntrySize+headersSizeInBytes), + onRemove: callback, + + isVerbose: config.Verbose, + logger: newLogger(config.Logger), + clock: clock, + lifeWindow: uint64(config.LifeWindow.Seconds()), + statsEnabled: config.StatsEnabled, + cleanEnabled: config.CleanWindow > 0, + } +} diff --git a/vendor/github.com/allegro/bigcache/v3/stats.go b/vendor/github.com/allegro/bigcache/v3/stats.go new file mode 100644 index 00000000..07157132 --- /dev/null +++ b/vendor/github.com/allegro/bigcache/v3/stats.go @@ -0,0 +1,15 @@ +package bigcache + +// Stats stores cache statistics +type Stats struct { + // Hits is a number of successfully found keys + Hits int64 `json:"hits"` + // Misses is a number of not found keys + Misses int64 `json:"misses"` + // DelHits is a number of successfully deleted keys + DelHits int64 `json:"delete_hits"` + // DelMisses is a number of not deleted keys + DelMisses int64 `json:"delete_misses"` + // Collisions is a number of happened key-collisions + Collisions int64 `json:"collisions"` +} diff --git a/vendor/github.com/allegro/bigcache/v3/utils.go b/vendor/github.com/allegro/bigcache/v3/utils.go new file mode 100644 index 00000000..2b6ac4f1 --- /dev/null +++ b/vendor/github.com/allegro/bigcache/v3/utils.go @@ -0,0 +1,23 @@ +package bigcache + +func max(a, b int) int { + if a > b { + return a + } + return b +} + +func min(a, b int) int { + if a < b { + return a + } + return b +} + +func convertMBToBytes(value int) int { + return value * 1024 * 1024 +} + +func isPowerOfTwo(number int) bool { + return (number != 0) && (number&(number-1)) == 0 +} diff --git a/vendor/github.com/conductorone/baton-sdk/internal/connector/connector.go b/vendor/github.com/conductorone/baton-sdk/internal/connector/connector.go index 10f2a05b..52c2759f 100644 --- a/vendor/github.com/conductorone/baton-sdk/internal/connector/connector.go +++ b/vendor/github.com/conductorone/baton-sdk/internal/connector/connector.go @@ -57,6 +57,7 @@ type wrapper struct { conn *grpc.ClientConn provisioningEnabled bool ticketingEnabled bool + fullSyncDisabled bool rateLimiter ratelimitV1.RateLimiterServiceServer rlCfg *ratelimitV1.RateLimiterConfig @@ -95,6 +96,13 @@ func WithProvisioningEnabled() Option { } } +func WithFullSyncDisabled() Option { + return func(ctx context.Context, w *wrapper) error { + w.fullSyncDisabled = true + return nil + } +} + func WithTicketingEnabled() Option { return func(ctx context.Context, w *wrapper) error { w.ticketingEnabled = true diff --git a/vendor/github.com/conductorone/baton-sdk/internal/connector/connector_server_unix.go b/vendor/github.com/conductorone/baton-sdk/internal/connector/connector_server_unix.go index ed4e03e4..ab7f1214 100644 --- a/vendor/github.com/conductorone/baton-sdk/internal/connector/connector_server_unix.go +++ b/vendor/github.com/conductorone/baton-sdk/internal/connector/connector_server_unix.go @@ -14,6 +14,11 @@ import ( "go.uber.org/zap" ) +func getPort(listener net.Listener) uint32 { + //nolint:gosec // No risk of overflow because `Port` is 16-bit. + return uint32(listener.Addr().(*net.TCPAddr).Port) +} + func (cw *wrapper) setupListener(ctx context.Context) (uint32, *os.File, error) { l := ctxzap.Extract(ctx) @@ -25,7 +30,7 @@ func (cw *wrapper) setupListener(ctx context.Context) (uint32, *os.File, error) if err != nil { return 0, nil, err } - listenPort := uint32(listener.Addr().(*net.TCPAddr).Port) + listenPort := getPort(listener) listenerFile, err := listener.File() if err != nil { return 0, nil, err @@ -58,7 +63,7 @@ func (cw *wrapper) getListener(ctx context.Context, serverCfg *connectorwrapperV return nil, err } - listenPort := uint32(listener.Addr().(*net.TCPAddr).Port) + listenPort := getPort(listener) if listenPort != serverCfg.ListenPort { return nil, fmt.Errorf("listen port mismatch: %d != %d", listenPort, serverCfg.ListenPort) } diff --git a/vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/annotation_grant.pb.go b/vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/annotation_grant.pb.go index 725f84a4..85e7febc 100644 --- a/vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/annotation_grant.pb.go +++ b/vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/annotation_grant.pb.go @@ -131,6 +131,7 @@ func (x *GrantExpandable) GetResourceTypeIds() []string { return nil } +// Grant cannot be updated or revoked. For example, membership in an "all users" group. type GrantImmutable struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -186,6 +187,84 @@ func (x *GrantImmutable) GetMetadata() *structpb.Struct { return nil } +// Grant was not created because the entitlement already existed. +type GrantAlreadyExists struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *GrantAlreadyExists) Reset() { + *x = GrantAlreadyExists{} + if protoimpl.UnsafeEnabled { + mi := &file_c1_connector_v2_annotation_grant_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GrantAlreadyExists) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GrantAlreadyExists) ProtoMessage() {} + +func (x *GrantAlreadyExists) ProtoReflect() protoreflect.Message { + mi := &file_c1_connector_v2_annotation_grant_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GrantAlreadyExists.ProtoReflect.Descriptor instead. +func (*GrantAlreadyExists) Descriptor() ([]byte, []int) { + return file_c1_connector_v2_annotation_grant_proto_rawDescGZIP(), []int{3} +} + +// Grant was not revoked because the entitlement does not exist. +type GrantAlreadyRevoked struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *GrantAlreadyRevoked) Reset() { + *x = GrantAlreadyRevoked{} + if protoimpl.UnsafeEnabled { + mi := &file_c1_connector_v2_annotation_grant_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GrantAlreadyRevoked) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GrantAlreadyRevoked) ProtoMessage() {} + +func (x *GrantAlreadyRevoked) ProtoReflect() protoreflect.Message { + mi := &file_c1_connector_v2_annotation_grant_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GrantAlreadyRevoked.ProtoReflect.Descriptor instead. +func (*GrantAlreadyRevoked) Descriptor() ([]byte, []int) { + return file_c1_connector_v2_annotation_grant_proto_rawDescGZIP(), []int{4} +} + var File_c1_connector_v2_annotation_grant_proto protoreflect.FileDescriptor var file_c1_connector_v2_annotation_grant_proto_rawDesc = []byte{ @@ -213,11 +292,14 @@ var file_c1_connector_v2_annotation_grant_proto_rawDesc = []byte{ 0x33, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, - 0x64, 0x61, 0x74, 0x61, 0x42, 0x36, 0x5a, 0x34, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, - 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x6e, 0x64, 0x75, 0x63, 0x74, 0x6f, 0x72, 0x6f, 0x6e, 0x65, 0x2f, - 0x62, 0x61, 0x74, 0x6f, 0x6e, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x70, 0x62, 0x2f, 0x63, 0x31, 0x2f, - 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2f, 0x76, 0x32, 0x62, 0x06, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x33, + 0x64, 0x61, 0x74, 0x61, 0x22, 0x14, 0x0a, 0x12, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x41, 0x6c, 0x72, + 0x65, 0x61, 0x64, 0x79, 0x45, 0x78, 0x69, 0x73, 0x74, 0x73, 0x22, 0x15, 0x0a, 0x13, 0x47, 0x72, + 0x61, 0x6e, 0x74, 0x41, 0x6c, 0x72, 0x65, 0x61, 0x64, 0x79, 0x52, 0x65, 0x76, 0x6f, 0x6b, 0x65, + 0x64, 0x42, 0x36, 0x5a, 0x34, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, + 0x63, 0x6f, 0x6e, 0x64, 0x75, 0x63, 0x74, 0x6f, 0x72, 0x6f, 0x6e, 0x65, 0x2f, 0x62, 0x61, 0x74, + 0x6f, 0x6e, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x70, 0x62, 0x2f, 0x63, 0x31, 0x2f, 0x63, 0x6f, 0x6e, + 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2f, 0x76, 0x32, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x33, } var ( @@ -232,16 +314,18 @@ func file_c1_connector_v2_annotation_grant_proto_rawDescGZIP() []byte { return file_c1_connector_v2_annotation_grant_proto_rawDescData } -var file_c1_connector_v2_annotation_grant_proto_msgTypes = make([]protoimpl.MessageInfo, 3) +var file_c1_connector_v2_annotation_grant_proto_msgTypes = make([]protoimpl.MessageInfo, 5) var file_c1_connector_v2_annotation_grant_proto_goTypes = []interface{}{ - (*GrantMetadata)(nil), // 0: c1.connector.v2.GrantMetadata - (*GrantExpandable)(nil), // 1: c1.connector.v2.GrantExpandable - (*GrantImmutable)(nil), // 2: c1.connector.v2.GrantImmutable - (*structpb.Struct)(nil), // 3: google.protobuf.Struct + (*GrantMetadata)(nil), // 0: c1.connector.v2.GrantMetadata + (*GrantExpandable)(nil), // 1: c1.connector.v2.GrantExpandable + (*GrantImmutable)(nil), // 2: c1.connector.v2.GrantImmutable + (*GrantAlreadyExists)(nil), // 3: c1.connector.v2.GrantAlreadyExists + (*GrantAlreadyRevoked)(nil), // 4: c1.connector.v2.GrantAlreadyRevoked + (*structpb.Struct)(nil), // 5: google.protobuf.Struct } var file_c1_connector_v2_annotation_grant_proto_depIdxs = []int32{ - 3, // 0: c1.connector.v2.GrantMetadata.metadata:type_name -> google.protobuf.Struct - 3, // 1: c1.connector.v2.GrantImmutable.metadata:type_name -> google.protobuf.Struct + 5, // 0: c1.connector.v2.GrantMetadata.metadata:type_name -> google.protobuf.Struct + 5, // 1: c1.connector.v2.GrantImmutable.metadata:type_name -> google.protobuf.Struct 2, // [2:2] is the sub-list for method output_type 2, // [2:2] is the sub-list for method input_type 2, // [2:2] is the sub-list for extension type_name @@ -291,6 +375,30 @@ func file_c1_connector_v2_annotation_grant_proto_init() { return nil } } + file_c1_connector_v2_annotation_grant_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GrantAlreadyExists); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_c1_connector_v2_annotation_grant_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GrantAlreadyRevoked); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } } type x struct{} out := protoimpl.TypeBuilder{ @@ -298,7 +406,7 @@ func file_c1_connector_v2_annotation_grant_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_c1_connector_v2_annotation_grant_proto_rawDesc, NumEnums: 0, - NumMessages: 3, + NumMessages: 5, NumExtensions: 0, NumServices: 0, }, diff --git a/vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/annotation_grant.pb.validate.go b/vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/annotation_grant.pb.validate.go index 98bfe0ec..4458379b 100644 --- a/vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/annotation_grant.pb.validate.go +++ b/vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/annotation_grant.pb.validate.go @@ -396,3 +396,207 @@ var _ interface { Cause() error ErrorName() string } = GrantImmutableValidationError{} + +// Validate checks the field values on GrantAlreadyExists with the rules +// defined in the proto definition for this message. If any rules are +// violated, the first error encountered is returned, or nil if there are no violations. +func (m *GrantAlreadyExists) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on GrantAlreadyExists with the rules +// defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// GrantAlreadyExistsMultiError, or nil if none found. +func (m *GrantAlreadyExists) ValidateAll() error { + return m.validate(true) +} + +func (m *GrantAlreadyExists) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if len(errors) > 0 { + return GrantAlreadyExistsMultiError(errors) + } + + return nil +} + +// GrantAlreadyExistsMultiError is an error wrapping multiple validation errors +// returned by GrantAlreadyExists.ValidateAll() if the designated constraints +// aren't met. +type GrantAlreadyExistsMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m GrantAlreadyExistsMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m GrantAlreadyExistsMultiError) AllErrors() []error { return m } + +// GrantAlreadyExistsValidationError is the validation error returned by +// GrantAlreadyExists.Validate if the designated constraints aren't met. +type GrantAlreadyExistsValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e GrantAlreadyExistsValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e GrantAlreadyExistsValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e GrantAlreadyExistsValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e GrantAlreadyExistsValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e GrantAlreadyExistsValidationError) ErrorName() string { + return "GrantAlreadyExistsValidationError" +} + +// Error satisfies the builtin error interface +func (e GrantAlreadyExistsValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sGrantAlreadyExists.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = GrantAlreadyExistsValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = GrantAlreadyExistsValidationError{} + +// Validate checks the field values on GrantAlreadyRevoked with the rules +// defined in the proto definition for this message. If any rules are +// violated, the first error encountered is returned, or nil if there are no violations. +func (m *GrantAlreadyRevoked) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on GrantAlreadyRevoked with the rules +// defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// GrantAlreadyRevokedMultiError, or nil if none found. +func (m *GrantAlreadyRevoked) ValidateAll() error { + return m.validate(true) +} + +func (m *GrantAlreadyRevoked) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if len(errors) > 0 { + return GrantAlreadyRevokedMultiError(errors) + } + + return nil +} + +// GrantAlreadyRevokedMultiError is an error wrapping multiple validation +// errors returned by GrantAlreadyRevoked.ValidateAll() if the designated +// constraints aren't met. +type GrantAlreadyRevokedMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m GrantAlreadyRevokedMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m GrantAlreadyRevokedMultiError) AllErrors() []error { return m } + +// GrantAlreadyRevokedValidationError is the validation error returned by +// GrantAlreadyRevoked.Validate if the designated constraints aren't met. +type GrantAlreadyRevokedValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e GrantAlreadyRevokedValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e GrantAlreadyRevokedValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e GrantAlreadyRevokedValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e GrantAlreadyRevokedValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e GrantAlreadyRevokedValidationError) ErrorName() string { + return "GrantAlreadyRevokedValidationError" +} + +// Error satisfies the builtin error interface +func (e GrantAlreadyRevokedValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sGrantAlreadyRevoked.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = GrantAlreadyRevokedValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = GrantAlreadyRevokedValidationError{} diff --git a/vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/ticket.pb.go b/vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/ticket.pb.go index 0415504d..0cb85b10 100644 --- a/vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/ticket.pb.go +++ b/vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/ticket.pb.go @@ -12,6 +12,7 @@ import ( protoimpl "google.golang.org/protobuf/runtime/protoimpl" anypb "google.golang.org/protobuf/types/known/anypb" timestamppb "google.golang.org/protobuf/types/known/timestamppb" + wrapperspb "google.golang.org/protobuf/types/known/wrapperspb" reflect "reflect" sync "sync" ) @@ -33,6 +34,7 @@ type TicketSchema struct { Types []*TicketType `protobuf:"bytes,3,rep,name=types,proto3" json:"types,omitempty"` Statuses []*TicketStatus `protobuf:"bytes,4,rep,name=statuses,proto3" json:"statuses,omitempty"` CustomFields map[string]*TicketCustomField `protobuf:"bytes,5,rep,name=custom_fields,json=customFields,proto3" json:"custom_fields,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + Annotations []*anypb.Any `protobuf:"bytes,6,rep,name=annotations,proto3" json:"annotations,omitempty"` } func (x *TicketSchema) Reset() { @@ -102,6 +104,13 @@ func (x *TicketSchema) GetCustomFields() map[string]*TicketCustomField { return nil } +func (x *TicketSchema) GetAnnotations() []*anypb.Any { + if x != nil { + return x.Annotations + } + return nil +} + type TicketCustomField struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -120,7 +129,9 @@ type TicketCustomField struct { // *TicketCustomField_PickMultipleStringValues // *TicketCustomField_PickObjectValue // *TicketCustomField_PickMultipleObjectValues - Value isTicketCustomField_Value `protobuf_oneof:"value"` + // *TicketCustomField_NumberValue + Value isTicketCustomField_Value `protobuf_oneof:"value"` + Annotations []*anypb.Any `protobuf:"bytes,4,rep,name=annotations,proto3" json:"annotations,omitempty"` } func (x *TicketCustomField) Reset() { @@ -239,6 +250,20 @@ func (x *TicketCustomField) GetPickMultipleObjectValues() *TicketCustomFieldPick return nil } +func (x *TicketCustomField) GetNumberValue() *TicketCustomFieldNumberValue { + if x, ok := x.GetValue().(*TicketCustomField_NumberValue); ok { + return x.NumberValue + } + return nil +} + +func (x *TicketCustomField) GetAnnotations() []*anypb.Any { + if x != nil { + return x.Annotations + } + return nil +} + type isTicketCustomField_Value interface { isTicketCustomField_Value() } @@ -275,6 +300,10 @@ type TicketCustomField_PickMultipleObjectValues struct { PickMultipleObjectValues *TicketCustomFieldPickMultipleObjectValues `protobuf:"bytes,107,opt,name=pick_multiple_object_values,json=pickMultipleObjectValues,proto3,oneof"` } +type TicketCustomField_NumberValue struct { + NumberValue *TicketCustomFieldNumberValue `protobuf:"bytes,108,opt,name=number_value,json=numberValue,proto3,oneof"` +} + func (*TicketCustomField_StringValue) isTicketCustomField_Value() {} func (*TicketCustomField_StringValues) isTicketCustomField_Value() {} @@ -291,12 +320,15 @@ func (*TicketCustomField_PickObjectValue) isTicketCustomField_Value() {} func (*TicketCustomField_PickMultipleObjectValues) isTicketCustomField_Value() {} +func (*TicketCustomField_NumberValue) isTicketCustomField_Value() {} + type TicketCustomFieldStringValue struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Value string `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` + Value string `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` + DefaultValue string `protobuf:"bytes,2,opt,name=default_value,json=defaultValue,proto3" json:"default_value,omitempty"` } func (x *TicketCustomFieldStringValue) Reset() { @@ -338,12 +370,20 @@ func (x *TicketCustomFieldStringValue) GetValue() string { return "" } +func (x *TicketCustomFieldStringValue) GetDefaultValue() string { + if x != nil { + return x.DefaultValue + } + return "" +} + type TicketCustomFieldStringValues struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Values []string `protobuf:"bytes,1,rep,name=values,proto3" json:"values,omitempty"` + Values []string `protobuf:"bytes,1,rep,name=values,proto3" json:"values,omitempty"` + DefaultValues []string `protobuf:"bytes,2,rep,name=default_values,json=defaultValues,proto3" json:"default_values,omitempty"` } func (x *TicketCustomFieldStringValues) Reset() { @@ -385,6 +425,13 @@ func (x *TicketCustomFieldStringValues) GetValues() []string { return nil } +func (x *TicketCustomFieldStringValues) GetDefaultValues() []string { + if x != nil { + return x.DefaultValues + } + return nil +} + type TicketCustomFieldBoolValue struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -432,18 +479,74 @@ func (x *TicketCustomFieldBoolValue) GetValue() bool { return false } +type TicketCustomFieldNumberValue struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Value *wrapperspb.FloatValue `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` + DefaultValue *wrapperspb.FloatValue `protobuf:"bytes,2,opt,name=default_value,json=defaultValue,proto3" json:"default_value,omitempty"` +} + +func (x *TicketCustomFieldNumberValue) Reset() { + *x = TicketCustomFieldNumberValue{} + if protoimpl.UnsafeEnabled { + mi := &file_c1_connector_v2_ticket_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TicketCustomFieldNumberValue) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TicketCustomFieldNumberValue) ProtoMessage() {} + +func (x *TicketCustomFieldNumberValue) ProtoReflect() protoreflect.Message { + mi := &file_c1_connector_v2_ticket_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TicketCustomFieldNumberValue.ProtoReflect.Descriptor instead. +func (*TicketCustomFieldNumberValue) Descriptor() ([]byte, []int) { + return file_c1_connector_v2_ticket_proto_rawDescGZIP(), []int{5} +} + +func (x *TicketCustomFieldNumberValue) GetValue() *wrapperspb.FloatValue { + if x != nil { + return x.Value + } + return nil +} + +func (x *TicketCustomFieldNumberValue) GetDefaultValue() *wrapperspb.FloatValue { + if x != nil { + return x.DefaultValue + } + return nil +} + type TicketCustomFieldTimestampValue struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Value *timestamppb.Timestamp `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` + Value *timestamppb.Timestamp `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` + DefaultValue *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=default_value,json=defaultValue,proto3" json:"default_value,omitempty"` } func (x *TicketCustomFieldTimestampValue) Reset() { *x = TicketCustomFieldTimestampValue{} if protoimpl.UnsafeEnabled { - mi := &file_c1_connector_v2_ticket_proto_msgTypes[5] + mi := &file_c1_connector_v2_ticket_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -456,7 +559,7 @@ func (x *TicketCustomFieldTimestampValue) String() string { func (*TicketCustomFieldTimestampValue) ProtoMessage() {} func (x *TicketCustomFieldTimestampValue) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_ticket_proto_msgTypes[5] + mi := &file_c1_connector_v2_ticket_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -469,7 +572,7 @@ func (x *TicketCustomFieldTimestampValue) ProtoReflect() protoreflect.Message { // Deprecated: Use TicketCustomFieldTimestampValue.ProtoReflect.Descriptor instead. func (*TicketCustomFieldTimestampValue) Descriptor() ([]byte, []int) { - return file_c1_connector_v2_ticket_proto_rawDescGZIP(), []int{5} + return file_c1_connector_v2_ticket_proto_rawDescGZIP(), []int{6} } func (x *TicketCustomFieldTimestampValue) GetValue() *timestamppb.Timestamp { @@ -479,6 +582,13 @@ func (x *TicketCustomFieldTimestampValue) GetValue() *timestamppb.Timestamp { return nil } +func (x *TicketCustomFieldTimestampValue) GetDefaultValue() *timestamppb.Timestamp { + if x != nil { + return x.DefaultValue + } + return nil +} + type TicketCustomFieldPickStringValue struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -486,12 +596,13 @@ type TicketCustomFieldPickStringValue struct { Value string `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` AllowedValues []string `protobuf:"bytes,2,rep,name=allowed_values,json=allowedValues,proto3" json:"allowed_values,omitempty"` + DefaultValue string `protobuf:"bytes,3,opt,name=default_value,json=defaultValue,proto3" json:"default_value,omitempty"` } func (x *TicketCustomFieldPickStringValue) Reset() { *x = TicketCustomFieldPickStringValue{} if protoimpl.UnsafeEnabled { - mi := &file_c1_connector_v2_ticket_proto_msgTypes[6] + mi := &file_c1_connector_v2_ticket_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -504,7 +615,7 @@ func (x *TicketCustomFieldPickStringValue) String() string { func (*TicketCustomFieldPickStringValue) ProtoMessage() {} func (x *TicketCustomFieldPickStringValue) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_ticket_proto_msgTypes[6] + mi := &file_c1_connector_v2_ticket_proto_msgTypes[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -517,7 +628,7 @@ func (x *TicketCustomFieldPickStringValue) ProtoReflect() protoreflect.Message { // Deprecated: Use TicketCustomFieldPickStringValue.ProtoReflect.Descriptor instead. func (*TicketCustomFieldPickStringValue) Descriptor() ([]byte, []int) { - return file_c1_connector_v2_ticket_proto_rawDescGZIP(), []int{6} + return file_c1_connector_v2_ticket_proto_rawDescGZIP(), []int{7} } func (x *TicketCustomFieldPickStringValue) GetValue() string { @@ -534,6 +645,13 @@ func (x *TicketCustomFieldPickStringValue) GetAllowedValues() []string { return nil } +func (x *TicketCustomFieldPickStringValue) GetDefaultValue() string { + if x != nil { + return x.DefaultValue + } + return "" +} + type TicketCustomFieldPickMultipleStringValues struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -541,12 +659,13 @@ type TicketCustomFieldPickMultipleStringValues struct { Values []string `protobuf:"bytes,1,rep,name=values,proto3" json:"values,omitempty"` AllowedValues []string `protobuf:"bytes,2,rep,name=allowed_values,json=allowedValues,proto3" json:"allowed_values,omitempty"` + DefaultValues []string `protobuf:"bytes,3,rep,name=default_values,json=defaultValues,proto3" json:"default_values,omitempty"` } func (x *TicketCustomFieldPickMultipleStringValues) Reset() { *x = TicketCustomFieldPickMultipleStringValues{} if protoimpl.UnsafeEnabled { - mi := &file_c1_connector_v2_ticket_proto_msgTypes[7] + mi := &file_c1_connector_v2_ticket_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -559,7 +678,7 @@ func (x *TicketCustomFieldPickMultipleStringValues) String() string { func (*TicketCustomFieldPickMultipleStringValues) ProtoMessage() {} func (x *TicketCustomFieldPickMultipleStringValues) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_ticket_proto_msgTypes[7] + mi := &file_c1_connector_v2_ticket_proto_msgTypes[8] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -572,7 +691,7 @@ func (x *TicketCustomFieldPickMultipleStringValues) ProtoReflect() protoreflect. // Deprecated: Use TicketCustomFieldPickMultipleStringValues.ProtoReflect.Descriptor instead. func (*TicketCustomFieldPickMultipleStringValues) Descriptor() ([]byte, []int) { - return file_c1_connector_v2_ticket_proto_rawDescGZIP(), []int{7} + return file_c1_connector_v2_ticket_proto_rawDescGZIP(), []int{8} } func (x *TicketCustomFieldPickMultipleStringValues) GetValues() []string { @@ -589,6 +708,13 @@ func (x *TicketCustomFieldPickMultipleStringValues) GetAllowedValues() []string return nil } +func (x *TicketCustomFieldPickMultipleStringValues) GetDefaultValues() []string { + if x != nil { + return x.DefaultValues + } + return nil +} + type TicketCustomFieldPickObjectValue struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -596,12 +722,13 @@ type TicketCustomFieldPickObjectValue struct { Value *TicketCustomFieldObjectValue `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` AllowedValues []*TicketCustomFieldObjectValue `protobuf:"bytes,2,rep,name=allowed_values,json=allowedValues,proto3" json:"allowed_values,omitempty"` + DefaultValue *TicketCustomFieldObjectValue `protobuf:"bytes,3,opt,name=default_value,json=defaultValue,proto3" json:"default_value,omitempty"` } func (x *TicketCustomFieldPickObjectValue) Reset() { *x = TicketCustomFieldPickObjectValue{} if protoimpl.UnsafeEnabled { - mi := &file_c1_connector_v2_ticket_proto_msgTypes[8] + mi := &file_c1_connector_v2_ticket_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -614,7 +741,7 @@ func (x *TicketCustomFieldPickObjectValue) String() string { func (*TicketCustomFieldPickObjectValue) ProtoMessage() {} func (x *TicketCustomFieldPickObjectValue) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_ticket_proto_msgTypes[8] + mi := &file_c1_connector_v2_ticket_proto_msgTypes[9] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -627,7 +754,7 @@ func (x *TicketCustomFieldPickObjectValue) ProtoReflect() protoreflect.Message { // Deprecated: Use TicketCustomFieldPickObjectValue.ProtoReflect.Descriptor instead. func (*TicketCustomFieldPickObjectValue) Descriptor() ([]byte, []int) { - return file_c1_connector_v2_ticket_proto_rawDescGZIP(), []int{8} + return file_c1_connector_v2_ticket_proto_rawDescGZIP(), []int{9} } func (x *TicketCustomFieldPickObjectValue) GetValue() *TicketCustomFieldObjectValue { @@ -644,6 +771,13 @@ func (x *TicketCustomFieldPickObjectValue) GetAllowedValues() []*TicketCustomFie return nil } +func (x *TicketCustomFieldPickObjectValue) GetDefaultValue() *TicketCustomFieldObjectValue { + if x != nil { + return x.DefaultValue + } + return nil +} + type TicketCustomFieldPickMultipleObjectValues struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -651,12 +785,13 @@ type TicketCustomFieldPickMultipleObjectValues struct { Values []*TicketCustomFieldObjectValue `protobuf:"bytes,1,rep,name=values,proto3" json:"values,omitempty"` AllowedValues []*TicketCustomFieldObjectValue `protobuf:"bytes,2,rep,name=allowed_values,json=allowedValues,proto3" json:"allowed_values,omitempty"` + DefaultValues []*TicketCustomFieldObjectValue `protobuf:"bytes,3,rep,name=default_values,json=defaultValues,proto3" json:"default_values,omitempty"` } func (x *TicketCustomFieldPickMultipleObjectValues) Reset() { *x = TicketCustomFieldPickMultipleObjectValues{} if protoimpl.UnsafeEnabled { - mi := &file_c1_connector_v2_ticket_proto_msgTypes[9] + mi := &file_c1_connector_v2_ticket_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -669,7 +804,7 @@ func (x *TicketCustomFieldPickMultipleObjectValues) String() string { func (*TicketCustomFieldPickMultipleObjectValues) ProtoMessage() {} func (x *TicketCustomFieldPickMultipleObjectValues) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_ticket_proto_msgTypes[9] + mi := &file_c1_connector_v2_ticket_proto_msgTypes[10] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -682,7 +817,7 @@ func (x *TicketCustomFieldPickMultipleObjectValues) ProtoReflect() protoreflect. // Deprecated: Use TicketCustomFieldPickMultipleObjectValues.ProtoReflect.Descriptor instead. func (*TicketCustomFieldPickMultipleObjectValues) Descriptor() ([]byte, []int) { - return file_c1_connector_v2_ticket_proto_rawDescGZIP(), []int{9} + return file_c1_connector_v2_ticket_proto_rawDescGZIP(), []int{10} } func (x *TicketCustomFieldPickMultipleObjectValues) GetValues() []*TicketCustomFieldObjectValue { @@ -699,6 +834,13 @@ func (x *TicketCustomFieldPickMultipleObjectValues) GetAllowedValues() []*Ticket return nil } +func (x *TicketCustomFieldPickMultipleObjectValues) GetDefaultValues() []*TicketCustomFieldObjectValue { + if x != nil { + return x.DefaultValues + } + return nil +} + type TicketCustomFieldObjectValue struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -711,7 +853,7 @@ type TicketCustomFieldObjectValue struct { func (x *TicketCustomFieldObjectValue) Reset() { *x = TicketCustomFieldObjectValue{} if protoimpl.UnsafeEnabled { - mi := &file_c1_connector_v2_ticket_proto_msgTypes[10] + mi := &file_c1_connector_v2_ticket_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -724,7 +866,7 @@ func (x *TicketCustomFieldObjectValue) String() string { func (*TicketCustomFieldObjectValue) ProtoMessage() {} func (x *TicketCustomFieldObjectValue) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_ticket_proto_msgTypes[10] + mi := &file_c1_connector_v2_ticket_proto_msgTypes[11] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -737,7 +879,7 @@ func (x *TicketCustomFieldObjectValue) ProtoReflect() protoreflect.Message { // Deprecated: Use TicketCustomFieldObjectValue.ProtoReflect.Descriptor instead. func (*TicketCustomFieldObjectValue) Descriptor() ([]byte, []int) { - return file_c1_connector_v2_ticket_proto_rawDescGZIP(), []int{10} + return file_c1_connector_v2_ticket_proto_rawDescGZIP(), []int{11} } func (x *TicketCustomFieldObjectValue) GetId() string { @@ -766,7 +908,7 @@ type TicketStatus struct { func (x *TicketStatus) Reset() { *x = TicketStatus{} if protoimpl.UnsafeEnabled { - mi := &file_c1_connector_v2_ticket_proto_msgTypes[11] + mi := &file_c1_connector_v2_ticket_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -779,7 +921,7 @@ func (x *TicketStatus) String() string { func (*TicketStatus) ProtoMessage() {} func (x *TicketStatus) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_ticket_proto_msgTypes[11] + mi := &file_c1_connector_v2_ticket_proto_msgTypes[12] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -792,7 +934,7 @@ func (x *TicketStatus) ProtoReflect() protoreflect.Message { // Deprecated: Use TicketStatus.ProtoReflect.Descriptor instead. func (*TicketStatus) Descriptor() ([]byte, []int) { - return file_c1_connector_v2_ticket_proto_rawDescGZIP(), []int{11} + return file_c1_connector_v2_ticket_proto_rawDescGZIP(), []int{12} } func (x *TicketStatus) GetId() string { @@ -821,7 +963,7 @@ type TicketsServiceGetTicketSchemaRequest struct { func (x *TicketsServiceGetTicketSchemaRequest) Reset() { *x = TicketsServiceGetTicketSchemaRequest{} if protoimpl.UnsafeEnabled { - mi := &file_c1_connector_v2_ticket_proto_msgTypes[12] + mi := &file_c1_connector_v2_ticket_proto_msgTypes[13] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -834,7 +976,7 @@ func (x *TicketsServiceGetTicketSchemaRequest) String() string { func (*TicketsServiceGetTicketSchemaRequest) ProtoMessage() {} func (x *TicketsServiceGetTicketSchemaRequest) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_ticket_proto_msgTypes[12] + mi := &file_c1_connector_v2_ticket_proto_msgTypes[13] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -847,7 +989,7 @@ func (x *TicketsServiceGetTicketSchemaRequest) ProtoReflect() protoreflect.Messa // Deprecated: Use TicketsServiceGetTicketSchemaRequest.ProtoReflect.Descriptor instead. func (*TicketsServiceGetTicketSchemaRequest) Descriptor() ([]byte, []int) { - return file_c1_connector_v2_ticket_proto_rawDescGZIP(), []int{12} + return file_c1_connector_v2_ticket_proto_rawDescGZIP(), []int{13} } func (x *TicketsServiceGetTicketSchemaRequest) GetId() string { @@ -876,7 +1018,7 @@ type TicketsServiceGetTicketSchemaResponse struct { func (x *TicketsServiceGetTicketSchemaResponse) Reset() { *x = TicketsServiceGetTicketSchemaResponse{} if protoimpl.UnsafeEnabled { - mi := &file_c1_connector_v2_ticket_proto_msgTypes[13] + mi := &file_c1_connector_v2_ticket_proto_msgTypes[14] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -889,7 +1031,7 @@ func (x *TicketsServiceGetTicketSchemaResponse) String() string { func (*TicketsServiceGetTicketSchemaResponse) ProtoMessage() {} func (x *TicketsServiceGetTicketSchemaResponse) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_ticket_proto_msgTypes[13] + mi := &file_c1_connector_v2_ticket_proto_msgTypes[14] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -902,7 +1044,7 @@ func (x *TicketsServiceGetTicketSchemaResponse) ProtoReflect() protoreflect.Mess // Deprecated: Use TicketsServiceGetTicketSchemaResponse.ProtoReflect.Descriptor instead. func (*TicketsServiceGetTicketSchemaResponse) Descriptor() ([]byte, []int) { - return file_c1_connector_v2_ticket_proto_rawDescGZIP(), []int{13} + return file_c1_connector_v2_ticket_proto_rawDescGZIP(), []int{14} } func (x *TicketsServiceGetTicketSchemaResponse) GetSchema() *TicketSchema { @@ -932,7 +1074,7 @@ type TicketsServiceListTicketSchemasRequest struct { func (x *TicketsServiceListTicketSchemasRequest) Reset() { *x = TicketsServiceListTicketSchemasRequest{} if protoimpl.UnsafeEnabled { - mi := &file_c1_connector_v2_ticket_proto_msgTypes[14] + mi := &file_c1_connector_v2_ticket_proto_msgTypes[15] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -945,7 +1087,7 @@ func (x *TicketsServiceListTicketSchemasRequest) String() string { func (*TicketsServiceListTicketSchemasRequest) ProtoMessage() {} func (x *TicketsServiceListTicketSchemasRequest) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_ticket_proto_msgTypes[14] + mi := &file_c1_connector_v2_ticket_proto_msgTypes[15] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -958,7 +1100,7 @@ func (x *TicketsServiceListTicketSchemasRequest) ProtoReflect() protoreflect.Mes // Deprecated: Use TicketsServiceListTicketSchemasRequest.ProtoReflect.Descriptor instead. func (*TicketsServiceListTicketSchemasRequest) Descriptor() ([]byte, []int) { - return file_c1_connector_v2_ticket_proto_rawDescGZIP(), []int{14} + return file_c1_connector_v2_ticket_proto_rawDescGZIP(), []int{15} } func (x *TicketsServiceListTicketSchemasRequest) GetPageSize() uint32 { @@ -995,7 +1137,7 @@ type TicketsServiceListTicketSchemasResponse struct { func (x *TicketsServiceListTicketSchemasResponse) Reset() { *x = TicketsServiceListTicketSchemasResponse{} if protoimpl.UnsafeEnabled { - mi := &file_c1_connector_v2_ticket_proto_msgTypes[15] + mi := &file_c1_connector_v2_ticket_proto_msgTypes[16] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1008,7 +1150,7 @@ func (x *TicketsServiceListTicketSchemasResponse) String() string { func (*TicketsServiceListTicketSchemasResponse) ProtoMessage() {} func (x *TicketsServiceListTicketSchemasResponse) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_ticket_proto_msgTypes[15] + mi := &file_c1_connector_v2_ticket_proto_msgTypes[16] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1021,7 +1163,7 @@ func (x *TicketsServiceListTicketSchemasResponse) ProtoReflect() protoreflect.Me // Deprecated: Use TicketsServiceListTicketSchemasResponse.ProtoReflect.Descriptor instead. func (*TicketsServiceListTicketSchemasResponse) Descriptor() ([]byte, []int) { - return file_c1_connector_v2_ticket_proto_rawDescGZIP(), []int{15} + return file_c1_connector_v2_ticket_proto_rawDescGZIP(), []int{16} } func (x *TicketsServiceListTicketSchemasResponse) GetList() []*TicketSchema { @@ -1069,7 +1211,7 @@ type Ticket struct { func (x *Ticket) Reset() { *x = Ticket{} if protoimpl.UnsafeEnabled { - mi := &file_c1_connector_v2_ticket_proto_msgTypes[16] + mi := &file_c1_connector_v2_ticket_proto_msgTypes[17] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1082,7 +1224,7 @@ func (x *Ticket) String() string { func (*Ticket) ProtoMessage() {} func (x *Ticket) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_ticket_proto_msgTypes[16] + mi := &file_c1_connector_v2_ticket_proto_msgTypes[17] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1095,7 +1237,7 @@ func (x *Ticket) ProtoReflect() protoreflect.Message { // Deprecated: Use Ticket.ProtoReflect.Descriptor instead. func (*Ticket) Descriptor() ([]byte, []int) { - return file_c1_connector_v2_ticket_proto_rawDescGZIP(), []int{16} + return file_c1_connector_v2_ticket_proto_rawDescGZIP(), []int{17} } func (x *Ticket) GetId() string { @@ -1208,7 +1350,7 @@ type TicketType struct { func (x *TicketType) Reset() { *x = TicketType{} if protoimpl.UnsafeEnabled { - mi := &file_c1_connector_v2_ticket_proto_msgTypes[17] + mi := &file_c1_connector_v2_ticket_proto_msgTypes[18] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1221,7 +1363,7 @@ func (x *TicketType) String() string { func (*TicketType) ProtoMessage() {} func (x *TicketType) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_ticket_proto_msgTypes[17] + mi := &file_c1_connector_v2_ticket_proto_msgTypes[18] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1234,7 +1376,7 @@ func (x *TicketType) ProtoReflect() protoreflect.Message { // Deprecated: Use TicketType.ProtoReflect.Descriptor instead. func (*TicketType) Descriptor() ([]byte, []int) { - return file_c1_connector_v2_ticket_proto_rawDescGZIP(), []int{17} + return file_c1_connector_v2_ticket_proto_rawDescGZIP(), []int{18} } func (x *TicketType) GetId() string { @@ -1268,7 +1410,7 @@ type TicketRequest struct { func (x *TicketRequest) Reset() { *x = TicketRequest{} if protoimpl.UnsafeEnabled { - mi := &file_c1_connector_v2_ticket_proto_msgTypes[18] + mi := &file_c1_connector_v2_ticket_proto_msgTypes[19] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1281,7 +1423,7 @@ func (x *TicketRequest) String() string { func (*TicketRequest) ProtoMessage() {} func (x *TicketRequest) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_ticket_proto_msgTypes[18] + mi := &file_c1_connector_v2_ticket_proto_msgTypes[19] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1294,7 +1436,7 @@ func (x *TicketRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use TicketRequest.ProtoReflect.Descriptor instead. func (*TicketRequest) Descriptor() ([]byte, []int) { - return file_c1_connector_v2_ticket_proto_rawDescGZIP(), []int{18} + return file_c1_connector_v2_ticket_proto_rawDescGZIP(), []int{19} } func (x *TicketRequest) GetDisplayName() string { @@ -1359,7 +1501,7 @@ type TicketsServiceCreateTicketRequest struct { func (x *TicketsServiceCreateTicketRequest) Reset() { *x = TicketsServiceCreateTicketRequest{} if protoimpl.UnsafeEnabled { - mi := &file_c1_connector_v2_ticket_proto_msgTypes[19] + mi := &file_c1_connector_v2_ticket_proto_msgTypes[20] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1372,7 +1514,7 @@ func (x *TicketsServiceCreateTicketRequest) String() string { func (*TicketsServiceCreateTicketRequest) ProtoMessage() {} func (x *TicketsServiceCreateTicketRequest) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_ticket_proto_msgTypes[19] + mi := &file_c1_connector_v2_ticket_proto_msgTypes[20] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1385,7 +1527,7 @@ func (x *TicketsServiceCreateTicketRequest) ProtoReflect() protoreflect.Message // Deprecated: Use TicketsServiceCreateTicketRequest.ProtoReflect.Descriptor instead. func (*TicketsServiceCreateTicketRequest) Descriptor() ([]byte, []int) { - return file_c1_connector_v2_ticket_proto_rawDescGZIP(), []int{19} + return file_c1_connector_v2_ticket_proto_rawDescGZIP(), []int{20} } func (x *TicketsServiceCreateTicketRequest) GetRequest() *TicketRequest { @@ -1421,7 +1563,7 @@ type TicketsServiceCreateTicketResponse struct { func (x *TicketsServiceCreateTicketResponse) Reset() { *x = TicketsServiceCreateTicketResponse{} if protoimpl.UnsafeEnabled { - mi := &file_c1_connector_v2_ticket_proto_msgTypes[20] + mi := &file_c1_connector_v2_ticket_proto_msgTypes[21] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1434,7 +1576,7 @@ func (x *TicketsServiceCreateTicketResponse) String() string { func (*TicketsServiceCreateTicketResponse) ProtoMessage() {} func (x *TicketsServiceCreateTicketResponse) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_ticket_proto_msgTypes[20] + mi := &file_c1_connector_v2_ticket_proto_msgTypes[21] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1447,7 +1589,7 @@ func (x *TicketsServiceCreateTicketResponse) ProtoReflect() protoreflect.Message // Deprecated: Use TicketsServiceCreateTicketResponse.ProtoReflect.Descriptor instead. func (*TicketsServiceCreateTicketResponse) Descriptor() ([]byte, []int) { - return file_c1_connector_v2_ticket_proto_rawDescGZIP(), []int{20} + return file_c1_connector_v2_ticket_proto_rawDescGZIP(), []int{21} } func (x *TicketsServiceCreateTicketResponse) GetTicket() *Ticket { @@ -1476,7 +1618,7 @@ type TicketsServiceGetTicketRequest struct { func (x *TicketsServiceGetTicketRequest) Reset() { *x = TicketsServiceGetTicketRequest{} if protoimpl.UnsafeEnabled { - mi := &file_c1_connector_v2_ticket_proto_msgTypes[21] + mi := &file_c1_connector_v2_ticket_proto_msgTypes[22] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1489,7 +1631,7 @@ func (x *TicketsServiceGetTicketRequest) String() string { func (*TicketsServiceGetTicketRequest) ProtoMessage() {} func (x *TicketsServiceGetTicketRequest) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_ticket_proto_msgTypes[21] + mi := &file_c1_connector_v2_ticket_proto_msgTypes[22] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1502,7 +1644,7 @@ func (x *TicketsServiceGetTicketRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use TicketsServiceGetTicketRequest.ProtoReflect.Descriptor instead. func (*TicketsServiceGetTicketRequest) Descriptor() ([]byte, []int) { - return file_c1_connector_v2_ticket_proto_rawDescGZIP(), []int{21} + return file_c1_connector_v2_ticket_proto_rawDescGZIP(), []int{22} } func (x *TicketsServiceGetTicketRequest) GetId() string { @@ -1531,7 +1673,7 @@ type TicketsServiceGetTicketResponse struct { func (x *TicketsServiceGetTicketResponse) Reset() { *x = TicketsServiceGetTicketResponse{} if protoimpl.UnsafeEnabled { - mi := &file_c1_connector_v2_ticket_proto_msgTypes[22] + mi := &file_c1_connector_v2_ticket_proto_msgTypes[23] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1544,7 +1686,7 @@ func (x *TicketsServiceGetTicketResponse) String() string { func (*TicketsServiceGetTicketResponse) ProtoMessage() {} func (x *TicketsServiceGetTicketResponse) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_ticket_proto_msgTypes[22] + mi := &file_c1_connector_v2_ticket_proto_msgTypes[23] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1557,7 +1699,7 @@ func (x *TicketsServiceGetTicketResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use TicketsServiceGetTicketResponse.ProtoReflect.Descriptor instead. func (*TicketsServiceGetTicketResponse) Descriptor() ([]byte, []int) { - return file_c1_connector_v2_ticket_proto_rawDescGZIP(), []int{22} + return file_c1_connector_v2_ticket_proto_rawDescGZIP(), []int{23} } func (x *TicketsServiceGetTicketResponse) GetTicket() *Ticket { @@ -1585,9 +1727,11 @@ var file_c1_connector_v2_ticket_proto_rawDesc = []byte{ 0x19, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6e, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, - 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x76, 0x61, 0x6c, + 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x77, 0x72, 0x61, + 0x70, 0x70, 0x65, 0x72, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xea, 0x02, 0x0a, 0x0c, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x53, + 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xa2, 0x03, 0x0a, 0x0c, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x69, 0x73, @@ -1603,122 +1747,168 @@ var file_c1_connector_v2_ticket_proto_rawDesc = []byte{ 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x2e, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0c, - 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x1a, 0x63, 0x0a, 0x11, - 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x45, 0x6e, 0x74, 0x72, - 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, - 0x6b, 0x65, 0x79, 0x12, 0x38, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, - 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x43, 0x75, 0x73, 0x74, 0x6f, - 0x6d, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, - 0x01, 0x22, 0xfd, 0x06, 0x0a, 0x11, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x43, 0x75, 0x73, 0x74, - 0x6f, 0x6d, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x64, 0x69, 0x73, 0x70, 0x6c, - 0x61, 0x79, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, - 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, - 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x72, 0x65, - 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x12, 0x52, 0x0a, 0x0c, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, - 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x64, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x63, - 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x54, - 0x69, 0x63, 0x6b, 0x65, 0x74, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x46, 0x69, 0x65, 0x6c, 0x64, - 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x48, 0x00, 0x52, 0x0b, 0x73, - 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x55, 0x0a, 0x0d, 0x73, 0x74, - 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x65, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x2e, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, - 0x2e, 0x76, 0x32, 0x2e, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, - 0x46, 0x69, 0x65, 0x6c, 0x64, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, - 0x73, 0x48, 0x00, 0x52, 0x0c, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, - 0x73, 0x12, 0x4c, 0x0a, 0x0a, 0x62, 0x6f, 0x6f, 0x6c, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, - 0x66, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, - 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x43, 0x75, - 0x73, 0x74, 0x6f, 0x6d, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x42, 0x6f, 0x6f, 0x6c, 0x56, 0x61, 0x6c, - 0x75, 0x65, 0x48, 0x00, 0x52, 0x09, 0x62, 0x6f, 0x6f, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, - 0x5b, 0x0a, 0x0f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x5f, 0x76, 0x61, 0x6c, - 0x75, 0x65, 0x18, 0x67, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x30, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, - 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x54, 0x69, 0x63, 0x6b, 0x65, - 0x74, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x54, 0x69, 0x6d, 0x65, - 0x73, 0x74, 0x61, 0x6d, 0x70, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x48, 0x00, 0x52, 0x0e, 0x74, 0x69, - 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x5f, 0x0a, 0x11, - 0x70, 0x69, 0x63, 0x6b, 0x5f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x76, 0x61, 0x6c, 0x75, - 0x65, 0x18, 0x68, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, - 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, - 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x50, 0x69, 0x63, 0x6b, 0x53, - 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x48, 0x00, 0x52, 0x0f, 0x70, 0x69, - 0x63, 0x6b, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x7b, 0x0a, - 0x1b, 0x70, 0x69, 0x63, 0x6b, 0x5f, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, 0x5f, 0x73, - 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x69, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x3a, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, - 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x43, 0x75, 0x73, 0x74, 0x6f, - 0x6d, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x50, 0x69, 0x63, 0x6b, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x70, - 0x6c, 0x65, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x48, 0x00, - 0x52, 0x18, 0x70, 0x69, 0x63, 0x6b, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, 0x53, 0x74, - 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, 0x5f, 0x0a, 0x11, 0x70, 0x69, - 0x63, 0x6b, 0x5f, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, - 0x6a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, - 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x43, 0x75, - 0x73, 0x74, 0x6f, 0x6d, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x50, 0x69, 0x63, 0x6b, 0x4f, 0x62, 0x6a, - 0x65, 0x63, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x48, 0x00, 0x52, 0x0f, 0x70, 0x69, 0x63, 0x6b, - 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x7b, 0x0a, 0x1b, 0x70, - 0x69, 0x63, 0x6b, 0x5f, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, 0x5f, 0x6f, 0x62, 0x6a, - 0x65, 0x63, 0x74, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x6b, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x3a, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, + 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x12, 0x36, 0x0a, 0x0b, + 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x0b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x1a, 0x63, 0x0a, 0x11, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x46, 0x69, + 0x65, 0x6c, 0x64, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x38, 0x0a, 0x05, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x63, 0x31, 0x2e, + 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x54, 0x69, 0x63, + 0x6b, 0x65, 0x74, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x52, 0x05, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x89, 0x08, 0x0a, 0x11, 0x54, 0x69, + 0x63, 0x6b, 0x65, 0x74, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x12, + 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, + 0x21, 0x0a, 0x0c, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x4e, 0x61, + 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x12, 0x52, + 0x0a, 0x0c, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x64, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, + 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x43, 0x75, 0x73, + 0x74, 0x6f, 0x6d, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, + 0x6c, 0x75, 0x65, 0x48, 0x00, 0x52, 0x0b, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, + 0x75, 0x65, 0x12, 0x55, 0x0a, 0x0d, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x73, 0x18, 0x65, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x63, 0x31, 0x2e, 0x63, + 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x54, 0x69, 0x63, 0x6b, + 0x65, 0x74, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x53, 0x74, 0x72, + 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x48, 0x00, 0x52, 0x0c, 0x73, 0x74, 0x72, + 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, 0x4c, 0x0a, 0x0a, 0x62, 0x6f, 0x6f, + 0x6c, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x66, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, + 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x32, 0x2e, + 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x46, 0x69, 0x65, 0x6c, + 0x64, 0x42, 0x6f, 0x6f, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x48, 0x00, 0x52, 0x09, 0x62, 0x6f, + 0x6f, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x5b, 0x0a, 0x0f, 0x74, 0x69, 0x6d, 0x65, 0x73, + 0x74, 0x61, 0x6d, 0x70, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x67, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x30, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x46, - 0x69, 0x65, 0x6c, 0x64, 0x50, 0x69, 0x63, 0x6b, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, - 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x48, 0x00, 0x52, 0x18, - 0x70, 0x69, 0x63, 0x6b, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, 0x4f, 0x62, 0x6a, 0x65, - 0x63, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x42, 0x07, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, - 0x65, 0x22, 0x34, 0x0a, 0x1c, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x43, 0x75, 0x73, 0x74, 0x6f, - 0x6d, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, - 0x65, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x37, 0x0a, 0x1d, 0x54, 0x69, 0x63, 0x6b, 0x65, - 0x74, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x53, 0x74, 0x72, 0x69, - 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x76, 0x61, 0x6c, 0x75, - 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, - 0x22, 0x32, 0x0a, 0x1a, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, - 0x46, 0x69, 0x65, 0x6c, 0x64, 0x42, 0x6f, 0x6f, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x14, - 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x76, - 0x61, 0x6c, 0x75, 0x65, 0x22, 0x53, 0x0a, 0x1f, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x43, 0x75, - 0x73, 0x74, 0x6f, 0x6d, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, - 0x6d, 0x70, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x30, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, - 0x6d, 0x70, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x5f, 0x0a, 0x20, 0x54, 0x69, 0x63, - 0x6b, 0x65, 0x74, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x50, 0x69, - 0x63, 0x6b, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x14, 0x0a, - 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, - 0x6c, 0x75, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x5f, 0x76, - 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0d, 0x61, 0x6c, 0x6c, - 0x6f, 0x77, 0x65, 0x64, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x22, 0x6a, 0x0a, 0x29, 0x54, 0x69, - 0x63, 0x6b, 0x65, 0x74, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x50, - 0x69, 0x63, 0x6b, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, 0x53, 0x74, 0x72, 0x69, 0x6e, - 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, - 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, - 0x25, 0x0a, 0x0e, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, - 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0d, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, - 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x22, 0xbd, 0x01, 0x0a, 0x20, 0x54, 0x69, 0x63, 0x6b, 0x65, - 0x74, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x50, 0x69, 0x63, 0x6b, - 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x43, 0x0a, 0x05, 0x76, - 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x63, 0x31, 0x2e, + 0x69, 0x65, 0x6c, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x56, 0x61, 0x6c, + 0x75, 0x65, 0x48, 0x00, 0x52, 0x0e, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x56, + 0x61, 0x6c, 0x75, 0x65, 0x12, 0x5f, 0x0a, 0x11, 0x70, 0x69, 0x63, 0x6b, 0x5f, 0x73, 0x74, 0x72, + 0x69, 0x6e, 0x67, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x68, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x31, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x76, + 0x32, 0x2e, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x46, 0x69, + 0x65, 0x6c, 0x64, 0x50, 0x69, 0x63, 0x6b, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, + 0x75, 0x65, 0x48, 0x00, 0x52, 0x0f, 0x70, 0x69, 0x63, 0x6b, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, + 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x7b, 0x0a, 0x1b, 0x70, 0x69, 0x63, 0x6b, 0x5f, 0x6d, 0x75, + 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, 0x5f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x73, 0x18, 0x69, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x3a, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x54, 0x69, 0x63, - 0x6b, 0x65, 0x74, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4f, 0x62, - 0x6a, 0x65, 0x63, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, - 0x12, 0x54, 0x0a, 0x0e, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x5f, 0x76, 0x61, 0x6c, 0x75, - 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, + 0x6b, 0x65, 0x74, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x50, 0x69, + 0x63, 0x6b, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, + 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x48, 0x00, 0x52, 0x18, 0x70, 0x69, 0x63, 0x6b, 0x4d, 0x75, + 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, + 0x65, 0x73, 0x12, 0x5f, 0x0a, 0x11, 0x70, 0x69, 0x63, 0x6b, 0x5f, 0x6f, 0x62, 0x6a, 0x65, 0x63, + 0x74, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x6a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x31, 0x2e, + 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x32, 0x2e, + 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x46, 0x69, 0x65, 0x6c, + 0x64, 0x50, 0x69, 0x63, 0x6b, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, + 0x48, 0x00, 0x52, 0x0f, 0x70, 0x69, 0x63, 0x6b, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x56, 0x61, + 0x6c, 0x75, 0x65, 0x12, 0x7b, 0x0a, 0x1b, 0x70, 0x69, 0x63, 0x6b, 0x5f, 0x6d, 0x75, 0x6c, 0x74, + 0x69, 0x70, 0x6c, 0x65, 0x5f, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x73, 0x18, 0x6b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x3a, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x54, 0x69, 0x63, 0x6b, 0x65, - 0x74, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4f, 0x62, 0x6a, 0x65, - 0x63, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0d, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, - 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x22, 0xc8, 0x01, 0x0a, 0x29, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x50, 0x69, 0x63, 0x6b, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x56, 0x61, - 0x6c, 0x75, 0x65, 0x73, 0x12, 0x45, 0x0a, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x01, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, - 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x43, 0x75, 0x73, - 0x74, 0x6f, 0x6d, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x56, 0x61, - 0x6c, 0x75, 0x65, 0x52, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, 0x54, 0x0a, 0x0e, 0x61, - 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x02, 0x20, + 0x6c, 0x75, 0x65, 0x73, 0x48, 0x00, 0x52, 0x18, 0x70, 0x69, 0x63, 0x6b, 0x4d, 0x75, 0x6c, 0x74, + 0x69, 0x70, 0x6c, 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, + 0x12, 0x52, 0x0a, 0x0c, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x18, 0x6c, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, + 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x43, + 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, + 0x56, 0x61, 0x6c, 0x75, 0x65, 0x48, 0x00, 0x52, 0x0b, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x56, + 0x61, 0x6c, 0x75, 0x65, 0x12, 0x36, 0x0a, 0x0b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, + 0x0b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x42, 0x07, 0x0a, 0x05, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x59, 0x0a, 0x1c, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x43, + 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, + 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x64, + 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0c, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, + 0x22, 0x5e, 0x0a, 0x1d, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, + 0x46, 0x69, 0x65, 0x6c, 0x64, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, + 0x73, 0x12, 0x16, 0x0a, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, + 0x09, 0x52, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, 0x25, 0x0a, 0x0e, 0x64, 0x65, 0x66, + 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, + 0x09, 0x52, 0x0d, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, + 0x22, 0x32, 0x0a, 0x1a, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, + 0x46, 0x69, 0x65, 0x6c, 0x64, 0x42, 0x6f, 0x6f, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x14, + 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x22, 0x93, 0x01, 0x0a, 0x1c, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x43, + 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, + 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x31, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x6c, 0x6f, 0x61, 0x74, 0x56, 0x61, 0x6c, 0x75, + 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x40, 0x0a, 0x0d, 0x64, 0x65, 0x66, 0x61, + 0x75, 0x6c, 0x74, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2e, 0x46, 0x6c, 0x6f, 0x61, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0c, 0x64, 0x65, + 0x66, 0x61, 0x75, 0x6c, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x94, 0x01, 0x0a, 0x1f, 0x54, + 0x69, 0x63, 0x6b, 0x65, 0x74, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x46, 0x69, 0x65, 0x6c, 0x64, + 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x30, + 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, + 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x12, 0x3f, 0x0a, 0x0d, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, + 0x61, 0x6d, 0x70, 0x52, 0x0c, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x56, 0x61, 0x6c, 0x75, + 0x65, 0x22, 0x84, 0x01, 0x0a, 0x20, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x43, 0x75, 0x73, 0x74, + 0x6f, 0x6d, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x50, 0x69, 0x63, 0x6b, 0x53, 0x74, 0x72, 0x69, 0x6e, + 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x25, 0x0a, 0x0e, + 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x02, + 0x20, 0x03, 0x28, 0x09, 0x52, 0x0d, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x56, 0x61, 0x6c, + 0x75, 0x65, 0x73, 0x12, 0x23, 0x0a, 0x0d, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x64, 0x65, 0x66, 0x61, + 0x75, 0x6c, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x91, 0x01, 0x0a, 0x29, 0x54, 0x69, 0x63, + 0x6b, 0x65, 0x74, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x50, 0x69, + 0x63, 0x6b, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, + 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, + 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, 0x25, + 0x0a, 0x0e, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, + 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0d, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x56, + 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, 0x25, 0x0a, 0x0e, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, + 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0d, 0x64, + 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x22, 0x91, 0x02, 0x0a, + 0x20, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x46, 0x69, 0x65, + 0x6c, 0x64, 0x50, 0x69, 0x63, 0x6b, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x56, 0x61, 0x6c, 0x75, + 0x65, 0x12, 0x43, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x2d, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, + 0x76, 0x32, 0x2e, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x46, + 0x69, 0x65, 0x6c, 0x64, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, + 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x54, 0x0a, 0x0e, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x65, + 0x64, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2d, + 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x32, + 0x2e, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x46, 0x69, 0x65, + 0x6c, 0x64, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0d, 0x61, + 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, 0x52, 0x0a, 0x0d, + 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, + 0x6f, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x43, 0x75, 0x73, 0x74, + 0x6f, 0x6d, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x56, 0x61, 0x6c, + 0x75, 0x65, 0x52, 0x0c, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, + 0x22, 0x9e, 0x02, 0x0a, 0x29, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x43, 0x75, 0x73, 0x74, 0x6f, + 0x6d, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x50, 0x69, 0x63, 0x6b, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x70, + 0x6c, 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, 0x45, + 0x0a, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2d, + 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x32, + 0x2e, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x46, 0x69, 0x65, + 0x6c, 0x64, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x06, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, 0x54, 0x0a, 0x0e, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, + 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2d, 0x2e, + 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x32, 0x2e, + 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x46, 0x69, 0x65, 0x6c, + 0x64, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0d, 0x61, 0x6c, + 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, 0x54, 0x0a, 0x0e, 0x64, + 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x56, 0x61, 0x6c, - 0x75, 0x65, 0x52, 0x0d, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x56, 0x61, 0x6c, 0x75, 0x65, + 0x75, 0x65, 0x52, 0x0d, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x22, 0x51, 0x0a, 0x1c, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, @@ -1940,98 +2130,108 @@ func file_c1_connector_v2_ticket_proto_rawDescGZIP() []byte { return file_c1_connector_v2_ticket_proto_rawDescData } -var file_c1_connector_v2_ticket_proto_msgTypes = make([]protoimpl.MessageInfo, 26) +var file_c1_connector_v2_ticket_proto_msgTypes = make([]protoimpl.MessageInfo, 27) var file_c1_connector_v2_ticket_proto_goTypes = []interface{}{ (*TicketSchema)(nil), // 0: c1.connector.v2.TicketSchema (*TicketCustomField)(nil), // 1: c1.connector.v2.TicketCustomField (*TicketCustomFieldStringValue)(nil), // 2: c1.connector.v2.TicketCustomFieldStringValue (*TicketCustomFieldStringValues)(nil), // 3: c1.connector.v2.TicketCustomFieldStringValues (*TicketCustomFieldBoolValue)(nil), // 4: c1.connector.v2.TicketCustomFieldBoolValue - (*TicketCustomFieldTimestampValue)(nil), // 5: c1.connector.v2.TicketCustomFieldTimestampValue - (*TicketCustomFieldPickStringValue)(nil), // 6: c1.connector.v2.TicketCustomFieldPickStringValue - (*TicketCustomFieldPickMultipleStringValues)(nil), // 7: c1.connector.v2.TicketCustomFieldPickMultipleStringValues - (*TicketCustomFieldPickObjectValue)(nil), // 8: c1.connector.v2.TicketCustomFieldPickObjectValue - (*TicketCustomFieldPickMultipleObjectValues)(nil), // 9: c1.connector.v2.TicketCustomFieldPickMultipleObjectValues - (*TicketCustomFieldObjectValue)(nil), // 10: c1.connector.v2.TicketCustomFieldObjectValue - (*TicketStatus)(nil), // 11: c1.connector.v2.TicketStatus - (*TicketsServiceGetTicketSchemaRequest)(nil), // 12: c1.connector.v2.TicketsServiceGetTicketSchemaRequest - (*TicketsServiceGetTicketSchemaResponse)(nil), // 13: c1.connector.v2.TicketsServiceGetTicketSchemaResponse - (*TicketsServiceListTicketSchemasRequest)(nil), // 14: c1.connector.v2.TicketsServiceListTicketSchemasRequest - (*TicketsServiceListTicketSchemasResponse)(nil), // 15: c1.connector.v2.TicketsServiceListTicketSchemasResponse - (*Ticket)(nil), // 16: c1.connector.v2.Ticket - (*TicketType)(nil), // 17: c1.connector.v2.TicketType - (*TicketRequest)(nil), // 18: c1.connector.v2.TicketRequest - (*TicketsServiceCreateTicketRequest)(nil), // 19: c1.connector.v2.TicketsServiceCreateTicketRequest - (*TicketsServiceCreateTicketResponse)(nil), // 20: c1.connector.v2.TicketsServiceCreateTicketResponse - (*TicketsServiceGetTicketRequest)(nil), // 21: c1.connector.v2.TicketsServiceGetTicketRequest - (*TicketsServiceGetTicketResponse)(nil), // 22: c1.connector.v2.TicketsServiceGetTicketResponse - nil, // 23: c1.connector.v2.TicketSchema.CustomFieldsEntry - nil, // 24: c1.connector.v2.Ticket.CustomFieldsEntry - nil, // 25: c1.connector.v2.TicketRequest.CustomFieldsEntry - (*timestamppb.Timestamp)(nil), // 26: google.protobuf.Timestamp + (*TicketCustomFieldNumberValue)(nil), // 5: c1.connector.v2.TicketCustomFieldNumberValue + (*TicketCustomFieldTimestampValue)(nil), // 6: c1.connector.v2.TicketCustomFieldTimestampValue + (*TicketCustomFieldPickStringValue)(nil), // 7: c1.connector.v2.TicketCustomFieldPickStringValue + (*TicketCustomFieldPickMultipleStringValues)(nil), // 8: c1.connector.v2.TicketCustomFieldPickMultipleStringValues + (*TicketCustomFieldPickObjectValue)(nil), // 9: c1.connector.v2.TicketCustomFieldPickObjectValue + (*TicketCustomFieldPickMultipleObjectValues)(nil), // 10: c1.connector.v2.TicketCustomFieldPickMultipleObjectValues + (*TicketCustomFieldObjectValue)(nil), // 11: c1.connector.v2.TicketCustomFieldObjectValue + (*TicketStatus)(nil), // 12: c1.connector.v2.TicketStatus + (*TicketsServiceGetTicketSchemaRequest)(nil), // 13: c1.connector.v2.TicketsServiceGetTicketSchemaRequest + (*TicketsServiceGetTicketSchemaResponse)(nil), // 14: c1.connector.v2.TicketsServiceGetTicketSchemaResponse + (*TicketsServiceListTicketSchemasRequest)(nil), // 15: c1.connector.v2.TicketsServiceListTicketSchemasRequest + (*TicketsServiceListTicketSchemasResponse)(nil), // 16: c1.connector.v2.TicketsServiceListTicketSchemasResponse + (*Ticket)(nil), // 17: c1.connector.v2.Ticket + (*TicketType)(nil), // 18: c1.connector.v2.TicketType + (*TicketRequest)(nil), // 19: c1.connector.v2.TicketRequest + (*TicketsServiceCreateTicketRequest)(nil), // 20: c1.connector.v2.TicketsServiceCreateTicketRequest + (*TicketsServiceCreateTicketResponse)(nil), // 21: c1.connector.v2.TicketsServiceCreateTicketResponse + (*TicketsServiceGetTicketRequest)(nil), // 22: c1.connector.v2.TicketsServiceGetTicketRequest + (*TicketsServiceGetTicketResponse)(nil), // 23: c1.connector.v2.TicketsServiceGetTicketResponse + nil, // 24: c1.connector.v2.TicketSchema.CustomFieldsEntry + nil, // 25: c1.connector.v2.Ticket.CustomFieldsEntry + nil, // 26: c1.connector.v2.TicketRequest.CustomFieldsEntry (*anypb.Any)(nil), // 27: google.protobuf.Any - (*Resource)(nil), // 28: c1.connector.v2.Resource + (*wrapperspb.FloatValue)(nil), // 28: google.protobuf.FloatValue + (*timestamppb.Timestamp)(nil), // 29: google.protobuf.Timestamp + (*Resource)(nil), // 30: c1.connector.v2.Resource } var file_c1_connector_v2_ticket_proto_depIdxs = []int32{ - 17, // 0: c1.connector.v2.TicketSchema.types:type_name -> c1.connector.v2.TicketType - 11, // 1: c1.connector.v2.TicketSchema.statuses:type_name -> c1.connector.v2.TicketStatus - 23, // 2: c1.connector.v2.TicketSchema.custom_fields:type_name -> c1.connector.v2.TicketSchema.CustomFieldsEntry - 2, // 3: c1.connector.v2.TicketCustomField.string_value:type_name -> c1.connector.v2.TicketCustomFieldStringValue - 3, // 4: c1.connector.v2.TicketCustomField.string_values:type_name -> c1.connector.v2.TicketCustomFieldStringValues - 4, // 5: c1.connector.v2.TicketCustomField.bool_value:type_name -> c1.connector.v2.TicketCustomFieldBoolValue - 5, // 6: c1.connector.v2.TicketCustomField.timestamp_value:type_name -> c1.connector.v2.TicketCustomFieldTimestampValue - 6, // 7: c1.connector.v2.TicketCustomField.pick_string_value:type_name -> c1.connector.v2.TicketCustomFieldPickStringValue - 7, // 8: c1.connector.v2.TicketCustomField.pick_multiple_string_values:type_name -> c1.connector.v2.TicketCustomFieldPickMultipleStringValues - 8, // 9: c1.connector.v2.TicketCustomField.pick_object_value:type_name -> c1.connector.v2.TicketCustomFieldPickObjectValue - 9, // 10: c1.connector.v2.TicketCustomField.pick_multiple_object_values:type_name -> c1.connector.v2.TicketCustomFieldPickMultipleObjectValues - 26, // 11: c1.connector.v2.TicketCustomFieldTimestampValue.value:type_name -> google.protobuf.Timestamp - 10, // 12: c1.connector.v2.TicketCustomFieldPickObjectValue.value:type_name -> c1.connector.v2.TicketCustomFieldObjectValue - 10, // 13: c1.connector.v2.TicketCustomFieldPickObjectValue.allowed_values:type_name -> c1.connector.v2.TicketCustomFieldObjectValue - 10, // 14: c1.connector.v2.TicketCustomFieldPickMultipleObjectValues.values:type_name -> c1.connector.v2.TicketCustomFieldObjectValue - 10, // 15: c1.connector.v2.TicketCustomFieldPickMultipleObjectValues.allowed_values:type_name -> c1.connector.v2.TicketCustomFieldObjectValue - 27, // 16: c1.connector.v2.TicketsServiceGetTicketSchemaRequest.annotations:type_name -> google.protobuf.Any - 0, // 17: c1.connector.v2.TicketsServiceGetTicketSchemaResponse.schema:type_name -> c1.connector.v2.TicketSchema - 27, // 18: c1.connector.v2.TicketsServiceGetTicketSchemaResponse.annotations:type_name -> google.protobuf.Any - 27, // 19: c1.connector.v2.TicketsServiceListTicketSchemasRequest.annotations:type_name -> google.protobuf.Any - 0, // 20: c1.connector.v2.TicketsServiceListTicketSchemasResponse.list:type_name -> c1.connector.v2.TicketSchema - 27, // 21: c1.connector.v2.TicketsServiceListTicketSchemasResponse.annotations:type_name -> google.protobuf.Any - 28, // 22: c1.connector.v2.Ticket.assignees:type_name -> c1.connector.v2.Resource - 28, // 23: c1.connector.v2.Ticket.reporter:type_name -> c1.connector.v2.Resource - 11, // 24: c1.connector.v2.Ticket.status:type_name -> c1.connector.v2.TicketStatus - 17, // 25: c1.connector.v2.Ticket.type:type_name -> c1.connector.v2.TicketType - 24, // 26: c1.connector.v2.Ticket.custom_fields:type_name -> c1.connector.v2.Ticket.CustomFieldsEntry - 26, // 27: c1.connector.v2.Ticket.created_at:type_name -> google.protobuf.Timestamp - 26, // 28: c1.connector.v2.Ticket.updated_at:type_name -> google.protobuf.Timestamp - 26, // 29: c1.connector.v2.Ticket.completed_at:type_name -> google.protobuf.Timestamp - 28, // 30: c1.connector.v2.Ticket.requested_for:type_name -> c1.connector.v2.Resource - 11, // 31: c1.connector.v2.TicketRequest.status:type_name -> c1.connector.v2.TicketStatus - 17, // 32: c1.connector.v2.TicketRequest.type:type_name -> c1.connector.v2.TicketType - 25, // 33: c1.connector.v2.TicketRequest.custom_fields:type_name -> c1.connector.v2.TicketRequest.CustomFieldsEntry - 28, // 34: c1.connector.v2.TicketRequest.requested_for:type_name -> c1.connector.v2.Resource - 18, // 35: c1.connector.v2.TicketsServiceCreateTicketRequest.request:type_name -> c1.connector.v2.TicketRequest - 0, // 36: c1.connector.v2.TicketsServiceCreateTicketRequest.schema:type_name -> c1.connector.v2.TicketSchema - 27, // 37: c1.connector.v2.TicketsServiceCreateTicketRequest.annotations:type_name -> google.protobuf.Any - 16, // 38: c1.connector.v2.TicketsServiceCreateTicketResponse.ticket:type_name -> c1.connector.v2.Ticket - 27, // 39: c1.connector.v2.TicketsServiceCreateTicketResponse.annotations:type_name -> google.protobuf.Any - 27, // 40: c1.connector.v2.TicketsServiceGetTicketRequest.annotations:type_name -> google.protobuf.Any - 16, // 41: c1.connector.v2.TicketsServiceGetTicketResponse.ticket:type_name -> c1.connector.v2.Ticket - 27, // 42: c1.connector.v2.TicketsServiceGetTicketResponse.annotations:type_name -> google.protobuf.Any - 1, // 43: c1.connector.v2.TicketSchema.CustomFieldsEntry.value:type_name -> c1.connector.v2.TicketCustomField - 1, // 44: c1.connector.v2.Ticket.CustomFieldsEntry.value:type_name -> c1.connector.v2.TicketCustomField - 1, // 45: c1.connector.v2.TicketRequest.CustomFieldsEntry.value:type_name -> c1.connector.v2.TicketCustomField - 19, // 46: c1.connector.v2.TicketsService.CreateTicket:input_type -> c1.connector.v2.TicketsServiceCreateTicketRequest - 21, // 47: c1.connector.v2.TicketsService.GetTicket:input_type -> c1.connector.v2.TicketsServiceGetTicketRequest - 14, // 48: c1.connector.v2.TicketsService.ListTicketSchemas:input_type -> c1.connector.v2.TicketsServiceListTicketSchemasRequest - 12, // 49: c1.connector.v2.TicketsService.GetTicketSchema:input_type -> c1.connector.v2.TicketsServiceGetTicketSchemaRequest - 20, // 50: c1.connector.v2.TicketsService.CreateTicket:output_type -> c1.connector.v2.TicketsServiceCreateTicketResponse - 22, // 51: c1.connector.v2.TicketsService.GetTicket:output_type -> c1.connector.v2.TicketsServiceGetTicketResponse - 15, // 52: c1.connector.v2.TicketsService.ListTicketSchemas:output_type -> c1.connector.v2.TicketsServiceListTicketSchemasResponse - 13, // 53: c1.connector.v2.TicketsService.GetTicketSchema:output_type -> c1.connector.v2.TicketsServiceGetTicketSchemaResponse - 50, // [50:54] is the sub-list for method output_type - 46, // [46:50] is the sub-list for method input_type - 46, // [46:46] is the sub-list for extension type_name - 46, // [46:46] is the sub-list for extension extendee - 0, // [0:46] is the sub-list for field type_name + 18, // 0: c1.connector.v2.TicketSchema.types:type_name -> c1.connector.v2.TicketType + 12, // 1: c1.connector.v2.TicketSchema.statuses:type_name -> c1.connector.v2.TicketStatus + 24, // 2: c1.connector.v2.TicketSchema.custom_fields:type_name -> c1.connector.v2.TicketSchema.CustomFieldsEntry + 27, // 3: c1.connector.v2.TicketSchema.annotations:type_name -> google.protobuf.Any + 2, // 4: c1.connector.v2.TicketCustomField.string_value:type_name -> c1.connector.v2.TicketCustomFieldStringValue + 3, // 5: c1.connector.v2.TicketCustomField.string_values:type_name -> c1.connector.v2.TicketCustomFieldStringValues + 4, // 6: c1.connector.v2.TicketCustomField.bool_value:type_name -> c1.connector.v2.TicketCustomFieldBoolValue + 6, // 7: c1.connector.v2.TicketCustomField.timestamp_value:type_name -> c1.connector.v2.TicketCustomFieldTimestampValue + 7, // 8: c1.connector.v2.TicketCustomField.pick_string_value:type_name -> c1.connector.v2.TicketCustomFieldPickStringValue + 8, // 9: c1.connector.v2.TicketCustomField.pick_multiple_string_values:type_name -> c1.connector.v2.TicketCustomFieldPickMultipleStringValues + 9, // 10: c1.connector.v2.TicketCustomField.pick_object_value:type_name -> c1.connector.v2.TicketCustomFieldPickObjectValue + 10, // 11: c1.connector.v2.TicketCustomField.pick_multiple_object_values:type_name -> c1.connector.v2.TicketCustomFieldPickMultipleObjectValues + 5, // 12: c1.connector.v2.TicketCustomField.number_value:type_name -> c1.connector.v2.TicketCustomFieldNumberValue + 27, // 13: c1.connector.v2.TicketCustomField.annotations:type_name -> google.protobuf.Any + 28, // 14: c1.connector.v2.TicketCustomFieldNumberValue.value:type_name -> google.protobuf.FloatValue + 28, // 15: c1.connector.v2.TicketCustomFieldNumberValue.default_value:type_name -> google.protobuf.FloatValue + 29, // 16: c1.connector.v2.TicketCustomFieldTimestampValue.value:type_name -> google.protobuf.Timestamp + 29, // 17: c1.connector.v2.TicketCustomFieldTimestampValue.default_value:type_name -> google.protobuf.Timestamp + 11, // 18: c1.connector.v2.TicketCustomFieldPickObjectValue.value:type_name -> c1.connector.v2.TicketCustomFieldObjectValue + 11, // 19: c1.connector.v2.TicketCustomFieldPickObjectValue.allowed_values:type_name -> c1.connector.v2.TicketCustomFieldObjectValue + 11, // 20: c1.connector.v2.TicketCustomFieldPickObjectValue.default_value:type_name -> c1.connector.v2.TicketCustomFieldObjectValue + 11, // 21: c1.connector.v2.TicketCustomFieldPickMultipleObjectValues.values:type_name -> c1.connector.v2.TicketCustomFieldObjectValue + 11, // 22: c1.connector.v2.TicketCustomFieldPickMultipleObjectValues.allowed_values:type_name -> c1.connector.v2.TicketCustomFieldObjectValue + 11, // 23: c1.connector.v2.TicketCustomFieldPickMultipleObjectValues.default_values:type_name -> c1.connector.v2.TicketCustomFieldObjectValue + 27, // 24: c1.connector.v2.TicketsServiceGetTicketSchemaRequest.annotations:type_name -> google.protobuf.Any + 0, // 25: c1.connector.v2.TicketsServiceGetTicketSchemaResponse.schema:type_name -> c1.connector.v2.TicketSchema + 27, // 26: c1.connector.v2.TicketsServiceGetTicketSchemaResponse.annotations:type_name -> google.protobuf.Any + 27, // 27: c1.connector.v2.TicketsServiceListTicketSchemasRequest.annotations:type_name -> google.protobuf.Any + 0, // 28: c1.connector.v2.TicketsServiceListTicketSchemasResponse.list:type_name -> c1.connector.v2.TicketSchema + 27, // 29: c1.connector.v2.TicketsServiceListTicketSchemasResponse.annotations:type_name -> google.protobuf.Any + 30, // 30: c1.connector.v2.Ticket.assignees:type_name -> c1.connector.v2.Resource + 30, // 31: c1.connector.v2.Ticket.reporter:type_name -> c1.connector.v2.Resource + 12, // 32: c1.connector.v2.Ticket.status:type_name -> c1.connector.v2.TicketStatus + 18, // 33: c1.connector.v2.Ticket.type:type_name -> c1.connector.v2.TicketType + 25, // 34: c1.connector.v2.Ticket.custom_fields:type_name -> c1.connector.v2.Ticket.CustomFieldsEntry + 29, // 35: c1.connector.v2.Ticket.created_at:type_name -> google.protobuf.Timestamp + 29, // 36: c1.connector.v2.Ticket.updated_at:type_name -> google.protobuf.Timestamp + 29, // 37: c1.connector.v2.Ticket.completed_at:type_name -> google.protobuf.Timestamp + 30, // 38: c1.connector.v2.Ticket.requested_for:type_name -> c1.connector.v2.Resource + 12, // 39: c1.connector.v2.TicketRequest.status:type_name -> c1.connector.v2.TicketStatus + 18, // 40: c1.connector.v2.TicketRequest.type:type_name -> c1.connector.v2.TicketType + 26, // 41: c1.connector.v2.TicketRequest.custom_fields:type_name -> c1.connector.v2.TicketRequest.CustomFieldsEntry + 30, // 42: c1.connector.v2.TicketRequest.requested_for:type_name -> c1.connector.v2.Resource + 19, // 43: c1.connector.v2.TicketsServiceCreateTicketRequest.request:type_name -> c1.connector.v2.TicketRequest + 0, // 44: c1.connector.v2.TicketsServiceCreateTicketRequest.schema:type_name -> c1.connector.v2.TicketSchema + 27, // 45: c1.connector.v2.TicketsServiceCreateTicketRequest.annotations:type_name -> google.protobuf.Any + 17, // 46: c1.connector.v2.TicketsServiceCreateTicketResponse.ticket:type_name -> c1.connector.v2.Ticket + 27, // 47: c1.connector.v2.TicketsServiceCreateTicketResponse.annotations:type_name -> google.protobuf.Any + 27, // 48: c1.connector.v2.TicketsServiceGetTicketRequest.annotations:type_name -> google.protobuf.Any + 17, // 49: c1.connector.v2.TicketsServiceGetTicketResponse.ticket:type_name -> c1.connector.v2.Ticket + 27, // 50: c1.connector.v2.TicketsServiceGetTicketResponse.annotations:type_name -> google.protobuf.Any + 1, // 51: c1.connector.v2.TicketSchema.CustomFieldsEntry.value:type_name -> c1.connector.v2.TicketCustomField + 1, // 52: c1.connector.v2.Ticket.CustomFieldsEntry.value:type_name -> c1.connector.v2.TicketCustomField + 1, // 53: c1.connector.v2.TicketRequest.CustomFieldsEntry.value:type_name -> c1.connector.v2.TicketCustomField + 20, // 54: c1.connector.v2.TicketsService.CreateTicket:input_type -> c1.connector.v2.TicketsServiceCreateTicketRequest + 22, // 55: c1.connector.v2.TicketsService.GetTicket:input_type -> c1.connector.v2.TicketsServiceGetTicketRequest + 15, // 56: c1.connector.v2.TicketsService.ListTicketSchemas:input_type -> c1.connector.v2.TicketsServiceListTicketSchemasRequest + 13, // 57: c1.connector.v2.TicketsService.GetTicketSchema:input_type -> c1.connector.v2.TicketsServiceGetTicketSchemaRequest + 21, // 58: c1.connector.v2.TicketsService.CreateTicket:output_type -> c1.connector.v2.TicketsServiceCreateTicketResponse + 23, // 59: c1.connector.v2.TicketsService.GetTicket:output_type -> c1.connector.v2.TicketsServiceGetTicketResponse + 16, // 60: c1.connector.v2.TicketsService.ListTicketSchemas:output_type -> c1.connector.v2.TicketsServiceListTicketSchemasResponse + 14, // 61: c1.connector.v2.TicketsService.GetTicketSchema:output_type -> c1.connector.v2.TicketsServiceGetTicketSchemaResponse + 58, // [58:62] is the sub-list for method output_type + 54, // [54:58] is the sub-list for method input_type + 54, // [54:54] is the sub-list for extension type_name + 54, // [54:54] is the sub-list for extension extendee + 0, // [0:54] is the sub-list for field type_name } func init() { file_c1_connector_v2_ticket_proto_init() } @@ -2102,7 +2302,7 @@ func file_c1_connector_v2_ticket_proto_init() { } } file_c1_connector_v2_ticket_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TicketCustomFieldTimestampValue); i { + switch v := v.(*TicketCustomFieldNumberValue); i { case 0: return &v.state case 1: @@ -2114,7 +2314,7 @@ func file_c1_connector_v2_ticket_proto_init() { } } file_c1_connector_v2_ticket_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TicketCustomFieldPickStringValue); i { + switch v := v.(*TicketCustomFieldTimestampValue); i { case 0: return &v.state case 1: @@ -2126,7 +2326,7 @@ func file_c1_connector_v2_ticket_proto_init() { } } file_c1_connector_v2_ticket_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TicketCustomFieldPickMultipleStringValues); i { + switch v := v.(*TicketCustomFieldPickStringValue); i { case 0: return &v.state case 1: @@ -2138,7 +2338,7 @@ func file_c1_connector_v2_ticket_proto_init() { } } file_c1_connector_v2_ticket_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TicketCustomFieldPickObjectValue); i { + switch v := v.(*TicketCustomFieldPickMultipleStringValues); i { case 0: return &v.state case 1: @@ -2150,7 +2350,7 @@ func file_c1_connector_v2_ticket_proto_init() { } } file_c1_connector_v2_ticket_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TicketCustomFieldPickMultipleObjectValues); i { + switch v := v.(*TicketCustomFieldPickObjectValue); i { case 0: return &v.state case 1: @@ -2162,7 +2362,7 @@ func file_c1_connector_v2_ticket_proto_init() { } } file_c1_connector_v2_ticket_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TicketCustomFieldObjectValue); i { + switch v := v.(*TicketCustomFieldPickMultipleObjectValues); i { case 0: return &v.state case 1: @@ -2174,7 +2374,7 @@ func file_c1_connector_v2_ticket_proto_init() { } } file_c1_connector_v2_ticket_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TicketStatus); i { + switch v := v.(*TicketCustomFieldObjectValue); i { case 0: return &v.state case 1: @@ -2186,7 +2386,7 @@ func file_c1_connector_v2_ticket_proto_init() { } } file_c1_connector_v2_ticket_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TicketsServiceGetTicketSchemaRequest); i { + switch v := v.(*TicketStatus); i { case 0: return &v.state case 1: @@ -2198,7 +2398,7 @@ func file_c1_connector_v2_ticket_proto_init() { } } file_c1_connector_v2_ticket_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TicketsServiceGetTicketSchemaResponse); i { + switch v := v.(*TicketsServiceGetTicketSchemaRequest); i { case 0: return &v.state case 1: @@ -2210,7 +2410,7 @@ func file_c1_connector_v2_ticket_proto_init() { } } file_c1_connector_v2_ticket_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TicketsServiceListTicketSchemasRequest); i { + switch v := v.(*TicketsServiceGetTicketSchemaResponse); i { case 0: return &v.state case 1: @@ -2222,7 +2422,7 @@ func file_c1_connector_v2_ticket_proto_init() { } } file_c1_connector_v2_ticket_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TicketsServiceListTicketSchemasResponse); i { + switch v := v.(*TicketsServiceListTicketSchemasRequest); i { case 0: return &v.state case 1: @@ -2234,7 +2434,7 @@ func file_c1_connector_v2_ticket_proto_init() { } } file_c1_connector_v2_ticket_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Ticket); i { + switch v := v.(*TicketsServiceListTicketSchemasResponse); i { case 0: return &v.state case 1: @@ -2246,7 +2446,7 @@ func file_c1_connector_v2_ticket_proto_init() { } } file_c1_connector_v2_ticket_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TicketType); i { + switch v := v.(*Ticket); i { case 0: return &v.state case 1: @@ -2258,7 +2458,7 @@ func file_c1_connector_v2_ticket_proto_init() { } } file_c1_connector_v2_ticket_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TicketRequest); i { + switch v := v.(*TicketType); i { case 0: return &v.state case 1: @@ -2270,7 +2470,7 @@ func file_c1_connector_v2_ticket_proto_init() { } } file_c1_connector_v2_ticket_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TicketsServiceCreateTicketRequest); i { + switch v := v.(*TicketRequest); i { case 0: return &v.state case 1: @@ -2282,7 +2482,7 @@ func file_c1_connector_v2_ticket_proto_init() { } } file_c1_connector_v2_ticket_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TicketsServiceCreateTicketResponse); i { + switch v := v.(*TicketsServiceCreateTicketRequest); i { case 0: return &v.state case 1: @@ -2294,7 +2494,7 @@ func file_c1_connector_v2_ticket_proto_init() { } } file_c1_connector_v2_ticket_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TicketsServiceGetTicketRequest); i { + switch v := v.(*TicketsServiceCreateTicketResponse); i { case 0: return &v.state case 1: @@ -2306,6 +2506,18 @@ func file_c1_connector_v2_ticket_proto_init() { } } file_c1_connector_v2_ticket_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TicketsServiceGetTicketRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_c1_connector_v2_ticket_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*TicketsServiceGetTicketResponse); i { case 0: return &v.state @@ -2327,6 +2539,7 @@ func file_c1_connector_v2_ticket_proto_init() { (*TicketCustomField_PickMultipleStringValues)(nil), (*TicketCustomField_PickObjectValue)(nil), (*TicketCustomField_PickMultipleObjectValues)(nil), + (*TicketCustomField_NumberValue)(nil), } type x struct{} out := protoimpl.TypeBuilder{ @@ -2334,7 +2547,7 @@ func file_c1_connector_v2_ticket_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_c1_connector_v2_ticket_proto_rawDesc, NumEnums: 0, - NumMessages: 26, + NumMessages: 27, NumExtensions: 0, NumServices: 1, }, diff --git a/vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/ticket.pb.validate.go b/vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/ticket.pb.validate.go index 4aeef013..cd16ad94 100644 --- a/vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/ticket.pb.validate.go +++ b/vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/ticket.pb.validate.go @@ -175,6 +175,40 @@ func (m *TicketSchema) validate(all bool) error { } } + for idx, item := range m.GetAnnotations() { + _, _ = idx, item + + if all { + switch v := interface{}(item).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, TicketSchemaValidationError{ + field: fmt.Sprintf("Annotations[%v]", idx), + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, TicketSchemaValidationError{ + field: fmt.Sprintf("Annotations[%v]", idx), + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return TicketSchemaValidationError{ + field: fmt.Sprintf("Annotations[%v]", idx), + reason: "embedded message failed validation", + cause: err, + } + } + } + + } + if len(errors) > 0 { return TicketSchemaMultiError(errors) } @@ -280,6 +314,40 @@ func (m *TicketCustomField) validate(all bool) error { // no validation rules for Required + for idx, item := range m.GetAnnotations() { + _, _ = idx, item + + if all { + switch v := interface{}(item).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, TicketCustomFieldValidationError{ + field: fmt.Sprintf("Annotations[%v]", idx), + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, TicketCustomFieldValidationError{ + field: fmt.Sprintf("Annotations[%v]", idx), + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return TicketCustomFieldValidationError{ + field: fmt.Sprintf("Annotations[%v]", idx), + reason: "embedded message failed validation", + cause: err, + } + } + } + + } + switch v := m.Value.(type) { case *TicketCustomField_StringValue: if v == nil { @@ -609,6 +677,47 @@ func (m *TicketCustomField) validate(all bool) error { } } + case *TicketCustomField_NumberValue: + if v == nil { + err := TicketCustomFieldValidationError{ + field: "Value", + reason: "oneof value cannot be a typed-nil", + } + if !all { + return err + } + errors = append(errors, err) + } + + if all { + switch v := interface{}(m.GetNumberValue()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, TicketCustomFieldValidationError{ + field: "NumberValue", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, TicketCustomFieldValidationError{ + field: "NumberValue", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetNumberValue()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return TicketCustomFieldValidationError{ + field: "NumberValue", + reason: "embedded message failed validation", + cause: err, + } + } + } + default: _ = v // ensures v is used } @@ -717,6 +826,8 @@ func (m *TicketCustomFieldStringValue) validate(all bool) error { // no validation rules for Value + // no validation rules for DefaultValue + if len(errors) > 0 { return TicketCustomFieldStringValueMultiError(errors) } @@ -1005,6 +1116,167 @@ var _ interface { ErrorName() string } = TicketCustomFieldBoolValueValidationError{} +// Validate checks the field values on TicketCustomFieldNumberValue with the +// rules defined in the proto definition for this message. If any rules are +// violated, the first error encountered is returned, or nil if there are no violations. +func (m *TicketCustomFieldNumberValue) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on TicketCustomFieldNumberValue with the +// rules defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// TicketCustomFieldNumberValueMultiError, or nil if none found. +func (m *TicketCustomFieldNumberValue) ValidateAll() error { + return m.validate(true) +} + +func (m *TicketCustomFieldNumberValue) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if all { + switch v := interface{}(m.GetValue()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, TicketCustomFieldNumberValueValidationError{ + field: "Value", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, TicketCustomFieldNumberValueValidationError{ + field: "Value", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetValue()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return TicketCustomFieldNumberValueValidationError{ + field: "Value", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if all { + switch v := interface{}(m.GetDefaultValue()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, TicketCustomFieldNumberValueValidationError{ + field: "DefaultValue", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, TicketCustomFieldNumberValueValidationError{ + field: "DefaultValue", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetDefaultValue()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return TicketCustomFieldNumberValueValidationError{ + field: "DefaultValue", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if len(errors) > 0 { + return TicketCustomFieldNumberValueMultiError(errors) + } + + return nil +} + +// TicketCustomFieldNumberValueMultiError is an error wrapping multiple +// validation errors returned by TicketCustomFieldNumberValue.ValidateAll() if +// the designated constraints aren't met. +type TicketCustomFieldNumberValueMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m TicketCustomFieldNumberValueMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m TicketCustomFieldNumberValueMultiError) AllErrors() []error { return m } + +// TicketCustomFieldNumberValueValidationError is the validation error returned +// by TicketCustomFieldNumberValue.Validate if the designated constraints +// aren't met. +type TicketCustomFieldNumberValueValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e TicketCustomFieldNumberValueValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e TicketCustomFieldNumberValueValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e TicketCustomFieldNumberValueValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e TicketCustomFieldNumberValueValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e TicketCustomFieldNumberValueValidationError) ErrorName() string { + return "TicketCustomFieldNumberValueValidationError" +} + +// Error satisfies the builtin error interface +func (e TicketCustomFieldNumberValueValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sTicketCustomFieldNumberValue.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = TicketCustomFieldNumberValueValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = TicketCustomFieldNumberValueValidationError{} + // Validate checks the field values on TicketCustomFieldTimestampValue with the // rules defined in the proto definition for this message. If any rules are // violated, the first error encountered is returned, or nil if there are no violations. @@ -1056,6 +1328,35 @@ func (m *TicketCustomFieldTimestampValue) validate(all bool) error { } } + if all { + switch v := interface{}(m.GetDefaultValue()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, TicketCustomFieldTimestampValueValidationError{ + field: "DefaultValue", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, TicketCustomFieldTimestampValueValidationError{ + field: "DefaultValue", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetDefaultValue()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return TicketCustomFieldTimestampValueValidationError{ + field: "DefaultValue", + reason: "embedded message failed validation", + cause: err, + } + } + } + if len(errors) > 0 { return TicketCustomFieldTimestampValueMultiError(errors) } @@ -1162,6 +1463,8 @@ func (m *TicketCustomFieldPickStringValue) validate(all bool) error { // no validation rules for Value + // no validation rules for DefaultValue + if len(errors) > 0 { return TicketCustomFieldPickStringValueMultiError(errors) } @@ -1436,6 +1739,35 @@ func (m *TicketCustomFieldPickObjectValue) validate(all bool) error { } + if all { + switch v := interface{}(m.GetDefaultValue()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, TicketCustomFieldPickObjectValueValidationError{ + field: "DefaultValue", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, TicketCustomFieldPickObjectValueValidationError{ + field: "DefaultValue", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetDefaultValue()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return TicketCustomFieldPickObjectValueValidationError{ + field: "DefaultValue", + reason: "embedded message failed validation", + cause: err, + } + } + } + if len(errors) > 0 { return TicketCustomFieldPickObjectValueMultiError(errors) } @@ -1610,6 +1942,40 @@ func (m *TicketCustomFieldPickMultipleObjectValues) validate(all bool) error { } + for idx, item := range m.GetDefaultValues() { + _, _ = idx, item + + if all { + switch v := interface{}(item).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, TicketCustomFieldPickMultipleObjectValuesValidationError{ + field: fmt.Sprintf("DefaultValues[%v]", idx), + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, TicketCustomFieldPickMultipleObjectValuesValidationError{ + field: fmt.Sprintf("DefaultValues[%v]", idx), + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return TicketCustomFieldPickMultipleObjectValuesValidationError{ + field: fmt.Sprintf("DefaultValues[%v]", idx), + reason: "embedded message failed validation", + cause: err, + } + } + } + + } + if len(errors) > 0 { return TicketCustomFieldPickMultipleObjectValuesMultiError(errors) } diff --git a/vendor/github.com/conductorone/baton-sdk/pb/c1/connectorapi/baton/v1/baton.pb.go b/vendor/github.com/conductorone/baton-sdk/pb/c1/connectorapi/baton/v1/baton.pb.go index e4a427bb..a783d782 100644 --- a/vendor/github.com/conductorone/baton-sdk/pb/c1/connectorapi/baton/v1/baton.pb.go +++ b/vendor/github.com/conductorone/baton-sdk/pb/c1/connectorapi/baton/v1/baton.pb.go @@ -104,6 +104,7 @@ type Task struct { // *Task_ListTicketSchemas // *Task_GetTicket TaskType isTask_TaskType `protobuf_oneof:"task_type"` + Debug bool `protobuf:"varint,3,opt,name=debug,proto3" json:"debug,omitempty"` } func (x *Task) Reset() { @@ -250,6 +251,13 @@ func (x *Task) GetGetTicket() *Task_GetTicketTask { return nil } +func (x *Task) GetDebug() bool { + if x != nil { + return x.Debug + } + return false +} + type isTask_TaskType interface { isTask_TaskType() } @@ -1005,6 +1013,91 @@ func (x *BatonServiceFinishTaskResponse) GetAnnotations() []*anypb.Any { return nil } +type StartDebuggingRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *StartDebuggingRequest) Reset() { + *x = StartDebuggingRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StartDebuggingRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StartDebuggingRequest) ProtoMessage() {} + +func (x *StartDebuggingRequest) ProtoReflect() protoreflect.Message { + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[11] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use StartDebuggingRequest.ProtoReflect.Descriptor instead. +func (*StartDebuggingRequest) Descriptor() ([]byte, []int) { + return file_c1_connectorapi_baton_v1_baton_proto_rawDescGZIP(), []int{11} +} + +type StartDebuggingResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Status bool `protobuf:"varint,1,opt,name=status,proto3" json:"status,omitempty"` +} + +func (x *StartDebuggingResponse) Reset() { + *x = StartDebuggingResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StartDebuggingResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StartDebuggingResponse) ProtoMessage() {} + +func (x *StartDebuggingResponse) ProtoReflect() protoreflect.Message { + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[12] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use StartDebuggingResponse.ProtoReflect.Descriptor instead. +func (*StartDebuggingResponse) Descriptor() ([]byte, []int) { + return file_c1_connectorapi_baton_v1_baton_proto_rawDescGZIP(), []int{12} +} + +func (x *StartDebuggingResponse) GetStatus() bool { + if x != nil { + return x.Status + } + return false +} + type Task_NoneTask struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -1016,7 +1109,7 @@ type Task_NoneTask struct { func (x *Task_NoneTask) Reset() { *x = Task_NoneTask{} if protoimpl.UnsafeEnabled { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[11] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[13] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1029,7 +1122,7 @@ func (x *Task_NoneTask) String() string { func (*Task_NoneTask) ProtoMessage() {} func (x *Task_NoneTask) ProtoReflect() protoreflect.Message { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[11] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[13] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1063,7 +1156,7 @@ type Task_HelloTask struct { func (x *Task_HelloTask) Reset() { *x = Task_HelloTask{} if protoimpl.UnsafeEnabled { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[12] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[14] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1076,7 +1169,7 @@ func (x *Task_HelloTask) String() string { func (*Task_HelloTask) ProtoMessage() {} func (x *Task_HelloTask) ProtoReflect() protoreflect.Message { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[12] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[14] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1110,7 +1203,7 @@ type Task_SyncFullTask struct { func (x *Task_SyncFullTask) Reset() { *x = Task_SyncFullTask{} if protoimpl.UnsafeEnabled { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[13] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[15] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1123,7 +1216,7 @@ func (x *Task_SyncFullTask) String() string { func (*Task_SyncFullTask) ProtoMessage() {} func (x *Task_SyncFullTask) ProtoReflect() protoreflect.Message { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[13] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[15] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1158,7 +1251,7 @@ type Task_EventFeedTask struct { func (x *Task_EventFeedTask) Reset() { *x = Task_EventFeedTask{} if protoimpl.UnsafeEnabled { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[14] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[16] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1171,7 +1264,7 @@ func (x *Task_EventFeedTask) String() string { func (*Task_EventFeedTask) ProtoMessage() {} func (x *Task_EventFeedTask) ProtoReflect() protoreflect.Message { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[14] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[16] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1215,7 +1308,7 @@ type Task_GrantTask struct { func (x *Task_GrantTask) Reset() { *x = Task_GrantTask{} if protoimpl.UnsafeEnabled { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[15] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[17] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1228,7 +1321,7 @@ func (x *Task_GrantTask) String() string { func (*Task_GrantTask) ProtoMessage() {} func (x *Task_GrantTask) ProtoReflect() protoreflect.Message { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[15] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[17] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1284,7 +1377,7 @@ type Task_RevokeTask struct { func (x *Task_RevokeTask) Reset() { *x = Task_RevokeTask{} if protoimpl.UnsafeEnabled { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[16] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[18] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1297,7 +1390,7 @@ func (x *Task_RevokeTask) String() string { func (*Task_RevokeTask) ProtoMessage() {} func (x *Task_RevokeTask) ProtoReflect() protoreflect.Message { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[16] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[18] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1340,7 +1433,7 @@ type Task_CreateAccountTask struct { func (x *Task_CreateAccountTask) Reset() { *x = Task_CreateAccountTask{} if protoimpl.UnsafeEnabled { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[17] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[19] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1353,7 +1446,7 @@ func (x *Task_CreateAccountTask) String() string { func (*Task_CreateAccountTask) ProtoMessage() {} func (x *Task_CreateAccountTask) ProtoReflect() protoreflect.Message { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[17] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[19] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1401,7 +1494,7 @@ type Task_CreateResourceTask struct { func (x *Task_CreateResourceTask) Reset() { *x = Task_CreateResourceTask{} if protoimpl.UnsafeEnabled { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[18] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[20] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1414,7 +1507,7 @@ func (x *Task_CreateResourceTask) String() string { func (*Task_CreateResourceTask) ProtoMessage() {} func (x *Task_CreateResourceTask) ProtoReflect() protoreflect.Message { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[18] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[20] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1448,7 +1541,7 @@ type Task_DeleteResourceTask struct { func (x *Task_DeleteResourceTask) Reset() { *x = Task_DeleteResourceTask{} if protoimpl.UnsafeEnabled { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[19] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[21] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1461,7 +1554,7 @@ func (x *Task_DeleteResourceTask) String() string { func (*Task_DeleteResourceTask) ProtoMessage() {} func (x *Task_DeleteResourceTask) ProtoReflect() protoreflect.Message { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[19] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[21] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1497,7 +1590,7 @@ type Task_RotateCredentialsTask struct { func (x *Task_RotateCredentialsTask) Reset() { *x = Task_RotateCredentialsTask{} if protoimpl.UnsafeEnabled { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[20] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[22] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1510,7 +1603,7 @@ func (x *Task_RotateCredentialsTask) String() string { func (*Task_RotateCredentialsTask) ProtoMessage() {} func (x *Task_RotateCredentialsTask) ProtoReflect() protoreflect.Message { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[20] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[22] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1560,7 +1653,7 @@ type Task_CreateTicketTask struct { func (x *Task_CreateTicketTask) Reset() { *x = Task_CreateTicketTask{} if protoimpl.UnsafeEnabled { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[21] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[23] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1573,7 +1666,7 @@ func (x *Task_CreateTicketTask) String() string { func (*Task_CreateTicketTask) ProtoMessage() {} func (x *Task_CreateTicketTask) ProtoReflect() protoreflect.Message { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[21] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[23] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1621,7 +1714,7 @@ type Task_ListTicketSchemasTask struct { func (x *Task_ListTicketSchemasTask) Reset() { *x = Task_ListTicketSchemasTask{} if protoimpl.UnsafeEnabled { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[22] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[24] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1634,7 +1727,7 @@ func (x *Task_ListTicketSchemasTask) String() string { func (*Task_ListTicketSchemasTask) ProtoMessage() {} func (x *Task_ListTicketSchemasTask) ProtoReflect() protoreflect.Message { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[22] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[24] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1669,7 +1762,7 @@ type Task_GetTicketTask struct { func (x *Task_GetTicketTask) Reset() { *x = Task_GetTicketTask{} if protoimpl.UnsafeEnabled { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[23] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[25] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1682,7 +1775,7 @@ func (x *Task_GetTicketTask) String() string { func (*Task_GetTicketTask) ProtoMessage() {} func (x *Task_GetTicketTask) ProtoReflect() protoreflect.Message { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[23] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[25] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1725,7 +1818,7 @@ type BatonServiceHelloRequest_BuildInfo struct { func (x *BatonServiceHelloRequest_BuildInfo) Reset() { *x = BatonServiceHelloRequest_BuildInfo{} if protoimpl.UnsafeEnabled { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[24] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[26] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1738,7 +1831,7 @@ func (x *BatonServiceHelloRequest_BuildInfo) String() string { func (*BatonServiceHelloRequest_BuildInfo) ProtoMessage() {} func (x *BatonServiceHelloRequest_BuildInfo) ProtoReflect() protoreflect.Message { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[24] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[26] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1793,7 +1886,7 @@ type BatonServiceHelloRequest_OSInfo struct { func (x *BatonServiceHelloRequest_OSInfo) Reset() { *x = BatonServiceHelloRequest_OSInfo{} if protoimpl.UnsafeEnabled { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[25] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[27] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1806,7 +1899,7 @@ func (x *BatonServiceHelloRequest_OSInfo) String() string { func (*BatonServiceHelloRequest_OSInfo) ProtoMessage() {} func (x *BatonServiceHelloRequest_OSInfo) ProtoReflect() protoreflect.Message { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[25] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[27] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1891,7 +1984,7 @@ type BatonServiceUploadAssetRequest_UploadMetadata struct { func (x *BatonServiceUploadAssetRequest_UploadMetadata) Reset() { *x = BatonServiceUploadAssetRequest_UploadMetadata{} if protoimpl.UnsafeEnabled { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[26] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[28] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1904,7 +1997,7 @@ func (x *BatonServiceUploadAssetRequest_UploadMetadata) String() string { func (*BatonServiceUploadAssetRequest_UploadMetadata) ProtoMessage() {} func (x *BatonServiceUploadAssetRequest_UploadMetadata) ProtoReflect() protoreflect.Message { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[26] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[28] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1953,7 +2046,7 @@ type BatonServiceUploadAssetRequest_UploadData struct { func (x *BatonServiceUploadAssetRequest_UploadData) Reset() { *x = BatonServiceUploadAssetRequest_UploadData{} if protoimpl.UnsafeEnabled { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[27] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[29] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1966,7 +2059,7 @@ func (x *BatonServiceUploadAssetRequest_UploadData) String() string { func (*BatonServiceUploadAssetRequest_UploadData) ProtoMessage() {} func (x *BatonServiceUploadAssetRequest_UploadData) ProtoReflect() protoreflect.Message { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[27] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[29] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2001,7 +2094,7 @@ type BatonServiceUploadAssetRequest_UploadEOF struct { func (x *BatonServiceUploadAssetRequest_UploadEOF) Reset() { *x = BatonServiceUploadAssetRequest_UploadEOF{} if protoimpl.UnsafeEnabled { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[28] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[30] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2014,7 +2107,7 @@ func (x *BatonServiceUploadAssetRequest_UploadEOF) String() string { func (*BatonServiceUploadAssetRequest_UploadEOF) ProtoMessage() {} func (x *BatonServiceUploadAssetRequest_UploadEOF) ProtoReflect() protoreflect.Message { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[28] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[30] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2058,7 +2151,7 @@ type BatonServiceFinishTaskRequest_Error struct { func (x *BatonServiceFinishTaskRequest_Error) Reset() { *x = BatonServiceFinishTaskRequest_Error{} if protoimpl.UnsafeEnabled { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[29] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[31] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2071,7 +2164,7 @@ func (x *BatonServiceFinishTaskRequest_Error) String() string { func (*BatonServiceFinishTaskRequest_Error) ProtoMessage() {} func (x *BatonServiceFinishTaskRequest_Error) ProtoReflect() protoreflect.Message { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[29] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[31] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2121,7 +2214,7 @@ type BatonServiceFinishTaskRequest_Success struct { func (x *BatonServiceFinishTaskRequest_Success) Reset() { *x = BatonServiceFinishTaskRequest_Success{} if protoimpl.UnsafeEnabled { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[30] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[32] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2134,7 +2227,7 @@ func (x *BatonServiceFinishTaskRequest_Success) String() string { func (*BatonServiceFinishTaskRequest_Success) ProtoMessage() {} func (x *BatonServiceFinishTaskRequest_Success) ProtoReflect() protoreflect.Message { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[30] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[32] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2189,7 +2282,7 @@ var file_c1_connectorapi_baton_v1_baton_proto_rawDesc = []byte{ 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x72, 0x70, 0x63, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2f, 0x76, - 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xf4, 0x17, + 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x8a, 0x18, 0x0a, 0x04, 0x54, 0x61, 0x73, 0x6b, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x3d, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x25, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, @@ -2262,378 +2355,391 @@ var file_c1_connectorapi_baton_v1_baton_proto_rawDesc = []byte{ 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x61, 0x70, 0x69, 0x2e, 0x62, 0x61, 0x74, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x61, 0x73, 0x6b, 0x2e, 0x47, 0x65, 0x74, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x54, 0x61, 0x73, - 0x6b, 0x48, 0x00, 0x52, 0x09, 0x67, 0x65, 0x74, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x1a, 0x42, - 0x0a, 0x08, 0x4e, 0x6f, 0x6e, 0x65, 0x54, 0x61, 0x73, 0x6b, 0x12, 0x36, 0x0a, 0x0b, 0x61, 0x6e, - 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, - 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x0b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x73, 0x1a, 0x43, 0x0a, 0x09, 0x48, 0x65, 0x6c, 0x6c, 0x6f, 0x54, 0x61, 0x73, 0x6b, 0x12, - 0x36, 0x0a, 0x0b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x0b, 0x61, 0x6e, 0x6e, 0x6f, - 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x1a, 0x46, 0x0a, 0x0c, 0x53, 0x79, 0x6e, 0x63, 0x46, - 0x75, 0x6c, 0x6c, 0x54, 0x61, 0x73, 0x6b, 0x12, 0x36, 0x0a, 0x0b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, - 0x6e, 0x79, 0x52, 0x0b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x1a, - 0x7e, 0x0a, 0x0d, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x46, 0x65, 0x65, 0x64, 0x54, 0x61, 0x73, 0x6b, + 0x6b, 0x48, 0x00, 0x52, 0x09, 0x67, 0x65, 0x74, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x12, 0x14, + 0x0a, 0x05, 0x64, 0x65, 0x62, 0x75, 0x67, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x64, + 0x65, 0x62, 0x75, 0x67, 0x1a, 0x42, 0x0a, 0x08, 0x4e, 0x6f, 0x6e, 0x65, 0x54, 0x61, 0x73, 0x6b, 0x12, 0x36, 0x0a, 0x0b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x0b, 0x61, 0x6e, 0x6e, - 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x35, 0x0a, 0x08, 0x73, 0x74, 0x61, 0x72, - 0x74, 0x5f, 0x61, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, - 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x07, 0x73, 0x74, 0x61, 0x72, 0x74, 0x41, 0x74, 0x1a, - 0xf3, 0x01, 0x0a, 0x09, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x54, 0x61, 0x73, 0x6b, 0x12, 0x3e, 0x0a, - 0x0b, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, - 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, - 0x52, 0x0b, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x37, 0x0a, - 0x09, 0x70, 0x72, 0x69, 0x6e, 0x63, 0x69, 0x70, 0x61, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x19, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, - 0x76, 0x32, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x09, 0x70, 0x72, 0x69, - 0x6e, 0x63, 0x69, 0x70, 0x61, 0x6c, 0x12, 0x36, 0x0a, 0x0b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, + 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x1a, 0x43, 0x0a, 0x09, 0x48, 0x65, 0x6c, 0x6c, + 0x6f, 0x54, 0x61, 0x73, 0x6b, 0x12, 0x36, 0x0a, 0x0b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, + 0x52, 0x0b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x1a, 0x46, 0x0a, + 0x0c, 0x53, 0x79, 0x6e, 0x63, 0x46, 0x75, 0x6c, 0x6c, 0x54, 0x61, 0x73, 0x6b, 0x12, 0x36, 0x0a, + 0x0b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x0b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x1a, 0x7e, 0x0a, 0x0d, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x46, 0x65, + 0x65, 0x64, 0x54, 0x61, 0x73, 0x6b, 0x12, 0x36, 0x0a, 0x0b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x0b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x35, - 0x0a, 0x08, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, - 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x08, 0x64, 0x75, 0x72, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0x72, 0x0a, 0x0a, 0x52, 0x65, 0x76, 0x6f, 0x6b, 0x65, 0x54, - 0x61, 0x73, 0x6b, 0x12, 0x2c, 0x0a, 0x05, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, - 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x52, 0x05, 0x67, 0x72, 0x61, 0x6e, - 0x74, 0x12, 0x36, 0x0a, 0x0b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, - 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x0b, 0x61, 0x6e, - 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x1a, 0xf9, 0x01, 0x0a, 0x11, 0x43, 0x72, - 0x65, 0x61, 0x74, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x54, 0x61, 0x73, 0x6b, 0x12, - 0x3f, 0x0a, 0x0c, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, - 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, - 0x6e, 0x66, 0x6f, 0x52, 0x0b, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x6e, 0x66, 0x6f, - 0x12, 0x51, 0x0a, 0x12, 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x5f, 0x6f, - 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x63, - 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x43, - 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, - 0x52, 0x11, 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x4f, 0x70, 0x74, 0x69, - 0x6f, 0x6e, 0x73, 0x12, 0x50, 0x0a, 0x12, 0x65, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, - 0x6e, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x21, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x76, - 0x32, 0x2e, 0x45, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x66, - 0x69, 0x67, 0x52, 0x11, 0x65, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, - 0x6e, 0x66, 0x69, 0x67, 0x73, 0x1a, 0x4b, 0x0a, 0x12, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, - 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x54, 0x61, 0x73, 0x6b, 0x12, 0x35, 0x0a, 0x08, 0x72, - 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, - 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x32, 0x2e, - 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, - 0x63, 0x65, 0x1a, 0x52, 0x0a, 0x12, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x73, 0x6f, - 0x75, 0x72, 0x63, 0x65, 0x54, 0x61, 0x73, 0x6b, 0x12, 0x3c, 0x0a, 0x0b, 0x72, 0x65, 0x73, 0x6f, - 0x75, 0x72, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, - 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x32, 0x2e, - 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x64, 0x52, 0x0a, 0x72, 0x65, 0x73, 0x6f, - 0x75, 0x72, 0x63, 0x65, 0x49, 0x64, 0x1a, 0xfa, 0x01, 0x0a, 0x15, 0x52, 0x6f, 0x74, 0x61, 0x74, - 0x65, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x73, 0x54, 0x61, 0x73, 0x6b, - 0x12, 0x3c, 0x0a, 0x0b, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, - 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, - 0x49, 0x64, 0x52, 0x0a, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x64, 0x12, 0x51, - 0x0a, 0x12, 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x5f, 0x6f, 0x70, 0x74, - 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x63, 0x31, 0x2e, - 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x72, 0x65, - 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x11, - 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, - 0x73, 0x12, 0x50, 0x0a, 0x12, 0x65, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x5f, - 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x21, 0x2e, - 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x32, 0x2e, - 0x45, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, - 0x52, 0x11, 0x65, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x66, - 0x69, 0x67, 0x73, 0x1a, 0xd5, 0x01, 0x0a, 0x10, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, - 0x63, 0x6b, 0x65, 0x74, 0x54, 0x61, 0x73, 0x6b, 0x12, 0x45, 0x0a, 0x0e, 0x74, 0x69, 0x63, 0x6b, - 0x65, 0x74, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x1e, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, - 0x76, 0x32, 0x2e, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x52, 0x0d, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, - 0x42, 0x0a, 0x0d, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x5f, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, - 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x53, - 0x63, 0x68, 0x65, 0x6d, 0x61, 0x52, 0x0c, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x53, 0x63, 0x68, - 0x65, 0x6d, 0x61, 0x12, 0x36, 0x0a, 0x0b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x0b, - 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x1a, 0x4f, 0x0a, 0x15, 0x4c, - 0x69, 0x73, 0x74, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x73, - 0x54, 0x61, 0x73, 0x6b, 0x12, 0x36, 0x0a, 0x0b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, - 0x0b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x1a, 0x64, 0x0a, 0x0d, - 0x47, 0x65, 0x74, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x54, 0x61, 0x73, 0x6b, 0x12, 0x1b, 0x0a, - 0x09, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x08, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x49, 0x64, 0x12, 0x36, 0x0a, 0x0b, 0x61, 0x6e, - 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, - 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x0b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x73, 0x22, 0x73, 0x0a, 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x16, 0x0a, 0x12, - 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, - 0x45, 0x44, 0x10, 0x00, 0x12, 0x12, 0x0a, 0x0e, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x50, - 0x45, 0x4e, 0x44, 0x49, 0x4e, 0x47, 0x10, 0x01, 0x12, 0x14, 0x0a, 0x10, 0x53, 0x54, 0x41, 0x54, - 0x55, 0x53, 0x5f, 0x53, 0x43, 0x48, 0x45, 0x44, 0x55, 0x4c, 0x45, 0x44, 0x10, 0x02, 0x12, 0x12, - 0x0a, 0x0e, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x52, 0x55, 0x4e, 0x4e, 0x49, 0x4e, 0x47, - 0x10, 0x03, 0x12, 0x13, 0x0a, 0x0f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x46, 0x49, 0x4e, - 0x49, 0x53, 0x48, 0x45, 0x44, 0x10, 0x04, 0x42, 0x0b, 0x0a, 0x09, 0x74, 0x61, 0x73, 0x6b, 0x5f, - 0x74, 0x79, 0x70, 0x65, 0x22, 0xf3, 0x07, 0x0a, 0x18, 0x42, 0x61, 0x74, 0x6f, 0x6e, 0x53, 0x65, - 0x72, 0x76, 0x69, 0x63, 0x65, 0x48, 0x65, 0x6c, 0x6c, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x12, 0x23, 0x0a, 0x07, 0x68, 0x6f, 0x73, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x42, 0x0a, 0xfa, 0x42, 0x07, 0x72, 0x05, 0x10, 0x01, 0x18, 0x80, 0x02, 0x52, 0x06, - 0x68, 0x6f, 0x73, 0x74, 0x49, 0x64, 0x12, 0x32, 0x0a, 0x07, 0x74, 0x61, 0x73, 0x6b, 0x5f, 0x69, - 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x19, 0xfa, 0x42, 0x16, 0x72, 0x14, 0x32, 0x12, - 0x5e, 0x5b, 0x61, 0x2d, 0x7a, 0x41, 0x2d, 0x5a, 0x30, 0x2d, 0x39, 0x5d, 0x7b, 0x32, 0x37, 0x7d, - 0x7c, 0x24, 0x52, 0x06, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x12, 0x65, 0x0a, 0x0a, 0x62, 0x75, - 0x69, 0x6c, 0x64, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x3c, - 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x61, 0x70, 0x69, - 0x2e, 0x62, 0x61, 0x74, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x61, 0x74, 0x6f, 0x6e, 0x53, - 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x48, 0x65, 0x6c, 0x6c, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x2e, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x49, 0x6e, 0x66, 0x6f, 0x42, 0x08, 0xfa, 0x42, - 0x05, 0x8a, 0x01, 0x02, 0x10, 0x01, 0x52, 0x09, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x49, 0x6e, 0x66, - 0x6f, 0x12, 0x5c, 0x0a, 0x07, 0x6f, 0x73, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x39, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, - 0x72, 0x61, 0x70, 0x69, 0x2e, 0x62, 0x61, 0x74, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x61, - 0x74, 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x48, 0x65, 0x6c, 0x6c, 0x6f, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x4f, 0x53, 0x49, 0x6e, 0x66, 0x6f, 0x42, 0x08, 0xfa, - 0x42, 0x05, 0x8a, 0x01, 0x02, 0x10, 0x01, 0x52, 0x06, 0x6f, 0x73, 0x49, 0x6e, 0x66, 0x6f, 0x12, - 0x5b, 0x0a, 0x12, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x5f, 0x6d, 0x65, 0x74, - 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x63, 0x31, - 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x6f, - 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x42, - 0x08, 0xfa, 0x42, 0x05, 0x8a, 0x01, 0x02, 0x10, 0x01, 0x52, 0x11, 0x63, 0x6f, 0x6e, 0x6e, 0x65, - 0x63, 0x74, 0x6f, 0x72, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x40, 0x0a, 0x0b, - 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, + 0x0a, 0x08, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x61, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x07, 0x73, 0x74, + 0x61, 0x72, 0x74, 0x41, 0x74, 0x1a, 0xf3, 0x01, 0x0a, 0x09, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x54, + 0x61, 0x73, 0x6b, 0x12, 0x3e, 0x0a, 0x0b, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x6d, 0x65, + 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, + 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x45, 0x6e, 0x74, 0x69, 0x74, + 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x0b, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x6d, + 0x65, 0x6e, 0x74, 0x12, 0x37, 0x0a, 0x09, 0x70, 0x72, 0x69, 0x6e, 0x63, 0x69, 0x70, 0x61, 0x6c, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, + 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, + 0x65, 0x52, 0x09, 0x70, 0x72, 0x69, 0x6e, 0x63, 0x69, 0x70, 0x61, 0x6c, 0x12, 0x36, 0x0a, 0x0b, + 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x92, 0x01, 0x02, 0x10, - 0x10, 0x52, 0x0b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x1a, 0x95, - 0x01, 0x0a, 0x09, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x2d, 0x0a, 0x0c, - 0x6c, 0x61, 0x6e, 0x67, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x42, 0x0a, 0xfa, 0x42, 0x07, 0x72, 0x05, 0x10, 0x01, 0x18, 0x80, 0x02, 0x52, 0x0b, - 0x6c, 0x61, 0x6e, 0x67, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x24, 0x0a, 0x07, 0x70, - 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0a, 0xfa, 0x42, - 0x07, 0x72, 0x05, 0x10, 0x01, 0x18, 0x80, 0x02, 0x52, 0x07, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, - 0x65, 0x12, 0x33, 0x0a, 0x0f, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x5f, 0x76, 0x65, 0x72, - 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0a, 0xfa, 0x42, 0x07, 0x72, - 0x05, 0x10, 0x01, 0x18, 0x80, 0x02, 0x52, 0x0e, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x56, - 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x1a, 0x81, 0x03, 0x0a, 0x06, 0x4f, 0x53, 0x49, 0x6e, 0x66, - 0x6f, 0x12, 0x26, 0x0a, 0x08, 0x68, 0x6f, 0x73, 0x74, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x42, 0x0a, 0xfa, 0x42, 0x07, 0x72, 0x05, 0x10, 0x01, 0x18, 0x80, 0x02, 0x52, - 0x08, 0x68, 0x6f, 0x73, 0x74, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x02, 0x6f, 0x73, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0a, 0xfa, 0x42, 0x07, 0x72, 0x05, 0x10, 0x01, 0x18, 0x80, - 0x02, 0x52, 0x02, 0x6f, 0x73, 0x12, 0x26, 0x0a, 0x08, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, - 0x6d, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0a, 0xfa, 0x42, 0x07, 0x72, 0x05, 0x10, 0x01, - 0x18, 0x80, 0x02, 0x52, 0x08, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x12, 0x35, 0x0a, - 0x10, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, - 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0a, 0xfa, 0x42, 0x07, 0x72, 0x05, 0x10, 0x01, - 0x18, 0x80, 0x02, 0x52, 0x0f, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x56, 0x65, 0x72, - 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x33, 0x0a, 0x0f, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, - 0x5f, 0x66, 0x61, 0x6d, 0x69, 0x6c, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0a, 0xfa, - 0x42, 0x07, 0x72, 0x05, 0x10, 0x01, 0x18, 0x80, 0x02, 0x52, 0x0e, 0x70, 0x6c, 0x61, 0x74, 0x66, - 0x6f, 0x72, 0x6d, 0x46, 0x61, 0x6d, 0x69, 0x6c, 0x79, 0x12, 0x31, 0x0a, 0x0e, 0x6b, 0x65, 0x72, - 0x6e, 0x65, 0x6c, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, - 0x09, 0x42, 0x0a, 0xfa, 0x42, 0x07, 0x72, 0x05, 0x10, 0x01, 0x18, 0x80, 0x02, 0x52, 0x0d, 0x6b, - 0x65, 0x72, 0x6e, 0x65, 0x6c, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x2b, 0x0a, 0x0b, - 0x6b, 0x65, 0x72, 0x6e, 0x65, 0x6c, 0x5f, 0x61, 0x72, 0x63, 0x68, 0x18, 0x07, 0x20, 0x01, 0x28, - 0x09, 0x42, 0x0a, 0xfa, 0x42, 0x07, 0x72, 0x05, 0x10, 0x01, 0x18, 0x80, 0x02, 0x52, 0x0a, 0x6b, - 0x65, 0x72, 0x6e, 0x65, 0x6c, 0x41, 0x72, 0x63, 0x68, 0x12, 0x3f, 0x0a, 0x15, 0x76, 0x69, 0x72, - 0x74, 0x75, 0x61, 0x6c, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x73, 0x79, 0x73, 0x74, - 0x65, 0x6d, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0a, 0xfa, 0x42, 0x07, 0x72, 0x05, 0x10, - 0x01, 0x18, 0x80, 0x02, 0x52, 0x14, 0x76, 0x69, 0x72, 0x74, 0x75, 0x61, 0x6c, 0x69, 0x7a, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x22, 0x53, 0x0a, 0x19, 0x42, 0x61, - 0x74, 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x48, 0x65, 0x6c, 0x6c, 0x6f, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x36, 0x0a, 0x0b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, - 0x6e, 0x79, 0x52, 0x0b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, - 0x41, 0x0a, 0x1a, 0x42, 0x61, 0x74, 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x47, - 0x65, 0x74, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x23, 0x0a, - 0x07, 0x68, 0x6f, 0x73, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0a, - 0xfa, 0x42, 0x07, 0x72, 0x05, 0x10, 0x01, 0x18, 0x80, 0x02, 0x52, 0x06, 0x68, 0x6f, 0x73, 0x74, - 0x49, 0x64, 0x22, 0x83, 0x02, 0x0a, 0x1b, 0x42, 0x61, 0x74, 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76, - 0x69, 0x63, 0x65, 0x47, 0x65, 0x74, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x12, 0x32, 0x0a, 0x04, 0x74, 0x61, 0x73, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x1e, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x61, - 0x70, 0x69, 0x2e, 0x62, 0x61, 0x74, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x61, 0x73, 0x6b, - 0x52, 0x04, 0x74, 0x61, 0x73, 0x6b, 0x12, 0x36, 0x0a, 0x09, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x70, - 0x6f, 0x6c, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x08, 0x6e, 0x65, 0x78, 0x74, 0x50, 0x6f, 0x6c, 0x6c, 0x12, 0x40, - 0x0a, 0x0e, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x68, 0x65, 0x61, 0x72, 0x74, 0x62, 0x65, 0x61, 0x74, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x0b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x35, 0x0a, 0x08, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x52, 0x0d, 0x6e, 0x65, 0x78, 0x74, 0x48, 0x65, 0x61, 0x72, 0x74, 0x62, 0x65, 0x61, 0x74, + 0x6e, 0x52, 0x08, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0x72, 0x0a, 0x0a, 0x52, + 0x65, 0x76, 0x6f, 0x6b, 0x65, 0x54, 0x61, 0x73, 0x6b, 0x12, 0x2c, 0x0a, 0x05, 0x67, 0x72, 0x61, + 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, + 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x47, 0x72, 0x61, 0x6e, 0x74, + 0x52, 0x05, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x12, 0x36, 0x0a, 0x0b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, + 0x6e, 0x79, 0x52, 0x0b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x1a, + 0xf9, 0x01, 0x0a, 0x11, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, + 0x74, 0x54, 0x61, 0x73, 0x6b, 0x12, 0x3f, 0x0a, 0x0c, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, + 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x63, 0x31, + 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x41, 0x63, + 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x0b, 0x61, 0x63, 0x63, 0x6f, 0x75, + 0x6e, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x51, 0x0a, 0x12, 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, + 0x74, 0x69, 0x61, 0x6c, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, + 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x4f, + 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x11, 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, + 0x61, 0x6c, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x50, 0x0a, 0x12, 0x65, 0x6e, 0x63, + 0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x73, 0x18, + 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, + 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x45, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x11, 0x65, 0x6e, 0x63, 0x72, 0x79, 0x70, + 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x73, 0x1a, 0x4b, 0x0a, 0x12, 0x43, + 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x54, 0x61, 0x73, + 0x6b, 0x12, 0x35, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, + 0x6f, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x08, + 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x1a, 0x52, 0x0a, 0x12, 0x44, 0x65, 0x6c, 0x65, + 0x74, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x54, 0x61, 0x73, 0x6b, 0x12, 0x3c, + 0x0a, 0x0b, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, + 0x6f, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x64, + 0x52, 0x0a, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x64, 0x1a, 0xfa, 0x01, 0x0a, + 0x15, 0x52, 0x6f, 0x74, 0x61, 0x74, 0x65, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, + 0x6c, 0x73, 0x54, 0x61, 0x73, 0x6b, 0x12, 0x3c, 0x0a, 0x0b, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x63, 0x31, + 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x65, + 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x64, 0x52, 0x0a, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x49, 0x64, 0x12, 0x51, 0x0a, 0x12, 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, + 0x61, 0x6c, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x22, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, + 0x76, 0x32, 0x2e, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x4f, 0x70, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x11, 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, + 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x50, 0x0a, 0x12, 0x65, 0x6e, 0x63, 0x72, 0x79, + 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x73, 0x18, 0x03, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, + 0x6f, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x45, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, + 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x11, 0x65, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x73, 0x1a, 0xd5, 0x01, 0x0a, 0x10, 0x43, 0x72, + 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x54, 0x61, 0x73, 0x6b, 0x12, 0x45, + 0x0a, 0x0e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, + 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x0d, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x42, 0x0a, 0x0d, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x5f, + 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x63, + 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x54, + 0x69, 0x63, 0x6b, 0x65, 0x74, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x52, 0x0c, 0x74, 0x69, 0x63, + 0x6b, 0x65, 0x74, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x12, 0x36, 0x0a, 0x0b, 0x61, 0x6e, 0x6e, + 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x0b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x1a, 0x4f, 0x0a, 0x15, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x53, + 0x63, 0x68, 0x65, 0x6d, 0x61, 0x73, 0x54, 0x61, 0x73, 0x6b, 0x12, 0x36, 0x0a, 0x0b, 0x61, 0x6e, + 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x0b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x73, 0x1a, 0x64, 0x0a, 0x0d, 0x47, 0x65, 0x74, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x54, + 0x61, 0x73, 0x6b, 0x12, 0x1b, 0x0a, 0x09, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x5f, 0x69, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x49, 0x64, 0x12, 0x36, 0x0a, 0x0b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, - 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, + 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x0b, 0x61, 0x6e, 0x6e, - 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0xb8, 0x01, 0x0a, 0x1c, 0x42, 0x61, 0x74, - 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x48, 0x65, 0x61, 0x72, 0x74, 0x62, 0x65, - 0x61, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x23, 0x0a, 0x07, 0x68, 0x6f, 0x73, - 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0a, 0xfa, 0x42, 0x07, 0x72, - 0x05, 0x10, 0x01, 0x18, 0x80, 0x02, 0x52, 0x06, 0x68, 0x6f, 0x73, 0x74, 0x49, 0x64, 0x12, 0x31, - 0x0a, 0x07, 0x74, 0x61, 0x73, 0x6b, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, - 0x18, 0xfa, 0x42, 0x15, 0x72, 0x13, 0x32, 0x11, 0x5e, 0x5b, 0x61, 0x2d, 0x7a, 0x41, 0x2d, 0x5a, - 0x30, 0x2d, 0x39, 0x5d, 0x7b, 0x32, 0x37, 0x7d, 0x24, 0x52, 0x06, 0x74, 0x61, 0x73, 0x6b, 0x49, - 0x64, 0x12, 0x40, 0x0a, 0x0b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, - 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x42, 0x08, 0xfa, 0x42, - 0x05, 0x92, 0x01, 0x02, 0x10, 0x10, 0x52, 0x0b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x73, 0x22, 0xb7, 0x01, 0x0a, 0x1d, 0x42, 0x61, 0x74, 0x6f, 0x6e, 0x53, 0x65, 0x72, - 0x76, 0x69, 0x63, 0x65, 0x48, 0x65, 0x61, 0x72, 0x74, 0x62, 0x65, 0x61, 0x74, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x40, 0x0a, 0x0e, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x68, 0x65, - 0x61, 0x72, 0x74, 0x62, 0x65, 0x61, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, - 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0d, 0x6e, 0x65, 0x78, 0x74, 0x48, 0x65, - 0x61, 0x72, 0x74, 0x62, 0x65, 0x61, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x61, 0x6e, 0x63, 0x65, - 0x6c, 0x6c, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x63, 0x61, 0x6e, 0x63, - 0x65, 0x6c, 0x6c, 0x65, 0x64, 0x12, 0x36, 0x0a, 0x0b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, - 0x52, 0x0b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0xa3, 0x05, - 0x0a, 0x1e, 0x42, 0x61, 0x74, 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x55, 0x70, - 0x6c, 0x6f, 0x61, 0x64, 0x41, 0x73, 0x73, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x12, 0x65, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x64, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x47, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, - 0x72, 0x61, 0x70, 0x69, 0x2e, 0x62, 0x61, 0x74, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x61, - 0x74, 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, - 0x41, 0x73, 0x73, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x55, 0x70, 0x6c, - 0x6f, 0x61, 0x64, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x48, 0x00, 0x52, 0x08, 0x6d, - 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x59, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, - 0x65, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x43, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, + 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x73, 0x0a, 0x06, 0x53, 0x74, 0x61, 0x74, + 0x75, 0x73, 0x12, 0x16, 0x0a, 0x12, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x55, 0x4e, 0x53, + 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x12, 0x0a, 0x0e, 0x53, 0x54, + 0x41, 0x54, 0x55, 0x53, 0x5f, 0x50, 0x45, 0x4e, 0x44, 0x49, 0x4e, 0x47, 0x10, 0x01, 0x12, 0x14, + 0x0a, 0x10, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x53, 0x43, 0x48, 0x45, 0x44, 0x55, 0x4c, + 0x45, 0x44, 0x10, 0x02, 0x12, 0x12, 0x0a, 0x0e, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x52, + 0x55, 0x4e, 0x4e, 0x49, 0x4e, 0x47, 0x10, 0x03, 0x12, 0x13, 0x0a, 0x0f, 0x53, 0x54, 0x41, 0x54, + 0x55, 0x53, 0x5f, 0x46, 0x49, 0x4e, 0x49, 0x53, 0x48, 0x45, 0x44, 0x10, 0x04, 0x42, 0x0b, 0x0a, + 0x09, 0x74, 0x61, 0x73, 0x6b, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x22, 0xf3, 0x07, 0x0a, 0x18, 0x42, + 0x61, 0x74, 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x48, 0x65, 0x6c, 0x6c, 0x6f, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x23, 0x0a, 0x07, 0x68, 0x6f, 0x73, 0x74, 0x5f, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0a, 0xfa, 0x42, 0x07, 0x72, 0x05, 0x10, + 0x01, 0x18, 0x80, 0x02, 0x52, 0x06, 0x68, 0x6f, 0x73, 0x74, 0x49, 0x64, 0x12, 0x32, 0x0a, 0x07, + 0x74, 0x61, 0x73, 0x6b, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x19, 0xfa, + 0x42, 0x16, 0x72, 0x14, 0x32, 0x12, 0x5e, 0x5b, 0x61, 0x2d, 0x7a, 0x41, 0x2d, 0x5a, 0x30, 0x2d, + 0x39, 0x5d, 0x7b, 0x32, 0x37, 0x7d, 0x7c, 0x24, 0x52, 0x06, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, + 0x12, 0x65, 0x0a, 0x0a, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x3c, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, + 0x74, 0x6f, 0x72, 0x61, 0x70, 0x69, 0x2e, 0x62, 0x61, 0x74, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, + 0x42, 0x61, 0x74, 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x48, 0x65, 0x6c, 0x6c, + 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x49, 0x6e, + 0x66, 0x6f, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x8a, 0x01, 0x02, 0x10, 0x01, 0x52, 0x09, 0x62, 0x75, + 0x69, 0x6c, 0x64, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x5c, 0x0a, 0x07, 0x6f, 0x73, 0x5f, 0x69, 0x6e, + 0x66, 0x6f, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x39, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, + 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x61, 0x70, 0x69, 0x2e, 0x62, 0x61, 0x74, 0x6f, 0x6e, + 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x61, 0x74, 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x48, 0x65, 0x6c, 0x6c, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x4f, 0x53, 0x49, + 0x6e, 0x66, 0x6f, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x8a, 0x01, 0x02, 0x10, 0x01, 0x52, 0x06, 0x6f, + 0x73, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x5b, 0x0a, 0x12, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, + 0x6f, 0x72, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x05, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x22, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, + 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x4d, 0x65, 0x74, + 0x61, 0x64, 0x61, 0x74, 0x61, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x8a, 0x01, 0x02, 0x10, 0x01, 0x52, + 0x11, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, + 0x74, 0x61, 0x12, 0x40, 0x0a, 0x0b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x42, 0x08, 0xfa, + 0x42, 0x05, 0x92, 0x01, 0x02, 0x10, 0x10, 0x52, 0x0b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x1a, 0x95, 0x01, 0x0a, 0x09, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x49, 0x6e, + 0x66, 0x6f, 0x12, 0x2d, 0x0a, 0x0c, 0x6c, 0x61, 0x6e, 0x67, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, + 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0a, 0xfa, 0x42, 0x07, 0x72, 0x05, 0x10, + 0x01, 0x18, 0x80, 0x02, 0x52, 0x0b, 0x6c, 0x61, 0x6e, 0x67, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, + 0x6e, 0x12, 0x24, 0x0a, 0x07, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x42, 0x0a, 0xfa, 0x42, 0x07, 0x72, 0x05, 0x10, 0x01, 0x18, 0x80, 0x02, 0x52, 0x07, + 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x12, 0x33, 0x0a, 0x0f, 0x70, 0x61, 0x63, 0x6b, 0x61, + 0x67, 0x65, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, + 0x42, 0x0a, 0xfa, 0x42, 0x07, 0x72, 0x05, 0x10, 0x01, 0x18, 0x80, 0x02, 0x52, 0x0e, 0x70, 0x61, + 0x63, 0x6b, 0x61, 0x67, 0x65, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x1a, 0x81, 0x03, 0x0a, + 0x06, 0x4f, 0x53, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x26, 0x0a, 0x08, 0x68, 0x6f, 0x73, 0x74, 0x6e, + 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0a, 0xfa, 0x42, 0x07, 0x72, 0x05, + 0x10, 0x01, 0x18, 0x80, 0x02, 0x52, 0x08, 0x68, 0x6f, 0x73, 0x74, 0x6e, 0x61, 0x6d, 0x65, 0x12, + 0x1a, 0x0a, 0x02, 0x6f, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0a, 0xfa, 0x42, 0x07, + 0x72, 0x05, 0x10, 0x01, 0x18, 0x80, 0x02, 0x52, 0x02, 0x6f, 0x73, 0x12, 0x26, 0x0a, 0x08, 0x70, + 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0a, 0xfa, + 0x42, 0x07, 0x72, 0x05, 0x10, 0x01, 0x18, 0x80, 0x02, 0x52, 0x08, 0x70, 0x6c, 0x61, 0x74, 0x66, + 0x6f, 0x72, 0x6d, 0x12, 0x35, 0x0a, 0x10, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x5f, + 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0a, 0xfa, + 0x42, 0x07, 0x72, 0x05, 0x10, 0x01, 0x18, 0x80, 0x02, 0x52, 0x0f, 0x70, 0x6c, 0x61, 0x74, 0x66, + 0x6f, 0x72, 0x6d, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x33, 0x0a, 0x0f, 0x70, 0x6c, + 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x5f, 0x66, 0x61, 0x6d, 0x69, 0x6c, 0x79, 0x18, 0x05, 0x20, + 0x01, 0x28, 0x09, 0x42, 0x0a, 0xfa, 0x42, 0x07, 0x72, 0x05, 0x10, 0x01, 0x18, 0x80, 0x02, 0x52, + 0x0e, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x46, 0x61, 0x6d, 0x69, 0x6c, 0x79, 0x12, + 0x31, 0x0a, 0x0e, 0x6b, 0x65, 0x72, 0x6e, 0x65, 0x6c, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, + 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0a, 0xfa, 0x42, 0x07, 0x72, 0x05, 0x10, 0x01, + 0x18, 0x80, 0x02, 0x52, 0x0d, 0x6b, 0x65, 0x72, 0x6e, 0x65, 0x6c, 0x56, 0x65, 0x72, 0x73, 0x69, + 0x6f, 0x6e, 0x12, 0x2b, 0x0a, 0x0b, 0x6b, 0x65, 0x72, 0x6e, 0x65, 0x6c, 0x5f, 0x61, 0x72, 0x63, + 0x68, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0a, 0xfa, 0x42, 0x07, 0x72, 0x05, 0x10, 0x01, + 0x18, 0x80, 0x02, 0x52, 0x0a, 0x6b, 0x65, 0x72, 0x6e, 0x65, 0x6c, 0x41, 0x72, 0x63, 0x68, 0x12, + 0x3f, 0x0a, 0x15, 0x76, 0x69, 0x72, 0x74, 0x75, 0x61, 0x6c, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x5f, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0a, + 0xfa, 0x42, 0x07, 0x72, 0x05, 0x10, 0x01, 0x18, 0x80, 0x02, 0x52, 0x14, 0x76, 0x69, 0x72, 0x74, + 0x75, 0x61, 0x6c, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, + 0x22, 0x53, 0x0a, 0x19, 0x42, 0x61, 0x74, 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x48, 0x65, 0x6c, 0x6c, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x36, 0x0a, + 0x0b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x0b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x41, 0x0a, 0x1a, 0x42, 0x61, 0x74, 0x6f, 0x6e, 0x53, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x47, 0x65, 0x74, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x23, 0x0a, 0x07, 0x68, 0x6f, 0x73, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x42, 0x0a, 0xfa, 0x42, 0x07, 0x72, 0x05, 0x10, 0x01, 0x18, 0x80, 0x02, + 0x52, 0x06, 0x68, 0x6f, 0x73, 0x74, 0x49, 0x64, 0x22, 0x83, 0x02, 0x0a, 0x1b, 0x42, 0x61, 0x74, + 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x47, 0x65, 0x74, 0x54, 0x61, 0x73, 0x6b, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x32, 0x0a, 0x04, 0x74, 0x61, 0x73, 0x6b, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, + 0x65, 0x63, 0x74, 0x6f, 0x72, 0x61, 0x70, 0x69, 0x2e, 0x62, 0x61, 0x74, 0x6f, 0x6e, 0x2e, 0x76, + 0x31, 0x2e, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x04, 0x74, 0x61, 0x73, 0x6b, 0x12, 0x36, 0x0a, 0x09, + 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x6f, 0x6c, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x08, 0x6e, 0x65, 0x78, 0x74, + 0x50, 0x6f, 0x6c, 0x6c, 0x12, 0x40, 0x0a, 0x0e, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x68, 0x65, 0x61, + 0x72, 0x74, 0x62, 0x65, 0x61, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, + 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0d, 0x6e, 0x65, 0x78, 0x74, 0x48, 0x65, 0x61, + 0x72, 0x74, 0x62, 0x65, 0x61, 0x74, 0x12, 0x36, 0x0a, 0x0b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, + 0x79, 0x52, 0x0b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0xb8, + 0x01, 0x0a, 0x1c, 0x42, 0x61, 0x74, 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x48, + 0x65, 0x61, 0x72, 0x74, 0x62, 0x65, 0x61, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, + 0x23, 0x0a, 0x07, 0x68, 0x6f, 0x73, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x42, 0x0a, 0xfa, 0x42, 0x07, 0x72, 0x05, 0x10, 0x01, 0x18, 0x80, 0x02, 0x52, 0x06, 0x68, 0x6f, + 0x73, 0x74, 0x49, 0x64, 0x12, 0x31, 0x0a, 0x07, 0x74, 0x61, 0x73, 0x6b, 0x5f, 0x69, 0x64, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xfa, 0x42, 0x15, 0x72, 0x13, 0x32, 0x11, 0x5e, 0x5b, + 0x61, 0x2d, 0x7a, 0x41, 0x2d, 0x5a, 0x30, 0x2d, 0x39, 0x5d, 0x7b, 0x32, 0x37, 0x7d, 0x24, 0x52, + 0x06, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x12, 0x40, 0x0a, 0x0b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, + 0x6e, 0x79, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x92, 0x01, 0x02, 0x10, 0x10, 0x52, 0x0b, 0x61, 0x6e, + 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0xb7, 0x01, 0x0a, 0x1d, 0x42, 0x61, + 0x74, 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x48, 0x65, 0x61, 0x72, 0x74, 0x62, + 0x65, 0x61, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x40, 0x0a, 0x0e, 0x6e, + 0x65, 0x78, 0x74, 0x5f, 0x68, 0x65, 0x61, 0x72, 0x74, 0x62, 0x65, 0x61, 0x74, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0d, + 0x6e, 0x65, 0x78, 0x74, 0x48, 0x65, 0x61, 0x72, 0x74, 0x62, 0x65, 0x61, 0x74, 0x12, 0x1c, 0x0a, + 0x09, 0x63, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x6c, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, + 0x52, 0x09, 0x63, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x6c, 0x65, 0x64, 0x12, 0x36, 0x0a, 0x0b, 0x61, + 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x0b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x22, 0xa3, 0x05, 0x0a, 0x1e, 0x42, 0x61, 0x74, 0x6f, 0x6e, 0x53, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x41, 0x73, 0x73, 0x65, 0x74, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x65, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, + 0x74, 0x61, 0x18, 0x64, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x47, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, + 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x61, 0x70, 0x69, 0x2e, 0x62, 0x61, 0x74, 0x6f, 0x6e, + 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x61, 0x74, 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x41, 0x73, 0x73, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x2e, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, + 0x61, 0x48, 0x00, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x59, 0x0a, + 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x65, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x43, 0x2e, 0x63, 0x31, + 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x61, 0x70, 0x69, 0x2e, 0x62, 0x61, + 0x74, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x61, 0x74, 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x41, 0x73, 0x73, 0x65, 0x74, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x44, 0x61, 0x74, 0x61, + 0x48, 0x00, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x56, 0x0a, 0x03, 0x65, 0x6f, 0x66, 0x18, + 0x66, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x42, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x61, 0x70, 0x69, 0x2e, 0x62, 0x61, 0x74, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x61, 0x74, 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x41, 0x73, 0x73, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, - 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x44, 0x61, 0x74, 0x61, 0x48, 0x00, 0x52, 0x04, 0x64, 0x61, - 0x74, 0x61, 0x12, 0x56, 0x0a, 0x03, 0x65, 0x6f, 0x66, 0x18, 0x66, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x42, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x61, 0x70, - 0x69, 0x2e, 0x62, 0x61, 0x74, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x61, 0x74, 0x6f, 0x6e, - 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x41, 0x73, 0x73, - 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, - 0x45, 0x4f, 0x46, 0x48, 0x00, 0x52, 0x03, 0x65, 0x6f, 0x66, 0x1a, 0xaa, 0x01, 0x0a, 0x0e, 0x55, - 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x23, 0x0a, - 0x07, 0x68, 0x6f, 0x73, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0a, - 0xfa, 0x42, 0x07, 0x72, 0x05, 0x10, 0x01, 0x18, 0x80, 0x02, 0x52, 0x06, 0x68, 0x6f, 0x73, 0x74, - 0x49, 0x64, 0x12, 0x31, 0x0a, 0x07, 0x74, 0x61, 0x73, 0x6b, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x42, 0x18, 0xfa, 0x42, 0x15, 0x72, 0x13, 0x32, 0x11, 0x5e, 0x5b, 0x61, 0x2d, - 0x7a, 0x41, 0x2d, 0x5a, 0x30, 0x2d, 0x39, 0x5d, 0x7b, 0x32, 0x37, 0x7d, 0x24, 0x52, 0x06, 0x74, - 0x61, 0x73, 0x6b, 0x49, 0x64, 0x12, 0x40, 0x0a, 0x0b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, - 0x42, 0x08, 0xfa, 0x42, 0x05, 0x92, 0x01, 0x02, 0x10, 0x10, 0x52, 0x0b, 0x61, 0x6e, 0x6e, 0x6f, - 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x1a, 0x2d, 0x0a, 0x0a, 0x55, 0x70, 0x6c, 0x6f, 0x61, - 0x64, 0x44, 0x61, 0x74, 0x61, 0x12, 0x1f, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0c, 0x42, 0x0b, 0xfa, 0x42, 0x08, 0x7a, 0x06, 0x10, 0x01, 0x18, 0x80, 0x80, 0x40, - 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x1a, 0x7f, 0x0a, 0x09, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, - 0x45, 0x4f, 0x46, 0x12, 0x30, 0x0a, 0x0f, 0x73, 0x68, 0x61, 0x32, 0x35, 0x36, 0x5f, 0x63, 0x68, - 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x07, 0xfa, 0x42, - 0x04, 0x7a, 0x02, 0x68, 0x20, 0x52, 0x0e, 0x73, 0x68, 0x61, 0x32, 0x35, 0x36, 0x43, 0x68, 0x65, - 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x12, 0x40, 0x0a, 0x0b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, - 0x42, 0x08, 0xfa, 0x42, 0x05, 0x92, 0x01, 0x02, 0x10, 0x10, 0x52, 0x0b, 0x61, 0x6e, 0x6e, 0x6f, - 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x42, 0x0a, 0x0a, 0x03, 0x6d, 0x73, 0x67, 0x12, 0x03, - 0xf8, 0x42, 0x01, 0x22, 0x59, 0x0a, 0x1f, 0x42, 0x61, 0x74, 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76, - 0x69, 0x63, 0x65, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x41, 0x73, 0x73, 0x65, 0x74, 0x52, 0x65, + 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x45, 0x4f, 0x46, 0x48, 0x00, 0x52, 0x03, 0x65, 0x6f, 0x66, + 0x1a, 0xaa, 0x01, 0x0a, 0x0e, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x4d, 0x65, 0x74, 0x61, 0x64, + 0x61, 0x74, 0x61, 0x12, 0x23, 0x0a, 0x07, 0x68, 0x6f, 0x73, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x42, 0x0a, 0xfa, 0x42, 0x07, 0x72, 0x05, 0x10, 0x01, 0x18, 0x80, 0x02, + 0x52, 0x06, 0x68, 0x6f, 0x73, 0x74, 0x49, 0x64, 0x12, 0x31, 0x0a, 0x07, 0x74, 0x61, 0x73, 0x6b, + 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xfa, 0x42, 0x15, 0x72, 0x13, + 0x32, 0x11, 0x5e, 0x5b, 0x61, 0x2d, 0x7a, 0x41, 0x2d, 0x5a, 0x30, 0x2d, 0x39, 0x5d, 0x7b, 0x32, + 0x37, 0x7d, 0x24, 0x52, 0x06, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x12, 0x40, 0x0a, 0x0b, 0x61, + 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x92, 0x01, 0x02, 0x10, 0x10, + 0x52, 0x0b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x1a, 0x2d, 0x0a, + 0x0a, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x44, 0x61, 0x74, 0x61, 0x12, 0x1f, 0x0a, 0x04, 0x64, + 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x0b, 0xfa, 0x42, 0x08, 0x7a, 0x06, + 0x10, 0x01, 0x18, 0x80, 0x80, 0x40, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x1a, 0x7f, 0x0a, 0x09, + 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x45, 0x4f, 0x46, 0x12, 0x30, 0x0a, 0x0f, 0x73, 0x68, 0x61, + 0x32, 0x35, 0x36, 0x5f, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0c, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x7a, 0x02, 0x68, 0x20, 0x52, 0x0e, 0x73, 0x68, 0x61, + 0x32, 0x35, 0x36, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x12, 0x40, 0x0a, 0x0b, 0x61, + 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x92, 0x01, 0x02, 0x10, 0x10, + 0x52, 0x0b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x42, 0x0a, 0x0a, + 0x03, 0x6d, 0x73, 0x67, 0x12, 0x03, 0xf8, 0x42, 0x01, 0x22, 0x59, 0x0a, 0x1f, 0x42, 0x61, 0x74, + 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x41, + 0x73, 0x73, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x36, 0x0a, 0x0b, + 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x0b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x8d, 0x05, 0x0a, 0x1d, 0x42, 0x61, 0x74, 0x6f, 0x6e, 0x53, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x46, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x54, 0x61, 0x73, 0x6b, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x23, 0x0a, 0x07, 0x68, 0x6f, 0x73, 0x74, 0x5f, 0x69, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0a, 0xfa, 0x42, 0x07, 0x72, 0x05, 0x10, 0x01, + 0x18, 0x80, 0x02, 0x52, 0x06, 0x68, 0x6f, 0x73, 0x74, 0x49, 0x64, 0x12, 0x31, 0x0a, 0x07, 0x74, + 0x61, 0x73, 0x6b, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xfa, 0x42, + 0x15, 0x72, 0x13, 0x32, 0x11, 0x5e, 0x5b, 0x61, 0x2d, 0x7a, 0x41, 0x2d, 0x5a, 0x30, 0x2d, 0x39, + 0x5d, 0x7b, 0x32, 0x37, 0x7d, 0x24, 0x52, 0x06, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x12, 0x2a, + 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x74, 0x61, 0x74, + 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x55, 0x0a, 0x05, 0x65, 0x72, + 0x72, 0x6f, 0x72, 0x18, 0x64, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x3d, 0x2e, 0x63, 0x31, 0x2e, 0x63, + 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x61, 0x70, 0x69, 0x2e, 0x62, 0x61, 0x74, 0x6f, + 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x61, 0x74, 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x46, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x2e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x48, 0x00, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, + 0x72, 0x12, 0x5b, 0x0a, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x18, 0x65, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x3f, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, + 0x72, 0x61, 0x70, 0x69, 0x2e, 0x62, 0x61, 0x74, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x61, + 0x74, 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x46, 0x69, 0x6e, 0x69, 0x73, 0x68, + 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x53, 0x75, 0x63, 0x63, + 0x65, 0x73, 0x73, 0x48, 0x00, 0x52, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x1a, 0xa0, + 0x01, 0x0a, 0x05, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x23, 0x0a, 0x0d, 0x6e, 0x6f, 0x6e, 0x5f, + 0x72, 0x65, 0x74, 0x72, 0x79, 0x61, 0x62, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, + 0x0c, 0x6e, 0x6f, 0x6e, 0x52, 0x65, 0x74, 0x72, 0x79, 0x61, 0x62, 0x6c, 0x65, 0x12, 0x40, 0x0a, + 0x0b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x92, 0x01, 0x02, + 0x10, 0x10, 0x52, 0x0b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, + 0x30, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x1a, 0x7d, 0x0a, 0x07, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x40, 0x0a, 0x0b, + 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x92, 0x01, 0x02, 0x10, + 0x10, 0x52, 0x0b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x30, + 0x0a, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x42, 0x12, 0x0a, 0x0b, 0x66, 0x69, 0x6e, 0x61, 0x6c, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x12, + 0x03, 0xf8, 0x42, 0x01, 0x22, 0x58, 0x0a, 0x1e, 0x42, 0x61, 0x74, 0x6f, 0x6e, 0x53, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x46, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x36, 0x0a, 0x0b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, - 0x79, 0x52, 0x0b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x8d, - 0x05, 0x0a, 0x1d, 0x42, 0x61, 0x74, 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x46, - 0x69, 0x6e, 0x69, 0x73, 0x68, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x12, 0x23, 0x0a, 0x07, 0x68, 0x6f, 0x73, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x42, 0x0a, 0xfa, 0x42, 0x07, 0x72, 0x05, 0x10, 0x01, 0x18, 0x80, 0x02, 0x52, 0x06, 0x68, - 0x6f, 0x73, 0x74, 0x49, 0x64, 0x12, 0x31, 0x0a, 0x07, 0x74, 0x61, 0x73, 0x6b, 0x5f, 0x69, 0x64, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xfa, 0x42, 0x15, 0x72, 0x13, 0x32, 0x11, 0x5e, - 0x5b, 0x61, 0x2d, 0x7a, 0x41, 0x2d, 0x5a, 0x30, 0x2d, 0x39, 0x5d, 0x7b, 0x32, 0x37, 0x7d, 0x24, - 0x52, 0x06, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x12, 0x2a, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, - 0x75, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, - 0x61, 0x74, 0x75, 0x73, 0x12, 0x55, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x64, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x3d, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, + 0x79, 0x52, 0x0b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x17, + 0x0a, 0x15, 0x53, 0x74, 0x61, 0x72, 0x74, 0x44, 0x65, 0x62, 0x75, 0x67, 0x67, 0x69, 0x6e, 0x67, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x30, 0x0a, 0x16, 0x53, 0x74, 0x61, 0x72, 0x74, + 0x44, 0x65, 0x62, 0x75, 0x67, 0x67, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x08, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x32, 0x80, 0x06, 0x0a, 0x0c, 0x42, 0x61, + 0x74, 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x72, 0x0a, 0x05, 0x48, 0x65, + 0x6c, 0x6c, 0x6f, 0x12, 0x32, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x61, 0x70, 0x69, 0x2e, 0x62, 0x61, 0x74, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x42, - 0x61, 0x74, 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x46, 0x69, 0x6e, 0x69, 0x73, - 0x68, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x45, 0x72, 0x72, - 0x6f, 0x72, 0x48, 0x00, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x5b, 0x0a, 0x07, 0x73, - 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x18, 0x65, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x3f, 0x2e, 0x63, + 0x61, 0x74, 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x48, 0x65, 0x6c, 0x6c, 0x6f, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x33, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, + 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x61, 0x70, 0x69, 0x2e, 0x62, 0x61, 0x74, 0x6f, 0x6e, 0x2e, + 0x76, 0x31, 0x2e, 0x42, 0x61, 0x74, 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x48, + 0x65, 0x6c, 0x6c, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x78, + 0x0a, 0x07, 0x47, 0x65, 0x74, 0x54, 0x61, 0x73, 0x6b, 0x12, 0x34, 0x2e, 0x63, 0x31, 0x2e, 0x63, + 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x61, 0x70, 0x69, 0x2e, 0x62, 0x61, 0x74, 0x6f, + 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x61, 0x74, 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x47, 0x65, 0x74, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x35, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x61, 0x70, + 0x69, 0x2e, 0x62, 0x61, 0x74, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x61, 0x74, 0x6f, 0x6e, + 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x47, 0x65, 0x74, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x7e, 0x0a, 0x09, 0x48, 0x65, 0x61, 0x72, + 0x74, 0x62, 0x65, 0x61, 0x74, 0x12, 0x36, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, + 0x63, 0x74, 0x6f, 0x72, 0x61, 0x70, 0x69, 0x2e, 0x62, 0x61, 0x74, 0x6f, 0x6e, 0x2e, 0x76, 0x31, + 0x2e, 0x42, 0x61, 0x74, 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x48, 0x65, 0x61, + 0x72, 0x74, 0x62, 0x65, 0x61, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x37, 0x2e, + 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x61, 0x70, 0x69, 0x2e, + 0x62, 0x61, 0x74, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x61, 0x74, 0x6f, 0x6e, 0x53, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x48, 0x65, 0x61, 0x72, 0x74, 0x62, 0x65, 0x61, 0x74, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x81, 0x01, 0x0a, 0x0a, 0x46, 0x69, 0x6e, + 0x69, 0x73, 0x68, 0x54, 0x61, 0x73, 0x6b, 0x12, 0x37, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, + 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x61, 0x70, 0x69, 0x2e, 0x62, 0x61, 0x74, 0x6f, 0x6e, 0x2e, + 0x76, 0x31, 0x2e, 0x42, 0x61, 0x74, 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x46, + 0x69, 0x6e, 0x69, 0x73, 0x68, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x38, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x61, + 0x70, 0x69, 0x2e, 0x62, 0x61, 0x74, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x61, 0x74, 0x6f, + 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x46, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x54, 0x61, + 0x73, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x86, 0x01, 0x0a, + 0x0b, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x41, 0x73, 0x73, 0x65, 0x74, 0x12, 0x38, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x61, 0x70, 0x69, 0x2e, 0x62, 0x61, 0x74, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x61, 0x74, 0x6f, 0x6e, 0x53, 0x65, 0x72, - 0x76, 0x69, 0x63, 0x65, 0x46, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x48, 0x00, 0x52, - 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x1a, 0xa0, 0x01, 0x0a, 0x05, 0x45, 0x72, 0x72, - 0x6f, 0x72, 0x12, 0x23, 0x0a, 0x0d, 0x6e, 0x6f, 0x6e, 0x5f, 0x72, 0x65, 0x74, 0x72, 0x79, 0x61, - 0x62, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0c, 0x6e, 0x6f, 0x6e, 0x52, 0x65, - 0x74, 0x72, 0x79, 0x61, 0x62, 0x6c, 0x65, 0x12, 0x40, 0x0a, 0x0b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, - 0x6e, 0x79, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x92, 0x01, 0x02, 0x10, 0x10, 0x52, 0x0b, 0x61, 0x6e, - 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x30, 0x0a, 0x08, 0x72, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, - 0x79, 0x52, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x1a, 0x7d, 0x0a, 0x07, 0x53, - 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x40, 0x0a, 0x0b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, - 0x79, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x92, 0x01, 0x02, 0x10, 0x10, 0x52, 0x0b, 0x61, 0x6e, 0x6e, - 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x30, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, - 0x52, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x12, 0x0a, 0x0b, 0x66, 0x69, - 0x6e, 0x61, 0x6c, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x12, 0x03, 0xf8, 0x42, 0x01, 0x22, 0x58, - 0x0a, 0x1e, 0x42, 0x61, 0x74, 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x46, 0x69, - 0x6e, 0x69, 0x73, 0x68, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x36, 0x0a, 0x0b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, - 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x0b, 0x61, 0x6e, 0x6e, - 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x32, 0x89, 0x05, 0x0a, 0x0c, 0x42, 0x61, 0x74, - 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x72, 0x0a, 0x05, 0x48, 0x65, 0x6c, - 0x6c, 0x6f, 0x12, 0x32, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, - 0x72, 0x61, 0x70, 0x69, 0x2e, 0x62, 0x61, 0x74, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x61, - 0x74, 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x48, 0x65, 0x6c, 0x6c, 0x6f, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x33, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, + 0x76, 0x69, 0x63, 0x65, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x41, 0x73, 0x73, 0x65, 0x74, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x39, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x61, 0x70, 0x69, 0x2e, 0x62, 0x61, 0x74, 0x6f, 0x6e, 0x2e, 0x76, - 0x31, 0x2e, 0x42, 0x61, 0x74, 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x48, 0x65, - 0x6c, 0x6c, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x78, 0x0a, - 0x07, 0x47, 0x65, 0x74, 0x54, 0x61, 0x73, 0x6b, 0x12, 0x34, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, + 0x31, 0x2e, 0x42, 0x61, 0x74, 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x55, 0x70, + 0x6c, 0x6f, 0x61, 0x64, 0x41, 0x73, 0x73, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x00, 0x28, 0x01, 0x12, 0x75, 0x0a, 0x0e, 0x53, 0x74, 0x61, 0x72, 0x74, 0x44, 0x65, + 0x62, 0x75, 0x67, 0x67, 0x69, 0x6e, 0x67, 0x12, 0x2f, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, + 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x61, 0x70, 0x69, 0x2e, 0x62, 0x61, 0x74, 0x6f, 0x6e, 0x2e, + 0x76, 0x31, 0x2e, 0x53, 0x74, 0x61, 0x72, 0x74, 0x44, 0x65, 0x62, 0x75, 0x67, 0x67, 0x69, 0x6e, + 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x30, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x61, 0x70, 0x69, 0x2e, 0x62, 0x61, 0x74, 0x6f, 0x6e, - 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x61, 0x74, 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, - 0x47, 0x65, 0x74, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x35, - 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x61, 0x70, 0x69, - 0x2e, 0x62, 0x61, 0x74, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x61, 0x74, 0x6f, 0x6e, 0x53, - 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x47, 0x65, 0x74, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x7e, 0x0a, 0x09, 0x48, 0x65, 0x61, 0x72, 0x74, - 0x62, 0x65, 0x61, 0x74, 0x12, 0x36, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, - 0x74, 0x6f, 0x72, 0x61, 0x70, 0x69, 0x2e, 0x62, 0x61, 0x74, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, - 0x42, 0x61, 0x74, 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x48, 0x65, 0x61, 0x72, - 0x74, 0x62, 0x65, 0x61, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x37, 0x2e, 0x63, - 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x61, 0x70, 0x69, 0x2e, 0x62, - 0x61, 0x74, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x61, 0x74, 0x6f, 0x6e, 0x53, 0x65, 0x72, - 0x76, 0x69, 0x63, 0x65, 0x48, 0x65, 0x61, 0x72, 0x74, 0x62, 0x65, 0x61, 0x74, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x81, 0x01, 0x0a, 0x0a, 0x46, 0x69, 0x6e, 0x69, - 0x73, 0x68, 0x54, 0x61, 0x73, 0x6b, 0x12, 0x37, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, - 0x65, 0x63, 0x74, 0x6f, 0x72, 0x61, 0x70, 0x69, 0x2e, 0x62, 0x61, 0x74, 0x6f, 0x6e, 0x2e, 0x76, - 0x31, 0x2e, 0x42, 0x61, 0x74, 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x46, 0x69, - 0x6e, 0x69, 0x73, 0x68, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x38, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x61, 0x70, - 0x69, 0x2e, 0x62, 0x61, 0x74, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x61, 0x74, 0x6f, 0x6e, - 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x46, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x54, 0x61, 0x73, - 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x86, 0x01, 0x0a, 0x0b, - 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x41, 0x73, 0x73, 0x65, 0x74, 0x12, 0x38, 0x2e, 0x63, 0x31, - 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x61, 0x70, 0x69, 0x2e, 0x62, 0x61, - 0x74, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x61, 0x74, 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76, - 0x69, 0x63, 0x65, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x41, 0x73, 0x73, 0x65, 0x74, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x39, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, - 0x63, 0x74, 0x6f, 0x72, 0x61, 0x70, 0x69, 0x2e, 0x62, 0x61, 0x74, 0x6f, 0x6e, 0x2e, 0x76, 0x31, - 0x2e, 0x42, 0x61, 0x74, 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x55, 0x70, 0x6c, - 0x6f, 0x61, 0x64, 0x41, 0x73, 0x73, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x22, 0x00, 0x28, 0x01, 0x42, 0x37, 0x5a, 0x35, 0x67, 0x69, 0x74, 0x6c, 0x61, 0x62, 0x2e, 0x63, - 0x6f, 0x6d, 0x2f, 0x64, 0x75, 0x63, 0x74, 0x6f, 0x6e, 0x65, 0x2f, 0x63, 0x31, 0x2f, 0x70, 0x6b, - 0x67, 0x2f, 0x70, 0x62, 0x2f, 0x63, 0x31, 0x2f, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, - 0x72, 0x61, 0x70, 0x69, 0x2f, 0x62, 0x61, 0x74, 0x6f, 0x6e, 0x2f, 0x76, 0x31, 0x62, 0x06, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x74, 0x61, 0x72, 0x74, 0x44, 0x65, 0x62, 0x75, 0x67, 0x67, 0x69, + 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x37, 0x5a, 0x35, + 0x67, 0x69, 0x74, 0x6c, 0x61, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x64, 0x75, 0x63, 0x74, 0x6f, + 0x6e, 0x65, 0x2f, 0x63, 0x31, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x62, 0x2f, 0x63, 0x31, 0x2f, + 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x61, 0x70, 0x69, 0x2f, 0x62, 0x61, 0x74, + 0x6f, 0x6e, 0x2f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -2649,7 +2755,7 @@ func file_c1_connectorapi_baton_v1_baton_proto_rawDescGZIP() []byte { } var file_c1_connectorapi_baton_v1_baton_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_c1_connectorapi_baton_v1_baton_proto_msgTypes = make([]protoimpl.MessageInfo, 31) +var file_c1_connectorapi_baton_v1_baton_proto_msgTypes = make([]protoimpl.MessageInfo, 33) var file_c1_connectorapi_baton_v1_baton_proto_goTypes = []interface{}{ (Task_Status)(0), // 0: c1.connectorapi.baton.v1.Task.Status (*Task)(nil), // 1: c1.connectorapi.baton.v1.Task @@ -2663,118 +2769,122 @@ var file_c1_connectorapi_baton_v1_baton_proto_goTypes = []interface{}{ (*BatonServiceUploadAssetResponse)(nil), // 9: c1.connectorapi.baton.v1.BatonServiceUploadAssetResponse (*BatonServiceFinishTaskRequest)(nil), // 10: c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest (*BatonServiceFinishTaskResponse)(nil), // 11: c1.connectorapi.baton.v1.BatonServiceFinishTaskResponse - (*Task_NoneTask)(nil), // 12: c1.connectorapi.baton.v1.Task.NoneTask - (*Task_HelloTask)(nil), // 13: c1.connectorapi.baton.v1.Task.HelloTask - (*Task_SyncFullTask)(nil), // 14: c1.connectorapi.baton.v1.Task.SyncFullTask - (*Task_EventFeedTask)(nil), // 15: c1.connectorapi.baton.v1.Task.EventFeedTask - (*Task_GrantTask)(nil), // 16: c1.connectorapi.baton.v1.Task.GrantTask - (*Task_RevokeTask)(nil), // 17: c1.connectorapi.baton.v1.Task.RevokeTask - (*Task_CreateAccountTask)(nil), // 18: c1.connectorapi.baton.v1.Task.CreateAccountTask - (*Task_CreateResourceTask)(nil), // 19: c1.connectorapi.baton.v1.Task.CreateResourceTask - (*Task_DeleteResourceTask)(nil), // 20: c1.connectorapi.baton.v1.Task.DeleteResourceTask - (*Task_RotateCredentialsTask)(nil), // 21: c1.connectorapi.baton.v1.Task.RotateCredentialsTask - (*Task_CreateTicketTask)(nil), // 22: c1.connectorapi.baton.v1.Task.CreateTicketTask - (*Task_ListTicketSchemasTask)(nil), // 23: c1.connectorapi.baton.v1.Task.ListTicketSchemasTask - (*Task_GetTicketTask)(nil), // 24: c1.connectorapi.baton.v1.Task.GetTicketTask - (*BatonServiceHelloRequest_BuildInfo)(nil), // 25: c1.connectorapi.baton.v1.BatonServiceHelloRequest.BuildInfo - (*BatonServiceHelloRequest_OSInfo)(nil), // 26: c1.connectorapi.baton.v1.BatonServiceHelloRequest.OSInfo - (*BatonServiceUploadAssetRequest_UploadMetadata)(nil), // 27: c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.UploadMetadata - (*BatonServiceUploadAssetRequest_UploadData)(nil), // 28: c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.UploadData - (*BatonServiceUploadAssetRequest_UploadEOF)(nil), // 29: c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.UploadEOF - (*BatonServiceFinishTaskRequest_Error)(nil), // 30: c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.Error - (*BatonServiceFinishTaskRequest_Success)(nil), // 31: c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.Success - (*v2.ConnectorMetadata)(nil), // 32: c1.connector.v2.ConnectorMetadata - (*anypb.Any)(nil), // 33: google.protobuf.Any - (*durationpb.Duration)(nil), // 34: google.protobuf.Duration - (*status.Status)(nil), // 35: google.rpc.Status - (*timestamppb.Timestamp)(nil), // 36: google.protobuf.Timestamp - (*v2.Entitlement)(nil), // 37: c1.connector.v2.Entitlement - (*v2.Resource)(nil), // 38: c1.connector.v2.Resource - (*v2.Grant)(nil), // 39: c1.connector.v2.Grant - (*v2.AccountInfo)(nil), // 40: c1.connector.v2.AccountInfo - (*v2.CredentialOptions)(nil), // 41: c1.connector.v2.CredentialOptions - (*v2.EncryptionConfig)(nil), // 42: c1.connector.v2.EncryptionConfig - (*v2.ResourceId)(nil), // 43: c1.connector.v2.ResourceId - (*v2.TicketRequest)(nil), // 44: c1.connector.v2.TicketRequest - (*v2.TicketSchema)(nil), // 45: c1.connector.v2.TicketSchema + (*StartDebuggingRequest)(nil), // 12: c1.connectorapi.baton.v1.StartDebuggingRequest + (*StartDebuggingResponse)(nil), // 13: c1.connectorapi.baton.v1.StartDebuggingResponse + (*Task_NoneTask)(nil), // 14: c1.connectorapi.baton.v1.Task.NoneTask + (*Task_HelloTask)(nil), // 15: c1.connectorapi.baton.v1.Task.HelloTask + (*Task_SyncFullTask)(nil), // 16: c1.connectorapi.baton.v1.Task.SyncFullTask + (*Task_EventFeedTask)(nil), // 17: c1.connectorapi.baton.v1.Task.EventFeedTask + (*Task_GrantTask)(nil), // 18: c1.connectorapi.baton.v1.Task.GrantTask + (*Task_RevokeTask)(nil), // 19: c1.connectorapi.baton.v1.Task.RevokeTask + (*Task_CreateAccountTask)(nil), // 20: c1.connectorapi.baton.v1.Task.CreateAccountTask + (*Task_CreateResourceTask)(nil), // 21: c1.connectorapi.baton.v1.Task.CreateResourceTask + (*Task_DeleteResourceTask)(nil), // 22: c1.connectorapi.baton.v1.Task.DeleteResourceTask + (*Task_RotateCredentialsTask)(nil), // 23: c1.connectorapi.baton.v1.Task.RotateCredentialsTask + (*Task_CreateTicketTask)(nil), // 24: c1.connectorapi.baton.v1.Task.CreateTicketTask + (*Task_ListTicketSchemasTask)(nil), // 25: c1.connectorapi.baton.v1.Task.ListTicketSchemasTask + (*Task_GetTicketTask)(nil), // 26: c1.connectorapi.baton.v1.Task.GetTicketTask + (*BatonServiceHelloRequest_BuildInfo)(nil), // 27: c1.connectorapi.baton.v1.BatonServiceHelloRequest.BuildInfo + (*BatonServiceHelloRequest_OSInfo)(nil), // 28: c1.connectorapi.baton.v1.BatonServiceHelloRequest.OSInfo + (*BatonServiceUploadAssetRequest_UploadMetadata)(nil), // 29: c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.UploadMetadata + (*BatonServiceUploadAssetRequest_UploadData)(nil), // 30: c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.UploadData + (*BatonServiceUploadAssetRequest_UploadEOF)(nil), // 31: c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.UploadEOF + (*BatonServiceFinishTaskRequest_Error)(nil), // 32: c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.Error + (*BatonServiceFinishTaskRequest_Success)(nil), // 33: c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.Success + (*v2.ConnectorMetadata)(nil), // 34: c1.connector.v2.ConnectorMetadata + (*anypb.Any)(nil), // 35: google.protobuf.Any + (*durationpb.Duration)(nil), // 36: google.protobuf.Duration + (*status.Status)(nil), // 37: google.rpc.Status + (*timestamppb.Timestamp)(nil), // 38: google.protobuf.Timestamp + (*v2.Entitlement)(nil), // 39: c1.connector.v2.Entitlement + (*v2.Resource)(nil), // 40: c1.connector.v2.Resource + (*v2.Grant)(nil), // 41: c1.connector.v2.Grant + (*v2.AccountInfo)(nil), // 42: c1.connector.v2.AccountInfo + (*v2.CredentialOptions)(nil), // 43: c1.connector.v2.CredentialOptions + (*v2.EncryptionConfig)(nil), // 44: c1.connector.v2.EncryptionConfig + (*v2.ResourceId)(nil), // 45: c1.connector.v2.ResourceId + (*v2.TicketRequest)(nil), // 46: c1.connector.v2.TicketRequest + (*v2.TicketSchema)(nil), // 47: c1.connector.v2.TicketSchema } var file_c1_connectorapi_baton_v1_baton_proto_depIdxs = []int32{ 0, // 0: c1.connectorapi.baton.v1.Task.status:type_name -> c1.connectorapi.baton.v1.Task.Status - 12, // 1: c1.connectorapi.baton.v1.Task.none:type_name -> c1.connectorapi.baton.v1.Task.NoneTask - 13, // 2: c1.connectorapi.baton.v1.Task.hello:type_name -> c1.connectorapi.baton.v1.Task.HelloTask - 14, // 3: c1.connectorapi.baton.v1.Task.sync_full:type_name -> c1.connectorapi.baton.v1.Task.SyncFullTask - 16, // 4: c1.connectorapi.baton.v1.Task.grant:type_name -> c1.connectorapi.baton.v1.Task.GrantTask - 17, // 5: c1.connectorapi.baton.v1.Task.revoke:type_name -> c1.connectorapi.baton.v1.Task.RevokeTask - 18, // 6: c1.connectorapi.baton.v1.Task.create_account:type_name -> c1.connectorapi.baton.v1.Task.CreateAccountTask - 19, // 7: c1.connectorapi.baton.v1.Task.create_resource:type_name -> c1.connectorapi.baton.v1.Task.CreateResourceTask - 20, // 8: c1.connectorapi.baton.v1.Task.delete_resource:type_name -> c1.connectorapi.baton.v1.Task.DeleteResourceTask - 21, // 9: c1.connectorapi.baton.v1.Task.rotate_credentials:type_name -> c1.connectorapi.baton.v1.Task.RotateCredentialsTask - 15, // 10: c1.connectorapi.baton.v1.Task.event_feed:type_name -> c1.connectorapi.baton.v1.Task.EventFeedTask - 22, // 11: c1.connectorapi.baton.v1.Task.create_ticket_task:type_name -> c1.connectorapi.baton.v1.Task.CreateTicketTask - 23, // 12: c1.connectorapi.baton.v1.Task.list_ticket_schemas:type_name -> c1.connectorapi.baton.v1.Task.ListTicketSchemasTask - 24, // 13: c1.connectorapi.baton.v1.Task.get_ticket:type_name -> c1.connectorapi.baton.v1.Task.GetTicketTask - 25, // 14: c1.connectorapi.baton.v1.BatonServiceHelloRequest.build_info:type_name -> c1.connectorapi.baton.v1.BatonServiceHelloRequest.BuildInfo - 26, // 15: c1.connectorapi.baton.v1.BatonServiceHelloRequest.os_info:type_name -> c1.connectorapi.baton.v1.BatonServiceHelloRequest.OSInfo - 32, // 16: c1.connectorapi.baton.v1.BatonServiceHelloRequest.connector_metadata:type_name -> c1.connector.v2.ConnectorMetadata - 33, // 17: c1.connectorapi.baton.v1.BatonServiceHelloRequest.annotations:type_name -> google.protobuf.Any - 33, // 18: c1.connectorapi.baton.v1.BatonServiceHelloResponse.annotations:type_name -> google.protobuf.Any + 14, // 1: c1.connectorapi.baton.v1.Task.none:type_name -> c1.connectorapi.baton.v1.Task.NoneTask + 15, // 2: c1.connectorapi.baton.v1.Task.hello:type_name -> c1.connectorapi.baton.v1.Task.HelloTask + 16, // 3: c1.connectorapi.baton.v1.Task.sync_full:type_name -> c1.connectorapi.baton.v1.Task.SyncFullTask + 18, // 4: c1.connectorapi.baton.v1.Task.grant:type_name -> c1.connectorapi.baton.v1.Task.GrantTask + 19, // 5: c1.connectorapi.baton.v1.Task.revoke:type_name -> c1.connectorapi.baton.v1.Task.RevokeTask + 20, // 6: c1.connectorapi.baton.v1.Task.create_account:type_name -> c1.connectorapi.baton.v1.Task.CreateAccountTask + 21, // 7: c1.connectorapi.baton.v1.Task.create_resource:type_name -> c1.connectorapi.baton.v1.Task.CreateResourceTask + 22, // 8: c1.connectorapi.baton.v1.Task.delete_resource:type_name -> c1.connectorapi.baton.v1.Task.DeleteResourceTask + 23, // 9: c1.connectorapi.baton.v1.Task.rotate_credentials:type_name -> c1.connectorapi.baton.v1.Task.RotateCredentialsTask + 17, // 10: c1.connectorapi.baton.v1.Task.event_feed:type_name -> c1.connectorapi.baton.v1.Task.EventFeedTask + 24, // 11: c1.connectorapi.baton.v1.Task.create_ticket_task:type_name -> c1.connectorapi.baton.v1.Task.CreateTicketTask + 25, // 12: c1.connectorapi.baton.v1.Task.list_ticket_schemas:type_name -> c1.connectorapi.baton.v1.Task.ListTicketSchemasTask + 26, // 13: c1.connectorapi.baton.v1.Task.get_ticket:type_name -> c1.connectorapi.baton.v1.Task.GetTicketTask + 27, // 14: c1.connectorapi.baton.v1.BatonServiceHelloRequest.build_info:type_name -> c1.connectorapi.baton.v1.BatonServiceHelloRequest.BuildInfo + 28, // 15: c1.connectorapi.baton.v1.BatonServiceHelloRequest.os_info:type_name -> c1.connectorapi.baton.v1.BatonServiceHelloRequest.OSInfo + 34, // 16: c1.connectorapi.baton.v1.BatonServiceHelloRequest.connector_metadata:type_name -> c1.connector.v2.ConnectorMetadata + 35, // 17: c1.connectorapi.baton.v1.BatonServiceHelloRequest.annotations:type_name -> google.protobuf.Any + 35, // 18: c1.connectorapi.baton.v1.BatonServiceHelloResponse.annotations:type_name -> google.protobuf.Any 1, // 19: c1.connectorapi.baton.v1.BatonServiceGetTaskResponse.task:type_name -> c1.connectorapi.baton.v1.Task - 34, // 20: c1.connectorapi.baton.v1.BatonServiceGetTaskResponse.next_poll:type_name -> google.protobuf.Duration - 34, // 21: c1.connectorapi.baton.v1.BatonServiceGetTaskResponse.next_heartbeat:type_name -> google.protobuf.Duration - 33, // 22: c1.connectorapi.baton.v1.BatonServiceGetTaskResponse.annotations:type_name -> google.protobuf.Any - 33, // 23: c1.connectorapi.baton.v1.BatonServiceHeartbeatRequest.annotations:type_name -> google.protobuf.Any - 34, // 24: c1.connectorapi.baton.v1.BatonServiceHeartbeatResponse.next_heartbeat:type_name -> google.protobuf.Duration - 33, // 25: c1.connectorapi.baton.v1.BatonServiceHeartbeatResponse.annotations:type_name -> google.protobuf.Any - 27, // 26: c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.metadata:type_name -> c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.UploadMetadata - 28, // 27: c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.data:type_name -> c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.UploadData - 29, // 28: c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.eof:type_name -> c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.UploadEOF - 33, // 29: c1.connectorapi.baton.v1.BatonServiceUploadAssetResponse.annotations:type_name -> google.protobuf.Any - 35, // 30: c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.status:type_name -> google.rpc.Status - 30, // 31: c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.error:type_name -> c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.Error - 31, // 32: c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.success:type_name -> c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.Success - 33, // 33: c1.connectorapi.baton.v1.BatonServiceFinishTaskResponse.annotations:type_name -> google.protobuf.Any - 33, // 34: c1.connectorapi.baton.v1.Task.NoneTask.annotations:type_name -> google.protobuf.Any - 33, // 35: c1.connectorapi.baton.v1.Task.HelloTask.annotations:type_name -> google.protobuf.Any - 33, // 36: c1.connectorapi.baton.v1.Task.SyncFullTask.annotations:type_name -> google.protobuf.Any - 33, // 37: c1.connectorapi.baton.v1.Task.EventFeedTask.annotations:type_name -> google.protobuf.Any - 36, // 38: c1.connectorapi.baton.v1.Task.EventFeedTask.start_at:type_name -> google.protobuf.Timestamp - 37, // 39: c1.connectorapi.baton.v1.Task.GrantTask.entitlement:type_name -> c1.connector.v2.Entitlement - 38, // 40: c1.connectorapi.baton.v1.Task.GrantTask.principal:type_name -> c1.connector.v2.Resource - 33, // 41: c1.connectorapi.baton.v1.Task.GrantTask.annotations:type_name -> google.protobuf.Any - 34, // 42: c1.connectorapi.baton.v1.Task.GrantTask.duration:type_name -> google.protobuf.Duration - 39, // 43: c1.connectorapi.baton.v1.Task.RevokeTask.grant:type_name -> c1.connector.v2.Grant - 33, // 44: c1.connectorapi.baton.v1.Task.RevokeTask.annotations:type_name -> google.protobuf.Any - 40, // 45: c1.connectorapi.baton.v1.Task.CreateAccountTask.account_info:type_name -> c1.connector.v2.AccountInfo - 41, // 46: c1.connectorapi.baton.v1.Task.CreateAccountTask.credential_options:type_name -> c1.connector.v2.CredentialOptions - 42, // 47: c1.connectorapi.baton.v1.Task.CreateAccountTask.encryption_configs:type_name -> c1.connector.v2.EncryptionConfig - 38, // 48: c1.connectorapi.baton.v1.Task.CreateResourceTask.resource:type_name -> c1.connector.v2.Resource - 43, // 49: c1.connectorapi.baton.v1.Task.DeleteResourceTask.resource_id:type_name -> c1.connector.v2.ResourceId - 43, // 50: c1.connectorapi.baton.v1.Task.RotateCredentialsTask.resource_id:type_name -> c1.connector.v2.ResourceId - 41, // 51: c1.connectorapi.baton.v1.Task.RotateCredentialsTask.credential_options:type_name -> c1.connector.v2.CredentialOptions - 42, // 52: c1.connectorapi.baton.v1.Task.RotateCredentialsTask.encryption_configs:type_name -> c1.connector.v2.EncryptionConfig - 44, // 53: c1.connectorapi.baton.v1.Task.CreateTicketTask.ticket_request:type_name -> c1.connector.v2.TicketRequest - 45, // 54: c1.connectorapi.baton.v1.Task.CreateTicketTask.ticket_schema:type_name -> c1.connector.v2.TicketSchema - 33, // 55: c1.connectorapi.baton.v1.Task.CreateTicketTask.annotations:type_name -> google.protobuf.Any - 33, // 56: c1.connectorapi.baton.v1.Task.ListTicketSchemasTask.annotations:type_name -> google.protobuf.Any - 33, // 57: c1.connectorapi.baton.v1.Task.GetTicketTask.annotations:type_name -> google.protobuf.Any - 33, // 58: c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.UploadMetadata.annotations:type_name -> google.protobuf.Any - 33, // 59: c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.UploadEOF.annotations:type_name -> google.protobuf.Any - 33, // 60: c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.Error.annotations:type_name -> google.protobuf.Any - 33, // 61: c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.Error.response:type_name -> google.protobuf.Any - 33, // 62: c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.Success.annotations:type_name -> google.protobuf.Any - 33, // 63: c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.Success.response:type_name -> google.protobuf.Any + 36, // 20: c1.connectorapi.baton.v1.BatonServiceGetTaskResponse.next_poll:type_name -> google.protobuf.Duration + 36, // 21: c1.connectorapi.baton.v1.BatonServiceGetTaskResponse.next_heartbeat:type_name -> google.protobuf.Duration + 35, // 22: c1.connectorapi.baton.v1.BatonServiceGetTaskResponse.annotations:type_name -> google.protobuf.Any + 35, // 23: c1.connectorapi.baton.v1.BatonServiceHeartbeatRequest.annotations:type_name -> google.protobuf.Any + 36, // 24: c1.connectorapi.baton.v1.BatonServiceHeartbeatResponse.next_heartbeat:type_name -> google.protobuf.Duration + 35, // 25: c1.connectorapi.baton.v1.BatonServiceHeartbeatResponse.annotations:type_name -> google.protobuf.Any + 29, // 26: c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.metadata:type_name -> c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.UploadMetadata + 30, // 27: c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.data:type_name -> c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.UploadData + 31, // 28: c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.eof:type_name -> c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.UploadEOF + 35, // 29: c1.connectorapi.baton.v1.BatonServiceUploadAssetResponse.annotations:type_name -> google.protobuf.Any + 37, // 30: c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.status:type_name -> google.rpc.Status + 32, // 31: c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.error:type_name -> c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.Error + 33, // 32: c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.success:type_name -> c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.Success + 35, // 33: c1.connectorapi.baton.v1.BatonServiceFinishTaskResponse.annotations:type_name -> google.protobuf.Any + 35, // 34: c1.connectorapi.baton.v1.Task.NoneTask.annotations:type_name -> google.protobuf.Any + 35, // 35: c1.connectorapi.baton.v1.Task.HelloTask.annotations:type_name -> google.protobuf.Any + 35, // 36: c1.connectorapi.baton.v1.Task.SyncFullTask.annotations:type_name -> google.protobuf.Any + 35, // 37: c1.connectorapi.baton.v1.Task.EventFeedTask.annotations:type_name -> google.protobuf.Any + 38, // 38: c1.connectorapi.baton.v1.Task.EventFeedTask.start_at:type_name -> google.protobuf.Timestamp + 39, // 39: c1.connectorapi.baton.v1.Task.GrantTask.entitlement:type_name -> c1.connector.v2.Entitlement + 40, // 40: c1.connectorapi.baton.v1.Task.GrantTask.principal:type_name -> c1.connector.v2.Resource + 35, // 41: c1.connectorapi.baton.v1.Task.GrantTask.annotations:type_name -> google.protobuf.Any + 36, // 42: c1.connectorapi.baton.v1.Task.GrantTask.duration:type_name -> google.protobuf.Duration + 41, // 43: c1.connectorapi.baton.v1.Task.RevokeTask.grant:type_name -> c1.connector.v2.Grant + 35, // 44: c1.connectorapi.baton.v1.Task.RevokeTask.annotations:type_name -> google.protobuf.Any + 42, // 45: c1.connectorapi.baton.v1.Task.CreateAccountTask.account_info:type_name -> c1.connector.v2.AccountInfo + 43, // 46: c1.connectorapi.baton.v1.Task.CreateAccountTask.credential_options:type_name -> c1.connector.v2.CredentialOptions + 44, // 47: c1.connectorapi.baton.v1.Task.CreateAccountTask.encryption_configs:type_name -> c1.connector.v2.EncryptionConfig + 40, // 48: c1.connectorapi.baton.v1.Task.CreateResourceTask.resource:type_name -> c1.connector.v2.Resource + 45, // 49: c1.connectorapi.baton.v1.Task.DeleteResourceTask.resource_id:type_name -> c1.connector.v2.ResourceId + 45, // 50: c1.connectorapi.baton.v1.Task.RotateCredentialsTask.resource_id:type_name -> c1.connector.v2.ResourceId + 43, // 51: c1.connectorapi.baton.v1.Task.RotateCredentialsTask.credential_options:type_name -> c1.connector.v2.CredentialOptions + 44, // 52: c1.connectorapi.baton.v1.Task.RotateCredentialsTask.encryption_configs:type_name -> c1.connector.v2.EncryptionConfig + 46, // 53: c1.connectorapi.baton.v1.Task.CreateTicketTask.ticket_request:type_name -> c1.connector.v2.TicketRequest + 47, // 54: c1.connectorapi.baton.v1.Task.CreateTicketTask.ticket_schema:type_name -> c1.connector.v2.TicketSchema + 35, // 55: c1.connectorapi.baton.v1.Task.CreateTicketTask.annotations:type_name -> google.protobuf.Any + 35, // 56: c1.connectorapi.baton.v1.Task.ListTicketSchemasTask.annotations:type_name -> google.protobuf.Any + 35, // 57: c1.connectorapi.baton.v1.Task.GetTicketTask.annotations:type_name -> google.protobuf.Any + 35, // 58: c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.UploadMetadata.annotations:type_name -> google.protobuf.Any + 35, // 59: c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.UploadEOF.annotations:type_name -> google.protobuf.Any + 35, // 60: c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.Error.annotations:type_name -> google.protobuf.Any + 35, // 61: c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.Error.response:type_name -> google.protobuf.Any + 35, // 62: c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.Success.annotations:type_name -> google.protobuf.Any + 35, // 63: c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.Success.response:type_name -> google.protobuf.Any 2, // 64: c1.connectorapi.baton.v1.BatonService.Hello:input_type -> c1.connectorapi.baton.v1.BatonServiceHelloRequest 4, // 65: c1.connectorapi.baton.v1.BatonService.GetTask:input_type -> c1.connectorapi.baton.v1.BatonServiceGetTaskRequest 6, // 66: c1.connectorapi.baton.v1.BatonService.Heartbeat:input_type -> c1.connectorapi.baton.v1.BatonServiceHeartbeatRequest 10, // 67: c1.connectorapi.baton.v1.BatonService.FinishTask:input_type -> c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest 8, // 68: c1.connectorapi.baton.v1.BatonService.UploadAsset:input_type -> c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest - 3, // 69: c1.connectorapi.baton.v1.BatonService.Hello:output_type -> c1.connectorapi.baton.v1.BatonServiceHelloResponse - 5, // 70: c1.connectorapi.baton.v1.BatonService.GetTask:output_type -> c1.connectorapi.baton.v1.BatonServiceGetTaskResponse - 7, // 71: c1.connectorapi.baton.v1.BatonService.Heartbeat:output_type -> c1.connectorapi.baton.v1.BatonServiceHeartbeatResponse - 11, // 72: c1.connectorapi.baton.v1.BatonService.FinishTask:output_type -> c1.connectorapi.baton.v1.BatonServiceFinishTaskResponse - 9, // 73: c1.connectorapi.baton.v1.BatonService.UploadAsset:output_type -> c1.connectorapi.baton.v1.BatonServiceUploadAssetResponse - 69, // [69:74] is the sub-list for method output_type - 64, // [64:69] is the sub-list for method input_type + 12, // 69: c1.connectorapi.baton.v1.BatonService.StartDebugging:input_type -> c1.connectorapi.baton.v1.StartDebuggingRequest + 3, // 70: c1.connectorapi.baton.v1.BatonService.Hello:output_type -> c1.connectorapi.baton.v1.BatonServiceHelloResponse + 5, // 71: c1.connectorapi.baton.v1.BatonService.GetTask:output_type -> c1.connectorapi.baton.v1.BatonServiceGetTaskResponse + 7, // 72: c1.connectorapi.baton.v1.BatonService.Heartbeat:output_type -> c1.connectorapi.baton.v1.BatonServiceHeartbeatResponse + 11, // 73: c1.connectorapi.baton.v1.BatonService.FinishTask:output_type -> c1.connectorapi.baton.v1.BatonServiceFinishTaskResponse + 9, // 74: c1.connectorapi.baton.v1.BatonService.UploadAsset:output_type -> c1.connectorapi.baton.v1.BatonServiceUploadAssetResponse + 13, // 75: c1.connectorapi.baton.v1.BatonService.StartDebugging:output_type -> c1.connectorapi.baton.v1.StartDebuggingResponse + 70, // [70:76] is the sub-list for method output_type + 64, // [64:70] is the sub-list for method input_type 64, // [64:64] is the sub-list for extension type_name 64, // [64:64] is the sub-list for extension extendee 0, // [0:64] is the sub-list for field type_name @@ -2919,7 +3029,7 @@ func file_c1_connectorapi_baton_v1_baton_proto_init() { } } file_c1_connectorapi_baton_v1_baton_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Task_NoneTask); i { + switch v := v.(*StartDebuggingRequest); i { case 0: return &v.state case 1: @@ -2931,7 +3041,7 @@ func file_c1_connectorapi_baton_v1_baton_proto_init() { } } file_c1_connectorapi_baton_v1_baton_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Task_HelloTask); i { + switch v := v.(*StartDebuggingResponse); i { case 0: return &v.state case 1: @@ -2943,7 +3053,7 @@ func file_c1_connectorapi_baton_v1_baton_proto_init() { } } file_c1_connectorapi_baton_v1_baton_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Task_SyncFullTask); i { + switch v := v.(*Task_NoneTask); i { case 0: return &v.state case 1: @@ -2955,7 +3065,7 @@ func file_c1_connectorapi_baton_v1_baton_proto_init() { } } file_c1_connectorapi_baton_v1_baton_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Task_EventFeedTask); i { + switch v := v.(*Task_HelloTask); i { case 0: return &v.state case 1: @@ -2967,7 +3077,7 @@ func file_c1_connectorapi_baton_v1_baton_proto_init() { } } file_c1_connectorapi_baton_v1_baton_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Task_GrantTask); i { + switch v := v.(*Task_SyncFullTask); i { case 0: return &v.state case 1: @@ -2979,7 +3089,7 @@ func file_c1_connectorapi_baton_v1_baton_proto_init() { } } file_c1_connectorapi_baton_v1_baton_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Task_RevokeTask); i { + switch v := v.(*Task_EventFeedTask); i { case 0: return &v.state case 1: @@ -2991,7 +3101,7 @@ func file_c1_connectorapi_baton_v1_baton_proto_init() { } } file_c1_connectorapi_baton_v1_baton_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Task_CreateAccountTask); i { + switch v := v.(*Task_GrantTask); i { case 0: return &v.state case 1: @@ -3003,7 +3113,7 @@ func file_c1_connectorapi_baton_v1_baton_proto_init() { } } file_c1_connectorapi_baton_v1_baton_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Task_CreateResourceTask); i { + switch v := v.(*Task_RevokeTask); i { case 0: return &v.state case 1: @@ -3015,7 +3125,7 @@ func file_c1_connectorapi_baton_v1_baton_proto_init() { } } file_c1_connectorapi_baton_v1_baton_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Task_DeleteResourceTask); i { + switch v := v.(*Task_CreateAccountTask); i { case 0: return &v.state case 1: @@ -3027,7 +3137,7 @@ func file_c1_connectorapi_baton_v1_baton_proto_init() { } } file_c1_connectorapi_baton_v1_baton_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Task_RotateCredentialsTask); i { + switch v := v.(*Task_CreateResourceTask); i { case 0: return &v.state case 1: @@ -3039,7 +3149,7 @@ func file_c1_connectorapi_baton_v1_baton_proto_init() { } } file_c1_connectorapi_baton_v1_baton_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Task_CreateTicketTask); i { + switch v := v.(*Task_DeleteResourceTask); i { case 0: return &v.state case 1: @@ -3051,7 +3161,7 @@ func file_c1_connectorapi_baton_v1_baton_proto_init() { } } file_c1_connectorapi_baton_v1_baton_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Task_ListTicketSchemasTask); i { + switch v := v.(*Task_RotateCredentialsTask); i { case 0: return &v.state case 1: @@ -3063,7 +3173,7 @@ func file_c1_connectorapi_baton_v1_baton_proto_init() { } } file_c1_connectorapi_baton_v1_baton_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Task_GetTicketTask); i { + switch v := v.(*Task_CreateTicketTask); i { case 0: return &v.state case 1: @@ -3075,7 +3185,7 @@ func file_c1_connectorapi_baton_v1_baton_proto_init() { } } file_c1_connectorapi_baton_v1_baton_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*BatonServiceHelloRequest_BuildInfo); i { + switch v := v.(*Task_ListTicketSchemasTask); i { case 0: return &v.state case 1: @@ -3087,7 +3197,7 @@ func file_c1_connectorapi_baton_v1_baton_proto_init() { } } file_c1_connectorapi_baton_v1_baton_proto_msgTypes[25].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*BatonServiceHelloRequest_OSInfo); i { + switch v := v.(*Task_GetTicketTask); i { case 0: return &v.state case 1: @@ -3099,7 +3209,7 @@ func file_c1_connectorapi_baton_v1_baton_proto_init() { } } file_c1_connectorapi_baton_v1_baton_proto_msgTypes[26].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*BatonServiceUploadAssetRequest_UploadMetadata); i { + switch v := v.(*BatonServiceHelloRequest_BuildInfo); i { case 0: return &v.state case 1: @@ -3111,7 +3221,7 @@ func file_c1_connectorapi_baton_v1_baton_proto_init() { } } file_c1_connectorapi_baton_v1_baton_proto_msgTypes[27].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*BatonServiceUploadAssetRequest_UploadData); i { + switch v := v.(*BatonServiceHelloRequest_OSInfo); i { case 0: return &v.state case 1: @@ -3123,7 +3233,7 @@ func file_c1_connectorapi_baton_v1_baton_proto_init() { } } file_c1_connectorapi_baton_v1_baton_proto_msgTypes[28].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*BatonServiceUploadAssetRequest_UploadEOF); i { + switch v := v.(*BatonServiceUploadAssetRequest_UploadMetadata); i { case 0: return &v.state case 1: @@ -3135,7 +3245,7 @@ func file_c1_connectorapi_baton_v1_baton_proto_init() { } } file_c1_connectorapi_baton_v1_baton_proto_msgTypes[29].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*BatonServiceFinishTaskRequest_Error); i { + switch v := v.(*BatonServiceUploadAssetRequest_UploadData); i { case 0: return &v.state case 1: @@ -3147,6 +3257,30 @@ func file_c1_connectorapi_baton_v1_baton_proto_init() { } } file_c1_connectorapi_baton_v1_baton_proto_msgTypes[30].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*BatonServiceUploadAssetRequest_UploadEOF); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_c1_connectorapi_baton_v1_baton_proto_msgTypes[31].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*BatonServiceFinishTaskRequest_Error); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_c1_connectorapi_baton_v1_baton_proto_msgTypes[32].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*BatonServiceFinishTaskRequest_Success); i { case 0: return &v.state @@ -3189,7 +3323,7 @@ func file_c1_connectorapi_baton_v1_baton_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_c1_connectorapi_baton_v1_baton_proto_rawDesc, NumEnums: 1, - NumMessages: 31, + NumMessages: 33, NumExtensions: 0, NumServices: 1, }, diff --git a/vendor/github.com/conductorone/baton-sdk/pb/c1/connectorapi/baton/v1/baton.pb.validate.go b/vendor/github.com/conductorone/baton-sdk/pb/c1/connectorapi/baton/v1/baton.pb.validate.go index a5aeb0a9..ab18837d 100644 --- a/vendor/github.com/conductorone/baton-sdk/pb/c1/connectorapi/baton/v1/baton.pb.validate.go +++ b/vendor/github.com/conductorone/baton-sdk/pb/c1/connectorapi/baton/v1/baton.pb.validate.go @@ -60,6 +60,8 @@ func (m *Task) validate(all bool) error { // no validation rules for Status + // no validation rules for Debug + switch v := m.TaskType.(type) { case *Task_None: if v == nil { @@ -2554,6 +2556,212 @@ var _ interface { ErrorName() string } = BatonServiceFinishTaskResponseValidationError{} +// Validate checks the field values on StartDebuggingRequest with the rules +// defined in the proto definition for this message. If any rules are +// violated, the first error encountered is returned, or nil if there are no violations. +func (m *StartDebuggingRequest) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on StartDebuggingRequest with the rules +// defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// StartDebuggingRequestMultiError, or nil if none found. +func (m *StartDebuggingRequest) ValidateAll() error { + return m.validate(true) +} + +func (m *StartDebuggingRequest) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if len(errors) > 0 { + return StartDebuggingRequestMultiError(errors) + } + + return nil +} + +// StartDebuggingRequestMultiError is an error wrapping multiple validation +// errors returned by StartDebuggingRequest.ValidateAll() if the designated +// constraints aren't met. +type StartDebuggingRequestMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m StartDebuggingRequestMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m StartDebuggingRequestMultiError) AllErrors() []error { return m } + +// StartDebuggingRequestValidationError is the validation error returned by +// StartDebuggingRequest.Validate if the designated constraints aren't met. +type StartDebuggingRequestValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e StartDebuggingRequestValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e StartDebuggingRequestValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e StartDebuggingRequestValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e StartDebuggingRequestValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e StartDebuggingRequestValidationError) ErrorName() string { + return "StartDebuggingRequestValidationError" +} + +// Error satisfies the builtin error interface +func (e StartDebuggingRequestValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sStartDebuggingRequest.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = StartDebuggingRequestValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = StartDebuggingRequestValidationError{} + +// Validate checks the field values on StartDebuggingResponse with the rules +// defined in the proto definition for this message. If any rules are +// violated, the first error encountered is returned, or nil if there are no violations. +func (m *StartDebuggingResponse) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on StartDebuggingResponse with the rules +// defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// StartDebuggingResponseMultiError, or nil if none found. +func (m *StartDebuggingResponse) ValidateAll() error { + return m.validate(true) +} + +func (m *StartDebuggingResponse) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for Status + + if len(errors) > 0 { + return StartDebuggingResponseMultiError(errors) + } + + return nil +} + +// StartDebuggingResponseMultiError is an error wrapping multiple validation +// errors returned by StartDebuggingResponse.ValidateAll() if the designated +// constraints aren't met. +type StartDebuggingResponseMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m StartDebuggingResponseMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m StartDebuggingResponseMultiError) AllErrors() []error { return m } + +// StartDebuggingResponseValidationError is the validation error returned by +// StartDebuggingResponse.Validate if the designated constraints aren't met. +type StartDebuggingResponseValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e StartDebuggingResponseValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e StartDebuggingResponseValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e StartDebuggingResponseValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e StartDebuggingResponseValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e StartDebuggingResponseValidationError) ErrorName() string { + return "StartDebuggingResponseValidationError" +} + +// Error satisfies the builtin error interface +func (e StartDebuggingResponseValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sStartDebuggingResponse.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = StartDebuggingResponseValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = StartDebuggingResponseValidationError{} + // Validate checks the field values on Task_NoneTask with the rules defined in // the proto definition for this message. If any rules are violated, the first // error encountered is returned, or nil if there are no violations. diff --git a/vendor/github.com/conductorone/baton-sdk/pb/c1/connectorapi/baton/v1/baton_grpc.pb.go b/vendor/github.com/conductorone/baton-sdk/pb/c1/connectorapi/baton/v1/baton_grpc.pb.go index a830fd3b..3529de4f 100644 --- a/vendor/github.com/conductorone/baton-sdk/pb/c1/connectorapi/baton/v1/baton_grpc.pb.go +++ b/vendor/github.com/conductorone/baton-sdk/pb/c1/connectorapi/baton/v1/baton_grpc.pb.go @@ -27,6 +27,7 @@ type BatonServiceClient interface { Heartbeat(ctx context.Context, in *BatonServiceHeartbeatRequest, opts ...grpc.CallOption) (*BatonServiceHeartbeatResponse, error) FinishTask(ctx context.Context, in *BatonServiceFinishTaskRequest, opts ...grpc.CallOption) (*BatonServiceFinishTaskResponse, error) UploadAsset(ctx context.Context, opts ...grpc.CallOption) (BatonService_UploadAssetClient, error) + StartDebugging(ctx context.Context, in *StartDebuggingRequest, opts ...grpc.CallOption) (*StartDebuggingResponse, error) } type batonServiceClient struct { @@ -107,6 +108,15 @@ func (x *batonServiceUploadAssetClient) CloseAndRecv() (*BatonServiceUploadAsset return m, nil } +func (c *batonServiceClient) StartDebugging(ctx context.Context, in *StartDebuggingRequest, opts ...grpc.CallOption) (*StartDebuggingResponse, error) { + out := new(StartDebuggingResponse) + err := c.cc.Invoke(ctx, "/c1.connectorapi.baton.v1.BatonService/StartDebugging", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // BatonServiceServer is the server API for BatonService service. // All implementations should embed UnimplementedBatonServiceServer // for forward compatibility @@ -116,6 +126,7 @@ type BatonServiceServer interface { Heartbeat(context.Context, *BatonServiceHeartbeatRequest) (*BatonServiceHeartbeatResponse, error) FinishTask(context.Context, *BatonServiceFinishTaskRequest) (*BatonServiceFinishTaskResponse, error) UploadAsset(BatonService_UploadAssetServer) error + StartDebugging(context.Context, *StartDebuggingRequest) (*StartDebuggingResponse, error) } // UnimplementedBatonServiceServer should be embedded to have forward compatible implementations. @@ -137,6 +148,9 @@ func (UnimplementedBatonServiceServer) FinishTask(context.Context, *BatonService func (UnimplementedBatonServiceServer) UploadAsset(BatonService_UploadAssetServer) error { return status.Errorf(codes.Unimplemented, "method UploadAsset not implemented") } +func (UnimplementedBatonServiceServer) StartDebugging(context.Context, *StartDebuggingRequest) (*StartDebuggingResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method StartDebugging not implemented") +} // UnsafeBatonServiceServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to BatonServiceServer will @@ -247,6 +261,24 @@ func (x *batonServiceUploadAssetServer) Recv() (*BatonServiceUploadAssetRequest, return m, nil } +func _BatonService_StartDebugging_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(StartDebuggingRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(BatonServiceServer).StartDebugging(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/c1.connectorapi.baton.v1.BatonService/StartDebugging", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(BatonServiceServer).StartDebugging(ctx, req.(*StartDebuggingRequest)) + } + return interceptor(ctx, in, info, handler) +} + // BatonService_ServiceDesc is the grpc.ServiceDesc for BatonService service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) @@ -270,6 +302,10 @@ var BatonService_ServiceDesc = grpc.ServiceDesc{ MethodName: "FinishTask", Handler: _BatonService_FinishTask_Handler, }, + { + MethodName: "StartDebugging", + Handler: _BatonService_StartDebugging_Handler, + }, }, Streams: []grpc.StreamDesc{ { diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/annotations/annotations.go b/vendor/github.com/conductorone/baton-sdk/pkg/annotations/annotations.go index 19eda948..e1284bd1 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/annotations/annotations.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/annotations/annotations.go @@ -10,7 +10,7 @@ import ( type Annotations []*anypb.Any -// Convenience function to create annotations. +// New - Convenience function to create annotations. func New(msgs ...proto.Message) Annotations { annos := Annotations{} for _, msg := range msgs { diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/cli/commands.go b/vendor/github.com/conductorone/baton-sdk/pkg/cli/commands.go index 34edb0ca..ac89fb59 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/cli/commands.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/cli/commands.go @@ -33,9 +33,13 @@ func MakeMainCommand( getconnector GetConnectorFunc, opts ...connectorrunner.Option, ) func(*cobra.Command, []string) error { - return func(*cobra.Command, []string) error { - // validate required fields and relationship constraints - if err := field.Validate(confschema, v); err != nil { + return func(cmd *cobra.Command, args []string) error { + // NOTE(shackra): bind all the flags (persistent and + // regular) with our instance of Viper, doing this + // anywhere else may fail to communicate to Viper the + // values gathered by Cobra. + err := v.BindPFlags(cmd.Flags()) + if err != nil { return err } @@ -52,6 +56,7 @@ func MakeMainCommand( l := ctxzap.Extract(runCtx) if isService() { + l.Debug("running as service", zap.String("name", name)) runCtx, err = runService(runCtx, name) if err != nil { l.Error("error running service", zap.Error(err)) @@ -59,6 +64,11 @@ func MakeMainCommand( } } + // validate required fields and relationship constraints + if err := field.Validate(confschema, v); err != nil { + return err + } + c, err := getconnector(runCtx, v) if err != nil { return err @@ -79,6 +89,9 @@ func MakeMainCommand( v.GetString("client-secret"), ), ) + if v.GetBool("skip-full-sync") { + opts = append(opts, connectorrunner.WithFullSyncDisabled()) + } } else { switch { case v.GetString("grant-entitlement") != "": @@ -148,6 +161,7 @@ func MakeMainCommand( opts = append(opts, connectorrunner.WithTempDir(v.GetString("c1z-temp-dir"))) } + // NOTE(shackra): top-most in the execution flow for connectors r, err := connectorrunner.NewConnectorRunner(runCtx, c, opts...) if err != nil { l.Error("error creating connector runner", zap.Error(err)) @@ -172,9 +186,13 @@ func MakeGRPCServerCommand( confschema field.Configuration, getconnector GetConnectorFunc, ) func(*cobra.Command, []string) error { - return func(*cobra.Command, []string) error { - // validate required fields and relationship constraints - if err := field.Validate(confschema, v); err != nil { + return func(cmd *cobra.Command, args []string) error { + // NOTE(shackra): bind all the flags (persistent and + // regular) with our instance of Viper, doing this + // anywhere else may fail to communicate to Viper the + // values gathered by Cobra. + err := v.BindPFlags(cmd.Flags()) + if err != nil { return err } @@ -188,6 +206,11 @@ func MakeGRPCServerCommand( return err } + // validate required fields and relationship constraints + if err := field.Validate(confschema, v); err != nil { + return err + } + c, err := getconnector(runCtx, v) if err != nil { return err @@ -203,6 +226,10 @@ func MakeGRPCServerCommand( copts = append(copts, connector.WithTicketingEnabled()) } + if v.GetBool("skip-full-sync") { + copts = append(copts, connector.WithFullSyncDisabled()) + } + switch { case v.GetString("grant-entitlement") != "": copts = append(copts, connector.WithProvisioningEnabled()) @@ -270,9 +297,19 @@ func MakeCapabilitiesCommand( ctx context.Context, name string, v *viper.Viper, + confschema field.Configuration, getconnector GetConnectorFunc, ) func(*cobra.Command, []string) error { - return func(*cobra.Command, []string) error { + return func(cmd *cobra.Command, args []string) error { + // NOTE(shackra): bind all the flags (persistent and + // regular) with our instance of Viper, doing this + // anywhere else may fail to communicate to Viper the + // values gathered by Cobra. + err := v.BindPFlags(cmd.Flags()) + if err != nil { + return err + } + runCtx, err := initLogger( ctx, name, @@ -283,6 +320,11 @@ func MakeCapabilitiesCommand( return err } + // validate required fields and relationship constraints + if err := field.Validate(confschema, v); err != nil { + return err + } + c, err := getconnector(runCtx, v) if err != nil { return err diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/cli/service_windows.go b/vendor/github.com/conductorone/baton-sdk/pkg/cli/service_windows.go index 5ba74988..5ed0fed7 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/cli/service_windows.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/cli/service_windows.go @@ -178,7 +178,7 @@ func stopCmd(name string) *cobra.Command { l.Error("Failed to stop service within 10 seconds.", zap.Error(err)) return changeCtx.Err() - case <-time.After(300 * time.Millisecond): + case <-time.After(1 * time.Second): status, err = s.Query() if err != nil { l.Error("Failed to query service status.", zap.Error(err)) @@ -258,6 +258,7 @@ func getWindowsService(ctx context.Context, name string) (*mgr.Service, func(), l.Error("Failed to connect to service manager.", zap.Error(err)) return nil, func() {}, err } + l.Debug("Connected to service manager.") s, err := m.OpenService(name) if err != nil { @@ -265,6 +266,7 @@ func getWindowsService(ctx context.Context, name string) (*mgr.Service, func(), l.Error("Failed to open service.", zap.Error(err)) return nil, func() {}, err } + l.Debug("Opened service.", zap.String("service_name", name)) return s, func() { s.Close() @@ -281,8 +283,8 @@ func interactiveSetup(ctx context.Context, outputFilePath string, fields []field return fmt.Errorf("field has no name") } - // ignore any fields from the default set - if field.IsFieldAmongDefaultList(vfield) { + // ignore any fields from the default set, except client id and client secret + if field.IsFieldAmongDefaultList(vfield) && vfield.GetName() != "client-id" && vfield.GetName() != "client-secret" { continue } @@ -294,6 +296,13 @@ func interactiveSetup(ctx context.Context, outputFilePath string, fields []field break } + if input == "" { + if vfield.Required { + return fmt.Errorf("required field '%s' cannot be empty", vfield.GetName()) + } + continue + } + switch vfield.GetType() { case reflect.Bool: b, err := strconv.ParseBool(input) @@ -379,7 +388,12 @@ func installCmd(name string, fields []field.SchemaField) *cobra.Command { l.Error("Failed to get executable path.", zap.Error(err)) return err } - s, err = svcMgr.CreateService(name, exePath, mgr.Config{DisplayName: name}) + mgrCfg := mgr.Config{ + DisplayName: name, + Description: fmt.Sprintf("ConductorOne %s service", name), + BinaryPathName: exePath, + } + s, err = svcMgr.CreateService(name, exePath, mgrCfg) if err != nil { l.Error("Failed to create service.", zap.Error(err), zap.String("service_name", name)) return err @@ -449,61 +463,76 @@ func uninstallCmd(name string) *cobra.Command { } type batonService struct { + name string ctx context.Context elog debug.Log } func (s *batonService) Execute(args []string, r <-chan svc.ChangeRequest, changes chan<- svc.Status) (ssec bool, errno uint32) { + ctx, err := initLogger(s.ctx, s.name, logging.WithLogFormat(logging.LogFormatConsole), logging.WithLogLevel("info")) + if err != nil { + s.elog.Error(1, fmt.Sprintf("Failed to initialize logger. %v", err)) + return false, 1 + } + l := ctxzap.Extract(ctx) + l.Info("Executing service.") changes <- svc.Status{State: svc.StartPending} - s.elog.Info(1, "Starting service.") + s.elog.Info(1, fmt.Sprintf("Starting %s service.", s.name)) changes <- svc.Status{State: svc.Running, Accepts: svc.AcceptStop | svc.AcceptShutdown} - s.elog.Info(1, "Started service.") + s.elog.Info(1, fmt.Sprintf("Started %s service.", s.name)) outer: for { select { case <-s.ctx.Done(): - s.elog.Info(1, "Service context done. Shutting down.") + l.Info("Service context done. Shutting down") + s.elog.Info(1, fmt.Sprintf("%s service context done. Shutting down.", s.name)) break outer case c := <-r: switch c.Cmd { case svc.Interrogate: changes <- c.CurrentStatus case svc.Stop, svc.Shutdown: - s.elog.Info(1, "Received stop/shutdown request. Stopping service.") + l.Info("Received stop/shutdown request. Stopping service.") + s.elog.Info(1, fmt.Sprintf("Received stop/shutdown request. Stopping %s service.", s.name)) break outer default: - s.elog.Error(1, fmt.Sprintf("Unexpected control request #%d", c.Cmd)) + s.elog.Error(1, fmt.Sprintf("Unexpected control request #%d", c)) } } } + l.Info("Service stopped.") changes <- svc.Status{State: svc.StopPending} - s.elog.Info(1, "Service stopped.") + s.elog.Info(1, fmt.Sprintf("%s service stopped.", s.name)) return false, 0 } func runService(ctx context.Context, name string) (context.Context, error) { l := ctxzap.Extract(ctx) - l.Info("Running service.") ctx, cancel := context.WithCancelCause(ctx) + var elog debug.Log go func() { defer cancel(nil) - elog, err := eventlog.Open(name) + var err error + elog, err = eventlog.Open(name) if err != nil { l.Error("Failed to open event log.", zap.Error(err)) } defer elog.Close() err = svc.Run(name, &batonService{ + name: name, ctx: ctx, elog: elog, }) if err != nil { - l.Error("Service failed.", zap.Error(err)) + elog.Error(1, fmt.Sprintf("Running %v service failed. %v", name, err)) + } else { + elog.Info(1, fmt.Sprintf("%v service is running.", name)) } }() diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/config/config.go b/vendor/github.com/conductorone/baton-sdk/pkg/config/config.go index 45d2b093..291192df 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/config/config.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/config/config.go @@ -43,10 +43,6 @@ func DefineConfiguration( v.SetEnvKeyReplacer(strings.NewReplacer("-", "_")) v.AutomaticEnv() - // add default fields and constrains - schema.Fields = field.EnsureDefaultFieldsExists(schema.Fields) - schema.Constraints = field.EnsureDefaultRelationships(schema.Constraints) - // setup CLI with cobra mainCMD := &cobra.Command{ Use: connectorName, @@ -55,60 +51,178 @@ func DefineConfiguration( SilenceUsage: true, RunE: cli.MakeMainCommand(ctx, connectorName, v, schema, connector, options...), } + // set persistent flags only on the main subcommand + err = setFlagsAndConstraints(mainCMD, field.NewConfiguration(field.DefaultFields, field.DefaultRelationships...)) + if err != nil { + return nil, nil, err + } + + // set the rest of flags + err = setFlagsAndConstraints(mainCMD, schema) + if err != nil { + return nil, nil, err + } + + grpcServerCmd := &cobra.Command{ + Use: "_connector-service", + Short: "Start the connector service", + Hidden: true, + RunE: cli.MakeGRPCServerCommand(ctx, connectorName, v, schema, connector), + } + err = setFlagsAndConstraints(grpcServerCmd, schema) + if err != nil { + return nil, nil, err + } + mainCMD.AddCommand(grpcServerCmd) + + capabilitiesCmd := &cobra.Command{ + Use: "capabilities", + Short: "Get connector capabilities", + RunE: cli.MakeCapabilitiesCommand(ctx, connectorName, v, schema, connector), + } + err = setFlagsAndConstraints(capabilitiesCmd, schema) + if err != nil { + return nil, nil, err + } + mainCMD.AddCommand(capabilitiesCmd) + + mainCMD.AddCommand(cli.AdditionalCommands(connectorName, schema.Fields)...) + + // NOTE(shackra): Set all values from Viper to the flags so + // that Cobra won't complain that a flag is missing in case we + // pass values through environment variables + + // main subcommand + mainCMD.Flags().VisitAll(func(f *pflag.Flag) { + if v.IsSet(f.Name) { + _ = mainCMD.Flags().Set(f.Name, v.GetString(f.Name)) + } + }) + + // children process subcommand + grpcServerCmd.Flags().VisitAll(func(f *pflag.Flag) { + if v.IsSet(f.Name) { + _ = grpcServerCmd.Flags().Set(f.Name, v.GetString(f.Name)) + } + }) - // add options to the main command + // capabilities subcommand + capabilitiesCmd.Flags().VisitAll(func(f *pflag.Flag) { + if v.IsSet(f.Name) { + _ = capabilitiesCmd.Flags().Set(f.Name, v.GetString(f.Name)) + } + }) + + return v, mainCMD, nil +} + +func listFieldConstrainsAsStrings(constrains field.SchemaFieldRelationship) []string { + var fields []string + for _, v := range constrains.Fields { + fields = append(fields, v.FieldName) + } + + return fields +} + +func cleanOrGetConfigPath(customPath string) (string, string, error) { + if customPath != "" { + cfgDir, cfgFile := filepath.Split(filepath.Clean(customPath)) + if cfgDir == "" { + cfgDir = "." + } + + ext := filepath.Ext(cfgFile) + if ext == "" || (ext != ".yaml" && ext != ".yml") { + return "", "", errors.New("expected config file to have .yaml or .yml extension") + } + + return strings.TrimSuffix( + cfgDir, + string(filepath.Separator), + ), strings.TrimSuffix( + cfgFile, + ext, + ), nil + } + + return ".", ".baton", nil +} + +func setFlagsAndConstraints(command *cobra.Command, schema field.Configuration) error { + // add options for _, field := range schema.Fields { switch field.FieldType { case reflect.Bool: value, err := field.Bool() if err != nil { - return nil, nil, fmt.Errorf( + return fmt.Errorf( "field %s, %s: %w", field.FieldName, field.FieldType, err, ) } - mainCMD.PersistentFlags(). - BoolP(field.FieldName, field.CLIShortHand, value, field.GetDescription()) + if field.Persistent { + command.PersistentFlags(). + BoolP(field.FieldName, field.CLIShortHand, value, field.GetDescription()) + } else { + command.Flags(). + BoolP(field.FieldName, field.CLIShortHand, value, field.GetDescription()) + } case reflect.Int: value, err := field.Int() if err != nil { - return nil, nil, fmt.Errorf( + return fmt.Errorf( "field %s, %s: %w", field.FieldName, field.FieldType, err, ) } - mainCMD.PersistentFlags(). - IntP(field.FieldName, field.CLIShortHand, value, field.GetDescription()) + if field.Persistent { + command.PersistentFlags(). + IntP(field.FieldName, field.CLIShortHand, value, field.GetDescription()) + } else { + command.Flags(). + IntP(field.FieldName, field.CLIShortHand, value, field.GetDescription()) + } case reflect.String: value, err := field.String() if err != nil { - return nil, nil, fmt.Errorf( + return fmt.Errorf( "field %s, %s: %w", field.FieldName, field.FieldType, err, ) } - mainCMD.PersistentFlags(). - StringP(field.FieldName, field.CLIShortHand, value, field.GetDescription()) + if field.Persistent { + command.PersistentFlags(). + StringP(field.FieldName, field.CLIShortHand, value, field.GetDescription()) + } else { + command.Flags(). + StringP(field.FieldName, field.CLIShortHand, value, field.GetDescription()) + } case reflect.Slice: value, err := field.StringSlice() if err != nil { - return nil, nil, fmt.Errorf( + return fmt.Errorf( "field %s, %s: %w", field.FieldName, field.FieldType, err, ) } - mainCMD.PersistentFlags(). - StringSliceP(field.FieldName, field.CLIShortHand, value, field.GetDescription()) + if field.Persistent { + command.PersistentFlags(). + StringSliceP(field.FieldName, field.CLIShortHand, value, field.GetDescription()) + } else { + command.Flags(). + StringSliceP(field.FieldName, field.CLIShortHand, value, field.GetDescription()) + } default: - return nil, nil, fmt.Errorf( + return fmt.Errorf( "field %s, %s is not yet supported", field.FieldName, field.FieldType, @@ -117,31 +231,55 @@ func DefineConfiguration( // mark hidden if field.Hidden { - err := mainCMD.PersistentFlags().MarkHidden(field.FieldName) - if err != nil { - return nil, nil, fmt.Errorf( - "cannot hide field %s, %s: %w", - field.FieldName, - field.FieldType, - err, - ) + if field.Persistent { + err := command.PersistentFlags().MarkHidden(field.FieldName) + if err != nil { + return fmt.Errorf( + "cannot hide persistent field %s, %s: %w", + field.FieldName, + field.FieldType, + err, + ) + } + } else { + err := command.Flags().MarkHidden(field.FieldName) + if err != nil { + return fmt.Errorf( + "cannot hide field %s, %s: %w", + field.FieldName, + field.FieldType, + err, + ) + } } } // mark required if field.Required { if field.FieldType == reflect.Bool { - return nil, nil, fmt.Errorf("requiring %s of type %s does not make sense", field.FieldName, field.FieldType) + return fmt.Errorf("requiring %s of type %s does not make sense", field.FieldName, field.FieldType) } - err := mainCMD.MarkPersistentFlagRequired(field.FieldName) - if err != nil { - return nil, nil, fmt.Errorf( - "cannot require field %s, %s: %w", - field.FieldName, - field.FieldType, - err, - ) + if field.Persistent { + err := command.MarkPersistentFlagRequired(field.FieldName) + if err != nil { + return fmt.Errorf( + "cannot require persistent field %s, %s: %w", + field.FieldName, + field.FieldType, + err, + ) + } + } else { + err := command.MarkFlagRequired(field.FieldName) + if err != nil { + return fmt.Errorf( + "cannot require field %s, %s: %w", + field.FieldName, + field.FieldType, + err, + ) + } } } } @@ -150,79 +288,17 @@ func DefineConfiguration( for _, constrain := range schema.Constraints { switch constrain.Kind { case field.MutuallyExclusive: - mainCMD.MarkFlagsMutuallyExclusive(listFieldConstrainsAsStrings(constrain)...) + command.MarkFlagsMutuallyExclusive(listFieldConstrainsAsStrings(constrain)...) case field.RequiredTogether: - mainCMD.MarkFlagsRequiredTogether(listFieldConstrainsAsStrings(constrain)...) + command.MarkFlagsRequiredTogether(listFieldConstrainsAsStrings(constrain)...) case field.AtLeastOne: - mainCMD.MarkFlagsOneRequired(listFieldConstrainsAsStrings(constrain)...) + command.MarkFlagsOneRequired(listFieldConstrainsAsStrings(constrain)...) case field.Dependents: // do nothing + default: + return fmt.Errorf("invalid config") } } - if err := v.BindPFlags(mainCMD.PersistentFlags()); err != nil { - return nil, nil, err - } - if err := v.BindPFlags(mainCMD.Flags()); err != nil { - return nil, nil, err - } - - grpcServerCmd := &cobra.Command{ - Use: "_connector-service", - Short: "Start the connector service", - Hidden: true, - RunE: cli.MakeGRPCServerCommand(ctx, connectorName, v, schema, connector), - } - mainCMD.AddCommand(grpcServerCmd) - - capabilitiesCmd := &cobra.Command{ - Use: "capabilities", - Short: "Get connector capabilities", - RunE: cli.MakeCapabilitiesCommand(ctx, connectorName, v, connector), - } - mainCMD.AddCommand(capabilitiesCmd) - - mainCMD.AddCommand(cli.AdditionalCommands(name, schema.Fields)...) - - // NOTE (shackra): we don't check subcommands (i.e.: grpcServerCmd and capabilitiesCmd) - mainCMD.PersistentFlags().VisitAll(func(f *pflag.Flag) { - if v.IsSet(f.Name) { - _ = mainCMD.Flags().Set(f.Name, v.GetString(f.Name)) - } - }) - - return v, mainCMD, nil -} - -func listFieldConstrainsAsStrings(constrains field.SchemaFieldRelationship) []string { - var fields []string - for _, v := range constrains.Fields { - fields = append(fields, v.FieldName) - } - - return fields -} - -func cleanOrGetConfigPath(customPath string) (string, string, error) { - if customPath != "" { - cfgDir, cfgFile := filepath.Split(filepath.Clean(customPath)) - if cfgDir == "" { - cfgDir = "." - } - - ext := filepath.Ext(cfgFile) - if ext == "" || (ext != ".yaml" && ext != ".yml") { - return "", "", errors.New("expected config file to have .yaml or .yml extension") - } - - return strings.TrimSuffix( - cfgDir, - string(filepath.Separator), - ), strings.TrimSuffix( - cfgFile, - ext, - ), nil - } - - return ".", ".baton", nil + return nil } diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/connectorbuilder/connectorbuilder.go b/vendor/github.com/conductorone/baton-sdk/pkg/connectorbuilder/connectorbuilder.go index 48616d4a..a66b6ec5 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/connectorbuilder/connectorbuilder.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/connectorbuilder/connectorbuilder.go @@ -21,6 +21,7 @@ import ( "github.com/conductorone/baton-sdk/pkg/pagination" "github.com/conductorone/baton-sdk/pkg/types" "github.com/conductorone/baton-sdk/pkg/types/tasks" + "github.com/conductorone/baton-sdk/pkg/uhttp" ) type ResourceSyncer interface { @@ -138,16 +139,22 @@ func (b *builderImpl) CreateTicket(ctx context.Context, request *v2.TicketsServi DisplayName: reqBody.GetDisplayName(), Description: reqBody.GetDescription(), Status: reqBody.GetStatus(), - Type: reqBody.GetType(), Labels: reqBody.GetLabels(), CustomFields: reqBody.GetCustomFields(), RequestedFor: reqBody.GetRequestedFor(), } ticket, annos, err := b.ticketManager.CreateTicket(ctx, cTicket, request.GetSchema()) + var resp *v2.TicketsServiceCreateTicketResponse if err != nil { b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start)) - return nil, fmt.Errorf("error: creating ticket failed: %w", err) + if ticket != nil { + resp = &v2.TicketsServiceCreateTicketResponse{ + Ticket: ticket, + Annotations: annos, + } + } + return resp, fmt.Errorf("error: creating ticket failed: %w", err) } b.m.RecordTaskSuccess(ctx, tt, b.nowFunc().Sub(start)) @@ -165,10 +172,17 @@ func (b *builderImpl) GetTicket(ctx context.Context, request *v2.TicketsServiceG return nil, fmt.Errorf("error: ticket manager not implemented") } + var resp *v2.TicketsServiceGetTicketResponse ticket, annos, err := b.ticketManager.GetTicket(ctx, request.GetId()) if err != nil { b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start)) - return nil, fmt.Errorf("error: getting ticket failed: %w", err) + if ticket != nil { + resp = &v2.TicketsServiceGetTicketResponse{ + Ticket: ticket, + Annotations: annos, + } + } + return resp, fmt.Errorf("error: getting ticket failed: %w", err) } b.m.RecordTaskSuccess(ctx, tt, b.nowFunc().Sub(start)) @@ -338,6 +352,13 @@ func (b *builderImpl) ListResourceTypes( tt := tasks.ListResourceTypesType var out []*v2.ResourceType + l := ctxzap.Extract(ctx) + // Clear all http caches at the start of a sync. This must be run in the child process, which is why it's in this function and not in syncer.go + err := uhttp.ClearCaches(ctx) + if err != nil { + l.Warn("error clearing http caches", zap.Error(err)) + } + for _, rb := range b.resourceBuilders { out = append(out, rb.ResourceType(ctx)) } @@ -360,21 +381,22 @@ func (b *builderImpl) ListResources(ctx context.Context, request *v2.ResourcesSe Size: int(request.PageSize), Token: request.PageToken, }) + resp := &v2.ResourcesServiceListResourcesResponse{ + List: out, + NextPageToken: nextPageToken, + Annotations: annos, + } if err != nil { b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start)) - return nil, fmt.Errorf("error: listing resources failed: %w", err) + return resp, fmt.Errorf("error: listing resources failed: %w", err) } if request.PageToken != "" && request.PageToken == nextPageToken { b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start)) - return nil, fmt.Errorf("error: listing resources failed: next page token is the same as the current page token. this is most likely a connector bug") + return resp, fmt.Errorf("error: listing resources failed: next page token is the same as the current page token. this is most likely a connector bug") } b.m.RecordTaskSuccess(ctx, tt, b.nowFunc().Sub(start)) - return &v2.ResourcesServiceListResourcesResponse{ - List: out, - NextPageToken: nextPageToken, - Annotations: annos, - }, nil + return resp, nil } // ListEntitlements returns all the entitlements for a given resource. @@ -391,21 +413,22 @@ func (b *builderImpl) ListEntitlements(ctx context.Context, request *v2.Entitlem Size: int(request.PageSize), Token: request.PageToken, }) + resp := &v2.EntitlementsServiceListEntitlementsResponse{ + List: out, + NextPageToken: nextPageToken, + Annotations: annos, + } if err != nil { b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start)) - return nil, fmt.Errorf("error: listing entitlements failed: %w", err) + return resp, fmt.Errorf("error: listing entitlements failed: %w", err) } if request.PageToken != "" && request.PageToken == nextPageToken { b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start)) - return nil, fmt.Errorf("error: listing entitlements failed: next page token is the same as the current page token. this is most likely a connector bug") + return resp, fmt.Errorf("error: listing entitlements failed: next page token is the same as the current page token. this is most likely a connector bug") } b.m.RecordTaskSuccess(ctx, tt, b.nowFunc().Sub(start)) - return &v2.EntitlementsServiceListEntitlementsResponse{ - List: out, - NextPageToken: nextPageToken, - Annotations: annos, - }, nil + return resp, nil } // ListGrants lists all the grants for a given resource. @@ -423,23 +446,24 @@ func (b *builderImpl) ListGrants(ctx context.Context, request *v2.GrantsServiceL Size: int(request.PageSize), Token: request.PageToken, }) + resp := &v2.GrantsServiceListGrantsResponse{ + List: out, + NextPageToken: nextPageToken, + Annotations: annos, + } if err != nil { b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start)) - return nil, fmt.Errorf("error: listing grants for resource %s/%s failed: %w", rid.ResourceType, rid.Resource, err) + return resp, fmt.Errorf("error: listing grants for resource %s/%s failed: %w", rid.ResourceType, rid.Resource, err) } if request.PageToken != "" && request.PageToken == nextPageToken { b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start)) - return nil, fmt.Errorf("error: listing grants for resource %s/%s failed: next page token is the same as the current page token. this is most likely a connector bug", + return resp, fmt.Errorf("error: listing grants for resource %s/%s failed: next page token is the same as the current page token. this is most likely a connector bug", rid.ResourceType, rid.Resource) } b.m.RecordTaskSuccess(ctx, tt, b.nowFunc().Sub(start)) - return &v2.GrantsServiceListGrantsResponse{ - List: out, - NextPageToken: nextPageToken, - Annotations: annos, - }, nil + return resp, nil } // GetMetadata gets all metadata for a connector. diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/connectorrunner/runner.go b/vendor/github.com/conductorone/baton-sdk/pkg/connectorrunner/runner.go index 86a3f390..f57889fd 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/connectorrunner/runner.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/connectorrunner/runner.go @@ -6,12 +6,15 @@ import ( "fmt" "os" "os/signal" + "path/filepath" + "strings" "time" "golang.org/x/sync/semaphore" "github.com/grpc-ecosystem/go-grpc-middleware/logging/zap/ctxzap" "go.uber.org/zap" + "go.uber.org/zap/zapcore" "google.golang.org/protobuf/types/known/durationpb" v1 "github.com/conductorone/baton-sdk/pb/c1/connectorapi/baton/v1" @@ -30,9 +33,10 @@ const ( ) type connectorRunner struct { - cw types.ClientWrapper - oneShot bool - tasks tasks.Manager + cw types.ClientWrapper + oneShot bool + tasks tasks.Manager + debugFile *os.File } var ErrSigTerm = errors.New("context cancelled by process shutdown") @@ -42,6 +46,28 @@ func (c *connectorRunner) Run(ctx context.Context) error { ctx, cancel := context.WithCancelCause(ctx) defer cancel(ErrSigTerm) + if c.tasks.ShouldDebug() && c.debugFile == nil { + var err error + c.debugFile, err = os.Create(filepath.Join(c.tasks.GetTempDir(), "debug.log")) + if err != nil { + return err + } + } + + // modify the context to insert a logger directed to a file + if c.debugFile != nil { + l := ctxzap.Extract(ctx) + writeSyncer := zapcore.AddSync(c.debugFile) + encoder := zapcore.NewJSONEncoder(zap.NewProductionEncoderConfig()) + core := zapcore.NewCore(encoder, writeSyncer, zapcore.DebugLevel) + + l = l.WithOptions(zap.WrapCore(func(c zapcore.Core) zapcore.Core { + return zapcore.NewTee(c, core) + })) + + ctx = ctxzap.ToContext(ctx, l) + } + sigChan := make(chan os.Signal, 1) signal.Notify(sigChan, os.Interrupt) go func() { @@ -103,8 +129,9 @@ func (c *connectorRunner) run(ctx context.Context) error { waitDuration := time.Second * 0 errCount := 0 + stopForLoop := false var err error - for { + for !stopForLoop { select { case <-ctx.Done(): return c.handleContextCancel(ctx) @@ -169,7 +196,11 @@ func (c *connectorRunner) run(ctx context.Context) error { defer sem.Release(1) err := c.processTask(ctx, t) if err != nil { + if strings.Contains(err.Error(), "grpc: the client connection is closing") { + stopForLoop = true + } l.Error("runner: error processing task", zap.Error(err), zap.String("task_id", t.Id), zap.String("task_type", tasks.GetType(t).String())) + return } l.Debug("runner: task processed", zap.String("task_id", t.Id), zap.String("task_type", tasks.GetType(t).String())) }(nextTask) @@ -177,6 +208,12 @@ func (c *connectorRunner) run(ctx context.Context) error { l.Debug("runner: dispatched task, waiting for next task", zap.Duration("wait_duration", waitDuration)) } } + + if stopForLoop { + return fmt.Errorf("Unable to communicate with gRPC server") + } + + return nil } func (c *connectorRunner) Close(ctx context.Context) error { @@ -186,6 +223,13 @@ func (c *connectorRunner) Close(ctx context.Context) error { retErr = errors.Join(retErr, err) } + if c.debugFile != nil { + if err := c.debugFile.Close(); err != nil { + retErr = errors.Join(retErr, err) + } + c.debugFile = nil + } + return retErr } @@ -249,6 +293,7 @@ type runnerConfig struct { createTicketConfig *createTicketConfig listTicketSchemasConfig *listTicketSchemasConfig getTicketConfig *getTicketConfig + skipFullSync bool } // WithRateLimiterConfig sets the RateLimiterConfig for a runner. @@ -416,6 +461,13 @@ func WithProvisioningEnabled() Option { } } +func WithFullSyncDisabled() Option { + return func(ctx context.Context, cfg *runnerConfig) error { + cfg.skipFullSync = true + return nil + } +} + func WithTicketingEnabled() Option { return func(ctx context.Context, cfg *runnerConfig) error { cfg.ticketingEnabled = true @@ -485,6 +537,10 @@ func NewConnectorRunner(ctx context.Context, c types.ConnectorServer, opts ...Op wrapperOpts = append(wrapperOpts, connector.WithTicketingEnabled()) } + if cfg.skipFullSync { + wrapperOpts = append(wrapperOpts, connector.WithFullSyncDisabled()) + } + cw, err := connector.NewWrapper(ctx, c, wrapperOpts...) if err != nil { return nil, err @@ -541,7 +597,7 @@ func NewConnectorRunner(ctx context.Context, c types.ConnectorServer, opts ...Op return runner, nil } - tm, err := c1api.NewC1TaskManager(ctx, cfg.clientID, cfg.clientSecret, cfg.tempDir) + tm, err := c1api.NewC1TaskManager(ctx, cfg.clientID, cfg.clientSecret, cfg.tempDir, cfg.skipFullSync) if err != nil { return nil, err } diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/connectorstore/connectorstore.go b/vendor/github.com/conductorone/baton-sdk/pkg/connectorstore/connectorstore.go index 54d3f522..88ac4e5c 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/connectorstore/connectorstore.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/connectorstore/connectorstore.go @@ -33,6 +33,7 @@ type Reader interface { type Writer interface { Reader StartSync(ctx context.Context) (string, bool, error) + StartNewSync(ctx context.Context) (string, error) CurrentSyncStep(ctx context.Context) (string, error) CheckpointSync(ctx context.Context, syncToken string) error EndSync(ctx context.Context) error diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/decoder.go b/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/decoder.go index ee27fd03..e2360c68 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/decoder.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/decoder.go @@ -14,8 +14,8 @@ import ( ) const ( - defaultMaxDecodedSize = 2 * 1024 * 1024 * 1024 // 2GiB - defaultDecoderMaxMemory = 32 * 1024 * 1024 // 32MiB + defaultMaxDecodedSize = 3 * 1024 * 1024 * 1024 // 3GiB + defaultDecoderMaxMemory = 128 * 1024 * 1024 // 128MiB maxDecodedSizeEnvVar = "BATON_DECODER_MAX_DECODED_SIZE_MB" maxDecoderMemorySizeEnv = "BATON_DECODER_MAX_MEMORY_MB" ) @@ -24,8 +24,8 @@ var C1ZFileHeader = []byte("C1ZF\x00") var ( ErrInvalidFile = fmt.Errorf("c1z: invalid file") - ErrMaxSizeExceeded = errors.New("c1z: max decoded size exceeded, increase DecoderMaxDecodedSize") - ErrWindowSizeExceeded = errors.New("c1z: window size exceeded, increase DecoderMaxMemory") + ErrMaxSizeExceeded = fmt.Errorf("c1z: max decoded size exceeded, increase DecoderMaxDecodedSize using %v environment variable", maxDecodedSizeEnvVar) + ErrWindowSizeExceeded = fmt.Errorf("c1z: window size exceeded, increase DecoderMaxMemory using %v environment variable", maxDecoderMemorySizeEnv) ) // ReadHeader reads len(C1ZFileHeader) bytes from the given io.Reader and compares them to C1ZFileHeader, returning an error if they don't match. @@ -167,6 +167,7 @@ func (d *decoder) Read(p []byte) (int, error) { // Do underlying read n, err := d.zd.Read(p) + //nolint:gosec // No risk of overflow/underflow because n is always >= 0. d.decodedBytes += uint64(n) if err != nil { // NOTE(morgabra) This happens if you set a small DecoderMaxMemory diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/sql_helpers.go b/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/sql_helpers.go index 3bd3fb99..968e9277 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/sql_helpers.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/sql_helpers.go @@ -183,7 +183,7 @@ func (c *C1File) listConnectorObjects(ctx context.Context, tableName string, req } // Clamp the page size - pageSize := int(listReq.GetPageSize()) + pageSize := listReq.GetPageSize() if pageSize > maxPageSize || pageSize == 0 { pageSize = maxPageSize } @@ -206,7 +206,7 @@ func (c *C1File) listConnectorObjects(ctx context.Context, tableName string, req } defer rows.Close() - count := 0 + var count uint32 = 0 lastRow := 0 for rows.Next() { count++ diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/sync_runs.go b/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/sync_runs.go index 9bd1eb64..9d1f7a79 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/sync_runs.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/sync_runs.go @@ -120,7 +120,7 @@ func (c *C1File) getFinishedSync(ctx context.Context, offset uint) (*syncRun, er return ret, nil } -func (c *C1File) ListSyncRuns(ctx context.Context, pageToken string, pageSize int) ([]*syncRun, string, error) { +func (c *C1File) ListSyncRuns(ctx context.Context, pageToken string, pageSize uint) ([]*syncRun, string, error) { err := c.validateDb(ctx) if err != nil { return nil, "", err @@ -138,7 +138,7 @@ func (c *C1File) ListSyncRuns(ctx context.Context, pageToken string, pageSize in } q = q.Order(goqu.C("id").Asc()) - q = q.Limit(uint(pageSize + 1)) + q = q.Limit(pageSize + 1) var ret []*syncRun @@ -153,7 +153,7 @@ func (c *C1File) ListSyncRuns(ctx context.Context, pageToken string, pageSize in } defer rows.Close() - count := 0 + var count uint = 0 lastRow := 0 for rows.Next() { count++ @@ -299,29 +299,15 @@ func (c *C1File) StartSync(ctx context.Context) (string, bool, error) { return "", false, err } - syncID := ksuid.New().String() + var syncID string if sync != nil && sync.EndedAt == nil { syncID = sync.ID } else { - q := c.db.Insert(syncRuns.Name()) - q = q.Rows(goqu.Record{ - "sync_id": syncID, - "started_at": time.Now().Format("2006-01-02 15:04:05.999999999"), - "sync_token": "", - }) - - query, args, err := q.ToSQL() - if err != nil { - return "", false, err - } - - _, err = c.db.ExecContext(ctx, query, args...) + syncID, err = c.StartNewSync(ctx) if err != nil { return "", false, err } - newSync = true - c.dbUpdated = true } c.currentSyncID = syncID @@ -329,6 +315,37 @@ func (c *C1File) StartSync(ctx context.Context) (string, bool, error) { return c.currentSyncID, newSync, nil } +func (c *C1File) StartNewSync(ctx context.Context) (string, error) { + // Not sure if we want to do this here + if c.currentSyncID != "" { + return c.currentSyncID, nil + } + + syncID := ksuid.New().String() + + q := c.db.Insert(syncRuns.Name()) + q = q.Rows(goqu.Record{ + "sync_id": syncID, + "started_at": time.Now().Format("2006-01-02 15:04:05.999999999"), + "sync_token": "", + }) + + query, args, err := q.ToSQL() + if err != nil { + return "", err + } + + _, err = c.db.ExecContext(ctx, query, args...) + if err != nil { + return "", err + } + + c.dbUpdated = true + c.currentSyncID = syncID + + return c.currentSyncID, nil +} + func (c *C1File) CurrentSyncStep(ctx context.Context) (string, error) { sr, err := c.getCurrentSync(ctx) if err != nil { diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/field/default_relationships.go b/vendor/github.com/conductorone/baton-sdk/pkg/field/default_relationships.go index f889a02f..35271405 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/field/default_relationships.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/field/default_relationships.go @@ -1,6 +1,6 @@ package field -var defaultRelationship = []SchemaFieldRelationship{ +var DefaultRelationships = []SchemaFieldRelationship{ FieldsRequiredTogether(grantEntitlementField, grantPrincipalField), FieldsRequiredTogether(clientIDField, clientSecretField), FieldsRequiredTogether(createTicketField, ticketTemplatePathField), @@ -28,5 +28,5 @@ var defaultRelationship = []SchemaFieldRelationship{ } func EnsureDefaultRelationships(original []SchemaFieldRelationship) []SchemaFieldRelationship { - return append(defaultRelationship, original...) + return append(DefaultRelationships, original...) } diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/field/defaults.go b/vendor/github.com/conductorone/baton-sdk/pkg/field/defaults.go index ced64e94..5a246f98 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/field/defaults.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/field/defaults.go @@ -3,31 +3,32 @@ package field import "github.com/conductorone/baton-sdk/pkg/logging" var ( - createTicketField = BoolField("create-ticket", WithHidden(true), WithDescription("Create ticket")) - getTicketField = BoolField("get-ticket", WithHidden(true), WithDescription("Get ticket")) - ListTicketSchemasField = BoolField("list-ticket-schemas", WithHidden(true), WithDescription("List ticket schemas")) - provisioningField = BoolField("provisioning", WithShortHand("p"), WithDescription("This must be set in order for provisioning actions to be enabled")) - TicketingField = BoolField("ticketing", WithDescription("This must be set to enable ticketing support")) + createTicketField = BoolField("create-ticket", WithHidden(true), WithDescription("Create ticket"), WithPersistent(true)) + getTicketField = BoolField("get-ticket", WithHidden(true), WithDescription("Get ticket"), WithPersistent(true)) + ListTicketSchemasField = BoolField("list-ticket-schemas", WithHidden(true), WithDescription("List ticket schemas"), WithPersistent(true)) + provisioningField = BoolField("provisioning", WithShortHand("p"), WithDescription("This must be set in order for provisioning actions to be enabled"), WithPersistent(true)) + TicketingField = BoolField("ticketing", WithDescription("This must be set to enable ticketing support"), WithPersistent(true)) c1zTmpDirField = StringField("c1z-temp-dir", WithHidden(true), WithDescription("The directory to store temporary files in. It must exist, "+ - "and write access is required. Defaults to the OS temporary directory.")) - clientIDField = StringField("client-id", WithDescription("The client ID used to authenticate with ConductorOne")) - clientSecretField = StringField("client-secret", WithDescription("The client secret used to authenticate with ConductorOne")) - createAccountEmailField = StringField("create-account-email", WithHidden(true), WithDescription("The email of the account to create")) - createAccountLoginField = StringField("create-account-login", WithHidden(true), WithDescription("The login of the account to create")) - deleteResourceField = StringField("delete-resource", WithHidden(true), WithDescription("The id of the resource to delete")) - deleteResourceTypeField = StringField("delete-resource-type", WithHidden(true), WithDescription("The type of the resource to delete")) - eventFeedField = StringField("event-feed", WithHidden(true), WithDescription("Read feed events to stdout")) - fileField = StringField("file", WithShortHand("f"), WithDefaultValue("sync.c1z"), WithDescription("The path to the c1z file to sync with")) - grantEntitlementField = StringField("grant-entitlement", WithHidden(true), WithDescription("The id of the entitlement to grant to the supplied principal")) - grantPrincipalField = StringField("grant-principal", WithHidden(true), WithDescription("The id of the resource to grant the entitlement to")) - grantPrincipalTypeField = StringField("grant-principal-type", WithHidden(true), WithDescription("The resource type of the principal to grant the entitlement to")) - logFormatField = StringField("log-format", WithDefaultValue(logging.LogFormatJSON), WithDescription("The output format for logs: json, console")) - revokeGrantField = StringField("revoke-grant", WithHidden(true), WithDescription("The grant to revoke")) - rotateCredentialsField = StringField("rotate-credentials", WithHidden(true), WithDescription("The id of the resource to rotate credentials on")) - rotateCredentialsTypeField = StringField("rotate-credentials-type", WithHidden(true), WithDescription("The type of the resource to rotate credentials on")) - ticketIDField = StringField("ticket-id", WithHidden(true), WithDescription("The ID of the ticket to get")) - ticketTemplatePathField = StringField("ticket-template-path", WithHidden(true), WithDescription("A JSON file describing the ticket to create")) - logLevelField = StringField("log-level", WithDefaultValue("info"), WithDescription("The log level: debug, info, warn, error")) + "and write access is required. Defaults to the OS temporary directory."), WithPersistent(true)) + clientIDField = StringField("client-id", WithDescription("The client ID used to authenticate with ConductorOne"), WithPersistent(true)) + clientSecretField = StringField("client-secret", WithDescription("The client secret used to authenticate with ConductorOne"), WithPersistent(true)) + createAccountEmailField = StringField("create-account-email", WithHidden(true), WithDescription("The email of the account to create"), WithPersistent(true)) + createAccountLoginField = StringField("create-account-login", WithHidden(true), WithDescription("The login of the account to create"), WithPersistent(true)) + deleteResourceField = StringField("delete-resource", WithHidden(true), WithDescription("The id of the resource to delete"), WithPersistent(true)) + deleteResourceTypeField = StringField("delete-resource-type", WithHidden(true), WithDescription("The type of the resource to delete"), WithPersistent(true)) + eventFeedField = StringField("event-feed", WithHidden(true), WithDescription("Read feed events to stdout"), WithPersistent(true)) + fileField = StringField("file", WithShortHand("f"), WithDefaultValue("sync.c1z"), WithDescription("The path to the c1z file to sync with"), WithPersistent(true)) + grantEntitlementField = StringField("grant-entitlement", WithHidden(true), WithDescription("The id of the entitlement to grant to the supplied principal"), WithPersistent(true)) + grantPrincipalField = StringField("grant-principal", WithHidden(true), WithDescription("The id of the resource to grant the entitlement to"), WithPersistent(true)) + grantPrincipalTypeField = StringField("grant-principal-type", WithHidden(true), WithDescription("The resource type of the principal to grant the entitlement to"), WithPersistent(true)) + logFormatField = StringField("log-format", WithDefaultValue(logging.LogFormatJSON), WithDescription("The output format for logs: json, console"), WithPersistent(true)) + revokeGrantField = StringField("revoke-grant", WithHidden(true), WithDescription("The grant to revoke"), WithPersistent(true)) + rotateCredentialsField = StringField("rotate-credentials", WithHidden(true), WithDescription("The id of the resource to rotate credentials on"), WithPersistent(true)) + rotateCredentialsTypeField = StringField("rotate-credentials-type", WithHidden(true), WithDescription("The type of the resource to rotate credentials on"), WithPersistent(true)) + ticketIDField = StringField("ticket-id", WithHidden(true), WithDescription("The ID of the ticket to get"), WithPersistent(true)) + ticketTemplatePathField = StringField("ticket-template-path", WithHidden(true), WithDescription("A JSON file describing the ticket to create"), WithPersistent(true)) + logLevelField = StringField("log-level", WithDefaultValue("info"), WithDescription("The log level: debug, info, warn, error"), WithPersistent(true)) + skipFullSync = BoolField("skip-full-sync", WithDescription("This must be set to skip a full sync"), WithPersistent(true)) ) // DefaultFields list the default fields expected in every single connector. @@ -56,6 +57,7 @@ var DefaultFields = []SchemaField{ ticketIDField, ticketTemplatePathField, logLevelField, + skipFullSync, } func IsFieldAmongDefaultList(f SchemaField) bool { diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/field/field_options.go b/vendor/github.com/conductorone/baton-sdk/pkg/field/field_options.go index 7177ee06..1699b448 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/field/field_options.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/field/field_options.go @@ -40,3 +40,11 @@ func WithShortHand(sh string) fieldOption { return o } } + +func WithPersistent(value bool) fieldOption { + return func(o SchemaField) SchemaField { + o.Persistent = value + + return o + } +} diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/field/fields.go b/vendor/github.com/conductorone/baton-sdk/pkg/field/fields.go index 4413407e..ab39e087 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/field/fields.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/field/fields.go @@ -7,9 +7,7 @@ import ( "strings" ) -var ( - WrongValueTypeErr = errors.New("unable to cast any to concrete type") -) +var WrongValueTypeErr = errors.New("unable to cast any to concrete type") type SchemaField struct { FieldName string @@ -17,6 +15,7 @@ type SchemaField struct { CLIShortHand string Required bool Hidden bool + Persistent bool Description string DefaultValue any } @@ -51,7 +50,7 @@ func (s SchemaField) String() (string, error) { return value, nil } -// StringSlice retuns the default value as a string array. +// StringSlice returns the default value as a string array. func (s SchemaField) StringSlice() ([]string, error) { value, ok := s.DefaultValue.([]string) if !ok { diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/field/relationships.go b/vendor/github.com/conductorone/baton-sdk/pkg/field/relationships.go index 769f822c..6e589b65 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/field/relationships.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/field/relationships.go @@ -3,7 +3,8 @@ package field type Relationship int const ( - RequiredTogether Relationship = iota + 1 + Invalid Relationship = iota + RequiredTogether MutuallyExclusive AtLeastOne Dependents @@ -15,31 +16,87 @@ type SchemaFieldRelationship struct { ExpectedFields []SchemaField } +func countFieldNames(fields ...SchemaField) int { + seen := map[string]bool{} + for _, field := range fields { + seen[field.FieldName] = true + } + return len(seen) +} + +// FieldsRequiredTogether - the provided fields are valid if and only if every +// provided field is present. func FieldsRequiredTogether(fields ...SchemaField) SchemaFieldRelationship { + count := countFieldNames(fields...) + if len(fields) > count || count <= 1 { + return SchemaFieldRelationship{Kind: Invalid} + } return SchemaFieldRelationship{ Kind: RequiredTogether, Fields: fields, } } +// FieldsMutuallyExclusive - the provided fields are valid if and only if at +// most one field is present. func FieldsMutuallyExclusive(fields ...SchemaField) SchemaFieldRelationship { + seen := map[string]bool{} + for _, field := range fields { + if field.Required { + return SchemaFieldRelationship{Kind: Invalid} + } + seen[field.FieldName] = true + } + if len(fields) > len(seen) || len(seen) <= 1 { + return SchemaFieldRelationship{Kind: Invalid} + } return SchemaFieldRelationship{ Kind: MutuallyExclusive, Fields: fields, } } +// FieldsAtLeastOneUsed - the provided fields are valid if and only if at least +// one field is present. func FieldsAtLeastOneUsed(fields ...SchemaField) SchemaFieldRelationship { + count := countFieldNames(fields...) + if len(fields) > count || count <= 1 { + return SchemaFieldRelationship{Kind: Invalid} + } return SchemaFieldRelationship{ Kind: AtLeastOne, Fields: fields, } } -func FieldsDependentOn(dependent []SchemaField, expected []SchemaField) SchemaFieldRelationship { +// FieldsDependentOn - the provided fields are valid if and only if every field +// in `required` are also present. +func FieldsDependentOn(fields []SchemaField, required []SchemaField) SchemaFieldRelationship { + seen0 := map[string]bool{} + for _, field := range fields { + seen0[field.FieldName] = true + } + if len(fields) > len(seen0) || + len(seen0) == 0 { + return SchemaFieldRelationship{Kind: Invalid} + } + + seen1 := map[string]bool{} + for _, field := range required { + if _, ok := seen0[field.FieldName]; ok { + return SchemaFieldRelationship{Kind: Invalid} + } + seen1[field.FieldName] = true + } + + if len(required) > len(seen1) || + len(seen1) == 0 { + return SchemaFieldRelationship{Kind: Invalid} + } + return SchemaFieldRelationship{ Kind: Dependents, - Fields: dependent, - ExpectedFields: expected, + Fields: fields, + ExpectedFields: required, } } diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/field/validation.go b/vendor/github.com/conductorone/baton-sdk/pkg/field/validation.go index 05812b57..06cd2ca6 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/field/validation.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/field/validation.go @@ -5,6 +5,7 @@ import ( "reflect" "strings" + "github.com/conductorone/baton-sdk/pkg/ustrings" "github.com/spf13/viper" ) @@ -29,11 +30,8 @@ func (e *ErrConfigurationMissingFields) Push(err error) { // Validate perform validation of field requirement and constraints // relationships after the configuration is read. // We don't check the following: -// - if required fields are mutually exclusive -// - repeated fields (by name) are defined // - if sets of fields are mutually exclusive and required // together at the same time -// - if fields depedent on themselves func Validate(c Configuration, v *viper.Viper) error { present := make(map[string]int) missingFieldsError := &ErrConfigurationMissingFields{} @@ -59,7 +57,13 @@ func Validate(c Configuration, v *viper.Viper) error { } if f.Required && !isNonZero { - missingFieldsError.Push(fmt.Errorf("field %s of type %s is marked as required but it has a zero-value", f.FieldName, f.FieldType)) + missingFieldsError.Push( + fmt.Errorf( + "field %s of type %s is marked as required but it has a zero-value", + f.FieldName, + f.FieldType, + ), + ) } } @@ -83,23 +87,39 @@ func validateConstraints(fieldsPresent map[string]int, relationships []SchemaFie expected += fieldsPresent[e.FieldName] } - if present > 1 && relationship.Kind == MutuallyExclusive { - return makeMutuallyExclusiveError(fieldsPresent, relationship) - } - if present > 0 && present < len(relationship.Fields) && relationship.Kind == RequiredTogether { - return makeNeededTogetherError(fieldsPresent, relationship) - } - if present == 0 && relationship.Kind == AtLeastOne { - return makeAtLeastOneError(fieldsPresent, relationship) - } - if present > 0 && expected != len(relationship.ExpectedFields) && relationship.Kind == Dependents { - return makeDependentFieldsError(fieldsPresent, relationship) + switch relationship.Kind { + case MutuallyExclusive: + if present > 1 { + return makeMutuallyExclusiveError(fieldsPresent, relationship) + } + case RequiredTogether: + if present > 0 && present < len(relationship.Fields) { + return makeNeededTogetherError(fieldsPresent, relationship) + } + case AtLeastOne: + if present == 0 { + return makeAtLeastOneError(fieldsPresent, relationship) + } + case Dependents: + if present > 0 && expected != len(relationship.ExpectedFields) { + return makeDependentFieldsError(fieldsPresent, relationship) + } + default: + return fmt.Errorf("invalid relationship constraint") } } return nil } +func nice(elements []string) string { + return ustrings.OxfordizeList( + elements, + ustrings.WithInnerWrappers(ustrings.SingleQuotes), + ustrings.WithOuterWrappers(ustrings.Parentheses), + ) +} + func makeMutuallyExclusiveError(fields map[string]int, relation SchemaFieldRelationship) error { var found []string for _, f := range relation.Fields { @@ -108,7 +128,10 @@ func makeMutuallyExclusiveError(fields map[string]int, relation SchemaFieldRelat } } - return fmt.Errorf("fields marked as mutually exclusive were set: %s", strings.Join(found, ", ")) + return fmt.Errorf( + "fields marked as mutually exclusive were set: %s", + nice(found), + ) } func makeNeededTogetherError(fields map[string]int, relation SchemaFieldRelationship) error { @@ -119,7 +142,10 @@ func makeNeededTogetherError(fields map[string]int, relation SchemaFieldRelation } } - return fmt.Errorf("fields marked as needed together are missing: %s", strings.Join(found, ", ")) + return fmt.Errorf( + "fields marked as needed together are missing: %s", + nice(found), + ) } func makeAtLeastOneError(fields map[string]int, relation SchemaFieldRelationship) error { @@ -130,7 +156,10 @@ func makeAtLeastOneError(fields map[string]int, relation SchemaFieldRelationship } } - return fmt.Errorf("at least one field was expected, any of: %s", strings.Join(found, ", ")) + return fmt.Errorf( + "at least one field was expected, any of: %s", + nice(found), + ) } func makeDependentFieldsError(fields map[string]int, relation SchemaFieldRelationship) error { @@ -148,6 +177,9 @@ func makeDependentFieldsError(fields map[string]int, relation SchemaFieldRelatio } } - return fmt.Errorf("set fields %s are dependent on %s being set", - strings.Join(foundDependent, ", "), strings.Join(notfoundExpected, ", ")) + return fmt.Errorf( + "set fields %s are dependent on %s being set", + nice(foundDependent), + nice(notfoundExpected), + ) } diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/ratelimit/grpc.go b/vendor/github.com/conductorone/baton-sdk/pkg/ratelimit/grpc.go index 5f58598b..0483b960 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/ratelimit/grpc.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/ratelimit/grpc.go @@ -83,7 +83,7 @@ func getRatelimitDescriptors(ctx context.Context, method string, in interface{}, return ret } -// UnaryServerInterceptor returns a new unary server interceptors that adds zap.Logger to the context. +// UnaryInterceptor returns a new unary server interceptors that adds zap.Logger to the context. func UnaryInterceptor(now func() time.Time, descriptors ...*ratelimitV1.RateLimitDescriptors_Entry) grpc.UnaryClientInterceptor { return func(ctx context.Context, method string, req, reply interface{}, cc *grpc.ClientConn, invoker grpc.UnaryInvoker, opts ...grpc.CallOption) error { // If this is a call to the rate limit service, skip it diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/helpers/helpers.go b/vendor/github.com/conductorone/baton-sdk/pkg/ratelimit/http.go similarity index 77% rename from vendor/github.com/conductorone/baton-sdk/pkg/helpers/helpers.go rename to vendor/github.com/conductorone/baton-sdk/pkg/ratelimit/http.go index b4da5ed8..9db8c5b2 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/helpers/helpers.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/ratelimit/http.go @@ -1,30 +1,14 @@ -package helpers +package ratelimit import ( "net/http" "strconv" - "strings" "time" v2 "github.com/conductorone/baton-sdk/pb/c1/connector/v2" "google.golang.org/protobuf/types/known/timestamppb" ) -func SplitFullName(name string) (string, string) { - names := strings.SplitN(name, " ", 2) - var firstName, lastName string - - switch len(names) { - case 1: - firstName = names[0] - case 2: - firstName = names[0] - lastName = names[1] - } - - return firstName, lastName -} - var limitHeaders = []string{ "X-Ratelimit-Limit", "Ratelimit-Limit", @@ -141,32 +125,3 @@ func ExtractRateLimitData(statusCode int, header *http.Header) (*v2.RateLimitDes ResetAt: timestamppb.New(resetAt), }, nil } - -func IsJSONContentType(contentType string) bool { - if !strings.HasPrefix(contentType, "application") { - return false - } - - if !strings.Contains(contentType, "json") { - return false - } - - return true -} - -var xmlContentTypes []string = []string{ - "text/xml", - "application/xml", -} - -func IsXMLContentType(contentType string) bool { - // there are some janky APIs out there - normalizedContentType := strings.TrimSpace(strings.ToLower(contentType)) - - for _, xmlContentType := range xmlContentTypes { - if strings.HasPrefix(normalizedContentType, xmlContentType) { - return true - } - } - return false -} diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/sdk/version.go b/vendor/github.com/conductorone/baton-sdk/pkg/sdk/version.go index 6e40b5c2..ed9800c8 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/sdk/version.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/sdk/version.go @@ -1,3 +1,3 @@ package sdk -const Version = "v0.2.12" +const Version = "v0.2.34" diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/sync/syncer.go b/vendor/github.com/conductorone/baton-sdk/pkg/sync/syncer.go index fc4febc0..63ad39dd 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/sync/syncer.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/sync/syncer.go @@ -7,6 +7,7 @@ import ( "errors" "fmt" "io" + "math" "os" "strconv" "time" @@ -37,8 +38,8 @@ var ( ) type Syncer interface { - Sync(ctx context.Context) error - Close(ctx context.Context) error + Sync(context.Context) error + Close(context.Context) error } // syncer orchestrates a connector sync and stores the results using the provided datasource.Writer. @@ -52,6 +53,7 @@ type syncer struct { transitionHandler func(s Action) progressHandler func(p *Progress) tmpDir string + skipFullSync bool skipEGForResourceType map[string]bool } @@ -78,7 +80,9 @@ func (s *syncer) handleInitialActionForStep(ctx context.Context, a Action) { func (s *syncer) handleProgress(ctx context.Context, a *Action, c int) { if s.progressHandler != nil { - s.progressHandler(NewProgress(a, uint32(c))) + //nolint:gosec // No risk of overflow because `c` is a slice length. + count := uint32(c) + s.progressHandler(NewProgress(a, count)) } } @@ -89,16 +93,41 @@ func shouldWaitAndRetry(ctx context.Context, err error) bool { attempts = 0 return true } - if status.Code(err) != codes.Unavailable { + if status.Code(err) != codes.Unavailable && status.Code(err) != codes.DeadlineExceeded { return false } attempts++ l := ctxzap.Extract(ctx) + // use linear time by default var wait time.Duration = time.Duration(attempts) * time.Second - l.Error("retrying operation", zap.Error(err), zap.Duration("wait", wait)) + // If error contains rate limit data, use that instead + if st, ok := status.FromError(err); ok { + details := st.Details() + for _, detail := range details { + if rlData, ok := detail.(*v2.RateLimitDescription); ok { + waitResetAt := time.Until(rlData.ResetAt.AsTime()) + if waitResetAt <= 0 { + continue + } + duration := time.Duration(rlData.Limit) + if duration <= 0 { + continue + } + waitResetAt /= duration + // Round up to the nearest second to make sure we don't hit the rate limit again + waitResetAt = time.Duration(math.Ceil(waitResetAt.Seconds())) * time.Second + if waitResetAt > 0 { + wait = waitResetAt + break + } + } + } + } + + l.Warn("retrying operation", zap.Error(err), zap.Duration("wait", wait)) for { select { @@ -115,6 +144,10 @@ func shouldWaitAndRetry(ctx context.Context, err error) bool { // an action is completed, it is popped off of the queue. Before processing each action, we checkpoint the state object // into the datasource. This allows for graceful resumes if a sync is interrupted. func (s *syncer) Sync(ctx context.Context) error { + if s.skipFullSync { + return s.SkipSync(ctx) + } + l := ctxzap.Extract(ctx) runCtx := ctx @@ -228,7 +261,7 @@ func (s *syncer) Sync(ctx context.Context) error { case SyncAssetsOp: err = s.SyncAssets(ctx) - if err != nil { + if !shouldWaitAndRetry(ctx, err) { return err } continue @@ -265,6 +298,46 @@ func (s *syncer) Sync(ctx context.Context) error { return nil } +func (s *syncer) SkipSync(ctx context.Context) error { + l := ctxzap.Extract(ctx) + l.Info("skipping sync") + + var runCanc context.CancelFunc + if s.runDuration > 0 { + _, runCanc = context.WithTimeout(ctx, s.runDuration) + } + if runCanc != nil { + defer runCanc() + } + + err := s.loadStore(ctx) + if err != nil { + return err + } + + _, err = s.connector.Validate(ctx, &v2.ConnectorServiceValidateRequest{}) + if err != nil { + return err + } + + _, err = s.store.StartNewSync(ctx) + if err != nil { + return err + } + + err = s.store.EndSync(ctx) + if err != nil { + return err + } + + err = s.store.Cleanup(ctx) + if err != nil { + return err + } + + return nil +} + // SyncResourceTypes calls the ListResourceType() connector endpoint and persists the results in to the datasource. func (s *syncer) SyncResourceTypes(ctx context.Context) error { pageToken := s.state.PageToken(ctx) @@ -739,7 +812,7 @@ func (s *syncer) SyncGrantExpansion(ctx context.Context) error { pageToken := s.state.PageToken(ctx) if pageToken == "" { - ctxzap.Extract(ctx).Info("Expanding grants...") + l.Info("Expanding grants...") s.handleInitialActionForStep(ctx, *s.state.Current()) } @@ -776,7 +849,7 @@ func (s *syncer) SyncGrantExpansion(ctx context.Context) error { // FIXME(morgabra) Log and skip some of the error paths here? for _, srcEntitlementID := range expandable.EntitlementIds { - ctxzap.Extract(ctx).Debug( + l.Debug( "Expandable entitlement found", zap.String("src_entitlement_id", srcEntitlementID), zap.String("dst_entitlement_id", grant.GetEntitlement().GetId()), @@ -786,7 +859,12 @@ func (s *syncer) SyncGrantExpansion(ctx context.Context) error { EntitlementId: srcEntitlementID, }) if err != nil { - return err + l.Error("error fetching source entitlement", + zap.String("src_entitlement_id", srcEntitlementID), + zap.String("dst_entitlement_id", grant.GetEntitlement().GetId()), + zap.Error(err), + ) + continue } // The expand annotation points at entitlements by id. Those entitlements' resource should match @@ -1278,7 +1356,7 @@ func (s *syncer) runGrantExpandActions(ctx context.Context) (bool, error) { return false, nil } -func (s *syncer) newExpandedGrant(ctx context.Context, descEntitlement *v2.Entitlement, principal *v2.Resource) (*v2.Grant, error) { +func (s *syncer) newExpandedGrant(_ context.Context, descEntitlement *v2.Entitlement, principal *v2.Resource) (*v2.Grant, error) { enResource := descEntitlement.GetResource() if enResource == nil { return nil, fmt.Errorf("newExpandedGrant: entitlement has no resource") @@ -1388,9 +1466,12 @@ func (s *syncer) loadStore(ctx context.Context) error { // Close closes the datastorage to ensure it is updated on disk. func (s *syncer) Close(ctx context.Context) error { - err := s.store.Close() - if err != nil { - return fmt.Errorf("error closing store: %w", err) + var err error + if s.store != nil { + err = s.store.Close() + if err != nil { + return fmt.Errorf("error closing store: %w", err) + } } if s.c1zManager != nil { @@ -1456,6 +1537,12 @@ func WithTmpDir(path string) SyncOpt { } } +func WithSkipFullSync() SyncOpt { + return func(s *syncer) { + s.skipFullSync = true + } +} + // NewSyncer returns a new syncer object. func NewSyncer(ctx context.Context, c types.ConnectorClient, opts ...SyncOpt) (Syncer, error) { s := &syncer{ diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/tasks/c1api/debug.go b/vendor/github.com/conductorone/baton-sdk/pkg/tasks/c1api/debug.go new file mode 100644 index 00000000..c05c5bcd --- /dev/null +++ b/vendor/github.com/conductorone/baton-sdk/pkg/tasks/c1api/debug.go @@ -0,0 +1,18 @@ +package c1api + +import ( + "context" +) + +type debugHandler struct { + taskmanager *c1ApiTaskManager +} + +func newStartDebugging(tm *c1ApiTaskManager) *debugHandler { + return &debugHandler{taskmanager: tm} +} + +func (c *debugHandler) HandleTask(ctx context.Context) error { + c.taskmanager.runnerShouldDebug = true + return nil +} diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/tasks/c1api/full_sync.go b/vendor/github.com/conductorone/baton-sdk/pkg/tasks/c1api/full_sync.go index 8a72c047..e214b769 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/tasks/c1api/full_sync.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/tasks/c1api/full_sync.go @@ -5,16 +5,16 @@ import ( "errors" "io" "os" - - "github.com/grpc-ecosystem/go-grpc-middleware/logging/zap/ctxzap" - "go.uber.org/zap" - "google.golang.org/protobuf/proto" + "path/filepath" v1 "github.com/conductorone/baton-sdk/pb/c1/connectorapi/baton/v1" "github.com/conductorone/baton-sdk/pkg/annotations" sdkSync "github.com/conductorone/baton-sdk/pkg/sync" "github.com/conductorone/baton-sdk/pkg/tasks" "github.com/conductorone/baton-sdk/pkg/types" + "github.com/grpc-ecosystem/go-grpc-middleware/logging/zap/ctxzap" + "go.uber.org/zap" + "google.golang.org/protobuf/proto" ) type fullSyncHelpers interface { @@ -26,13 +26,24 @@ type fullSyncHelpers interface { } type fullSyncTaskHandler struct { - task *v1.Task - helpers fullSyncHelpers + task *v1.Task + helpers fullSyncHelpers + skipFullSync bool } func (c *fullSyncTaskHandler) sync(ctx context.Context, c1zPath string) error { l := ctxzap.Extract(ctx).With(zap.String("task_id", c.task.GetId()), zap.Stringer("task_type", tasks.GetType(c.task))) - syncer, err := sdkSync.NewSyncer(ctx, c.helpers.ConnectorClient(), sdkSync.WithC1ZPath(c1zPath), sdkSync.WithTmpDir(c.helpers.TempDir())) + + syncOpts := []sdkSync.SyncOpt{ + sdkSync.WithC1ZPath(c1zPath), + sdkSync.WithTmpDir(c.helpers.TempDir()), + } + + if c.skipFullSync { + syncOpts = append(syncOpts, sdkSync.WithSkipFullSync()) + } + + syncer, err := sdkSync.NewSyncer(ctx, c.helpers.ConnectorClient(), syncOpts...) if err != nil { l.Error("failed to create syncer", zap.Error(err)) return err @@ -71,7 +82,6 @@ func (c *fullSyncTaskHandler) sync(ctx context.Context, c1zPath string) error { func (c *fullSyncTaskHandler) HandleTask(ctx context.Context) error { ctx, cancel := context.WithCancel(ctx) defer cancel() - l := ctxzap.Extract(ctx).With(zap.String("task_id", c.task.GetId()), zap.Stringer("task_type", tasks.GetType(c.task))) l.Info("Handling full sync task.") @@ -121,12 +131,54 @@ func (c *fullSyncTaskHandler) HandleTask(ctx context.Context) error { return c.helpers.FinishTask(ctx, nil, nil, err) } + err = uploadDebugLogs(ctx, c.helpers) + if err != nil { + return c.helpers.FinishTask(ctx, nil, nil, err) + } + return c.helpers.FinishTask(ctx, nil, nil, nil) } -func newFullSyncTaskHandler(task *v1.Task, helpers fullSyncHelpers) tasks.TaskHandler { +func newFullSyncTaskHandler(task *v1.Task, helpers fullSyncHelpers, skipFullSync bool) tasks.TaskHandler { return &fullSyncTaskHandler{ - task: task, - helpers: helpers, + task: task, + helpers: helpers, + skipFullSync: skipFullSync, + } +} + +func uploadDebugLogs(ctx context.Context, helper fullSyncHelpers) error { + l := ctxzap.Extract(ctx) + + debugfilelocation := filepath.Join(helper.TempDir(), "debug.log") + + _, err := os.Stat(debugfilelocation) + if err != nil { + if errors.Is(err, os.ErrNotExist) { + l.Warn("debug log file does not exists", zap.Error(err)) + return nil + } + return err + } else { + debugfile, err := os.Open(debugfilelocation) + if err != nil { + return err + } + defer debugfile.Close() + + l.Info("uploading debug logs", zap.String("file", debugfilelocation)) + err = helper.Upload(ctx, debugfile) + + if err != nil { + return err + } + defer func() { + err := os.Remove(debugfilelocation) + if err != nil { + l.Error("failed to delete file with debug logs", zap.Error(err), zap.String("file", debugfilelocation)) + } + }() + + return nil } } diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/tasks/c1api/manager.go b/vendor/github.com/conductorone/baton-sdk/pkg/tasks/c1api/manager.go index e1f2a9f4..633e10dc 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/tasks/c1api/manager.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/tasks/c1api/manager.go @@ -42,11 +42,13 @@ var ( ) type c1ApiTaskManager struct { - mtx sync.Mutex - started bool - queue []*v1.Task - serviceClient BatonServiceClient - tempDir string + mtx sync.Mutex + started bool + queue []*v1.Task + serviceClient BatonServiceClient + tempDir string + skipFullSync bool + runnerShouldDebug bool } // getHeartbeatInterval returns an appropriate heartbeat interval. If the interval is 0, it will return the default heartbeat interval. @@ -176,6 +178,7 @@ func (c *c1ApiTaskManager) finishTask(ctx context.Context, task *v1.Task, resp p _, rpcErr := c.serviceClient.FinishTask(finishCtx, &v1.BatonServiceFinishTaskRequest{ TaskId: task.GetId(), Status: &pbstatus.Status{ + //nolint:gosec // No risk of overflow because `Code` is a small enum. Code: int32(statusErr.Code()), Message: statusErr.Message(), }, @@ -194,6 +197,14 @@ func (c *c1ApiTaskManager) finishTask(ctx context.Context, task *v1.Task, resp p return err } +func (c *c1ApiTaskManager) GetTempDir() string { + return c.tempDir +} + +func (c *c1ApiTaskManager) ShouldDebug() bool { + return c.runnerShouldDebug +} + func (c *c1ApiTaskManager) Process(ctx context.Context, task *v1.Task, cc types.ConnectorClient) error { l := ctxzap.Extract(ctx) if task == nil { @@ -222,26 +233,19 @@ func (c *c1ApiTaskManager) Process(ctx context.Context, task *v1.Task, cc types. var handler tasks.TaskHandler switch tasks.GetType(task) { case taskTypes.FullSyncType: - handler = newFullSyncTaskHandler(task, tHelpers) - + handler = newFullSyncTaskHandler(task, tHelpers, c.skipFullSync) case taskTypes.HelloType: handler = newHelloTaskHandler(task, tHelpers) - case taskTypes.GrantType: handler = newGrantTaskHandler(task, tHelpers) - case taskTypes.RevokeType: handler = newRevokeTaskHandler(task, tHelpers) - case taskTypes.CreateAccountType: handler = newCreateAccountTaskHandler(task, tHelpers) - case taskTypes.CreateResourceType: handler = newCreateResourceTaskHandler(task, tHelpers) - case taskTypes.DeleteResourceType: handler = newDeleteResourceTaskHandler(task, tHelpers) - case taskTypes.RotateCredentialsType: handler = newRotateCredentialsTaskHandler(task, tHelpers) case taskTypes.CreateTicketType: @@ -250,6 +254,8 @@ func (c *c1ApiTaskManager) Process(ctx context.Context, task *v1.Task, cc types. handler = newListSchemasTaskHandler(task, tHelpers) case taskTypes.GetTicketType: handler = newGetTicketTaskHandler(task, tHelpers) + case taskTypes.StartDebugging: + handler = newStartDebugging(c) default: return c.finishTask(ctx, task, nil, nil, errors.New("unsupported task type")) } @@ -263,7 +269,7 @@ func (c *c1ApiTaskManager) Process(ctx context.Context, task *v1.Task, cc types. return nil } -func NewC1TaskManager(ctx context.Context, clientID string, clientSecret string, tempDir string) (tasks.Manager, error) { +func NewC1TaskManager(ctx context.Context, clientID string, clientSecret string, tempDir string, skipFullSync bool) (tasks.Manager, error) { serviceClient, err := newServiceClient(ctx, clientID, clientSecret) if err != nil { return nil, err @@ -272,5 +278,6 @@ func NewC1TaskManager(ctx context.Context, clientID string, clientSecret string, return &c1ApiTaskManager{ serviceClient: serviceClient, tempDir: tempDir, + skipFullSync: skipFullSync, }, nil } diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/tasks/c1api/service_client.go b/vendor/github.com/conductorone/baton-sdk/pkg/tasks/c1api/service_client.go index c46a4edc..d483cf2e 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/tasks/c1api/service_client.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/tasks/c1api/service_client.go @@ -171,13 +171,17 @@ func (c *c1ServiceClient) Upload(ctx context.Context, task *v1.Task, r io.ReadSe return err } - chunkCount := uint64(math.Ceil(float64(rLen) / float64(fileChunkSize))) - for i := uint64(0); i < chunkCount; i++ { - l.Debug("sending upload chunk", zap.Uint64("chunk", i), zap.Uint64("total_chunks", chunkCount)) + chunkCount := int(math.Ceil(float64(rLen) / float64(fileChunkSize))) + for i := 0; i < chunkCount; i++ { + l.Debug( + "sending upload chunk", + zap.Int("chunk", i), + zap.Int("total_chunks", chunkCount), + ) chunkSize := fileChunkSize if i == chunkCount-1 { - chunkSize = int(rLen) - int(i)*fileChunkSize + chunkSize = int(rLen) - i*fileChunkSize } chunk := make([]byte, chunkSize) @@ -221,6 +225,7 @@ func (c *c1ServiceClient) Upload(ctx context.Context, task *v1.Task, r io.ReadSe return nil } +// newServiceClient creates a client and dials to the gRPC server set with BATON_C1_API_HOST. func newServiceClient(ctx context.Context, clientID string, clientSecret string) (BatonServiceClient, error) { credProvider, clientName, tokenHost, err := ugrpc.NewC1CredentialProvider(ctx, clientID, clientSecret) if err != nil { diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/tasks/local/accounter.go b/vendor/github.com/conductorone/baton-sdk/pkg/tasks/local/accounter.go index 4a5c5032..4173c250 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/tasks/local/accounter.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/tasks/local/accounter.go @@ -19,6 +19,14 @@ type localAccountManager struct { email string } +func (m *localAccountManager) GetTempDir() string { + return "" +} + +func (m *localAccountManager) ShouldDebug() bool { + return false +} + func (m *localAccountManager) Next(ctx context.Context) (*v1.Task, time.Duration, error) { var task *v1.Task m.o.Do(func() { diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/tasks/local/deleter.go b/vendor/github.com/conductorone/baton-sdk/pkg/tasks/local/deleter.go index 78fab65e..7f2ef18b 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/tasks/local/deleter.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/tasks/local/deleter.go @@ -19,6 +19,14 @@ type localResourceDeleter struct { resourceType string } +func (m *localResourceDeleter) GetTempDir() string { + return "" +} + +func (m *localResourceDeleter) ShouldDebug() bool { + return false +} + func (m *localResourceDeleter) Next(ctx context.Context) (*v1.Task, time.Duration, error) { var task *v1.Task m.o.Do(func() { diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/tasks/local/event_feed.go b/vendor/github.com/conductorone/baton-sdk/pkg/tasks/local/event_feed.go index ea8a6770..87f9cbd2 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/tasks/local/event_feed.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/tasks/local/event_feed.go @@ -20,6 +20,14 @@ type localEventFeed struct { const EventsPerPageLocally = 100 +func (m *localEventFeed) GetTempDir() string { + return "" +} + +func (m *localEventFeed) ShouldDebug() bool { + return false +} + func (m *localEventFeed) Next(ctx context.Context) (*v1.Task, time.Duration, error) { var task *v1.Task m.o.Do(func() { diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/tasks/local/granter.go b/vendor/github.com/conductorone/baton-sdk/pkg/tasks/local/granter.go index 5942573d..ce0f59a6 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/tasks/local/granter.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/tasks/local/granter.go @@ -20,6 +20,14 @@ type localGranter struct { principalType string } +func (m *localGranter) GetTempDir() string { + return "" +} + +func (m *localGranter) ShouldDebug() bool { + return false +} + func (m *localGranter) Next(ctx context.Context) (*v1.Task, time.Duration, error) { var task *v1.Task m.o.Do(func() { diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/tasks/local/revoker.go b/vendor/github.com/conductorone/baton-sdk/pkg/tasks/local/revoker.go index 1168d0a4..828e0f54 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/tasks/local/revoker.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/tasks/local/revoker.go @@ -18,6 +18,14 @@ type localRevoker struct { grantID string } +func (m *localRevoker) GetTempDir() string { + return "" +} + +func (m *localRevoker) ShouldDebug() bool { + return false +} + func (m *localRevoker) Next(ctx context.Context) (*v1.Task, time.Duration, error) { var task *v1.Task m.o.Do(func() { diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/tasks/local/rotator.go b/vendor/github.com/conductorone/baton-sdk/pkg/tasks/local/rotator.go index d9bc64c0..24a3d0fc 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/tasks/local/rotator.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/tasks/local/rotator.go @@ -19,6 +19,14 @@ type localCredentialRotator struct { resourceType string } +func (m *localCredentialRotator) GetTempDir() string { + return "" +} + +func (m *localCredentialRotator) ShouldDebug() bool { + return false +} + func (m *localCredentialRotator) Next(ctx context.Context) (*v1.Task, time.Duration, error) { var task *v1.Task m.o.Do(func() { diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/tasks/local/syncer.go b/vendor/github.com/conductorone/baton-sdk/pkg/tasks/local/syncer.go index b879b83d..c2e1e49c 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/tasks/local/syncer.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/tasks/local/syncer.go @@ -26,6 +26,14 @@ func WithTmpDir(tmpDir string) Option { } } +func (m *localSyncer) GetTempDir() string { + return "" +} + +func (m *localSyncer) ShouldDebug() bool { + return false +} + func (m *localSyncer) Next(ctx context.Context) (*v1.Task, time.Duration, error) { var task *v1.Task m.o.Do(func() { diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/tasks/local/ticket.go b/vendor/github.com/conductorone/baton-sdk/pkg/tasks/local/ticket.go index 01d93a78..2e8e2c62 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/tasks/local/ticket.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/tasks/local/ticket.go @@ -27,7 +27,6 @@ type localCreateTicket struct { type ticketTemplate struct { SchemaID string `json:"schema_id"` StatusId string `json:"status_id"` - TypeId string `json:"type_id"` DisplayName string `json:"display_name"` Description string `json:"description"` Labels []string `json:"labels"` @@ -50,6 +49,14 @@ func (m *localCreateTicket) loadTicketTemplate(ctx context.Context) (*ticketTemp return template, nil } +func (m *localCreateTicket) GetTempDir() string { + return "" +} + +func (m *localCreateTicket) ShouldDebug() bool { + return false +} + func (m *localCreateTicket) Next(ctx context.Context) (*v1.Task, time.Duration, error) { var task *v1.Task m.o.Do(func() { @@ -83,12 +90,6 @@ func (m *localCreateTicket) Process(ctx context.Context, task *v1.Task, cc types Labels: template.Labels, } - if template.TypeId != "" { - ticketRequestBody.Type = &v2.TicketType{ - Id: template.TypeId, - } - } - if template.StatusId != "" { ticketRequestBody.Status = &v2.TicketStatus{ Id: template.StatusId, @@ -141,6 +142,14 @@ type localGetTicket struct { ticketId string } +func (m *localGetTicket) GetTempDir() string { + return "" +} + +func (m *localGetTicket) ShouldDebug() bool { + return false +} + func (m *localGetTicket) Next(ctx context.Context) (*v1.Task, time.Duration, error) { var task *v1.Task m.o.Do(func() { @@ -181,6 +190,14 @@ type localListTicketSchemas struct { o sync.Once } +func (m *localListTicketSchemas) GetTempDir() string { + return "" +} + +func (m *localListTicketSchemas) ShouldDebug() bool { + return false +} + func (m *localListTicketSchemas) Next(ctx context.Context) (*v1.Task, time.Duration, error) { var task *v1.Task m.o.Do(func() { diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/tasks/tasks.go b/vendor/github.com/conductorone/baton-sdk/pkg/tasks/tasks.go index b2071d22..96567873 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/tasks/tasks.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/tasks/tasks.go @@ -12,6 +12,8 @@ import ( type Manager interface { Next(ctx context.Context) (*v1.Task, time.Duration, error) Process(ctx context.Context, task *v1.Task, cc types.ConnectorClient) error + ShouldDebug() bool + GetTempDir() string } type TaskHandler interface { diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/types/grant/grant.go b/vendor/github.com/conductorone/baton-sdk/pkg/types/grant/grant.go index 25ff9ede..e59536c9 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/types/grant/grant.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/types/grant/grant.go @@ -17,6 +17,9 @@ type GrantPrincipal interface { GetBatonResource() bool } +// Sometimes C1 doesn't have the grant ID, but does have the principal and entitlement. +const UnknownGrantId string = "🧸_UNKNOWN_GRANT_ID" + func WithGrantMetadata(metadata map[string]interface{}) GrantOption { return func(g *v2.Grant) error { md, err := structpb.NewStruct(metadata) diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/types/resource/parse.go b/vendor/github.com/conductorone/baton-sdk/pkg/types/resource/parse.go new file mode 100644 index 00000000..f5e41ab1 --- /dev/null +++ b/vendor/github.com/conductorone/baton-sdk/pkg/types/resource/parse.go @@ -0,0 +1,18 @@ +package resource + +import "strings" + +// SplitFullName looks for the first ` `, everything to the left is first name, +// everything to the right is last name. +func SplitFullName(name string) (string, string) { + names := strings.SplitN(name, " ", 2) + var firstName, lastName string + if len(names) > 0 { + firstName = names[0] + } + if len(names) > 1 { + lastName = names[1] + } + + return firstName, lastName +} diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/types/resource/user_trait.go b/vendor/github.com/conductorone/baton-sdk/pkg/types/resource/user_trait.go index 7c104801..aefcdc7c 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/types/resource/user_trait.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/types/resource/user_trait.go @@ -45,6 +45,7 @@ func WithEmail(email string, primary bool) UserTraitOption { return nil } } + func WithUserLogin(login string, aliases ...string) UserTraitOption { return func(ut *v2.UserTrait) error { if login == "" { diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/types/tasks/tasks.go b/vendor/github.com/conductorone/baton-sdk/pkg/types/tasks/tasks.go index a98d9084..fe3a0c65 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/types/tasks/tasks.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/types/tasks/tasks.go @@ -44,6 +44,8 @@ func (tt TaskType) String() string { return "get_metadata" case ListEventsType: return "list_events" + case StartDebugging: + return "set_log_file_event" default: return "unknown" } @@ -71,4 +73,5 @@ const ( ListGrantsType GetMetadataType ListEventsType + StartDebugging ) diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/types/ticket/custom_fields.go b/vendor/github.com/conductorone/baton-sdk/pkg/types/ticket/custom_fields.go index 8d251c66..6a54a827 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/types/ticket/custom_fields.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/types/ticket/custom_fields.go @@ -11,11 +11,13 @@ import ( "go.uber.org/zap" "google.golang.org/protobuf/encoding/protojson" "google.golang.org/protobuf/types/known/timestamppb" + "google.golang.org/protobuf/types/known/wrapperspb" v2 "github.com/conductorone/baton-sdk/pb/c1/connector/v2" ) var ErrFieldNil = errors.New("error: field is nil") +var ErrTicketValidationError = errors.New("create ticket request is not valid") // CustomFieldForSchemaField returns a typed custom field for a given schema field. func CustomFieldForSchemaField(id string, schema *v2.TicketSchema, value interface{}) (*v2.TicketCustomField, error) { @@ -46,6 +48,13 @@ func CustomFieldForSchemaField(id string, schema *v2.TicketSchema, value interfa } return BoolField(id, v), nil + case *v2.TicketCustomField_NumberValue: + v, ok := value.(float32) + if !ok { + return nil, fmt.Errorf("unexpected value type for custom field: %s %T", id, v) + } + return NumberField(id, v), nil + case *v2.TicketCustomField_TimestampValue: v, ok := value.(*timestamppb.Timestamp) if !ok { @@ -149,6 +158,17 @@ func GetBoolValue(field *v2.TicketCustomField) (bool, error) { return v.BoolValue.Value, nil } +func GetNumberValue(field *v2.TicketCustomField) (float32, error) { + if field == nil { + return 0, ErrFieldNil + } + v, ok := field.GetValue().(*v2.TicketCustomField_NumberValue) + if !ok { + return 0, errors.New("error: expected number value") + } + return v.NumberValue.GetValue().GetValue(), nil +} + func GetTimestampValue(field *v2.TicketCustomField) (time.Time, error) { if field == nil { return time.Time{}, ErrFieldNil @@ -211,34 +231,132 @@ func GetCustomFieldValue(field *v2.TicketCustomField) (interface{}, error) { } switch v := field.GetValue().(type) { case *v2.TicketCustomField_StringValue: + strVal := v.StringValue.GetValue() + if strVal == "" { + return nil, nil + } return v.StringValue.GetValue(), nil case *v2.TicketCustomField_StringValues: - return v.StringValues.GetValues(), nil + strVals := v.StringValues.GetValues() + if len(strVals) == 0 { + return nil, nil + } + return strVals, nil case *v2.TicketCustomField_BoolValue: return v.BoolValue.GetValue(), nil + case *v2.TicketCustomField_NumberValue: + wrapperVal := v.NumberValue.GetValue() + if wrapperVal == nil { + return nil, nil + } + return wrapperVal.GetValue(), nil case *v2.TicketCustomField_TimestampValue: return v.TimestampValue.GetValue(), nil case *v2.TicketCustomField_PickStringValue: - return v.PickStringValue.GetValue(), nil + strVal := v.PickStringValue.GetValue() + if strVal == "" { + return nil, nil + } + return strVal, nil case *v2.TicketCustomField_PickMultipleStringValues: - return v.PickMultipleStringValues.GetValues(), nil + strVals := v.PickMultipleStringValues.GetValues() + if len(strVals) == 0 { + return nil, nil + } + return strVals, nil case *v2.TicketCustomField_PickObjectValue: return v.PickObjectValue.GetValue(), nil case *v2.TicketCustomField_PickMultipleObjectValues: - return v.PickMultipleObjectValues.GetValues(), nil + objVals := v.PickMultipleObjectValues.GetValues() + if len(objVals) == 0 { + return objVals, nil + } + return objVals, nil + + default: + return false, errors.New("error: unknown custom field type") + } +} + +func GetDefaultCustomFieldValue(field *v2.TicketCustomField) (interface{}, error) { + if field == nil { + return nil, nil + } + switch v := field.GetValue().(type) { + case *v2.TicketCustomField_StringValue: + strVal := v.StringValue.GetDefaultValue() + if strVal == "" { + return nil, nil + } + return strVal, nil + + case *v2.TicketCustomField_StringValues: + strVals := v.StringValues.GetDefaultValues() + if len(strVals) == 0 { + return nil, nil + } + return strVals, nil + + case *v2.TicketCustomField_BoolValue: + return v.BoolValue.GetValue(), nil + + case *v2.TicketCustomField_NumberValue: + defaultWrapper := v.NumberValue.GetDefaultValue() + if defaultWrapper == nil { + return nil, nil + } + return defaultWrapper.GetValue(), nil + + case *v2.TicketCustomField_TimestampValue: + return v.TimestampValue.GetDefaultValue(), nil + + case *v2.TicketCustomField_PickStringValue: + strVal := v.PickStringValue.GetDefaultValue() + if strVal == "" { + return nil, nil + } + return strVal, nil + + case *v2.TicketCustomField_PickMultipleStringValues: + strVals := v.PickMultipleStringValues.GetDefaultValues() + if len(strVals) == 0 { + return nil, nil + } + return strVals, nil + + case *v2.TicketCustomField_PickObjectValue: + return v.PickObjectValue.GetDefaultValue(), nil + + case *v2.TicketCustomField_PickMultipleObjectValues: + objVals := v.PickMultipleObjectValues.GetDefaultValues() + if len(objVals) == 0 { + return objVals, nil + } + return objVals, nil default: return false, errors.New("error: unknown custom field type") } } +func GetCustomFieldValueOrDefault(field *v2.TicketCustomField) (interface{}, error) { + v, err := GetCustomFieldValue(field) + if err != nil { + return nil, err + } + if v == nil { + return GetDefaultCustomFieldValue(field) + } + return v, nil +} + // TODO(lauren) doesn't validate fields on ticket that are not in the schema // ValidateTicket takes a ticket schema and ensures that the supplied ticket conforms. func ValidateTicket(ctx context.Context, schema *v2.TicketSchema, ticket *v2.Ticket) (bool, error) { @@ -261,23 +379,6 @@ func ValidateTicket(ctx context.Context, schema *v2.TicketSchema, ticket *v2.Tic return false, nil } - // Validate the ticket type is one defined in the schema - // Ticket type is not required so if a ticket doesn't have a type - // we don't need to validate, skip the loop in this case - validTicketType := ticket.Type == nil - if !validTicketType { - for _, tType := range schema.GetTypes() { - if ticket.Type.GetId() == tType.GetId() { - validTicketType = true - break - } - } - } - if !validTicketType { - l.Debug("error: invalid ticket: could not find ticket type", zap.String("ticket_type_id", ticket.Type.GetId())) - return false, nil - } - schemaCustomFields := schema.GetCustomFields() ticketCustomFields := ticket.GetCustomFields() @@ -301,7 +402,12 @@ func ValidateTicket(ctx context.Context, schema *v2.TicketSchema, ticket *v2.Tic return false, nil } - if cf.Required && tv.StringValue.GetValue() == "" { + stringValue := tv.StringValue.GetValue() + if stringValue == "" { + stringValue = tv.StringValue.GetDefaultValue() + } + + if cf.Required && stringValue == "" { l.Debug("error: invalid ticket: string value is required but was empty", zap.String("custom_field_id", cf.Id)) return false, nil } @@ -313,7 +419,12 @@ func ValidateTicket(ctx context.Context, schema *v2.TicketSchema, ticket *v2.Tic return false, nil } - if cf.Required && len(tv.StringValues.GetValues()) == 0 { + stringValues := tv.StringValues.GetValues() + if len(stringValues) == 0 { + stringValues = tv.StringValues.GetDefaultValues() + } + + if cf.Required && len(stringValues) == 0 { l.Debug("error: invalid ticket: string values is required but was empty", zap.String("custom_field_id", cf.Id)) return false, nil } @@ -324,6 +435,12 @@ func ValidateTicket(ctx context.Context, schema *v2.TicketSchema, ticket *v2.Tic l.Debug("error: invalid ticket: expected bool value for field", zap.String("custom_field_id", cf.Id), zap.Any("value", tv)) return false, nil } + case *v2.TicketCustomField_NumberValue: + tv, tok := ticketCf.GetValue().(*v2.TicketCustomField_NumberValue) + if !tok { + l.Debug("error: invalid ticket: expected number value for field", zap.String("custom_field_id", cf.Id), zap.Any("value", tv)) + return false, nil + } case *v2.TicketCustomField_TimestampValue: tv, tok := ticketCf.GetValue().(*v2.TicketCustomField_TimestampValue) @@ -332,7 +449,12 @@ func ValidateTicket(ctx context.Context, schema *v2.TicketSchema, ticket *v2.Tic return false, nil } - if cf.Required && tv.TimestampValue.GetValue() == nil { + timestampValue := tv.TimestampValue.GetValue() + if timestampValue == nil { + timestampValue = tv.TimestampValue.GetDefaultValue() + } + + if cf.Required && timestampValue == nil { l.Debug("error: invalid ticket: expected timestamp value for field but was empty", zap.String("custom_field_id", cf.Id)) return false, nil } @@ -346,6 +468,11 @@ func ValidateTicket(ctx context.Context, schema *v2.TicketSchema, ticket *v2.Tic ticketValue := tv.PickStringValue.GetValue() allowedValues := v.PickStringValue.GetAllowedValues() + defaultTicketValue := tv.PickStringValue.GetDefaultValue() + + if ticketValue == "" { + ticketValue = defaultTicketValue + } // String value is empty but custom field is not required, skip further validation if !cf.Required && ticketValue == "" { @@ -390,6 +517,10 @@ func ValidateTicket(ctx context.Context, schema *v2.TicketSchema, ticket *v2.Tic ticketValues := tv.PickMultipleStringValues.GetValues() allowedValues := v.PickMultipleStringValues.GetAllowedValues() + if len(ticketValues) == 0 { + ticketValues = tv.PickMultipleStringValues.GetDefaultValues() + } + // String values are empty but custom field is not required, skip further validation if !cf.Required && len(ticketValues) == 0 { continue @@ -434,6 +565,10 @@ func ValidateTicket(ctx context.Context, schema *v2.TicketSchema, ticket *v2.Tic ticketValue := tv.PickObjectValue.GetValue() allowedValues := v.PickObjectValue.GetAllowedValues() + if ticketValue == nil || ticketValue.GetId() == "" { + ticketValue = tv.PickObjectValue.GetDefaultValue() + } + // Object value for field is nil, but custom field is not required, skip further validation if !cf.Required && (ticketValue == nil || ticketValue.GetId() == "") { continue @@ -475,6 +610,10 @@ func ValidateTicket(ctx context.Context, schema *v2.TicketSchema, ticket *v2.Tic } ticketValues := tv.PickMultipleObjectValues.GetValues() + if len(ticketValues) == 0 { + ticketValues = v.PickMultipleObjectValues.GetDefaultValues() + } + allowedValues := v.PickMultipleObjectValues.GetAllowedValues() // Object values are empty but custom field is not required, skip further validation @@ -575,6 +714,17 @@ func BoolFieldSchema(id, displayName string, required bool) *v2.TicketCustomFiel } } +func NumberFieldSchema(id, displayName string, required bool) *v2.TicketCustomField { + return &v2.TicketCustomField{ + Id: id, + DisplayName: displayName, + Required: required, + Value: &v2.TicketCustomField_NumberValue{ + NumberValue: &v2.TicketCustomFieldNumberValue{}, + }, + } +} + func BoolField(id string, value bool) *v2.TicketCustomField { return &v2.TicketCustomField{ Id: id, @@ -586,6 +736,17 @@ func BoolField(id string, value bool) *v2.TicketCustomField { } } +func NumberField(id string, value float32) *v2.TicketCustomField { + return &v2.TicketCustomField{ + Id: id, + Value: &v2.TicketCustomField_NumberValue{ + NumberValue: &v2.TicketCustomFieldNumberValue{ + Value: wrapperspb.Float(value), + }, + }, + } +} + func TimestampFieldSchema(id, displayName string, required bool) *v2.TicketCustomField { return &v2.TicketCustomField{ Id: id, diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/uhttp/client.go b/vendor/github.com/conductorone/baton-sdk/pkg/uhttp/client.go index 7d679515..6b800c58 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/uhttp/client.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/uhttp/client.go @@ -4,6 +4,7 @@ import ( "context" "crypto/tls" "net/http" + "time" "go.uber.org/zap" ) @@ -61,11 +62,13 @@ type Option interface { // NewClient creates a new HTTP client that uses the given context and options to create a new transport layer. func NewClient(ctx context.Context, options ...Option) (*http.Client, error) { + httpClient := &http.Client{ + Timeout: 300 * time.Second, // 5 minutes + } t, err := NewTransport(ctx, options...) if err != nil { return nil, err } - return &http.Client{ - Transport: t, - }, nil + httpClient.Transport = t + return httpClient, nil } diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/uhttp/contenttype.go b/vendor/github.com/conductorone/baton-sdk/pkg/uhttp/contenttype.go new file mode 100644 index 00000000..cbad9818 --- /dev/null +++ b/vendor/github.com/conductorone/baton-sdk/pkg/uhttp/contenttype.go @@ -0,0 +1,25 @@ +package uhttp + +import "strings" + +var xmlContentTypes []string = []string{ + "text/xml", + "application/xml", +} + +func IsJSONContentType(contentType string) bool { + return strings.HasPrefix(contentType, "application") && + strings.Contains(contentType, "json") +} + +func IsXMLContentType(contentType string) bool { + // there are some janky APIs out there + normalizedContentType := strings.TrimSpace(strings.ToLower(contentType)) + + for _, xmlContentType := range xmlContentTypes { + if strings.HasPrefix(normalizedContentType, xmlContentType) { + return true + } + } + return false +} diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/uhttp/gocache.go b/vendor/github.com/conductorone/baton-sdk/pkg/uhttp/gocache.go new file mode 100644 index 00000000..7fbf0b04 --- /dev/null +++ b/vendor/github.com/conductorone/baton-sdk/pkg/uhttp/gocache.go @@ -0,0 +1,187 @@ +package uhttp + +import ( + "bufio" + "bytes" + "context" + "crypto/sha256" + "fmt" + "net/http" + "net/http/httputil" + "sort" + "strings" + "time" + + bigCache "github.com/allegro/bigcache/v3" + "github.com/grpc-ecosystem/go-grpc-middleware/logging/zap/ctxzap" + "go.uber.org/zap" +) + +type GoCache struct { + rootLibrary *bigCache.BigCache +} + +func NewGoCache(ctx context.Context, cfg CacheConfig) (GoCache, error) { + l := ctxzap.Extract(ctx) + if cfg.DisableCache { + l.Debug("http cache disabled") + return GoCache{}, nil + } + config := bigCache.DefaultConfig(time.Duration(cfg.CacheTTL) * time.Second) + config.Verbose = cfg.LogDebug + config.Shards = 4 + config.HardMaxCacheSize = cfg.CacheMaxSize // value in MB, 0 value means no size limit + cache, err := bigCache.New(ctx, config) + if err != nil { + l.Error("http cache initialization error", zap.Error(err)) + return GoCache{}, err + } + + l.Debug("http cache config", + zap.Dict("config", + zap.Int("Shards", config.Shards), + zap.Duration("LifeWindow", config.LifeWindow), + zap.Duration("CleanWindow", config.CleanWindow), + zap.Int("MaxEntriesInWindow", config.MaxEntriesInWindow), + zap.Int("MaxEntrySize", config.MaxEntrySize), + zap.Bool("StatsEnabled", config.StatsEnabled), + zap.Bool("Verbose", config.Verbose), + zap.Int("HardMaxCacheSize", config.HardMaxCacheSize), + )) + gc := GoCache{ + rootLibrary: cache, + } + + return gc, nil +} + +func (g *GoCache) Statistics() bigCache.Stats { + if g.rootLibrary == nil { + return bigCache.Stats{} + } + + return g.rootLibrary.Stats() +} + +// CreateCacheKey generates a cache key based on the request URL, query parameters, and headers. +// The key is a SHA-256 hash of the normalized URL path, sorted query parameters, and relevant headers. +func CreateCacheKey(req *http.Request) (string, error) { + // Normalize the URL path + path := strings.ToLower(req.URL.Path) + + // Combine the path with sorted query parameters + queryParams := req.URL.Query() + var sortedParams []string + for k, v := range queryParams { + for _, value := range v { + sortedParams = append(sortedParams, fmt.Sprintf("%s=%s", k, value)) + } + } + + sort.Strings(sortedParams) + queryString := strings.Join(sortedParams, "&") + + // Include relevant headers in the cache key + var headerParts []string + for key, values := range req.Header { + for _, value := range values { + if key == "Accept" || key == "Authorization" || key == "Cookie" || key == "Range" { + headerParts = append(headerParts, fmt.Sprintf("%s=%s", key, value)) + } + } + } + + sort.Strings(headerParts) + headersString := strings.Join(headerParts, "&") + + // Create a unique string for the cache key + cacheString := fmt.Sprintf("%s?%s&headers=%s", path, queryString, headersString) + + // Hash the cache string to create a key + hash := sha256.New() + _, err := hash.Write([]byte(cacheString)) + if err != nil { + return "", err + } + + cacheKey := fmt.Sprintf("%x", hash.Sum(nil)) + return cacheKey, nil +} + +func (g *GoCache) Get(key string) (*http.Response, error) { + if g.rootLibrary == nil { + return nil, nil + } + + entry, err := g.rootLibrary.Get(key) + if err == nil { + r := bufio.NewReader(bytes.NewReader(entry)) + resp, err := http.ReadResponse(r, nil) + if err != nil { + return nil, err + } + + return resp, nil + } + + return nil, nil +} + +func (g *GoCache) Set(key string, value *http.Response) error { + if g.rootLibrary == nil { + return nil + } + + cacheableResponse, err := httputil.DumpResponse(value, true) + if err != nil { + return err + } + + err = g.rootLibrary.Set(key, cacheableResponse) + if err != nil { + return err + } + + return nil +} + +func (g *GoCache) Delete(key string) error { + if g.rootLibrary == nil { + return nil + } + + err := g.rootLibrary.Delete(key) + if err != nil { + return err + } + + return nil +} + +func (g *GoCache) Clear(ctx context.Context) error { + l := ctxzap.Extract(ctx) + if g.rootLibrary == nil { + l.Debug("clear: rootLibrary is nil") + return nil + } + + err := g.rootLibrary.Reset() + if err != nil { + return err + } + err = g.rootLibrary.ResetStats() + if err != nil { + return err + } + + l.Debug("reset cache") + return nil +} + +func (g *GoCache) Has(key string) bool { + if g.rootLibrary == nil { + return false + } + _, found := g.rootLibrary.Get(key) + return found == nil +} diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/uhttp/transport.go b/vendor/github.com/conductorone/baton-sdk/pkg/uhttp/transport.go index eb08761c..4fd56e47 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/uhttp/transport.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/uhttp/transport.go @@ -85,7 +85,7 @@ func (uat *userAgentTripper) RoundTrip(req *http.Request) (*http.Response, error return uat.next.RoundTrip(req) } -func (t *Transport) make(ctx context.Context) (http.RoundTripper, error) { +func (t *Transport) make(_ context.Context) (http.RoundTripper, error) { // based on http.DefaultTransport baseTransport := &http.Transport{ Proxy: http.ProxyFromEnvironment, diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/uhttp/wrapper.go b/vendor/github.com/conductorone/baton-sdk/pkg/uhttp/wrapper.go index ce947697..377ca9e1 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/uhttp/wrapper.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/uhttp/wrapper.go @@ -5,13 +5,18 @@ import ( "context" "encoding/json" "encoding/xml" + "errors" "fmt" "io" "net/http" "net/url" + "os" + "strconv" v2 "github.com/conductorone/baton-sdk/pb/c1/connector/v2" - "github.com/conductorone/baton-sdk/pkg/helpers" + "github.com/conductorone/baton-sdk/pkg/ratelimit" + "github.com/grpc-ecosystem/go-grpc-middleware/logging/zap/ctxzap" + "go.uber.org/zap" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) @@ -23,6 +28,8 @@ const ( applicationFormUrlencoded = "application/x-www-form-urlencoded" applicationVndApiJSON = "application/vnd.api+json" acceptHeader = "Accept" + cacheTTLMaximum = 31536000 // 31536000 seconds = one year + cacheTTLDefault = 3600 // 3600 seconds = one hour ) type WrapperResponse struct { @@ -32,6 +39,22 @@ type WrapperResponse struct { StatusCode int } +// Keep a handle on all caches so we can clear them later. +var caches []GoCache + +func ClearCaches(ctx context.Context) error { + l := ctxzap.Extract(ctx) + l.Debug("clearing caches") + var err error + for _, cache := range caches { + err = cache.Clear(ctx) + if err != nil { + err = errors.Join(err, err) + } + } + return err +} + type ( HttpClient interface { HttpClient() *http.Client @@ -39,17 +62,82 @@ type ( NewRequest(ctx context.Context, method string, url *url.URL, options ...RequestOption) (*http.Request, error) } BaseHttpClient struct { - HttpClient *http.Client + HttpClient *http.Client + baseHttpCache GoCache } DoOption func(resp *WrapperResponse) error RequestOption func() (io.ReadWriter, map[string]string, error) + ContextKey struct{} + CacheConfig struct { + LogDebug bool + CacheTTL int32 + CacheMaxSize int + DisableCache bool + } ) func NewBaseHttpClient(httpClient *http.Client) *BaseHttpClient { - return &BaseHttpClient{ - HttpClient: httpClient, + ctx := context.TODO() + client, err := NewBaseHttpClientWithContext(ctx, httpClient) + if err != nil { + return nil } + return client +} + +// getCacheTTL read the `BATON_HTTP_CACHE_TTL` environment variable and return +// the value as a number of seconds between 0 and an arbitrary maximum. Note: +// this means that passing a value of `-1` will set the TTL to zero rather than +// infinity. +func getCacheTTL() int32 { + cacheTTL, err := strconv.ParseInt(os.Getenv("BATON_HTTP_CACHE_TTL"), 10, 64) + if err != nil { + cacheTTL = cacheTTLDefault // seconds + } + + cacheTTL = min(cacheTTLMaximum, max(0, cacheTTL)) + + //nolint:gosec // No risk of overflow because we have a low maximum. + return int32(cacheTTL) +} + +func NewBaseHttpClientWithContext(ctx context.Context, httpClient *http.Client) (*BaseHttpClient, error) { + l := ctxzap.Extract(ctx) + disableCache, err := strconv.ParseBool(os.Getenv("BATON_DISABLE_HTTP_CACHE")) + if err != nil { + disableCache = false + } + cacheMaxSize, err := strconv.ParseInt(os.Getenv("BATON_HTTP_CACHE_MAX_SIZE"), 10, 64) + if err != nil { + cacheMaxSize = 128 // MB + } + var ( + config = CacheConfig{ + LogDebug: l.Level().Enabled(zap.DebugLevel), + CacheTTL: getCacheTTL(), // seconds + CacheMaxSize: int(cacheMaxSize), // MB + DisableCache: disableCache, + } + ok bool + ) + if v := ctx.Value(ContextKey{}); v != nil { + if config, ok = v.(CacheConfig); !ok { + return nil, fmt.Errorf("error casting config values from context") + } + } + + cache, err := NewGoCache(ctx, config) + if err != nil { + l.Error("error creating http cache", zap.Error(err)) + return nil, err + } + caches = append(caches, cache) + + return &BaseHttpClient{ + HttpClient: httpClient, + baseHttpCache: cache, + }, nil } // WithJSONResponse is a wrapper that marshals the returned response body into @@ -57,13 +145,17 @@ func NewBaseHttpClient(httpClient *http.Client) *BaseHttpClient { // status code 204 No Content), then pass a `nil` to `response`. func WithJSONResponse(response interface{}) DoOption { return func(resp *WrapperResponse) error { - if !helpers.IsJSONContentType(resp.Header.Get(ContentType)) { + if !IsJSONContentType(resp.Header.Get(ContentType)) { return fmt.Errorf("unexpected content type for json response: %s", resp.Header.Get(ContentType)) } if response == nil && len(resp.Body) == 0 { return nil } - return json.Unmarshal(resp.Body, response) + err := json.Unmarshal(resp.Body, response) + if err != nil { + return fmt.Errorf("failed to unmarshal json response: %w. body %v", err, resp.Body) + } + return nil } } @@ -77,7 +169,7 @@ func WithErrorResponse(resource ErrorResponse) DoOption { return nil } - if !helpers.IsJSONContentType(resp.Header.Get(ContentType)) { + if !IsJSONContentType(resp.Header.Get(ContentType)) { return fmt.Errorf("%v", string(resp.Body)) } @@ -95,7 +187,7 @@ func WithErrorResponse(resource ErrorResponse) DoOption { func WithRatelimitData(resource *v2.RateLimitDescription) DoOption { return func(resp *WrapperResponse) error { - rl, err := helpers.ExtractRateLimitData(resp.StatusCode, &resp.Header) + rl, err := ratelimit.ExtractRateLimitData(resp.StatusCode, &resp.Header) if err != nil { return err } @@ -111,22 +203,26 @@ func WithRatelimitData(resource *v2.RateLimitDescription) DoOption { func WithXMLResponse(response interface{}) DoOption { return func(resp *WrapperResponse) error { - if !helpers.IsXMLContentType(resp.Header.Get(ContentType)) { + if !IsXMLContentType(resp.Header.Get(ContentType)) { return fmt.Errorf("unexpected content type for xml response: %s", resp.Header.Get(ContentType)) } if response == nil && len(resp.Body) == 0 { return nil } - return xml.Unmarshal(resp.Body, response) + err := xml.Unmarshal(resp.Body, response) + if err != nil { + return fmt.Errorf("failed to unmarshal xml response: %w. body %v", err, resp.Body) + } + return nil } } func WithResponse(response interface{}) DoOption { return func(resp *WrapperResponse) error { - if helpers.IsJSONContentType(resp.Header.Get(ContentType)) { + if IsJSONContentType(resp.Header.Get(ContentType)) { return WithJSONResponse(response)(resp) } - if helpers.IsXMLContentType(resp.Header.Get(ContentType)) { + if IsXMLContentType(resp.Header.Get(ContentType)) { return WithXMLResponse(response)(resp) } @@ -134,17 +230,65 @@ func WithResponse(response interface{}) DoOption { } } +func WrapErrorsWithRateLimitInfo(preferredCode codes.Code, resp *http.Response, errs ...error) error { + st := status.New(preferredCode, resp.Status) + + description, err := ratelimit.ExtractRateLimitData(resp.StatusCode, &resp.Header) + // Ignore any error extracting rate limit data + if err == nil { + st, _ = st.WithDetails(description) + } + + if len(errs) == 0 { + return st.Err() + } + + allErrs := append([]error{st.Err()}, errs...) + return errors.Join(allErrs...) +} + func (c *BaseHttpClient) Do(req *http.Request, options ...DoOption) (*http.Response, error) { - resp, err := c.HttpClient.Do(req) - if err != nil { - return nil, err + var ( + cacheKey string + err error + resp *http.Response + ) + l := ctxzap.Extract(req.Context()) + if req.Method == http.MethodGet { + cacheKey, err = CreateCacheKey(req) + if err != nil { + return nil, err + } + + resp, err = c.baseHttpCache.Get(cacheKey) + if err != nil { + return nil, err + } + if resp == nil { + l.Debug("http cache miss", zap.String("cacheKey", cacheKey), zap.String("url", req.URL.String())) + } else { + l.Debug("http cache hit", zap.String("cacheKey", cacheKey), zap.String("url", req.URL.String())) + } } - body, err := io.ReadAll(resp.Body) - if err != nil { - return nil, err + if resp == nil { + resp, err = c.HttpClient.Do(req) + if err != nil { + var urlErr *url.Error + if errors.As(err, &urlErr) { + if urlErr.Timeout() { + return nil, status.Error(codes.DeadlineExceeded, fmt.Sprintf("request timeout: %v", urlErr.URL)) + } + } + if errors.Is(err, context.DeadlineExceeded) { + return nil, status.Error(codes.DeadlineExceeded, "request timeout") + } + return nil, err + } } - err = resp.Body.Close() + + defer resp.Body.Close() + body, err := io.ReadAll(resp.Body) if err != nil { return nil, err } @@ -158,31 +302,46 @@ func (c *BaseHttpClient) Do(req *http.Request, options ...DoOption) (*http.Respo StatusCode: resp.StatusCode, Body: body, } + + var optErrs []error for _, option := range options { - err = option(&wresp) - if err != nil { - return resp, err + optErr := option(&wresp) + if optErr != nil { + optErrs = append(optErrs, optErr) } } switch resp.StatusCode { - case http.StatusTooManyRequests: - return resp, status.Error(codes.Unavailable, resp.Status) + case http.StatusRequestTimeout: + return resp, WrapErrorsWithRateLimitInfo(codes.DeadlineExceeded, resp, optErrs...) + case http.StatusTooManyRequests, http.StatusServiceUnavailable: + return resp, WrapErrorsWithRateLimitInfo(codes.Unavailable, resp, optErrs...) case http.StatusNotFound: - return resp, status.Error(codes.NotFound, resp.Status) + return resp, WrapErrorsWithRateLimitInfo(codes.NotFound, resp, optErrs...) case http.StatusUnauthorized: - return resp, status.Error(codes.Unauthenticated, resp.Status) + return resp, WrapErrorsWithRateLimitInfo(codes.Unauthenticated, resp, optErrs...) case http.StatusForbidden: - return resp, status.Error(codes.PermissionDenied, resp.Status) + return resp, WrapErrorsWithRateLimitInfo(codes.PermissionDenied, resp, optErrs...) case http.StatusNotImplemented: - return resp, status.Error(codes.Unimplemented, resp.Status) + return resp, WrapErrorsWithRateLimitInfo(codes.Unimplemented, resp, optErrs...) + } + + if resp.StatusCode >= 500 && resp.StatusCode <= 599 { + return resp, WrapErrorsWithRateLimitInfo(codes.Unavailable, resp, optErrs...) } if resp.StatusCode < 200 || resp.StatusCode >= 300 { - return resp, status.Error(codes.Unknown, fmt.Sprintf("unexpected status code: %d", resp.StatusCode)) + return resp, WrapErrorsWithRateLimitInfo(codes.Unknown, resp, append(optErrs, fmt.Errorf("unexpected status code: %d", resp.StatusCode))...) + } + + if req.Method == http.MethodGet && resp.StatusCode == http.StatusOK { + cacheErr := c.baseHttpCache.Set(cacheKey, resp) + if cacheErr != nil { + l.Warn("error setting cache", zap.String("cacheKey", cacheKey), zap.String("url", req.URL.String()), zap.Error(cacheErr)) + } } - return resp, err + return resp, errors.Join(optErrs...) } func WithHeader(key, value string) RequestOption { diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/ustrings/cli.go b/vendor/github.com/conductorone/baton-sdk/pkg/ustrings/cli.go new file mode 100644 index 00000000..44c82520 --- /dev/null +++ b/vendor/github.com/conductorone/baton-sdk/pkg/ustrings/cli.go @@ -0,0 +1,59 @@ +package ustrings + +import ( + "fmt" + "strings" +) + +const ( + flagSeparator = " " + flagPrefix = "--" + flagListSeparator = "," + flagDefaultValue = "true" +) + +func handleEmptyFlag(currentFlag string, output map[string]string) error { + if currentFlag != "" { + if _, ok := output[currentFlag]; ok { + return fmt.Errorf("duplicate flag has no value: %s", currentFlag) + } + output[currentFlag] = flagDefaultValue + } + return nil +} + +// ParseFlags - convert command line flags to a map of keys to strings. +func ParseFlags(expression string) (map[string]string, error) { + output := make(map[string]string) + trimmed := strings.TrimSpace(expression) + if trimmed == "" { + return output, nil + } + tokens := strings.Split(trimmed, flagSeparator) + currentFlag := "" + for _, token := range tokens { + if strings.HasPrefix(token, flagPrefix) { + err := handleEmptyFlag(currentFlag, output) + if err != nil { + return nil, err + } + currentFlag = strings.TrimPrefix(token, flagPrefix) + } else { + if currentFlag == "" { + return nil, fmt.Errorf("got a value without a flag: %s", token) + } + toAdd := TrimQuotes(token) + if found, ok := output[currentFlag]; ok { + toAdd = found + flagListSeparator + token + } + output[currentFlag] = toAdd + currentFlag = "" + } + } + // Clean up final flag if it exists. + err := handleEmptyFlag(currentFlag, output) + if err != nil { + return nil, err + } + return output, nil +} diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/ustrings/oxford.go b/vendor/github.com/conductorone/baton-sdk/pkg/ustrings/oxford.go new file mode 100644 index 00000000..264e5665 --- /dev/null +++ b/vendor/github.com/conductorone/baton-sdk/pkg/ustrings/oxford.go @@ -0,0 +1,107 @@ +package ustrings + +import ( + "fmt" + "strings" +) + +const ( + ConjunctionDefault = "and" + SeparatorDefault = "," + WrappersDefault = Empty + EmptyListMessageDefault = "" +) + +type OxfordConfigs struct { + conjunction string + separator string + wrappersInner WrapOption + wrappersOuter WrapOption + emptyListMessage string +} + +type OxfordOptions func(config *OxfordConfigs) + +func WithConjunction(conjunction string) OxfordOptions { + return func(config *OxfordConfigs) { + config.conjunction = conjunction + } +} + +func WithSeparator(separator string) OxfordOptions { + return func(config *OxfordConfigs) { + config.separator = separator + } +} + +func WithInnerWrappers(wrappers WrapOption) OxfordOptions { + return func(config *OxfordConfigs) { + config.wrappersInner = wrappers + } +} + +func WithOuterWrappers(wrappers WrapOption) OxfordOptions { + return func(config *OxfordConfigs) { + config.wrappersOuter = wrappers + } +} + +func WithEmptyListMessage(message string) OxfordOptions { + return func(config *OxfordConfigs) { + config.emptyListMessage = message + } +} + +func OxfordizeList(elements []string, options ...OxfordOptions) string { + configs := OxfordConfigs{ + conjunction: ConjunctionDefault, + separator: SeparatorDefault, + wrappersInner: WrappersDefault, + wrappersOuter: WrappersDefault, + emptyListMessage: EmptyListMessageDefault, + } + for _, option := range options { + option(&configs) + } + + wrapped := make([]string, 0) + for _, element := range elements { + wrapped = append( + wrapped, + WrapString( + element, + configs.wrappersInner, + ), + ) + } + + last := len(elements) - 1 + var output string + switch len(elements) { + case 0: + output = configs.emptyListMessage + case 1: + output = wrapped[0] + case 2: + output = fmt.Sprintf( + "%s %s %s", + wrapped[0], + configs.conjunction, + wrapped[last], + ) + default: + wrapped[last] = fmt.Sprintf( + "%s %s", + configs.conjunction, + wrapped[last], + ) + output = strings.Join( + wrapped, + fmt.Sprintf( + "%s ", + configs.separator, + ), + ) + } + return WrapString(output, configs.wrappersOuter) +} diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/ustrings/wrap.go b/vendor/github.com/conductorone/baton-sdk/pkg/ustrings/wrap.go new file mode 100644 index 00000000..fce1bdec --- /dev/null +++ b/vendor/github.com/conductorone/baton-sdk/pkg/ustrings/wrap.go @@ -0,0 +1,56 @@ +package ustrings + +import ( + "fmt" + "strings" +) + +type WrapOption int + +const ( + Empty WrapOption = iota + SingleQuotes + DoubleQuotes + TackQuotes + Parentheses + SquareBrackets + AngleBrackets +) + +const ( + quoteOptions = "'\"`" +) + +// TrimQuotes - given an input string, remove one layer of surrounding quotes if +// they exist. +func TrimQuotes(input string) string { + if len(input) <= 1 { + return input + } + for _, char := range strings.Split(quoteOptions, "") { + if strings.HasPrefix(input, char) && + strings.HasSuffix(input, char) { + return input[1 : len(input)-1] + } + } + return input +} + +func WrapString(input string, wrappers WrapOption) string { + switch wrappers { + case SingleQuotes: + return fmt.Sprintf("'%s'", input) + case DoubleQuotes: + return fmt.Sprintf(`"%s"`, input) + case TackQuotes: + return fmt.Sprintf("`%s`", input) + case Parentheses: + return fmt.Sprintf("(%s)", input) + case SquareBrackets: + return fmt.Sprintf("[%s]", input) + case AngleBrackets: + return fmt.Sprintf("<%s>", input) + default: + return input + } +} diff --git a/vendor/google.golang.org/protobuf/types/known/wrapperspb/wrappers.pb.go b/vendor/google.golang.org/protobuf/types/known/wrapperspb/wrappers.pb.go new file mode 100644 index 00000000..762a8713 --- /dev/null +++ b/vendor/google.golang.org/protobuf/types/known/wrapperspb/wrappers.pb.go @@ -0,0 +1,760 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Wrappers for primitive (non-message) types. These types are useful +// for embedding primitives in the `google.protobuf.Any` type and for places +// where we need to distinguish between the absence of a primitive +// typed field and its default value. +// +// These wrappers have no meaningful use within repeated fields as they lack +// the ability to detect presence on individual elements. +// These wrappers have no meaningful use within a map or a oneof since +// individual entries of a map or fields of a oneof can already detect presence. + +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: google/protobuf/wrappers.proto + +package wrapperspb + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +// Wrapper message for `double`. +// +// The JSON representation for `DoubleValue` is JSON number. +type DoubleValue struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The double value. + Value float64 `protobuf:"fixed64,1,opt,name=value,proto3" json:"value,omitempty"` +} + +// Double stores v in a new DoubleValue and returns a pointer to it. +func Double(v float64) *DoubleValue { + return &DoubleValue{Value: v} +} + +func (x *DoubleValue) Reset() { + *x = DoubleValue{} + if protoimpl.UnsafeEnabled { + mi := &file_google_protobuf_wrappers_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DoubleValue) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DoubleValue) ProtoMessage() {} + +func (x *DoubleValue) ProtoReflect() protoreflect.Message { + mi := &file_google_protobuf_wrappers_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DoubleValue.ProtoReflect.Descriptor instead. +func (*DoubleValue) Descriptor() ([]byte, []int) { + return file_google_protobuf_wrappers_proto_rawDescGZIP(), []int{0} +} + +func (x *DoubleValue) GetValue() float64 { + if x != nil { + return x.Value + } + return 0 +} + +// Wrapper message for `float`. +// +// The JSON representation for `FloatValue` is JSON number. +type FloatValue struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The float value. + Value float32 `protobuf:"fixed32,1,opt,name=value,proto3" json:"value,omitempty"` +} + +// Float stores v in a new FloatValue and returns a pointer to it. +func Float(v float32) *FloatValue { + return &FloatValue{Value: v} +} + +func (x *FloatValue) Reset() { + *x = FloatValue{} + if protoimpl.UnsafeEnabled { + mi := &file_google_protobuf_wrappers_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FloatValue) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FloatValue) ProtoMessage() {} + +func (x *FloatValue) ProtoReflect() protoreflect.Message { + mi := &file_google_protobuf_wrappers_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use FloatValue.ProtoReflect.Descriptor instead. +func (*FloatValue) Descriptor() ([]byte, []int) { + return file_google_protobuf_wrappers_proto_rawDescGZIP(), []int{1} +} + +func (x *FloatValue) GetValue() float32 { + if x != nil { + return x.Value + } + return 0 +} + +// Wrapper message for `int64`. +// +// The JSON representation for `Int64Value` is JSON string. +type Int64Value struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The int64 value. + Value int64 `protobuf:"varint,1,opt,name=value,proto3" json:"value,omitempty"` +} + +// Int64 stores v in a new Int64Value and returns a pointer to it. +func Int64(v int64) *Int64Value { + return &Int64Value{Value: v} +} + +func (x *Int64Value) Reset() { + *x = Int64Value{} + if protoimpl.UnsafeEnabled { + mi := &file_google_protobuf_wrappers_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Int64Value) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Int64Value) ProtoMessage() {} + +func (x *Int64Value) ProtoReflect() protoreflect.Message { + mi := &file_google_protobuf_wrappers_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Int64Value.ProtoReflect.Descriptor instead. +func (*Int64Value) Descriptor() ([]byte, []int) { + return file_google_protobuf_wrappers_proto_rawDescGZIP(), []int{2} +} + +func (x *Int64Value) GetValue() int64 { + if x != nil { + return x.Value + } + return 0 +} + +// Wrapper message for `uint64`. +// +// The JSON representation for `UInt64Value` is JSON string. +type UInt64Value struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The uint64 value. + Value uint64 `protobuf:"varint,1,opt,name=value,proto3" json:"value,omitempty"` +} + +// UInt64 stores v in a new UInt64Value and returns a pointer to it. +func UInt64(v uint64) *UInt64Value { + return &UInt64Value{Value: v} +} + +func (x *UInt64Value) Reset() { + *x = UInt64Value{} + if protoimpl.UnsafeEnabled { + mi := &file_google_protobuf_wrappers_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UInt64Value) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UInt64Value) ProtoMessage() {} + +func (x *UInt64Value) ProtoReflect() protoreflect.Message { + mi := &file_google_protobuf_wrappers_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UInt64Value.ProtoReflect.Descriptor instead. +func (*UInt64Value) Descriptor() ([]byte, []int) { + return file_google_protobuf_wrappers_proto_rawDescGZIP(), []int{3} +} + +func (x *UInt64Value) GetValue() uint64 { + if x != nil { + return x.Value + } + return 0 +} + +// Wrapper message for `int32`. +// +// The JSON representation for `Int32Value` is JSON number. +type Int32Value struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The int32 value. + Value int32 `protobuf:"varint,1,opt,name=value,proto3" json:"value,omitempty"` +} + +// Int32 stores v in a new Int32Value and returns a pointer to it. +func Int32(v int32) *Int32Value { + return &Int32Value{Value: v} +} + +func (x *Int32Value) Reset() { + *x = Int32Value{} + if protoimpl.UnsafeEnabled { + mi := &file_google_protobuf_wrappers_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Int32Value) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Int32Value) ProtoMessage() {} + +func (x *Int32Value) ProtoReflect() protoreflect.Message { + mi := &file_google_protobuf_wrappers_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Int32Value.ProtoReflect.Descriptor instead. +func (*Int32Value) Descriptor() ([]byte, []int) { + return file_google_protobuf_wrappers_proto_rawDescGZIP(), []int{4} +} + +func (x *Int32Value) GetValue() int32 { + if x != nil { + return x.Value + } + return 0 +} + +// Wrapper message for `uint32`. +// +// The JSON representation for `UInt32Value` is JSON number. +type UInt32Value struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The uint32 value. + Value uint32 `protobuf:"varint,1,opt,name=value,proto3" json:"value,omitempty"` +} + +// UInt32 stores v in a new UInt32Value and returns a pointer to it. +func UInt32(v uint32) *UInt32Value { + return &UInt32Value{Value: v} +} + +func (x *UInt32Value) Reset() { + *x = UInt32Value{} + if protoimpl.UnsafeEnabled { + mi := &file_google_protobuf_wrappers_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UInt32Value) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UInt32Value) ProtoMessage() {} + +func (x *UInt32Value) ProtoReflect() protoreflect.Message { + mi := &file_google_protobuf_wrappers_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UInt32Value.ProtoReflect.Descriptor instead. +func (*UInt32Value) Descriptor() ([]byte, []int) { + return file_google_protobuf_wrappers_proto_rawDescGZIP(), []int{5} +} + +func (x *UInt32Value) GetValue() uint32 { + if x != nil { + return x.Value + } + return 0 +} + +// Wrapper message for `bool`. +// +// The JSON representation for `BoolValue` is JSON `true` and `false`. +type BoolValue struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The bool value. + Value bool `protobuf:"varint,1,opt,name=value,proto3" json:"value,omitempty"` +} + +// Bool stores v in a new BoolValue and returns a pointer to it. +func Bool(v bool) *BoolValue { + return &BoolValue{Value: v} +} + +func (x *BoolValue) Reset() { + *x = BoolValue{} + if protoimpl.UnsafeEnabled { + mi := &file_google_protobuf_wrappers_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *BoolValue) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BoolValue) ProtoMessage() {} + +func (x *BoolValue) ProtoReflect() protoreflect.Message { + mi := &file_google_protobuf_wrappers_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use BoolValue.ProtoReflect.Descriptor instead. +func (*BoolValue) Descriptor() ([]byte, []int) { + return file_google_protobuf_wrappers_proto_rawDescGZIP(), []int{6} +} + +func (x *BoolValue) GetValue() bool { + if x != nil { + return x.Value + } + return false +} + +// Wrapper message for `string`. +// +// The JSON representation for `StringValue` is JSON string. +type StringValue struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The string value. + Value string `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` +} + +// String stores v in a new StringValue and returns a pointer to it. +func String(v string) *StringValue { + return &StringValue{Value: v} +} + +func (x *StringValue) Reset() { + *x = StringValue{} + if protoimpl.UnsafeEnabled { + mi := &file_google_protobuf_wrappers_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StringValue) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StringValue) ProtoMessage() {} + +func (x *StringValue) ProtoReflect() protoreflect.Message { + mi := &file_google_protobuf_wrappers_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use StringValue.ProtoReflect.Descriptor instead. +func (*StringValue) Descriptor() ([]byte, []int) { + return file_google_protobuf_wrappers_proto_rawDescGZIP(), []int{7} +} + +func (x *StringValue) GetValue() string { + if x != nil { + return x.Value + } + return "" +} + +// Wrapper message for `bytes`. +// +// The JSON representation for `BytesValue` is JSON string. +type BytesValue struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The bytes value. + Value []byte `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` +} + +// Bytes stores v in a new BytesValue and returns a pointer to it. +func Bytes(v []byte) *BytesValue { + return &BytesValue{Value: v} +} + +func (x *BytesValue) Reset() { + *x = BytesValue{} + if protoimpl.UnsafeEnabled { + mi := &file_google_protobuf_wrappers_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *BytesValue) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BytesValue) ProtoMessage() {} + +func (x *BytesValue) ProtoReflect() protoreflect.Message { + mi := &file_google_protobuf_wrappers_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use BytesValue.ProtoReflect.Descriptor instead. +func (*BytesValue) Descriptor() ([]byte, []int) { + return file_google_protobuf_wrappers_proto_rawDescGZIP(), []int{8} +} + +func (x *BytesValue) GetValue() []byte { + if x != nil { + return x.Value + } + return nil +} + +var File_google_protobuf_wrappers_proto protoreflect.FileDescriptor + +var file_google_protobuf_wrappers_proto_rawDesc = []byte{ + 0x0a, 0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2f, 0x77, 0x72, 0x61, 0x70, 0x70, 0x65, 0x72, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x12, 0x0f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x22, 0x23, 0x0a, 0x0b, 0x44, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, + 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x01, 0x52, + 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x22, 0x0a, 0x0a, 0x46, 0x6c, 0x6f, 0x61, 0x74, 0x56, + 0x61, 0x6c, 0x75, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x02, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x22, 0x0a, 0x0a, 0x49, 0x6e, + 0x74, 0x36, 0x34, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x23, + 0x0a, 0x0b, 0x55, 0x49, 0x6e, 0x74, 0x36, 0x34, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x14, 0x0a, + 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x22, 0x22, 0x0a, 0x0a, 0x49, 0x6e, 0x74, 0x33, 0x32, 0x56, 0x61, 0x6c, 0x75, + 0x65, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x23, 0x0a, 0x0b, 0x55, 0x49, 0x6e, 0x74, 0x33, + 0x32, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x21, 0x0a, 0x09, + 0x42, 0x6f, 0x6f, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, + 0x23, 0x0a, 0x0b, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x14, + 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x22, 0x22, 0x0a, 0x0a, 0x42, 0x79, 0x74, 0x65, 0x73, 0x56, 0x61, 0x6c, + 0x75, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0c, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x42, 0x83, 0x01, 0x0a, 0x13, 0x63, 0x6f, 0x6d, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x42, 0x0d, 0x57, 0x72, 0x61, 0x70, 0x70, 0x65, 0x72, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, + 0x01, 0x5a, 0x31, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x67, 0x6f, 0x6c, 0x61, 0x6e, 0x67, + 0x2e, 0x6f, 0x72, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x79, + 0x70, 0x65, 0x73, 0x2f, 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x2f, 0x77, 0x72, 0x61, 0x70, 0x70, 0x65, + 0x72, 0x73, 0x70, 0x62, 0xf8, 0x01, 0x01, 0xa2, 0x02, 0x03, 0x47, 0x50, 0x42, 0xaa, 0x02, 0x1e, + 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, + 0x57, 0x65, 0x6c, 0x6c, 0x4b, 0x6e, 0x6f, 0x77, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x73, 0x62, 0x06, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_google_protobuf_wrappers_proto_rawDescOnce sync.Once + file_google_protobuf_wrappers_proto_rawDescData = file_google_protobuf_wrappers_proto_rawDesc +) + +func file_google_protobuf_wrappers_proto_rawDescGZIP() []byte { + file_google_protobuf_wrappers_proto_rawDescOnce.Do(func() { + file_google_protobuf_wrappers_proto_rawDescData = protoimpl.X.CompressGZIP(file_google_protobuf_wrappers_proto_rawDescData) + }) + return file_google_protobuf_wrappers_proto_rawDescData +} + +var file_google_protobuf_wrappers_proto_msgTypes = make([]protoimpl.MessageInfo, 9) +var file_google_protobuf_wrappers_proto_goTypes = []interface{}{ + (*DoubleValue)(nil), // 0: google.protobuf.DoubleValue + (*FloatValue)(nil), // 1: google.protobuf.FloatValue + (*Int64Value)(nil), // 2: google.protobuf.Int64Value + (*UInt64Value)(nil), // 3: google.protobuf.UInt64Value + (*Int32Value)(nil), // 4: google.protobuf.Int32Value + (*UInt32Value)(nil), // 5: google.protobuf.UInt32Value + (*BoolValue)(nil), // 6: google.protobuf.BoolValue + (*StringValue)(nil), // 7: google.protobuf.StringValue + (*BytesValue)(nil), // 8: google.protobuf.BytesValue +} +var file_google_protobuf_wrappers_proto_depIdxs = []int32{ + 0, // [0:0] is the sub-list for method output_type + 0, // [0:0] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_google_protobuf_wrappers_proto_init() } +func file_google_protobuf_wrappers_proto_init() { + if File_google_protobuf_wrappers_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_google_protobuf_wrappers_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DoubleValue); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_google_protobuf_wrappers_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FloatValue); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_google_protobuf_wrappers_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Int64Value); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_google_protobuf_wrappers_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UInt64Value); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_google_protobuf_wrappers_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Int32Value); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_google_protobuf_wrappers_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UInt32Value); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_google_protobuf_wrappers_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*BoolValue); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_google_protobuf_wrappers_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StringValue); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_google_protobuf_wrappers_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*BytesValue); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_google_protobuf_wrappers_proto_rawDesc, + NumEnums: 0, + NumMessages: 9, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_google_protobuf_wrappers_proto_goTypes, + DependencyIndexes: file_google_protobuf_wrappers_proto_depIdxs, + MessageInfos: file_google_protobuf_wrappers_proto_msgTypes, + }.Build() + File_google_protobuf_wrappers_proto = out.File + file_google_protobuf_wrappers_proto_rawDesc = nil + file_google_protobuf_wrappers_proto_goTypes = nil + file_google_protobuf_wrappers_proto_depIdxs = nil +} diff --git a/vendor/modules.txt b/vendor/modules.txt index b5bcd37c..48561911 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -9,6 +9,10 @@ filippo.io/age/internal/stream ## explicit; go 1.20 filippo.io/edwards25519 filippo.io/edwards25519/field +# github.com/allegro/bigcache/v3 v3.1.0 +## explicit; go 1.16 +github.com/allegro/bigcache/v3 +github.com/allegro/bigcache/v3/queue # github.com/aws/aws-sdk-go-v2 v1.26.1 ## explicit; go 1.20 github.com/aws/aws-sdk-go-v2/aws @@ -140,7 +144,7 @@ github.com/aws/smithy-go/waiter # github.com/benbjohnson/clock v1.3.5 ## explicit; go 1.15 github.com/benbjohnson/clock -# github.com/conductorone/baton-sdk v0.2.13 +# github.com/conductorone/baton-sdk v0.2.35 ## explicit; go 1.21 github.com/conductorone/baton-sdk/internal/connector github.com/conductorone/baton-sdk/pb/c1/c1z/v1 @@ -164,7 +168,6 @@ github.com/conductorone/baton-sdk/pkg/dotc1z/manager github.com/conductorone/baton-sdk/pkg/dotc1z/manager/local github.com/conductorone/baton-sdk/pkg/dotc1z/manager/s3 github.com/conductorone/baton-sdk/pkg/field -github.com/conductorone/baton-sdk/pkg/helpers github.com/conductorone/baton-sdk/pkg/logging github.com/conductorone/baton-sdk/pkg/metrics github.com/conductorone/baton-sdk/pkg/pagination @@ -185,6 +188,7 @@ github.com/conductorone/baton-sdk/pkg/types/ticket github.com/conductorone/baton-sdk/pkg/ugrpc github.com/conductorone/baton-sdk/pkg/uhttp github.com/conductorone/baton-sdk/pkg/us3 +github.com/conductorone/baton-sdk/pkg/ustrings github.com/conductorone/baton-sdk/pkg/utls # github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc ## explicit @@ -577,6 +581,7 @@ google.golang.org/protobuf/types/known/anypb google.golang.org/protobuf/types/known/durationpb google.golang.org/protobuf/types/known/structpb google.golang.org/protobuf/types/known/timestamppb +google.golang.org/protobuf/types/known/wrapperspb # gopkg.in/ini.v1 v1.67.0 ## explicit gopkg.in/ini.v1