diff --git a/internal/services/server.go b/internal/services/server.go index d003235b54..a4844f0781 100644 --- a/internal/services/server.go +++ b/internal/services/server.go @@ -73,6 +73,7 @@ func RegisterGrpcServices( CaveatTypeSet: permSysConfig.CaveatTypeSet, AdditiveOnly: schemaServiceOption == V1SchemaServiceAdditiveOnly, ExpiringRelsEnabled: permSysConfig.ExpiringRelationshipsEnabled, + DeprecatedRelsEnabled: permSysConfig.DeprecatedRelationshipsEnabled, PerformanceInsightMetricsEnabled: permSysConfig.PerformanceInsightMetricsEnabled, } v1.RegisterSchemaServiceServer(srv, v1svc.NewSchemaServer(schemaConfig)) diff --git a/internal/services/shared/errors.go b/internal/services/shared/errors.go index 05b3907239..4e6d090088 100644 --- a/internal/services/shared/errors.go +++ b/internal/services/shared/errors.go @@ -52,6 +52,21 @@ type SchemaWriteDataValidationError struct { error } +type DeprecationError struct { + error +} + +func NewDeprecationError(namespace string, relation string, comments string) DeprecationError { + if relation == "" { + return DeprecationError{ + error: fmt.Errorf("object %s is deprecated, comments:%s", namespace, comments), + } + } + return DeprecationError{ + error: fmt.Errorf("relation %s#%s is deprecated, comments:%s", namespace, relation, comments), + } +} + // MarshalZerologObject implements zerolog object marshalling. func (err SchemaWriteDataValidationError) MarshalZerologObject(e *zerolog.Event) { e.Err(err.error) @@ -201,6 +216,9 @@ func rewriteError(ctx context.Context, err error, config *ConfigForErrors) error } return status.Errorf(codes.Canceled, "%s", err) + case errors.As(err, &DeprecationError{}): + log.Ctx(ctx).Err(err).Msg("using deprecated relation") + return status.Errorf(codes.Aborted, "%s", err) default: log.Ctx(ctx).Err(err).Msg("received unexpected error") return err diff --git a/internal/services/v1/relationships.go b/internal/services/v1/relationships.go index 87ccd8bd57..338cc89ca4 100644 --- a/internal/services/v1/relationships.go +++ b/internal/services/v1/relationships.go @@ -16,6 +16,7 @@ import ( v1 "github.com/authzed/authzed-go/proto/authzed/api/v1" "github.com/authzed/spicedb/internal/dispatch" + log "github.com/authzed/spicedb/internal/logging" "github.com/authzed/spicedb/internal/middleware" datastoremw "github.com/authzed/spicedb/internal/middleware/datastore" "github.com/authzed/spicedb/internal/middleware/handwrittenvalidation" @@ -34,6 +35,7 @@ import ( "github.com/authzed/spicedb/pkg/genutil" "github.com/authzed/spicedb/pkg/genutil/mapz" "github.com/authzed/spicedb/pkg/middleware/consistency" + corev1 "github.com/authzed/spicedb/pkg/proto/core/v1" dispatchv1 "github.com/authzed/spicedb/pkg/proto/dispatch/v1" "github.com/authzed/spicedb/pkg/tuple" "github.com/authzed/spicedb/pkg/zedtoken" @@ -103,6 +105,9 @@ type PermissionsServerConfig struct { // ExpiringRelationshipsEnabled defines whether or not expiring relationships are enabled. ExpiringRelationshipsEnabled bool + // DeprecatedRelationshipsEnabled defines whether or not deprecated relationships are enabled. + DeprecatedRelationshipsEnabled bool + // CaveatTypeSet is the set of caveat types to use for caveats. If not specified, // the default type set is used. CaveatTypeSet *caveattypes.TypeSet @@ -132,6 +137,7 @@ func NewPermissionsServer( MaxCheckBulkConcurrency: defaultIfZero(config.MaxCheckBulkConcurrency, 50), CaveatTypeSet: caveattypes.TypeSetOrDefault(config.CaveatTypeSet), ExpiringRelationshipsEnabled: config.ExpiringRelationshipsEnabled, + DeprecatedRelationshipsEnabled: config.DeprecatedRelationshipsEnabled, PerformanceInsightMetricsEnabled: config.PerformanceInsightMetricsEnabled, } @@ -324,6 +330,12 @@ func (ps *permissionServer) WriteRelationships(ctx context.Context, req *v1.Writ updateRelationshipSet := mapz.NewSet[string]() for _, update := range req.Updates { // TODO(jschorr): Change to struct-based keys. + if ps.config.DeprecatedRelationshipsEnabled { + if err := checkForDeprecatedRelationsAndObjects(ctx, update, ds); err != nil { + return nil, ps.rewriteError(ctx, err) + } + } + tupleStr := tuple.V1StringRelationshipWithoutCaveatOrExpiration(update.Relationship) if !updateRelationshipSet.Add(tupleStr) { return nil, ps.rewriteError( @@ -620,3 +632,70 @@ func labelsForFilter(filter *v1.RelationshipFilter) perfinsights.APIShapeLabels perfinsights.SubjectRelationLabel: filter.OptionalSubjectFilter.OptionalRelation.Relation, } } + +func checkForDeprecatedRelationsAndObjects(ctx context.Context, update *v1.RelationshipUpdate, ds datastore.Datastore) error { + resource := update.Relationship.Resource + headRevision, err := ds.HeadRevision(ctx) + if err != nil { + return err + } + reader := ds.SnapshotReader(headRevision) + _, relDef, err := namespace.ReadNamespaceAndRelation(ctx, resource.ObjectType, update.Relationship.Relation, reader) + if err != nil { + return err + } + + if relDef.Deprecation != nil && relDef.Deprecation.DeprecationType != corev1.DeprecationType_DEPRECATED_TYPE_UNSPECIFIED { + // Check if the relation is deprecated + switch relDef.Deprecation.DeprecationType { + case corev1.DeprecationType_DEPRECATED_TYPE_WARNING: + log.Warn(). + Str("namespace", update.Relationship.Resource.ObjectType). + Str("relation", update.Relationship.Relation). + Str("comments", relDef.Deprecation.Comments). + Msg("write to deprecated relation") + + case corev1.DeprecationType_DEPRECATED_TYPE_ERROR: + return shared.NewDeprecationError(update.Relationship.Resource.ObjectType, update.Relationship.Relation, relDef.Deprecation.Comments) + } + } + nsdef, _, err := reader.ReadNamespaceByName(ctx, resource.ObjectType) + if err != nil { + return err + } + + // Check if the resource is deprecated + if nsdef.Deprecation != nil && nsdef.Deprecation.DeprecationType != corev1.DeprecationType_DEPRECATED_TYPE_UNSPECIFIED { + // Check if the namespace is deprecated + switch nsdef.Deprecation.DeprecationType { + case corev1.DeprecationType_DEPRECATED_TYPE_WARNING: + log.Warn(). + Str("namespace", nsdef.Name). + Str("comments", nsdef.Deprecation.Comments). + Msg("write to deprecated object") + case corev1.DeprecationType_DEPRECATED_TYPE_ERROR: + return shared.NewDeprecationError(resource.ObjectType, "", nsdef.Deprecation.Comments) + } + } + + objectRef := update.Relationship.Subject + nsdef, _, err = reader.ReadNamespaceByName(ctx, objectRef.Object.ObjectType) + if err != nil { + return err + } + + if nsdef.Deprecation != nil && nsdef.Deprecation.DeprecationType != corev1.DeprecationType_DEPRECATED_TYPE_UNSPECIFIED { + // Check if the subject is deprecated + switch nsdef.Deprecation.DeprecationType { + case corev1.DeprecationType_DEPRECATED_TYPE_WARNING: + log.Warn(). + Str("namespace", nsdef.Name). + Str("comments", nsdef.Deprecation.Comments). + Msg("write to deprecated object") + case corev1.DeprecationType_DEPRECATED_TYPE_ERROR: + return shared.NewDeprecationError(resource.ObjectType, "", nsdef.Deprecation.Comments) + } + } + + return nil +} diff --git a/internal/services/v1/schema.go b/internal/services/v1/schema.go index e579bc1e66..c162d0f630 100644 --- a/internal/services/v1/schema.go +++ b/internal/services/v1/schema.go @@ -41,6 +41,9 @@ type SchemaServerConfig struct { // ExpiringRelsEnabled indicates whether expiring relationships are enabled. ExpiringRelsEnabled bool + // DeprecatedRelsEnabled indicates whether deprecated relations are enabled. + DeprecatedRelsEnabled bool + // PerformanceInsightMetricsEnabled indicates whether performance insight metrics are enabled. PerformanceInsightMetricsEnabled bool } @@ -61,9 +64,10 @@ func NewSchemaServer(config SchemaServerConfig) v1.SchemaServiceServer { perfinsights.StreamServerInterceptor(config.PerformanceInsightMetricsEnabled), ), }, - additiveOnly: config.AdditiveOnly, - expiringRelsEnabled: config.ExpiringRelsEnabled, - caveatTypeSet: cts, + additiveOnly: config.AdditiveOnly, + expiringRelsEnabled: config.ExpiringRelsEnabled, + deprecatedRelsEnabled: config.DeprecatedRelsEnabled, + caveatTypeSet: cts, } } @@ -71,9 +75,10 @@ type schemaServer struct { v1.UnimplementedSchemaServiceServer shared.WithServiceSpecificInterceptors - caveatTypeSet *caveattypes.TypeSet - additiveOnly bool - expiringRelsEnabled bool + caveatTypeSet *caveattypes.TypeSet + additiveOnly bool + expiringRelsEnabled bool + deprecatedRelsEnabled bool } func (ss *schemaServer) rewriteError(ctx context.Context, err error) error { @@ -148,6 +153,9 @@ func (ss *schemaServer) WriteSchema(ctx context.Context, in *v1.WriteSchemaReque opts = append(opts, compiler.DisallowExpirationFlag()) } + if !ss.deprecatedRelsEnabled { + opts = append(opts, compiler.DisallowDeprecationFlag()) + } opts = append(opts, compiler.CaveatTypeSet(ss.caveatTypeSet)) compiled, err := compiler.Compile(compiler.InputSchema{ diff --git a/internal/services/v1/schema_test.go b/internal/services/v1/schema_test.go index 3eddbbb940..72b98a06f3 100644 --- a/internal/services/v1/schema_test.go +++ b/internal/services/v1/schema_test.go @@ -1642,3 +1642,70 @@ func TestComputablePermissions(t *testing.T) { }) } } + +func TestSchemaChangeRelationDeprecation(t *testing.T) { + conn, cleanup, _, _ := testserver.NewTestServer(require.New(t), 0, memdb.DisableGC, true, tf.EmptyDatastore) + t.Cleanup(cleanup) + client := v1.NewSchemaServiceClient(conn) + v1client := v1.NewPermissionsServiceClient(conn) + + // Write a basic schema with deprecations. + originalSchema := ` + use deprecation + definition user {} + definition testuser {} + + definition document { + relation somerelation: user + relation otherelation: testuser + } + + @deprecated(warn, document#somerelation, "This relation is deprecated, please use otherelation instead.") + @deprecated(error, testuser, "super deprecated") + ` + _, err := client.WriteSchema(t.Context(), &v1.WriteSchemaRequest{ + Schema: originalSchema, + }) + require.NoError(t, err) + + // Write the relationship referencing the relation. + toWrite := tuple.MustParse("document:somedoc#somerelation@user:tom") + _, err = v1client.WriteRelationships(t.Context(), &v1.WriteRelationshipsRequest{ + Updates: []*v1.RelationshipUpdate{tuple.MustUpdateToV1RelationshipUpdate(tuple.Create( + toWrite, + ))}, + }) + require.Nil(t, err) + + // Attempt to write to a deprecated object which should fail. + toWrite = tuple.MustParse("document:somedoc#otherelation@testuser:jerry") + _, err = v1client.WriteRelationships(t.Context(), &v1.WriteRelationshipsRequest{ + Updates: []*v1.RelationshipUpdate{tuple.MustUpdateToV1RelationshipUpdate(tuple.Create( + toWrite, + ))}, + }) + require.Equal(t, "rpc error: code = Aborted desc = object document is deprecated, comments:super deprecated", err.Error()) + + // Change the schema to remove the deprecation type. + newSchema := ` + use deprecation + definition user {} + definition testuser {} + + definition document { + relation somerelation: user + relation otherelation: testuser + }` + _, err = client.WriteSchema(t.Context(), &v1.WriteSchemaRequest{ + Schema: newSchema, + }) + require.NoError(t, err) + + // Again attempt to write to the relation, which should now succeed. + _, err = v1client.WriteRelationships(t.Context(), &v1.WriteRelationshipsRequest{ + Updates: []*v1.RelationshipUpdate{tuple.MustUpdateToV1RelationshipUpdate(tuple.Create( + toWrite, + ))}, + }) + require.NoError(t, err) +} diff --git a/internal/testserver/server.go b/internal/testserver/server.go index 60b9bd3fa4..d0e2ab0f8a 100644 --- a/internal/testserver/server.go +++ b/internal/testserver/server.go @@ -76,6 +76,7 @@ func NewTestServerWithConfigAndDatastore(require *require.Assertions, cts := caveattypes.TypeSetOrDefault(config.CaveatTypeSet) srv, err := server.NewConfigWithOptionsAndDefaults( server.WithEnableExperimentalRelationshipExpiration(true), + server.WithEnableExperimentalRelationshipDeprecation(true), server.WithDatastore(ds), server.WithDispatcher(graph.NewLocalOnlyDispatcher(cts, 10, 100)), server.WithDispatchMaxDepth(50), diff --git a/pkg/cmd/serve.go b/pkg/cmd/serve.go index d87534b769..7d7a68a602 100644 --- a/pkg/cmd/serve.go +++ b/pkg/cmd/serve.go @@ -169,6 +169,7 @@ func RegisterServeFlags(cmd *cobra.Command, config *server.Config) error { } experimentalFlags.BoolVar(&config.EnableExperimentalRelationshipExpiration, "enable-experimental-relationship-expiration", false, "enables experimental support for relationship expiration") + experimentalFlags.BoolVar(&config.EnableExperimentalRelationshipDeprecation, "enable-experimental-relationship-deprecation", false, "enables experimental support for deprecating relations") experimentalFlags.BoolVar(&config.EnableExperimentalWatchableSchemaCache, "enable-experimental-watchable-schema-cache", false, "enables the experimental schema cache, which uses the Watch API to keep the schema up to date") // TODO: these two could reasonably be put in either the Dispatch group or the Experimental group. Is there a preference? experimentalFlags.StringToStringVar(&config.DispatchSecondaryUpstreamAddrs, "experimental-dispatch-secondary-upstream-addrs", nil, "secondary upstream addresses for dispatches, each with a name") diff --git a/pkg/cmd/server/server.go b/pkg/cmd/server/server.go index f5ca33afb9..b69629171f 100644 --- a/pkg/cmd/server/server.go +++ b/pkg/cmd/server/server.go @@ -111,21 +111,22 @@ type Config struct { ClusterDispatchCacheConfig CacheConfig `debugmap:"visible"` // API Behavior - DisableV1SchemaAPI bool `debugmap:"visible"` - V1SchemaAdditiveOnly bool `debugmap:"visible"` - MaximumUpdatesPerWrite uint16 `debugmap:"visible"` - MaximumPreconditionCount uint16 `debugmap:"visible"` - MaxDatastoreReadPageSize uint64 `debugmap:"visible"` - StreamingAPITimeout time.Duration `debugmap:"visible"` - WatchHeartbeat time.Duration `debugmap:"visible"` - MaxReadRelationshipsLimit uint32 `debugmap:"visible"` - MaxDeleteRelationshipsLimit uint32 `debugmap:"visible"` - MaxLookupResourcesLimit uint32 `debugmap:"visible"` - MaxBulkExportRelationshipsLimit uint32 `debugmap:"visible"` - EnableExperimentalLookupResources bool `debugmap:"visible"` - EnableExperimentalRelationshipExpiration bool `debugmap:"visible"` - EnableRevisionHeartbeat bool `debugmap:"visible"` - EnablePerformanceInsightMetrics bool `debugmap:"visible"` + DisableV1SchemaAPI bool `debugmap:"visible"` + V1SchemaAdditiveOnly bool `debugmap:"visible"` + MaximumUpdatesPerWrite uint16 `debugmap:"visible"` + MaximumPreconditionCount uint16 `debugmap:"visible"` + MaxDatastoreReadPageSize uint64 `debugmap:"visible"` + StreamingAPITimeout time.Duration `debugmap:"visible"` + WatchHeartbeat time.Duration `debugmap:"visible"` + MaxReadRelationshipsLimit uint32 `debugmap:"visible"` + MaxDeleteRelationshipsLimit uint32 `debugmap:"visible"` + MaxLookupResourcesLimit uint32 `debugmap:"visible"` + MaxBulkExportRelationshipsLimit uint32 `debugmap:"visible"` + EnableExperimentalLookupResources bool `debugmap:"visible"` + EnableExperimentalRelationshipExpiration bool `debugmap:"visible"` + EnableExperimentalRelationshipDeprecation bool `debugmap:"visible"` + EnableRevisionHeartbeat bool `debugmap:"visible"` + EnablePerformanceInsightMetrics bool `debugmap:"visible"` // Additional Services MetricsAPI util.HTTPServerConfig `debugmap:"visible"` @@ -455,6 +456,7 @@ func (c *Config) Complete(ctx context.Context) (RunnableServer, error) { MaxBulkExportRelationshipsLimit: c.MaxBulkExportRelationshipsLimit, DispatchChunkSize: c.DispatchChunkSize, ExpiringRelationshipsEnabled: c.EnableExperimentalRelationshipExpiration, + DeprecatedRelationshipsEnabled: c.EnableExperimentalRelationshipDeprecation, CaveatTypeSet: c.DatastoreConfig.CaveatTypeSet, PerformanceInsightMetricsEnabled: c.EnablePerformanceInsightMetrics, } diff --git a/pkg/cmd/server/zz_generated.options.go b/pkg/cmd/server/zz_generated.options.go index 95d1c16b5c..72190d1f90 100644 --- a/pkg/cmd/server/zz_generated.options.go +++ b/pkg/cmd/server/zz_generated.options.go @@ -91,6 +91,7 @@ func (c *Config) ToOption() ConfigOption { to.MaxBulkExportRelationshipsLimit = c.MaxBulkExportRelationshipsLimit to.EnableExperimentalLookupResources = c.EnableExperimentalLookupResources to.EnableExperimentalRelationshipExpiration = c.EnableExperimentalRelationshipExpiration + to.EnableExperimentalRelationshipDeprecation = c.EnableExperimentalRelationshipDeprecation to.EnableRevisionHeartbeat = c.EnableRevisionHeartbeat to.EnablePerformanceInsightMetrics = c.EnablePerformanceInsightMetrics to.MetricsAPI = c.MetricsAPI @@ -163,6 +164,7 @@ func (c Config) DebugMap() map[string]any { debugMap["MaxBulkExportRelationshipsLimit"] = helpers.DebugValue(c.MaxBulkExportRelationshipsLimit, false) debugMap["EnableExperimentalLookupResources"] = helpers.DebugValue(c.EnableExperimentalLookupResources, false) debugMap["EnableExperimentalRelationshipExpiration"] = helpers.DebugValue(c.EnableExperimentalRelationshipExpiration, false) + debugMap["EnableExperimentalRelationshipDeprecation"] = helpers.DebugValue(c.EnableExperimentalRelationshipDeprecation, false) debugMap["EnableRevisionHeartbeat"] = helpers.DebugValue(c.EnableRevisionHeartbeat, false) debugMap["EnablePerformanceInsightMetrics"] = helpers.DebugValue(c.EnablePerformanceInsightMetrics, false) debugMap["MetricsAPI"] = helpers.DebugValue(c.MetricsAPI, false) @@ -598,6 +600,13 @@ func WithEnableExperimentalRelationshipExpiration(enableExperimentalRelationship } } +// WithEnableExperimentalRelationshipDeprecation returns an option that can set EnableExperimentalRelationshipDeprecation on a Config +func WithEnableExperimentalRelationshipDeprecation(enableExperimentalRelationshipDeprecation bool) ConfigOption { + return func(c *Config) { + c.EnableExperimentalRelationshipDeprecation = enableExperimentalRelationshipDeprecation + } +} + // WithEnableRevisionHeartbeat returns an option that can set EnableRevisionHeartbeat on a Config func WithEnableRevisionHeartbeat(enableRevisionHeartbeat bool) ConfigOption { return func(c *Config) { diff --git a/pkg/cmd/testserver/testserver.go b/pkg/cmd/testserver/testserver.go index 96d852094c..af61011e5f 100644 --- a/pkg/cmd/testserver/testserver.go +++ b/pkg/cmd/testserver/testserver.go @@ -87,6 +87,7 @@ func (c *Config) Complete() (RunnableTestServer, error) { MaxBulkExportRelationshipsLimit: c.MaxBulkExportRelationshipsLimit, DispatchChunkSize: defaultMaxChunkSize, ExpiringRelationshipsEnabled: true, + DeprecatedRelationshipsEnabled: true, CaveatTypeSet: cts, }, 1*time.Second, diff --git a/pkg/development/devcontext.go b/pkg/development/devcontext.go index 87ddfc0487..80302ca89b 100644 --- a/pkg/development/devcontext.go +++ b/pkg/development/devcontext.go @@ -173,6 +173,7 @@ func (dc *DevContext) RunV1InMemoryService() (*grpc.ClientConn, func(), error) { MaximumAPIDepth: 50, MaxCaveatContextSize: 0, ExpiringRelationshipsEnabled: true, + DeprecatedRelationshipsEnabled: true, CaveatTypeSet: caveattypes.Default.TypeSet, PerformanceInsightMetricsEnabled: false, }) @@ -180,6 +181,7 @@ func (dc *DevContext) RunV1InMemoryService() (*grpc.ClientConn, func(), error) { CaveatTypeSet: caveattypes.Default.TypeSet, AdditiveOnly: false, ExpiringRelsEnabled: true, + DeprecatedRelsEnabled: true, PerformanceInsightMetricsEnabled: false, }) diff --git a/pkg/diff/namespace/diff.go b/pkg/diff/namespace/diff.go index af50f0fb51..889c2ac7fc 100644 --- a/pkg/diff/namespace/diff.go +++ b/pkg/diff/namespace/diff.go @@ -60,6 +60,9 @@ const ( // ChangedRelationComment indicates that the comment of the relation has changed in some way. ChangedRelationComment DeltaType = "changed-relation-comment" + + // ChangedDeprecation indicates that the deprecation status of the relation has changed. + ChangedDeprecation DeltaType = "changed-deprecation" ) // Diff holds the diff between two namespaces. @@ -129,6 +132,12 @@ func DiffNamespaces(existing *core.NamespaceDefinition, updated *core.NamespaceD }) } + if existing.Deprecation != updated.Deprecation { + deltas = append(deltas, Delta{ + Type: ChangedDeprecation, + }) + } + // Collect up relations and check. existingRels := map[string]*core.Relation{} existingRelNames := mapz.NewSet[string]() @@ -240,6 +249,14 @@ func DiffNamespaces(existing *core.NamespaceDefinition, updated *core.NamespaceD }) } + // Compare deprecation status + if existingRel.Deprecation != updatedRel.Deprecation { + deltas = append(deltas, Delta{ + Type: ChangedDeprecation, + RelationName: shared, + }) + } + // Compare comments. existingComments := nspkg.GetComments(existingRel.Metadata) updatedComments := nspkg.GetComments(updatedRel.Metadata) diff --git a/pkg/diff/namespace/diff_test.go b/pkg/diff/namespace/diff_test.go index 301a7d5c19..ac6b71d955 100644 --- a/pkg/diff/namespace/diff_test.go +++ b/pkg/diff/namespace/diff_test.go @@ -571,6 +571,40 @@ func TestNamespaceDiff(t *testing.T) { ), []Delta{}, }, + { + "deprecate relation with an error type", + ns.Namespace( + "document", + ns.MustRelation("somerel", nil, ns.AllowedDeprecatedRelation("foo", "bar", &core.Deprecation{ + DeprecationType: core.DeprecationType_DEPRECATED_TYPE_UNSPECIFIED, + })), + ), + ns.Namespace( + "document", + ns.MustRelation("somerel", nil, ns.AllowedDeprecatedRelation("foo", "bar", &core.Deprecation{ + DeprecationType: core.DeprecationType_DEPRECATED_TYPE_ERROR, + })), + ), + []Delta{ + {Type: ChangedDeprecation, RelationName: "somerel"}, + }, + }, + { + "remove deprecation", + ns.Namespace( + "document", + ns.MustRelation("somerel", nil, ns.AllowedDeprecatedRelation("foo", "bar", &core.Deprecation{ + DeprecationType: core.DeprecationType_DEPRECATED_TYPE_ERROR, + })), + ), + ns.Namespace( + "document", + ns.MustRelation("somerel", nil, ns.AllowedRelation("foo", "bar")), + ), + []Delta{ + {Type: ChangedDeprecation, RelationName: "somerel"}, + }, + }, } for _, tc := range testCases { diff --git a/pkg/namespace/builder.go b/pkg/namespace/builder.go index cf4c745b4f..982447d582 100644 --- a/pkg/namespace/builder.go +++ b/pkg/namespace/builder.go @@ -46,6 +46,10 @@ func Relation(name string, rewrite *core.UsersetRewrite, allowedDirectRelations TypeInformation: typeInfo, } + if err := setRelationDeprecation(rel, allowedDirectRelations...); err != nil { + return nil, spiceerrors.MustBugf("failed to set deprecation type: %s", err.Error()) + } + switch { case rewrite != nil && len(allowedDirectRelations) == 0: if err := SetRelationKind(rel, iv1.RelationMetadata_PERMISSION); err != nil { @@ -94,6 +98,17 @@ func AllowedRelationWithCaveat(namespaceName string, relationName string, withCa } } +// AllowedDeprecatedRelation creates a relation reference to an allowed relation that is deprecated. +func AllowedDeprecatedRelation(namespaceName string, relationName string, deprecation *core.Deprecation) *core.AllowedRelation { + return &core.AllowedRelation{ + Namespace: namespaceName, + RelationOrWildcard: &core.AllowedRelation_Relation{ + Relation: relationName, + }, + Deprecation: deprecation, + } +} + // WithExpiration adds the expiration trait to the allowed relation. func WithExpiration(allowedRelation *core.AllowedRelation) *core.AllowedRelation { return &core.AllowedRelation{ @@ -243,6 +258,18 @@ func setOperation(firstChild *core.SetOperation_Child, rest []*core.SetOperation } } +// setRelationDeprecationType sets the deprecation type of a relation based on all of the deprecations of allowed direct relations. +func setRelationDeprecation(relation *core.Relation, allowedDirectRelations ...*core.AllowedRelation) error { + if len(allowedDirectRelations) > 0 { + for _, allowedRelation := range allowedDirectRelations { + if allowedRelation.Deprecation != nil && allowedRelation.Deprecation.DeprecationType != core.DeprecationType_DEPRECATED_TYPE_UNSPECIFIED { + relation.Deprecation = allowedRelation.Deprecation + } + } + } + return nil +} + // Nil creates a child for a set operation that references the empty set. func Nil() *core.SetOperation_Child { return &core.SetOperation_Child{ diff --git a/pkg/proto/core/v1/core.pb.go b/pkg/proto/core/v1/core.pb.go index 56ce0f7b95..fdc551b277 100644 --- a/pkg/proto/core/v1/core.pb.go +++ b/pkg/proto/core/v1/core.pb.go @@ -24,6 +24,57 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) +// * +// DeprecationType is the type of deprecation for a relation. +type DeprecationType int32 + +const ( + DeprecationType_DEPRECATED_TYPE_UNSPECIFIED DeprecationType = 0 + DeprecationType_DEPRECATED_TYPE_WARNING DeprecationType = 1 + DeprecationType_DEPRECATED_TYPE_ERROR DeprecationType = 2 +) + +// Enum value maps for DeprecationType. +var ( + DeprecationType_name = map[int32]string{ + 0: "DEPRECATED_TYPE_UNSPECIFIED", + 1: "DEPRECATED_TYPE_WARNING", + 2: "DEPRECATED_TYPE_ERROR", + } + DeprecationType_value = map[string]int32{ + "DEPRECATED_TYPE_UNSPECIFIED": 0, + "DEPRECATED_TYPE_WARNING": 1, + "DEPRECATED_TYPE_ERROR": 2, + } +) + +func (x DeprecationType) Enum() *DeprecationType { + p := new(DeprecationType) + *p = x + return p +} + +func (x DeprecationType) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (DeprecationType) Descriptor() protoreflect.EnumDescriptor { + return file_core_v1_core_proto_enumTypes[0].Descriptor() +} + +func (DeprecationType) Type() protoreflect.EnumType { + return &file_core_v1_core_proto_enumTypes[0] +} + +func (x DeprecationType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use DeprecationType.Descriptor instead. +func (DeprecationType) EnumDescriptor() ([]byte, []int) { + return file_core_v1_core_proto_rawDescGZIP(), []int{0} +} + type RelationTupleUpdate_Operation int32 const ( @@ -60,11 +111,11 @@ func (x RelationTupleUpdate_Operation) String() string { } func (RelationTupleUpdate_Operation) Descriptor() protoreflect.EnumDescriptor { - return file_core_v1_core_proto_enumTypes[0].Descriptor() + return file_core_v1_core_proto_enumTypes[1].Descriptor() } func (RelationTupleUpdate_Operation) Type() protoreflect.EnumType { - return &file_core_v1_core_proto_enumTypes[0] + return &file_core_v1_core_proto_enumTypes[1] } func (x RelationTupleUpdate_Operation) Number() protoreflect.EnumNumber { @@ -112,11 +163,11 @@ func (x SetOperationUserset_Operation) String() string { } func (SetOperationUserset_Operation) Descriptor() protoreflect.EnumDescriptor { - return file_core_v1_core_proto_enumTypes[1].Descriptor() + return file_core_v1_core_proto_enumTypes[2].Descriptor() } func (SetOperationUserset_Operation) Type() protoreflect.EnumType { - return &file_core_v1_core_proto_enumTypes[1] + return &file_core_v1_core_proto_enumTypes[2] } func (x SetOperationUserset_Operation) Number() protoreflect.EnumNumber { @@ -170,11 +221,11 @@ func (x ReachabilityEntrypoint_ReachabilityEntrypointKind) String() string { } func (ReachabilityEntrypoint_ReachabilityEntrypointKind) Descriptor() protoreflect.EnumDescriptor { - return file_core_v1_core_proto_enumTypes[2].Descriptor() + return file_core_v1_core_proto_enumTypes[3].Descriptor() } func (ReachabilityEntrypoint_ReachabilityEntrypointKind) Type() protoreflect.EnumType { - return &file_core_v1_core_proto_enumTypes[2] + return &file_core_v1_core_proto_enumTypes[3] } func (x ReachabilityEntrypoint_ReachabilityEntrypointKind) Number() protoreflect.EnumNumber { @@ -183,7 +234,7 @@ func (x ReachabilityEntrypoint_ReachabilityEntrypointKind) Number() protoreflect // Deprecated: Use ReachabilityEntrypoint_ReachabilityEntrypointKind.Descriptor instead. func (ReachabilityEntrypoint_ReachabilityEntrypointKind) EnumDescriptor() ([]byte, []int) { - return file_core_v1_core_proto_rawDescGZIP(), []int{18, 0} + return file_core_v1_core_proto_rawDescGZIP(), []int{19, 0} } type ReachabilityEntrypoint_EntrypointResultStatus int32 @@ -223,11 +274,11 @@ func (x ReachabilityEntrypoint_EntrypointResultStatus) String() string { } func (ReachabilityEntrypoint_EntrypointResultStatus) Descriptor() protoreflect.EnumDescriptor { - return file_core_v1_core_proto_enumTypes[3].Descriptor() + return file_core_v1_core_proto_enumTypes[4].Descriptor() } func (ReachabilityEntrypoint_EntrypointResultStatus) Type() protoreflect.EnumType { - return &file_core_v1_core_proto_enumTypes[3] + return &file_core_v1_core_proto_enumTypes[4] } func (x ReachabilityEntrypoint_EntrypointResultStatus) Number() protoreflect.EnumNumber { @@ -236,7 +287,7 @@ func (x ReachabilityEntrypoint_EntrypointResultStatus) Number() protoreflect.Enu // Deprecated: Use ReachabilityEntrypoint_EntrypointResultStatus.Descriptor instead. func (ReachabilityEntrypoint_EntrypointResultStatus) EnumDescriptor() ([]byte, []int) { - return file_core_v1_core_proto_rawDescGZIP(), []int{18, 1} + return file_core_v1_core_proto_rawDescGZIP(), []int{19, 1} } type FunctionedTupleToUserset_Function int32 @@ -272,11 +323,11 @@ func (x FunctionedTupleToUserset_Function) String() string { } func (FunctionedTupleToUserset_Function) Descriptor() protoreflect.EnumDescriptor { - return file_core_v1_core_proto_enumTypes[4].Descriptor() + return file_core_v1_core_proto_enumTypes[5].Descriptor() } func (FunctionedTupleToUserset_Function) Type() protoreflect.EnumType { - return &file_core_v1_core_proto_enumTypes[4] + return &file_core_v1_core_proto_enumTypes[5] } func (x FunctionedTupleToUserset_Function) Number() protoreflect.EnumNumber { @@ -285,7 +336,7 @@ func (x FunctionedTupleToUserset_Function) Number() protoreflect.EnumNumber { // Deprecated: Use FunctionedTupleToUserset_Function.Descriptor instead. func (FunctionedTupleToUserset_Function) EnumDescriptor() ([]byte, []int) { - return file_core_v1_core_proto_rawDescGZIP(), []int{26, 0} + return file_core_v1_core_proto_rawDescGZIP(), []int{27, 0} } type ComputedUserset_Object int32 @@ -318,11 +369,11 @@ func (x ComputedUserset_Object) String() string { } func (ComputedUserset_Object) Descriptor() protoreflect.EnumDescriptor { - return file_core_v1_core_proto_enumTypes[5].Descriptor() + return file_core_v1_core_proto_enumTypes[6].Descriptor() } func (ComputedUserset_Object) Type() protoreflect.EnumType { - return &file_core_v1_core_proto_enumTypes[5] + return &file_core_v1_core_proto_enumTypes[6] } func (x ComputedUserset_Object) Number() protoreflect.EnumNumber { @@ -331,7 +382,7 @@ func (x ComputedUserset_Object) Number() protoreflect.EnumNumber { // Deprecated: Use ComputedUserset_Object.Descriptor instead. func (ComputedUserset_Object) EnumDescriptor() ([]byte, []int) { - return file_core_v1_core_proto_rawDescGZIP(), []int{27, 0} + return file_core_v1_core_proto_rawDescGZIP(), []int{28, 0} } type CaveatOperation_Operation int32 @@ -370,11 +421,11 @@ func (x CaveatOperation_Operation) String() string { } func (CaveatOperation_Operation) Descriptor() protoreflect.EnumDescriptor { - return file_core_v1_core_proto_enumTypes[6].Descriptor() + return file_core_v1_core_proto_enumTypes[7].Descriptor() } func (CaveatOperation_Operation) Type() protoreflect.EnumType { - return &file_core_v1_core_proto_enumTypes[6] + return &file_core_v1_core_proto_enumTypes[7] } func (x CaveatOperation_Operation) Number() protoreflect.EnumNumber { @@ -383,7 +434,7 @@ func (x CaveatOperation_Operation) Number() protoreflect.EnumNumber { // Deprecated: Use CaveatOperation_Operation.Descriptor instead. func (CaveatOperation_Operation) EnumDescriptor() ([]byte, []int) { - return file_core_v1_core_proto_rawDescGZIP(), []int{30, 0} + return file_core_v1_core_proto_rawDescGZIP(), []int{31, 0} } type RelationTuple struct { @@ -1279,6 +1330,8 @@ type NamespaceDefinition struct { Metadata *Metadata `protobuf:"bytes,3,opt,name=metadata,proto3" json:"metadata,omitempty"` // * source_position contains the position of the namespace in the source schema, if any SourcePosition *SourcePosition `protobuf:"bytes,4,opt,name=source_position,json=sourcePosition,proto3" json:"source_position,omitempty"` + // * deprecation contains the deprecation information for the namespace, if any + Deprecation *Deprecation `protobuf:"bytes,5,opt,name=deprecation,proto3" json:"deprecation,omitempty"` } func (x *NamespaceDefinition) Reset() { @@ -1341,6 +1394,99 @@ func (x *NamespaceDefinition) GetSourcePosition() *SourcePosition { return nil } +func (x *NamespaceDefinition) GetDeprecation() *Deprecation { + if x != nil { + return x.Deprecation + } + return nil +} + +type Deprecation struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // * + // deprecation_type is the type of deprecation for the relation. + // It can be either a warning or an error, defaults to unspecified. + DeprecationType DeprecationType `protobuf:"varint,1,opt,name=deprecation_type,json=deprecationType,proto3,enum=core.v1.DeprecationType" json:"deprecation_type,omitempty"` + // * object is the object that is deprecated + Object string `protobuf:"bytes,2,opt,name=object,proto3" json:"object,omitempty"` + // * relation is the relation that is deprecated + Relation string `protobuf:"bytes,3,opt,name=relation,proto3" json:"relation,omitempty"` + // * comments are the comments to show when the relation is used + Comments string `protobuf:"bytes,4,opt,name=comments,proto3" json:"comments,omitempty"` + // * source_position contains the position of the deprecation in the source schema, if any + SourcePosition *SourcePosition `protobuf:"bytes,5,opt,name=source_position,json=sourcePosition,proto3" json:"source_position,omitempty"` +} + +func (x *Deprecation) Reset() { + *x = Deprecation{} + if protoimpl.UnsafeEnabled { + mi := &file_core_v1_core_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Deprecation) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Deprecation) ProtoMessage() {} + +func (x *Deprecation) ProtoReflect() protoreflect.Message { + mi := &file_core_v1_core_proto_msgTypes[15] + 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 Deprecation.ProtoReflect.Descriptor instead. +func (*Deprecation) Descriptor() ([]byte, []int) { + return file_core_v1_core_proto_rawDescGZIP(), []int{15} +} + +func (x *Deprecation) GetDeprecationType() DeprecationType { + if x != nil { + return x.DeprecationType + } + return DeprecationType_DEPRECATED_TYPE_UNSPECIFIED +} + +func (x *Deprecation) GetObject() string { + if x != nil { + return x.Object + } + return "" +} + +func (x *Deprecation) GetRelation() string { + if x != nil { + return x.Relation + } + return "" +} + +func (x *Deprecation) GetComments() string { + if x != nil { + return x.Comments + } + return "" +} + +func (x *Deprecation) GetSourcePosition() *SourcePosition { + if x != nil { + return x.SourcePosition + } + return nil +} + // * // Relation represents the definition of a relation or permission under a namespace. type Relation struct { @@ -1362,12 +1508,14 @@ type Relation struct { SourcePosition *SourcePosition `protobuf:"bytes,5,opt,name=source_position,json=sourcePosition,proto3" json:"source_position,omitempty"` AliasingRelation string `protobuf:"bytes,6,opt,name=aliasing_relation,json=aliasingRelation,proto3" json:"aliasing_relation,omitempty"` CanonicalCacheKey string `protobuf:"bytes,7,opt,name=canonical_cache_key,json=canonicalCacheKey,proto3" json:"canonical_cache_key,omitempty"` + // * deprecation_type is the type of deprecation for the relation + Deprecation *Deprecation `protobuf:"bytes,8,opt,name=deprecation,proto3" json:"deprecation,omitempty"` } func (x *Relation) Reset() { *x = Relation{} if protoimpl.UnsafeEnabled { - mi := &file_core_v1_core_proto_msgTypes[15] + mi := &file_core_v1_core_proto_msgTypes[16] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1380,7 +1528,7 @@ func (x *Relation) String() string { func (*Relation) ProtoMessage() {} func (x *Relation) ProtoReflect() protoreflect.Message { - mi := &file_core_v1_core_proto_msgTypes[15] + mi := &file_core_v1_core_proto_msgTypes[16] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1393,7 +1541,7 @@ func (x *Relation) ProtoReflect() protoreflect.Message { // Deprecated: Use Relation.ProtoReflect.Descriptor instead. func (*Relation) Descriptor() ([]byte, []int) { - return file_core_v1_core_proto_rawDescGZIP(), []int{15} + return file_core_v1_core_proto_rawDescGZIP(), []int{16} } func (x *Relation) GetName() string { @@ -1445,6 +1593,13 @@ func (x *Relation) GetCanonicalCacheKey() string { return "" } +func (x *Relation) GetDeprecation() *Deprecation { + if x != nil { + return x.Deprecation + } + return nil +} + // * // ReachabilityGraph is a serialized form of a reachability graph, representing how a relation can // be reached from one or more subject types. @@ -1495,7 +1650,7 @@ type ReachabilityGraph struct { func (x *ReachabilityGraph) Reset() { *x = ReachabilityGraph{} if protoimpl.UnsafeEnabled { - mi := &file_core_v1_core_proto_msgTypes[16] + mi := &file_core_v1_core_proto_msgTypes[17] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1508,7 +1663,7 @@ func (x *ReachabilityGraph) String() string { func (*ReachabilityGraph) ProtoMessage() {} func (x *ReachabilityGraph) ProtoReflect() protoreflect.Message { - mi := &file_core_v1_core_proto_msgTypes[16] + mi := &file_core_v1_core_proto_msgTypes[17] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1521,7 +1676,7 @@ func (x *ReachabilityGraph) ProtoReflect() protoreflect.Message { // Deprecated: Use ReachabilityGraph.ProtoReflect.Descriptor instead. func (*ReachabilityGraph) Descriptor() ([]byte, []int) { - return file_core_v1_core_proto_rawDescGZIP(), []int{16} + return file_core_v1_core_proto_rawDescGZIP(), []int{17} } func (x *ReachabilityGraph) GetEntrypointsBySubjectType() map[string]*ReachabilityEntrypoints { @@ -1562,7 +1717,7 @@ type ReachabilityEntrypoints struct { func (x *ReachabilityEntrypoints) Reset() { *x = ReachabilityEntrypoints{} if protoimpl.UnsafeEnabled { - mi := &file_core_v1_core_proto_msgTypes[17] + mi := &file_core_v1_core_proto_msgTypes[18] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1575,7 +1730,7 @@ func (x *ReachabilityEntrypoints) String() string { func (*ReachabilityEntrypoints) ProtoMessage() {} func (x *ReachabilityEntrypoints) ProtoReflect() protoreflect.Message { - mi := &file_core_v1_core_proto_msgTypes[17] + mi := &file_core_v1_core_proto_msgTypes[18] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1588,7 +1743,7 @@ func (x *ReachabilityEntrypoints) ProtoReflect() protoreflect.Message { // Deprecated: Use ReachabilityEntrypoints.ProtoReflect.Descriptor instead. func (*ReachabilityEntrypoints) Descriptor() ([]byte, []int) { - return file_core_v1_core_proto_rawDescGZIP(), []int{17} + return file_core_v1_core_proto_rawDescGZIP(), []int{18} } func (x *ReachabilityEntrypoints) GetEntrypoints() []*ReachabilityEntrypoint { @@ -1643,7 +1798,7 @@ type ReachabilityEntrypoint struct { func (x *ReachabilityEntrypoint) Reset() { *x = ReachabilityEntrypoint{} if protoimpl.UnsafeEnabled { - mi := &file_core_v1_core_proto_msgTypes[18] + mi := &file_core_v1_core_proto_msgTypes[19] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1656,7 +1811,7 @@ func (x *ReachabilityEntrypoint) String() string { func (*ReachabilityEntrypoint) ProtoMessage() {} func (x *ReachabilityEntrypoint) ProtoReflect() protoreflect.Message { - mi := &file_core_v1_core_proto_msgTypes[18] + mi := &file_core_v1_core_proto_msgTypes[19] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1669,7 +1824,7 @@ func (x *ReachabilityEntrypoint) ProtoReflect() protoreflect.Message { // Deprecated: Use ReachabilityEntrypoint.ProtoReflect.Descriptor instead. func (*ReachabilityEntrypoint) Descriptor() ([]byte, []int) { - return file_core_v1_core_proto_rawDescGZIP(), []int{18} + return file_core_v1_core_proto_rawDescGZIP(), []int{19} } func (x *ReachabilityEntrypoint) GetKind() ReachabilityEntrypoint_ReachabilityEntrypointKind { @@ -1723,7 +1878,7 @@ type TypeInformation struct { func (x *TypeInformation) Reset() { *x = TypeInformation{} if protoimpl.UnsafeEnabled { - mi := &file_core_v1_core_proto_msgTypes[19] + mi := &file_core_v1_core_proto_msgTypes[20] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1736,7 +1891,7 @@ func (x *TypeInformation) String() string { func (*TypeInformation) ProtoMessage() {} func (x *TypeInformation) ProtoReflect() protoreflect.Message { - mi := &file_core_v1_core_proto_msgTypes[19] + mi := &file_core_v1_core_proto_msgTypes[20] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1749,7 +1904,7 @@ func (x *TypeInformation) ProtoReflect() protoreflect.Message { // Deprecated: Use TypeInformation.ProtoReflect.Descriptor instead. func (*TypeInformation) Descriptor() ([]byte, []int) { - return file_core_v1_core_proto_rawDescGZIP(), []int{19} + return file_core_v1_core_proto_rawDescGZIP(), []int{20} } func (x *TypeInformation) GetAllowedDirectRelations() []*AllowedRelation { @@ -1784,12 +1939,15 @@ type AllowedRelation struct { // * // required_expiration defines the required expiration on this relation. RequiredExpiration *ExpirationTrait `protobuf:"bytes,7,opt,name=required_expiration,json=requiredExpiration,proto3" json:"required_expiration,omitempty"` + // * + // deprecation_type defines the type of deprecation for this relation. + Deprecation *Deprecation `protobuf:"bytes,8,opt,name=deprecation,proto3" json:"deprecation,omitempty"` } func (x *AllowedRelation) Reset() { *x = AllowedRelation{} if protoimpl.UnsafeEnabled { - mi := &file_core_v1_core_proto_msgTypes[20] + mi := &file_core_v1_core_proto_msgTypes[21] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1802,7 +1960,7 @@ func (x *AllowedRelation) String() string { func (*AllowedRelation) ProtoMessage() {} func (x *AllowedRelation) ProtoReflect() protoreflect.Message { - mi := &file_core_v1_core_proto_msgTypes[20] + mi := &file_core_v1_core_proto_msgTypes[21] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1815,7 +1973,7 @@ func (x *AllowedRelation) ProtoReflect() protoreflect.Message { // Deprecated: Use AllowedRelation.ProtoReflect.Descriptor instead. func (*AllowedRelation) Descriptor() ([]byte, []int) { - return file_core_v1_core_proto_rawDescGZIP(), []int{20} + return file_core_v1_core_proto_rawDescGZIP(), []int{21} } func (x *AllowedRelation) GetNamespace() string { @@ -1867,6 +2025,13 @@ func (x *AllowedRelation) GetRequiredExpiration() *ExpirationTrait { return nil } +func (x *AllowedRelation) GetDeprecation() *Deprecation { + if x != nil { + return x.Deprecation + } + return nil +} + type isAllowedRelation_RelationOrWildcard interface { isAllowedRelation_RelationOrWildcard() } @@ -1894,7 +2059,7 @@ type ExpirationTrait struct { func (x *ExpirationTrait) Reset() { *x = ExpirationTrait{} if protoimpl.UnsafeEnabled { - mi := &file_core_v1_core_proto_msgTypes[21] + mi := &file_core_v1_core_proto_msgTypes[22] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1907,7 +2072,7 @@ func (x *ExpirationTrait) String() string { func (*ExpirationTrait) ProtoMessage() {} func (x *ExpirationTrait) ProtoReflect() protoreflect.Message { - mi := &file_core_v1_core_proto_msgTypes[21] + mi := &file_core_v1_core_proto_msgTypes[22] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1920,7 +2085,7 @@ func (x *ExpirationTrait) ProtoReflect() protoreflect.Message { // Deprecated: Use ExpirationTrait.ProtoReflect.Descriptor instead. func (*ExpirationTrait) Descriptor() ([]byte, []int) { - return file_core_v1_core_proto_rawDescGZIP(), []int{21} + return file_core_v1_core_proto_rawDescGZIP(), []int{22} } // * @@ -1938,7 +2103,7 @@ type AllowedCaveat struct { func (x *AllowedCaveat) Reset() { *x = AllowedCaveat{} if protoimpl.UnsafeEnabled { - mi := &file_core_v1_core_proto_msgTypes[22] + mi := &file_core_v1_core_proto_msgTypes[23] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1951,7 +2116,7 @@ func (x *AllowedCaveat) String() string { func (*AllowedCaveat) ProtoMessage() {} func (x *AllowedCaveat) ProtoReflect() protoreflect.Message { - mi := &file_core_v1_core_proto_msgTypes[22] + mi := &file_core_v1_core_proto_msgTypes[23] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1964,7 +2129,7 @@ func (x *AllowedCaveat) ProtoReflect() protoreflect.Message { // Deprecated: Use AllowedCaveat.ProtoReflect.Descriptor instead. func (*AllowedCaveat) Descriptor() ([]byte, []int) { - return file_core_v1_core_proto_rawDescGZIP(), []int{22} + return file_core_v1_core_proto_rawDescGZIP(), []int{23} } func (x *AllowedCaveat) GetCaveatName() string { @@ -1991,7 +2156,7 @@ type UsersetRewrite struct { func (x *UsersetRewrite) Reset() { *x = UsersetRewrite{} if protoimpl.UnsafeEnabled { - mi := &file_core_v1_core_proto_msgTypes[23] + mi := &file_core_v1_core_proto_msgTypes[24] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2004,7 +2169,7 @@ func (x *UsersetRewrite) String() string { func (*UsersetRewrite) ProtoMessage() {} func (x *UsersetRewrite) ProtoReflect() protoreflect.Message { - mi := &file_core_v1_core_proto_msgTypes[23] + mi := &file_core_v1_core_proto_msgTypes[24] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2017,7 +2182,7 @@ func (x *UsersetRewrite) ProtoReflect() protoreflect.Message { // Deprecated: Use UsersetRewrite.ProtoReflect.Descriptor instead. func (*UsersetRewrite) Descriptor() ([]byte, []int) { - return file_core_v1_core_proto_rawDescGZIP(), []int{23} + return file_core_v1_core_proto_rawDescGZIP(), []int{24} } func (m *UsersetRewrite) GetRewriteOperation() isUsersetRewrite_RewriteOperation { @@ -2088,7 +2253,7 @@ type SetOperation struct { func (x *SetOperation) Reset() { *x = SetOperation{} if protoimpl.UnsafeEnabled { - mi := &file_core_v1_core_proto_msgTypes[24] + mi := &file_core_v1_core_proto_msgTypes[25] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2101,7 +2266,7 @@ func (x *SetOperation) String() string { func (*SetOperation) ProtoMessage() {} func (x *SetOperation) ProtoReflect() protoreflect.Message { - mi := &file_core_v1_core_proto_msgTypes[24] + mi := &file_core_v1_core_proto_msgTypes[25] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2114,7 +2279,7 @@ func (x *SetOperation) ProtoReflect() protoreflect.Message { // Deprecated: Use SetOperation.ProtoReflect.Descriptor instead. func (*SetOperation) Descriptor() ([]byte, []int) { - return file_core_v1_core_proto_rawDescGZIP(), []int{24} + return file_core_v1_core_proto_rawDescGZIP(), []int{25} } func (x *SetOperation) GetChild() []*SetOperation_Child { @@ -2137,7 +2302,7 @@ type TupleToUserset struct { func (x *TupleToUserset) Reset() { *x = TupleToUserset{} if protoimpl.UnsafeEnabled { - mi := &file_core_v1_core_proto_msgTypes[25] + mi := &file_core_v1_core_proto_msgTypes[26] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2150,7 +2315,7 @@ func (x *TupleToUserset) String() string { func (*TupleToUserset) ProtoMessage() {} func (x *TupleToUserset) ProtoReflect() protoreflect.Message { - mi := &file_core_v1_core_proto_msgTypes[25] + mi := &file_core_v1_core_proto_msgTypes[26] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2163,7 +2328,7 @@ func (x *TupleToUserset) ProtoReflect() protoreflect.Message { // Deprecated: Use TupleToUserset.ProtoReflect.Descriptor instead. func (*TupleToUserset) Descriptor() ([]byte, []int) { - return file_core_v1_core_proto_rawDescGZIP(), []int{25} + return file_core_v1_core_proto_rawDescGZIP(), []int{26} } func (x *TupleToUserset) GetTupleset() *TupleToUserset_Tupleset { @@ -2201,7 +2366,7 @@ type FunctionedTupleToUserset struct { func (x *FunctionedTupleToUserset) Reset() { *x = FunctionedTupleToUserset{} if protoimpl.UnsafeEnabled { - mi := &file_core_v1_core_proto_msgTypes[26] + mi := &file_core_v1_core_proto_msgTypes[27] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2214,7 +2379,7 @@ func (x *FunctionedTupleToUserset) String() string { func (*FunctionedTupleToUserset) ProtoMessage() {} func (x *FunctionedTupleToUserset) ProtoReflect() protoreflect.Message { - mi := &file_core_v1_core_proto_msgTypes[26] + mi := &file_core_v1_core_proto_msgTypes[27] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2227,7 +2392,7 @@ func (x *FunctionedTupleToUserset) ProtoReflect() protoreflect.Message { // Deprecated: Use FunctionedTupleToUserset.ProtoReflect.Descriptor instead. func (*FunctionedTupleToUserset) Descriptor() ([]byte, []int) { - return file_core_v1_core_proto_rawDescGZIP(), []int{26} + return file_core_v1_core_proto_rawDescGZIP(), []int{27} } func (x *FunctionedTupleToUserset) GetFunction() FunctionedTupleToUserset_Function { @@ -2271,7 +2436,7 @@ type ComputedUserset struct { func (x *ComputedUserset) Reset() { *x = ComputedUserset{} if protoimpl.UnsafeEnabled { - mi := &file_core_v1_core_proto_msgTypes[27] + mi := &file_core_v1_core_proto_msgTypes[28] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2284,7 +2449,7 @@ func (x *ComputedUserset) String() string { func (*ComputedUserset) ProtoMessage() {} func (x *ComputedUserset) ProtoReflect() protoreflect.Message { - mi := &file_core_v1_core_proto_msgTypes[27] + mi := &file_core_v1_core_proto_msgTypes[28] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2297,7 +2462,7 @@ func (x *ComputedUserset) ProtoReflect() protoreflect.Message { // Deprecated: Use ComputedUserset.ProtoReflect.Descriptor instead. func (*ComputedUserset) Descriptor() ([]byte, []int) { - return file_core_v1_core_proto_rawDescGZIP(), []int{27} + return file_core_v1_core_proto_rawDescGZIP(), []int{28} } func (x *ComputedUserset) GetObject() ComputedUserset_Object { @@ -2333,7 +2498,7 @@ type SourcePosition struct { func (x *SourcePosition) Reset() { *x = SourcePosition{} if protoimpl.UnsafeEnabled { - mi := &file_core_v1_core_proto_msgTypes[28] + mi := &file_core_v1_core_proto_msgTypes[29] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2346,7 +2511,7 @@ func (x *SourcePosition) String() string { func (*SourcePosition) ProtoMessage() {} func (x *SourcePosition) ProtoReflect() protoreflect.Message { - mi := &file_core_v1_core_proto_msgTypes[28] + mi := &file_core_v1_core_proto_msgTypes[29] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2359,7 +2524,7 @@ func (x *SourcePosition) ProtoReflect() protoreflect.Message { // Deprecated: Use SourcePosition.ProtoReflect.Descriptor instead. func (*SourcePosition) Descriptor() ([]byte, []int) { - return file_core_v1_core_proto_rawDescGZIP(), []int{28} + return file_core_v1_core_proto_rawDescGZIP(), []int{29} } func (x *SourcePosition) GetZeroIndexedLineNumber() uint64 { @@ -2391,7 +2556,7 @@ type CaveatExpression struct { func (x *CaveatExpression) Reset() { *x = CaveatExpression{} if protoimpl.UnsafeEnabled { - mi := &file_core_v1_core_proto_msgTypes[29] + mi := &file_core_v1_core_proto_msgTypes[30] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2404,7 +2569,7 @@ func (x *CaveatExpression) String() string { func (*CaveatExpression) ProtoMessage() {} func (x *CaveatExpression) ProtoReflect() protoreflect.Message { - mi := &file_core_v1_core_proto_msgTypes[29] + mi := &file_core_v1_core_proto_msgTypes[30] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2417,7 +2582,7 @@ func (x *CaveatExpression) ProtoReflect() protoreflect.Message { // Deprecated: Use CaveatExpression.ProtoReflect.Descriptor instead. func (*CaveatExpression) Descriptor() ([]byte, []int) { - return file_core_v1_core_proto_rawDescGZIP(), []int{29} + return file_core_v1_core_proto_rawDescGZIP(), []int{30} } func (m *CaveatExpression) GetOperationOrCaveat() isCaveatExpression_OperationOrCaveat { @@ -2469,7 +2634,7 @@ type CaveatOperation struct { func (x *CaveatOperation) Reset() { *x = CaveatOperation{} if protoimpl.UnsafeEnabled { - mi := &file_core_v1_core_proto_msgTypes[30] + mi := &file_core_v1_core_proto_msgTypes[31] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2482,7 +2647,7 @@ func (x *CaveatOperation) String() string { func (*CaveatOperation) ProtoMessage() {} func (x *CaveatOperation) ProtoReflect() protoreflect.Message { - mi := &file_core_v1_core_proto_msgTypes[30] + mi := &file_core_v1_core_proto_msgTypes[31] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2495,7 +2660,7 @@ func (x *CaveatOperation) ProtoReflect() protoreflect.Message { // Deprecated: Use CaveatOperation.ProtoReflect.Descriptor instead. func (*CaveatOperation) Descriptor() ([]byte, []int) { - return file_core_v1_core_proto_rawDescGZIP(), []int{30} + return file_core_v1_core_proto_rawDescGZIP(), []int{31} } func (x *CaveatOperation) GetOp() CaveatOperation_Operation { @@ -2535,7 +2700,7 @@ type RelationshipFilter struct { func (x *RelationshipFilter) Reset() { *x = RelationshipFilter{} if protoimpl.UnsafeEnabled { - mi := &file_core_v1_core_proto_msgTypes[31] + mi := &file_core_v1_core_proto_msgTypes[32] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2548,7 +2713,7 @@ func (x *RelationshipFilter) String() string { func (*RelationshipFilter) ProtoMessage() {} func (x *RelationshipFilter) ProtoReflect() protoreflect.Message { - mi := &file_core_v1_core_proto_msgTypes[31] + mi := &file_core_v1_core_proto_msgTypes[32] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2561,7 +2726,7 @@ func (x *RelationshipFilter) ProtoReflect() protoreflect.Message { // Deprecated: Use RelationshipFilter.ProtoReflect.Descriptor instead. func (*RelationshipFilter) Descriptor() ([]byte, []int) { - return file_core_v1_core_proto_rawDescGZIP(), []int{31} + return file_core_v1_core_proto_rawDescGZIP(), []int{32} } func (x *RelationshipFilter) GetResourceType() string { @@ -2616,7 +2781,7 @@ type SubjectFilter struct { func (x *SubjectFilter) Reset() { *x = SubjectFilter{} if protoimpl.UnsafeEnabled { - mi := &file_core_v1_core_proto_msgTypes[32] + mi := &file_core_v1_core_proto_msgTypes[33] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2629,7 +2794,7 @@ func (x *SubjectFilter) String() string { func (*SubjectFilter) ProtoMessage() {} func (x *SubjectFilter) ProtoReflect() protoreflect.Message { - mi := &file_core_v1_core_proto_msgTypes[32] + mi := &file_core_v1_core_proto_msgTypes[33] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2642,7 +2807,7 @@ func (x *SubjectFilter) ProtoReflect() protoreflect.Message { // Deprecated: Use SubjectFilter.ProtoReflect.Descriptor instead. func (*SubjectFilter) Descriptor() ([]byte, []int) { - return file_core_v1_core_proto_rawDescGZIP(), []int{32} + return file_core_v1_core_proto_rawDescGZIP(), []int{33} } func (x *SubjectFilter) GetSubjectType() string { @@ -2675,7 +2840,7 @@ type AllowedRelation_PublicWildcard struct { func (x *AllowedRelation_PublicWildcard) Reset() { *x = AllowedRelation_PublicWildcard{} if protoimpl.UnsafeEnabled { - mi := &file_core_v1_core_proto_msgTypes[36] + mi := &file_core_v1_core_proto_msgTypes[37] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2688,7 +2853,7 @@ func (x *AllowedRelation_PublicWildcard) String() string { func (*AllowedRelation_PublicWildcard) ProtoMessage() {} func (x *AllowedRelation_PublicWildcard) ProtoReflect() protoreflect.Message { - mi := &file_core_v1_core_proto_msgTypes[36] + mi := &file_core_v1_core_proto_msgTypes[37] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2701,7 +2866,7 @@ func (x *AllowedRelation_PublicWildcard) ProtoReflect() protoreflect.Message { // Deprecated: Use AllowedRelation_PublicWildcard.ProtoReflect.Descriptor instead. func (*AllowedRelation_PublicWildcard) Descriptor() ([]byte, []int) { - return file_core_v1_core_proto_rawDescGZIP(), []int{20, 0} + return file_core_v1_core_proto_rawDescGZIP(), []int{21, 0} } type SetOperation_Child struct { @@ -2730,7 +2895,7 @@ type SetOperation_Child struct { func (x *SetOperation_Child) Reset() { *x = SetOperation_Child{} if protoimpl.UnsafeEnabled { - mi := &file_core_v1_core_proto_msgTypes[37] + mi := &file_core_v1_core_proto_msgTypes[38] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2743,7 +2908,7 @@ func (x *SetOperation_Child) String() string { func (*SetOperation_Child) ProtoMessage() {} func (x *SetOperation_Child) ProtoReflect() protoreflect.Message { - mi := &file_core_v1_core_proto_msgTypes[37] + mi := &file_core_v1_core_proto_msgTypes[38] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2756,7 +2921,7 @@ func (x *SetOperation_Child) ProtoReflect() protoreflect.Message { // Deprecated: Use SetOperation_Child.ProtoReflect.Descriptor instead. func (*SetOperation_Child) Descriptor() ([]byte, []int) { - return file_core_v1_core_proto_rawDescGZIP(), []int{24, 0} + return file_core_v1_core_proto_rawDescGZIP(), []int{25, 0} } func (m *SetOperation_Child) GetChildType() isSetOperation_Child_ChildType { @@ -2871,7 +3036,7 @@ type SetOperation_Child_This struct { func (x *SetOperation_Child_This) Reset() { *x = SetOperation_Child_This{} if protoimpl.UnsafeEnabled { - mi := &file_core_v1_core_proto_msgTypes[38] + mi := &file_core_v1_core_proto_msgTypes[39] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2884,7 +3049,7 @@ func (x *SetOperation_Child_This) String() string { func (*SetOperation_Child_This) ProtoMessage() {} func (x *SetOperation_Child_This) ProtoReflect() protoreflect.Message { - mi := &file_core_v1_core_proto_msgTypes[38] + mi := &file_core_v1_core_proto_msgTypes[39] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2897,7 +3062,7 @@ func (x *SetOperation_Child_This) ProtoReflect() protoreflect.Message { // Deprecated: Use SetOperation_Child_This.ProtoReflect.Descriptor instead. func (*SetOperation_Child_This) Descriptor() ([]byte, []int) { - return file_core_v1_core_proto_rawDescGZIP(), []int{24, 0, 0} + return file_core_v1_core_proto_rawDescGZIP(), []int{25, 0, 0} } type SetOperation_Child_Nil struct { @@ -2909,7 +3074,7 @@ type SetOperation_Child_Nil struct { func (x *SetOperation_Child_Nil) Reset() { *x = SetOperation_Child_Nil{} if protoimpl.UnsafeEnabled { - mi := &file_core_v1_core_proto_msgTypes[39] + mi := &file_core_v1_core_proto_msgTypes[40] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2922,7 +3087,7 @@ func (x *SetOperation_Child_Nil) String() string { func (*SetOperation_Child_Nil) ProtoMessage() {} func (x *SetOperation_Child_Nil) ProtoReflect() protoreflect.Message { - mi := &file_core_v1_core_proto_msgTypes[39] + mi := &file_core_v1_core_proto_msgTypes[40] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2935,7 +3100,7 @@ func (x *SetOperation_Child_Nil) ProtoReflect() protoreflect.Message { // Deprecated: Use SetOperation_Child_Nil.ProtoReflect.Descriptor instead. func (*SetOperation_Child_Nil) Descriptor() ([]byte, []int) { - return file_core_v1_core_proto_rawDescGZIP(), []int{24, 0, 1} + return file_core_v1_core_proto_rawDescGZIP(), []int{25, 0, 1} } type TupleToUserset_Tupleset struct { @@ -2949,7 +3114,7 @@ type TupleToUserset_Tupleset struct { func (x *TupleToUserset_Tupleset) Reset() { *x = TupleToUserset_Tupleset{} if protoimpl.UnsafeEnabled { - mi := &file_core_v1_core_proto_msgTypes[40] + mi := &file_core_v1_core_proto_msgTypes[41] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2962,7 +3127,7 @@ func (x *TupleToUserset_Tupleset) String() string { func (*TupleToUserset_Tupleset) ProtoMessage() {} func (x *TupleToUserset_Tupleset) ProtoReflect() protoreflect.Message { - mi := &file_core_v1_core_proto_msgTypes[40] + mi := &file_core_v1_core_proto_msgTypes[41] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2975,7 +3140,7 @@ func (x *TupleToUserset_Tupleset) ProtoReflect() protoreflect.Message { // Deprecated: Use TupleToUserset_Tupleset.ProtoReflect.Descriptor instead. func (*TupleToUserset_Tupleset) Descriptor() ([]byte, []int) { - return file_core_v1_core_proto_rawDescGZIP(), []int{25, 0} + return file_core_v1_core_proto_rawDescGZIP(), []int{26, 0} } func (x *TupleToUserset_Tupleset) GetRelation() string { @@ -2996,7 +3161,7 @@ type FunctionedTupleToUserset_Tupleset struct { func (x *FunctionedTupleToUserset_Tupleset) Reset() { *x = FunctionedTupleToUserset_Tupleset{} if protoimpl.UnsafeEnabled { - mi := &file_core_v1_core_proto_msgTypes[41] + mi := &file_core_v1_core_proto_msgTypes[42] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3009,7 +3174,7 @@ func (x *FunctionedTupleToUserset_Tupleset) String() string { func (*FunctionedTupleToUserset_Tupleset) ProtoMessage() {} func (x *FunctionedTupleToUserset_Tupleset) ProtoReflect() protoreflect.Message { - mi := &file_core_v1_core_proto_msgTypes[41] + mi := &file_core_v1_core_proto_msgTypes[42] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3022,7 +3187,7 @@ func (x *FunctionedTupleToUserset_Tupleset) ProtoReflect() protoreflect.Message // Deprecated: Use FunctionedTupleToUserset_Tupleset.ProtoReflect.Descriptor instead. func (*FunctionedTupleToUserset_Tupleset) Descriptor() ([]byte, []int) { - return file_core_v1_core_proto_rawDescGZIP(), []int{26, 0} + return file_core_v1_core_proto_rawDescGZIP(), []int{27, 0} } func (x *FunctionedTupleToUserset_Tupleset) GetRelation() string { @@ -3043,7 +3208,7 @@ type SubjectFilter_RelationFilter struct { func (x *SubjectFilter_RelationFilter) Reset() { *x = SubjectFilter_RelationFilter{} if protoimpl.UnsafeEnabled { - mi := &file_core_v1_core_proto_msgTypes[42] + mi := &file_core_v1_core_proto_msgTypes[43] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3056,7 +3221,7 @@ func (x *SubjectFilter_RelationFilter) String() string { func (*SubjectFilter_RelationFilter) ProtoMessage() {} func (x *SubjectFilter_RelationFilter) ProtoReflect() protoreflect.Message { - mi := &file_core_v1_core_proto_msgTypes[42] + mi := &file_core_v1_core_proto_msgTypes[43] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3069,7 +3234,7 @@ func (x *SubjectFilter_RelationFilter) ProtoReflect() protoreflect.Message { // Deprecated: Use SubjectFilter_RelationFilter.ProtoReflect.Descriptor instead. func (*SubjectFilter_RelationFilter) Descriptor() ([]byte, []int) { - return file_core_v1_core_proto_rawDescGZIP(), []int{32, 0} + return file_core_v1_core_proto_rawDescGZIP(), []int{33, 0} } func (x *SubjectFilter_RelationFilter) GetRelation() string { @@ -3276,7 +3441,7 @@ var file_core_v1_core_proto_rawDesc = []byte{ 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x69, 0x6d, 0x70, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x0f, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x4d, 0x65, 0x73, - 0x73, 0x61, 0x67, 0x65, 0x22, 0x93, 0x02, 0x0a, 0x13, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, + 0x73, 0x61, 0x67, 0x65, 0x22, 0xcb, 0x02, 0x0a, 0x13, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x44, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x5c, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x48, 0xfa, 0x42, 0x45, 0x72, 0x43, 0x28, 0x80, 0x01, 0x32, 0x3e, 0x5e, 0x28, 0x5b, 0x61, 0x2d, 0x7a, 0x5d, 0x5b, 0x61, 0x2d, @@ -3293,384 +3458,416 @@ var file_core_v1_core_proto_rawDesc = []byte{ 0x63, 0x65, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0e, 0x73, 0x6f, 0x75, 0x72, - 0x63, 0x65, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x9c, 0x03, 0x0a, 0x08, 0x52, - 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x3b, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x27, 0xfa, 0x42, 0x24, 0x72, 0x22, 0x28, 0x40, 0x32, 0x1e, - 0x5e, 0x5b, 0x61, 0x2d, 0x7a, 0x5d, 0x5b, 0x61, 0x2d, 0x7a, 0x30, 0x2d, 0x39, 0x5f, 0x5d, 0x7b, - 0x31, 0x2c, 0x36, 0x32, 0x7d, 0x5b, 0x61, 0x2d, 0x7a, 0x30, 0x2d, 0x39, 0x5d, 0x24, 0x52, 0x04, - 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x40, 0x0a, 0x0f, 0x75, 0x73, 0x65, 0x72, 0x73, 0x65, 0x74, 0x5f, - 0x72, 0x65, 0x77, 0x72, 0x69, 0x74, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, - 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x73, 0x65, 0x74, 0x52, - 0x65, 0x77, 0x72, 0x69, 0x74, 0x65, 0x52, 0x0e, 0x75, 0x73, 0x65, 0x72, 0x73, 0x65, 0x74, 0x52, - 0x65, 0x77, 0x72, 0x69, 0x74, 0x65, 0x12, 0x43, 0x0a, 0x10, 0x74, 0x79, 0x70, 0x65, 0x5f, 0x69, - 0x6e, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x18, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x49, - 0x6e, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0f, 0x74, 0x79, 0x70, 0x65, - 0x49, 0x6e, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2d, 0x0a, 0x08, 0x6d, - 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, - 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, - 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x40, 0x0a, 0x0f, 0x73, 0x6f, - 0x75, 0x72, 0x63, 0x65, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x6f, - 0x75, 0x72, 0x63, 0x65, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0e, 0x73, 0x6f, - 0x75, 0x72, 0x63, 0x65, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2b, 0x0a, 0x11, - 0x61, 0x6c, 0x69, 0x61, 0x73, 0x69, 0x6e, 0x67, 0x5f, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x61, 0x6c, 0x69, 0x61, 0x73, 0x69, 0x6e, - 0x67, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2e, 0x0a, 0x13, 0x63, 0x61, 0x6e, - 0x6f, 0x6e, 0x69, 0x63, 0x61, 0x6c, 0x5f, 0x63, 0x61, 0x63, 0x68, 0x65, 0x5f, 0x6b, 0x65, 0x79, - 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x11, 0x63, 0x61, 0x6e, 0x6f, 0x6e, 0x69, 0x63, 0x61, - 0x6c, 0x43, 0x61, 0x63, 0x68, 0x65, 0x4b, 0x65, 0x79, 0x22, 0xf4, 0x03, 0x0a, 0x11, 0x52, 0x65, - 0x61, 0x63, 0x68, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x47, 0x72, 0x61, 0x70, 0x68, 0x12, - 0x77, 0x0a, 0x1b, 0x65, 0x6e, 0x74, 0x72, 0x79, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x5f, 0x62, - 0x79, 0x5f, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x38, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x52, - 0x65, 0x61, 0x63, 0x68, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x47, 0x72, 0x61, 0x70, 0x68, - 0x2e, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x42, 0x79, 0x53, 0x75, - 0x62, 0x6a, 0x65, 0x63, 0x74, 0x54, 0x79, 0x70, 0x65, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x18, - 0x65, 0x6e, 0x74, 0x72, 0x79, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x42, 0x79, 0x53, 0x75, 0x62, - 0x6a, 0x65, 0x63, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x83, 0x01, 0x0a, 0x1f, 0x65, 0x6e, 0x74, - 0x72, 0x79, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x5f, 0x62, 0x79, 0x5f, 0x73, 0x75, 0x62, 0x6a, - 0x65, 0x63, 0x74, 0x5f, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x3c, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x61, - 0x63, 0x68, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x47, 0x72, 0x61, 0x70, 0x68, 0x2e, 0x45, - 0x6e, 0x74, 0x72, 0x79, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x42, 0x79, 0x53, 0x75, 0x62, 0x6a, - 0x65, 0x63, 0x74, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x6e, 0x74, 0x72, 0x79, - 0x52, 0x1c, 0x65, 0x6e, 0x74, 0x72, 0x79, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x42, 0x79, 0x53, - 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0x6d, - 0x0a, 0x1d, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x42, 0x79, 0x53, - 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x54, 0x79, 0x70, 0x65, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, - 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, - 0x79, 0x12, 0x36, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x20, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x61, 0x63, 0x68, - 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x70, 0x6f, 0x69, 0x6e, - 0x74, 0x73, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x71, 0x0a, - 0x21, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x42, 0x79, 0x53, 0x75, - 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x6e, 0x74, - 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x03, 0x6b, 0x65, 0x79, 0x12, 0x36, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, - 0x61, 0x63, 0x68, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x70, - 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, - 0x22, 0xc6, 0x01, 0x0a, 0x17, 0x52, 0x65, 0x61, 0x63, 0x68, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, - 0x79, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x12, 0x41, 0x0a, 0x0b, - 0x65, 0x6e, 0x74, 0x72, 0x79, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x1f, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x61, 0x63, - 0x68, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x70, 0x6f, 0x69, - 0x6e, 0x74, 0x52, 0x0b, 0x65, 0x6e, 0x74, 0x72, 0x79, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x12, - 0x21, 0x0a, 0x0c, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x54, 0x79, - 0x70, 0x65, 0x12, 0x45, 0x0a, 0x10, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x72, 0x65, - 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x63, - 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, - 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x0f, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, - 0x74, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0xce, 0x04, 0x0a, 0x16, 0x52, 0x65, - 0x61, 0x63, 0x68, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x70, - 0x6f, 0x69, 0x6e, 0x74, 0x12, 0x4e, 0x0a, 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0e, 0x32, 0x3a, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x61, - 0x63, 0x68, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x70, 0x6f, - 0x69, 0x6e, 0x74, 0x2e, 0x52, 0x65, 0x61, 0x63, 0x68, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, - 0x45, 0x6e, 0x74, 0x72, 0x79, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x4b, 0x69, 0x6e, 0x64, 0x52, 0x04, - 0x6b, 0x69, 0x6e, 0x64, 0x12, 0x43, 0x0a, 0x0f, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x5f, 0x72, - 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, - 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x0e, 0x74, 0x61, 0x72, 0x67, 0x65, - 0x74, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x5b, 0x0a, 0x0d, 0x72, 0x65, 0x73, - 0x75, 0x6c, 0x74, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, - 0x32, 0x36, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x61, 0x63, 0x68, - 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x70, 0x6f, 0x69, 0x6e, - 0x74, 0x2e, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x75, - 0x6c, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x0c, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, - 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x2b, 0x0a, 0x11, 0x74, 0x75, 0x70, 0x6c, 0x65, 0x73, - 0x65, 0x74, 0x5f, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x10, 0x74, 0x75, 0x70, 0x6c, 0x65, 0x73, 0x65, 0x74, 0x52, 0x65, 0x6c, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x12, 0x3a, 0x0a, 0x19, 0x63, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x64, 0x5f, - 0x75, 0x73, 0x65, 0x72, 0x73, 0x65, 0x74, 0x5f, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x17, 0x63, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x64, - 0x55, 0x73, 0x65, 0x72, 0x73, 0x65, 0x74, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, - 0x7a, 0x0a, 0x1a, 0x52, 0x65, 0x61, 0x63, 0x68, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x45, - 0x6e, 0x74, 0x72, 0x79, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x4b, 0x69, 0x6e, 0x64, 0x12, 0x17, 0x0a, - 0x13, 0x52, 0x45, 0x4c, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x45, 0x4e, 0x54, 0x52, 0x59, 0x50, - 0x4f, 0x49, 0x4e, 0x54, 0x10, 0x00, 0x12, 0x1f, 0x0a, 0x1b, 0x43, 0x4f, 0x4d, 0x50, 0x55, 0x54, - 0x45, 0x44, 0x5f, 0x55, 0x53, 0x45, 0x52, 0x53, 0x45, 0x54, 0x5f, 0x45, 0x4e, 0x54, 0x52, 0x59, - 0x50, 0x4f, 0x49, 0x4e, 0x54, 0x10, 0x01, 0x12, 0x22, 0x0a, 0x1e, 0x54, 0x55, 0x50, 0x4c, 0x45, - 0x53, 0x45, 0x54, 0x5f, 0x54, 0x4f, 0x5f, 0x55, 0x53, 0x45, 0x52, 0x53, 0x45, 0x54, 0x5f, 0x45, - 0x4e, 0x54, 0x52, 0x59, 0x50, 0x4f, 0x49, 0x4e, 0x54, 0x10, 0x02, 0x22, 0x57, 0x0a, 0x16, 0x45, - 0x6e, 0x74, 0x72, 0x79, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x53, - 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x20, 0x0a, 0x1c, 0x52, 0x45, 0x41, 0x43, 0x48, 0x41, 0x42, - 0x4c, 0x45, 0x5f, 0x43, 0x4f, 0x4e, 0x44, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x41, 0x4c, 0x5f, 0x52, - 0x45, 0x53, 0x55, 0x4c, 0x54, 0x10, 0x00, 0x12, 0x1b, 0x0a, 0x17, 0x44, 0x49, 0x52, 0x45, 0x43, - 0x54, 0x5f, 0x4f, 0x50, 0x45, 0x52, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x52, 0x45, 0x53, 0x55, - 0x4c, 0x54, 0x10, 0x01, 0x4a, 0x04, 0x08, 0x03, 0x10, 0x04, 0x22, 0x65, 0x0a, 0x0f, 0x54, 0x79, - 0x70, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x52, 0x0a, - 0x18, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x5f, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x5f, - 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x18, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x6c, 0x6c, 0x6f, 0x77, 0x65, - 0x64, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x16, 0x61, 0x6c, 0x6c, 0x6f, 0x77, - 0x65, 0x64, 0x44, 0x69, 0x72, 0x65, 0x63, 0x74, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x73, 0x22, 0x95, 0x04, 0x0a, 0x0f, 0x41, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x52, 0x65, 0x6c, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x66, 0x0a, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, - 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x48, 0xfa, 0x42, 0x45, 0x72, 0x43, 0x28, - 0x80, 0x01, 0x32, 0x3e, 0x5e, 0x28, 0x5b, 0x61, 0x2d, 0x7a, 0x5d, 0x5b, 0x61, 0x2d, 0x7a, 0x30, - 0x2d, 0x39, 0x5f, 0x5d, 0x7b, 0x31, 0x2c, 0x36, 0x31, 0x7d, 0x5b, 0x61, 0x2d, 0x7a, 0x30, 0x2d, - 0x39, 0x5d, 0x2f, 0x29, 0x2a, 0x5b, 0x61, 0x2d, 0x7a, 0x5d, 0x5b, 0x61, 0x2d, 0x7a, 0x30, 0x2d, - 0x39, 0x5f, 0x5d, 0x7b, 0x31, 0x2c, 0x36, 0x32, 0x7d, 0x5b, 0x61, 0x2d, 0x7a, 0x30, 0x2d, 0x39, - 0x5d, 0x24, 0x52, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x4e, 0x0a, - 0x08, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, - 0x30, 0xfa, 0x42, 0x2d, 0x72, 0x2b, 0x28, 0x40, 0x32, 0x27, 0x5e, 0x28, 0x5c, 0x2e, 0x5c, 0x2e, - 0x5c, 0x2e, 0x7c, 0x5b, 0x61, 0x2d, 0x7a, 0x5d, 0x5b, 0x61, 0x2d, 0x7a, 0x30, 0x2d, 0x39, 0x5f, - 0x5d, 0x7b, 0x31, 0x2c, 0x36, 0x32, 0x7d, 0x5b, 0x61, 0x2d, 0x7a, 0x30, 0x2d, 0x39, 0x5d, 0x29, - 0x24, 0x48, 0x00, 0x52, 0x08, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x52, 0x0a, - 0x0f, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x77, 0x69, 0x6c, 0x64, 0x63, 0x61, 0x72, 0x64, - 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, - 0x2e, 0x41, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x2e, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x57, 0x69, 0x6c, 0x64, 0x63, 0x61, 0x72, 0x64, 0x48, - 0x00, 0x52, 0x0e, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x57, 0x69, 0x6c, 0x64, 0x63, 0x61, 0x72, - 0x64, 0x12, 0x40, 0x0a, 0x0f, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x70, 0x6f, 0x73, 0x69, - 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x63, 0x6f, 0x72, - 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x50, 0x6f, 0x73, 0x69, 0x74, - 0x69, 0x6f, 0x6e, 0x52, 0x0e, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x50, 0x6f, 0x73, 0x69, 0x74, - 0x69, 0x6f, 0x6e, 0x12, 0x3f, 0x0a, 0x0f, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x5f, - 0x63, 0x61, 0x76, 0x65, 0x61, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x63, - 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x43, 0x61, - 0x76, 0x65, 0x61, 0x74, 0x52, 0x0e, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x43, 0x61, - 0x76, 0x65, 0x61, 0x74, 0x12, 0x49, 0x0a, 0x13, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, - 0x5f, 0x65, 0x78, 0x70, 0x69, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x07, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x18, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x70, 0x69, - 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x72, 0x61, 0x69, 0x74, 0x52, 0x12, 0x72, 0x65, 0x71, - 0x75, 0x69, 0x72, 0x65, 0x64, 0x45, 0x78, 0x70, 0x69, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x1a, - 0x10, 0x0a, 0x0e, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x57, 0x69, 0x6c, 0x64, 0x63, 0x61, 0x72, - 0x64, 0x42, 0x16, 0x0a, 0x14, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6f, 0x72, - 0x5f, 0x77, 0x69, 0x6c, 0x64, 0x63, 0x61, 0x72, 0x64, 0x22, 0x11, 0x0a, 0x0f, 0x45, 0x78, 0x70, - 0x69, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x72, 0x61, 0x69, 0x74, 0x22, 0x30, 0x0a, 0x0d, - 0x41, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x43, 0x61, 0x76, 0x65, 0x61, 0x74, 0x12, 0x1f, 0x0a, - 0x0b, 0x63, 0x61, 0x76, 0x65, 0x61, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x0a, 0x63, 0x61, 0x76, 0x65, 0x61, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0xad, - 0x02, 0x0a, 0x0e, 0x55, 0x73, 0x65, 0x72, 0x73, 0x65, 0x74, 0x52, 0x65, 0x77, 0x72, 0x69, 0x74, - 0x65, 0x12, 0x37, 0x0a, 0x05, 0x75, 0x6e, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x15, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x74, 0x4f, 0x70, - 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x8a, 0x01, 0x02, 0x10, - 0x01, 0x48, 0x00, 0x52, 0x05, 0x75, 0x6e, 0x69, 0x6f, 0x6e, 0x12, 0x45, 0x0a, 0x0c, 0x69, 0x6e, - 0x74, 0x65, 0x72, 0x73, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x15, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x74, 0x4f, 0x70, - 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x8a, 0x01, 0x02, 0x10, - 0x01, 0x48, 0x00, 0x52, 0x0c, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x73, 0x65, 0x63, 0x74, 0x69, 0x6f, - 0x6e, 0x12, 0x3f, 0x0a, 0x09, 0x65, 0x78, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, - 0x65, 0x74, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x08, 0xfa, 0x42, 0x05, - 0x8a, 0x01, 0x02, 0x10, 0x01, 0x48, 0x00, 0x52, 0x09, 0x65, 0x78, 0x63, 0x6c, 0x75, 0x73, 0x69, - 0x6f, 0x6e, 0x12, 0x40, 0x0a, 0x0f, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x70, 0x6f, 0x73, - 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x63, 0x6f, - 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x50, 0x6f, 0x73, 0x69, - 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0e, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x50, 0x6f, 0x73, 0x69, - 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x18, 0x0a, 0x11, 0x72, 0x65, 0x77, 0x72, 0x69, 0x74, 0x65, 0x5f, - 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x03, 0xf8, 0x42, 0x01, 0x22, 0xb2, - 0x05, 0x0a, 0x0c, 0x53, 0x65, 0x74, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, - 0x42, 0x0a, 0x05, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1b, - 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x74, 0x4f, 0x70, 0x65, 0x72, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x43, 0x68, 0x69, 0x6c, 0x64, 0x42, 0x0f, 0xfa, 0x42, 0x0c, - 0x92, 0x01, 0x09, 0x08, 0x01, 0x22, 0x05, 0x8a, 0x01, 0x02, 0x10, 0x01, 0x52, 0x05, 0x63, 0x68, - 0x69, 0x6c, 0x64, 0x1a, 0xdd, 0x04, 0x0a, 0x05, 0x43, 0x68, 0x69, 0x6c, 0x64, 0x12, 0x37, 0x0a, - 0x05, 0x5f, 0x74, 0x68, 0x69, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x63, - 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x74, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x2e, 0x43, 0x68, 0x69, 0x6c, 0x64, 0x2e, 0x54, 0x68, 0x69, 0x73, 0x48, 0x00, - 0x52, 0x04, 0x54, 0x68, 0x69, 0x73, 0x12, 0x4f, 0x0a, 0x10, 0x63, 0x6f, 0x6d, 0x70, 0x75, 0x74, - 0x65, 0x64, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x73, 0x65, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x18, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x75, - 0x74, 0x65, 0x64, 0x55, 0x73, 0x65, 0x72, 0x73, 0x65, 0x74, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x8a, - 0x01, 0x02, 0x10, 0x01, 0x48, 0x00, 0x52, 0x0f, 0x63, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x64, - 0x55, 0x73, 0x65, 0x72, 0x73, 0x65, 0x74, 0x12, 0x4d, 0x0a, 0x10, 0x74, 0x75, 0x70, 0x6c, 0x65, - 0x5f, 0x74, 0x6f, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x73, 0x65, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x17, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x75, 0x70, 0x6c, - 0x65, 0x54, 0x6f, 0x55, 0x73, 0x65, 0x72, 0x73, 0x65, 0x74, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x8a, - 0x01, 0x02, 0x10, 0x01, 0x48, 0x00, 0x52, 0x0e, 0x74, 0x75, 0x70, 0x6c, 0x65, 0x54, 0x6f, 0x55, - 0x73, 0x65, 0x72, 0x73, 0x65, 0x74, 0x12, 0x4c, 0x0a, 0x0f, 0x75, 0x73, 0x65, 0x72, 0x73, 0x65, - 0x74, 0x5f, 0x72, 0x65, 0x77, 0x72, 0x69, 0x74, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x17, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x73, 0x65, - 0x74, 0x52, 0x65, 0x77, 0x72, 0x69, 0x74, 0x65, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x8a, 0x01, 0x02, - 0x10, 0x01, 0x48, 0x00, 0x52, 0x0e, 0x75, 0x73, 0x65, 0x72, 0x73, 0x65, 0x74, 0x52, 0x65, 0x77, - 0x72, 0x69, 0x74, 0x65, 0x12, 0x6c, 0x0a, 0x1b, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, - 0x65, 0x64, 0x5f, 0x74, 0x75, 0x70, 0x6c, 0x65, 0x5f, 0x74, 0x6f, 0x5f, 0x75, 0x73, 0x65, 0x72, - 0x73, 0x65, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x63, 0x6f, 0x72, 0x65, - 0x2e, 0x76, 0x31, 0x2e, 0x46, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x65, 0x64, 0x54, 0x75, - 0x70, 0x6c, 0x65, 0x54, 0x6f, 0x55, 0x73, 0x65, 0x72, 0x73, 0x65, 0x74, 0x42, 0x08, 0xfa, 0x42, - 0x05, 0x8a, 0x01, 0x02, 0x10, 0x01, 0x48, 0x00, 0x52, 0x18, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, - 0x6f, 0x6e, 0x65, 0x64, 0x54, 0x75, 0x70, 0x6c, 0x65, 0x54, 0x6f, 0x55, 0x73, 0x65, 0x72, 0x73, - 0x65, 0x74, 0x12, 0x34, 0x0a, 0x04, 0x5f, 0x6e, 0x69, 0x6c, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x1f, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x74, 0x4f, 0x70, - 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x43, 0x68, 0x69, 0x6c, 0x64, 0x2e, 0x4e, 0x69, - 0x6c, 0x48, 0x00, 0x52, 0x03, 0x4e, 0x69, 0x6c, 0x12, 0x40, 0x0a, 0x0f, 0x73, 0x6f, 0x75, 0x72, - 0x63, 0x65, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x17, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x6f, 0x75, 0x72, - 0x63, 0x65, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0e, 0x73, 0x6f, 0x75, 0x72, - 0x63, 0x65, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x25, 0x0a, 0x0e, 0x6f, 0x70, - 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x61, 0x74, 0x68, 0x18, 0x07, 0x20, 0x03, - 0x28, 0x0d, 0x52, 0x0d, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x74, - 0x68, 0x1a, 0x06, 0x0a, 0x04, 0x54, 0x68, 0x69, 0x73, 0x1a, 0x05, 0x0a, 0x03, 0x4e, 0x69, 0x6c, - 0x42, 0x11, 0x0a, 0x0a, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x12, 0x03, - 0xf8, 0x42, 0x01, 0x22, 0xba, 0x02, 0x0a, 0x0e, 0x54, 0x75, 0x70, 0x6c, 0x65, 0x54, 0x6f, 0x55, - 0x73, 0x65, 0x72, 0x73, 0x65, 0x74, 0x12, 0x46, 0x0a, 0x08, 0x74, 0x75, 0x70, 0x6c, 0x65, 0x73, - 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, - 0x76, 0x31, 0x2e, 0x54, 0x75, 0x70, 0x6c, 0x65, 0x54, 0x6f, 0x55, 0x73, 0x65, 0x72, 0x73, 0x65, - 0x74, 0x2e, 0x54, 0x75, 0x70, 0x6c, 0x65, 0x73, 0x65, 0x74, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x8a, - 0x01, 0x02, 0x10, 0x01, 0x52, 0x08, 0x74, 0x75, 0x70, 0x6c, 0x65, 0x73, 0x65, 0x74, 0x12, 0x4d, - 0x0a, 0x10, 0x63, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x64, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x73, - 0x65, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, - 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x64, 0x55, 0x73, 0x65, 0x72, 0x73, - 0x65, 0x74, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x8a, 0x01, 0x02, 0x10, 0x01, 0x52, 0x0f, 0x63, 0x6f, - 0x6d, 0x70, 0x75, 0x74, 0x65, 0x64, 0x55, 0x73, 0x65, 0x72, 0x73, 0x65, 0x74, 0x12, 0x40, 0x0a, + 0x63, 0x65, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x36, 0x0a, 0x0b, 0x64, 0x65, + 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x14, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x70, 0x72, 0x65, 0x63, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0b, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x22, 0xf8, 0x01, 0x0a, 0x0b, 0x44, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x12, 0x4d, 0x0a, 0x10, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x18, 0x2e, 0x63, + 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x82, 0x01, 0x02, 0x10, 0x01, + 0x52, 0x0f, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, + 0x65, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x06, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x6c, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x72, 0x65, 0x6c, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x24, 0x0a, 0x08, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, + 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x72, 0x03, 0x28, 0x80, + 0x02, 0x52, 0x08, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x40, 0x0a, 0x0f, 0x73, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x05, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0e, 0x73, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0xd4, 0x03, + 0x0a, 0x08, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x3b, 0x0a, 0x04, 0x6e, 0x61, + 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x27, 0xfa, 0x42, 0x24, 0x72, 0x22, 0x28, + 0x40, 0x32, 0x1e, 0x5e, 0x5b, 0x61, 0x2d, 0x7a, 0x5d, 0x5b, 0x61, 0x2d, 0x7a, 0x30, 0x2d, 0x39, + 0x5f, 0x5d, 0x7b, 0x31, 0x2c, 0x36, 0x32, 0x7d, 0x5b, 0x61, 0x2d, 0x7a, 0x30, 0x2d, 0x39, 0x5d, + 0x24, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x40, 0x0a, 0x0f, 0x75, 0x73, 0x65, 0x72, 0x73, + 0x65, 0x74, 0x5f, 0x72, 0x65, 0x77, 0x72, 0x69, 0x74, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x17, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x73, + 0x65, 0x74, 0x52, 0x65, 0x77, 0x72, 0x69, 0x74, 0x65, 0x52, 0x0e, 0x75, 0x73, 0x65, 0x72, 0x73, + 0x65, 0x74, 0x52, 0x65, 0x77, 0x72, 0x69, 0x74, 0x65, 0x12, 0x43, 0x0a, 0x10, 0x74, 0x79, 0x70, + 0x65, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x79, + 0x70, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0f, 0x74, + 0x79, 0x70, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2d, + 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x11, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x64, + 0x61, 0x74, 0x61, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x40, 0x0a, 0x0f, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x52, - 0x0e, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x1a, - 0x4f, 0x0a, 0x08, 0x54, 0x75, 0x70, 0x6c, 0x65, 0x73, 0x65, 0x74, 0x12, 0x43, 0x0a, 0x08, 0x72, - 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x27, 0xfa, - 0x42, 0x24, 0x72, 0x22, 0x28, 0x40, 0x32, 0x1e, 0x5e, 0x5b, 0x61, 0x2d, 0x7a, 0x5d, 0x5b, 0x61, - 0x2d, 0x7a, 0x30, 0x2d, 0x39, 0x5f, 0x5d, 0x7b, 0x31, 0x2c, 0x36, 0x32, 0x7d, 0x5b, 0x61, 0x2d, - 0x7a, 0x30, 0x2d, 0x39, 0x5d, 0x24, 0x52, 0x08, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x22, 0xec, 0x03, 0x0a, 0x18, 0x46, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x65, 0x64, 0x54, - 0x75, 0x70, 0x6c, 0x65, 0x54, 0x6f, 0x55, 0x73, 0x65, 0x72, 0x73, 0x65, 0x74, 0x12, 0x52, 0x0a, - 0x08, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, - 0x2a, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x46, 0x75, 0x6e, 0x63, 0x74, 0x69, - 0x6f, 0x6e, 0x65, 0x64, 0x54, 0x75, 0x70, 0x6c, 0x65, 0x54, 0x6f, 0x55, 0x73, 0x65, 0x72, 0x73, - 0x65, 0x74, 0x2e, 0x46, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x0a, 0xfa, 0x42, 0x07, - 0x82, 0x01, 0x04, 0x10, 0x01, 0x20, 0x00, 0x52, 0x08, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, - 0x6e, 0x12, 0x50, 0x0a, 0x08, 0x74, 0x75, 0x70, 0x6c, 0x65, 0x73, 0x65, 0x74, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x46, 0x75, - 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x65, 0x64, 0x54, 0x75, 0x70, 0x6c, 0x65, 0x54, 0x6f, 0x55, - 0x73, 0x65, 0x72, 0x73, 0x65, 0x74, 0x2e, 0x54, 0x75, 0x70, 0x6c, 0x65, 0x73, 0x65, 0x74, 0x42, - 0x08, 0xfa, 0x42, 0x05, 0x8a, 0x01, 0x02, 0x10, 0x01, 0x52, 0x08, 0x74, 0x75, 0x70, 0x6c, 0x65, - 0x73, 0x65, 0x74, 0x12, 0x4d, 0x0a, 0x10, 0x63, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x64, 0x5f, - 0x75, 0x73, 0x65, 0x72, 0x73, 0x65, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, - 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x64, - 0x55, 0x73, 0x65, 0x72, 0x73, 0x65, 0x74, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x8a, 0x01, 0x02, 0x10, - 0x01, 0x52, 0x0f, 0x63, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x64, 0x55, 0x73, 0x65, 0x72, 0x73, - 0x65, 0x74, 0x12, 0x40, 0x0a, 0x0f, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x70, 0x6f, 0x73, - 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x63, 0x6f, - 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x50, 0x6f, 0x73, 0x69, - 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0e, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x50, 0x6f, 0x73, 0x69, - 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0x4f, 0x0a, 0x08, 0x54, 0x75, 0x70, 0x6c, 0x65, 0x73, 0x65, 0x74, - 0x12, 0x43, 0x0a, 0x08, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x42, 0x27, 0xfa, 0x42, 0x24, 0x72, 0x22, 0x28, 0x40, 0x32, 0x1e, 0x5e, 0x5b, 0x61, + 0x0e, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, + 0x2b, 0x0a, 0x11, 0x61, 0x6c, 0x69, 0x61, 0x73, 0x69, 0x6e, 0x67, 0x5f, 0x72, 0x65, 0x6c, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x61, 0x6c, 0x69, 0x61, + 0x73, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2e, 0x0a, 0x13, + 0x63, 0x61, 0x6e, 0x6f, 0x6e, 0x69, 0x63, 0x61, 0x6c, 0x5f, 0x63, 0x61, 0x63, 0x68, 0x65, 0x5f, + 0x6b, 0x65, 0x79, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x11, 0x63, 0x61, 0x6e, 0x6f, 0x6e, + 0x69, 0x63, 0x61, 0x6c, 0x43, 0x61, 0x63, 0x68, 0x65, 0x4b, 0x65, 0x79, 0x12, 0x36, 0x0a, 0x0b, + 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x08, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x14, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x70, 0x72, + 0x65, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0b, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x22, 0xf4, 0x03, 0x0a, 0x11, 0x52, 0x65, 0x61, 0x63, 0x68, 0x61, 0x62, + 0x69, 0x6c, 0x69, 0x74, 0x79, 0x47, 0x72, 0x61, 0x70, 0x68, 0x12, 0x77, 0x0a, 0x1b, 0x65, 0x6e, + 0x74, 0x72, 0x79, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x5f, 0x62, 0x79, 0x5f, 0x73, 0x75, 0x62, + 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x38, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x61, 0x63, 0x68, 0x61, + 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x47, 0x72, 0x61, 0x70, 0x68, 0x2e, 0x45, 0x6e, 0x74, 0x72, + 0x79, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x42, 0x79, 0x53, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, + 0x54, 0x79, 0x70, 0x65, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x18, 0x65, 0x6e, 0x74, 0x72, 0x79, + 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x42, 0x79, 0x53, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x54, + 0x79, 0x70, 0x65, 0x12, 0x83, 0x01, 0x0a, 0x1f, 0x65, 0x6e, 0x74, 0x72, 0x79, 0x70, 0x6f, 0x69, + 0x6e, 0x74, 0x73, 0x5f, 0x62, 0x79, 0x5f, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x72, + 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3c, 0x2e, + 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x61, 0x63, 0x68, 0x61, 0x62, 0x69, + 0x6c, 0x69, 0x74, 0x79, 0x47, 0x72, 0x61, 0x70, 0x68, 0x2e, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x70, + 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x42, 0x79, 0x53, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, + 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x1c, 0x65, 0x6e, 0x74, + 0x72, 0x79, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x42, 0x79, 0x53, 0x75, 0x62, 0x6a, 0x65, 0x63, + 0x74, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0x6d, 0x0a, 0x1d, 0x45, 0x6e, 0x74, + 0x72, 0x79, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x42, 0x79, 0x53, 0x75, 0x62, 0x6a, 0x65, 0x63, + 0x74, 0x54, 0x79, 0x70, 0x65, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, + 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x36, 0x0a, 0x05, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x63, 0x6f, + 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x61, 0x63, 0x68, 0x61, 0x62, 0x69, 0x6c, 0x69, + 0x74, 0x79, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x52, 0x05, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x71, 0x0a, 0x21, 0x45, 0x6e, 0x74, 0x72, + 0x79, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x42, 0x79, 0x53, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, + 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, + 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, + 0x36, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, + 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x61, 0x63, 0x68, 0x61, 0x62, + 0x69, 0x6c, 0x69, 0x74, 0x79, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, + 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0xc6, 0x01, 0x0a, 0x17, + 0x52, 0x65, 0x61, 0x63, 0x68, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x45, 0x6e, 0x74, 0x72, + 0x79, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x12, 0x41, 0x0a, 0x0b, 0x65, 0x6e, 0x74, 0x72, 0x79, + 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x63, + 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x61, 0x63, 0x68, 0x61, 0x62, 0x69, 0x6c, + 0x69, 0x74, 0x79, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x52, 0x0b, 0x65, + 0x6e, 0x74, 0x72, 0x79, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x12, 0x21, 0x0a, 0x0c, 0x73, 0x75, + 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0b, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x45, 0x0a, + 0x10, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, + 0x31, 0x2e, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, + 0x6e, 0x63, 0x65, 0x52, 0x0f, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x6c, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x22, 0xce, 0x04, 0x0a, 0x16, 0x52, 0x65, 0x61, 0x63, 0x68, 0x61, 0x62, + 0x69, 0x6c, 0x69, 0x74, 0x79, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x12, + 0x4e, 0x0a, 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x3a, 0x2e, + 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x61, 0x63, 0x68, 0x61, 0x62, 0x69, + 0x6c, 0x69, 0x74, 0x79, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x2e, 0x52, + 0x65, 0x61, 0x63, 0x68, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x45, 0x6e, 0x74, 0x72, 0x79, + 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x4b, 0x69, 0x6e, 0x64, 0x52, 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x12, + 0x43, 0x0a, 0x0f, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x5f, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, + 0x76, 0x31, 0x2e, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x66, 0x65, 0x72, + 0x65, 0x6e, 0x63, 0x65, 0x52, 0x0e, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x52, 0x65, 0x6c, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x5b, 0x0a, 0x0d, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x5f, 0x73, + 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x36, 0x2e, 0x63, 0x6f, + 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x61, 0x63, 0x68, 0x61, 0x62, 0x69, 0x6c, 0x69, + 0x74, 0x79, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x2e, 0x45, 0x6e, 0x74, + 0x72, 0x79, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x53, 0x74, 0x61, + 0x74, 0x75, 0x73, 0x52, 0x0c, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, + 0x73, 0x12, 0x2b, 0x0a, 0x11, 0x74, 0x75, 0x70, 0x6c, 0x65, 0x73, 0x65, 0x74, 0x5f, 0x72, 0x65, + 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x74, 0x75, + 0x70, 0x6c, 0x65, 0x73, 0x65, 0x74, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x3a, + 0x0a, 0x19, 0x63, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x64, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x73, + 0x65, 0x74, 0x5f, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x17, 0x63, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x64, 0x55, 0x73, 0x65, 0x72, 0x73, + 0x65, 0x74, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x7a, 0x0a, 0x1a, 0x52, 0x65, + 0x61, 0x63, 0x68, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x70, + 0x6f, 0x69, 0x6e, 0x74, 0x4b, 0x69, 0x6e, 0x64, 0x12, 0x17, 0x0a, 0x13, 0x52, 0x45, 0x4c, 0x41, + 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x45, 0x4e, 0x54, 0x52, 0x59, 0x50, 0x4f, 0x49, 0x4e, 0x54, 0x10, + 0x00, 0x12, 0x1f, 0x0a, 0x1b, 0x43, 0x4f, 0x4d, 0x50, 0x55, 0x54, 0x45, 0x44, 0x5f, 0x55, 0x53, + 0x45, 0x52, 0x53, 0x45, 0x54, 0x5f, 0x45, 0x4e, 0x54, 0x52, 0x59, 0x50, 0x4f, 0x49, 0x4e, 0x54, + 0x10, 0x01, 0x12, 0x22, 0x0a, 0x1e, 0x54, 0x55, 0x50, 0x4c, 0x45, 0x53, 0x45, 0x54, 0x5f, 0x54, + 0x4f, 0x5f, 0x55, 0x53, 0x45, 0x52, 0x53, 0x45, 0x54, 0x5f, 0x45, 0x4e, 0x54, 0x52, 0x59, 0x50, + 0x4f, 0x49, 0x4e, 0x54, 0x10, 0x02, 0x22, 0x57, 0x0a, 0x16, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x70, + 0x6f, 0x69, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x12, 0x20, 0x0a, 0x1c, 0x52, 0x45, 0x41, 0x43, 0x48, 0x41, 0x42, 0x4c, 0x45, 0x5f, 0x43, 0x4f, + 0x4e, 0x44, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x41, 0x4c, 0x5f, 0x52, 0x45, 0x53, 0x55, 0x4c, 0x54, + 0x10, 0x00, 0x12, 0x1b, 0x0a, 0x17, 0x44, 0x49, 0x52, 0x45, 0x43, 0x54, 0x5f, 0x4f, 0x50, 0x45, + 0x52, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x52, 0x45, 0x53, 0x55, 0x4c, 0x54, 0x10, 0x01, 0x4a, + 0x04, 0x08, 0x03, 0x10, 0x04, 0x22, 0x65, 0x0a, 0x0f, 0x54, 0x79, 0x70, 0x65, 0x49, 0x6e, 0x66, + 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x52, 0x0a, 0x18, 0x61, 0x6c, 0x6c, 0x6f, + 0x77, 0x65, 0x64, 0x5f, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x5f, 0x72, 0x65, 0x6c, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x63, 0x6f, 0x72, + 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x52, 0x65, 0x6c, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x16, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x44, 0x69, 0x72, + 0x65, 0x63, 0x74, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0xcd, 0x04, 0x0a, + 0x0f, 0x41, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x12, 0x66, 0x0a, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x42, 0x48, 0xfa, 0x42, 0x45, 0x72, 0x43, 0x28, 0x80, 0x01, 0x32, 0x3e, 0x5e, + 0x28, 0x5b, 0x61, 0x2d, 0x7a, 0x5d, 0x5b, 0x61, 0x2d, 0x7a, 0x30, 0x2d, 0x39, 0x5f, 0x5d, 0x7b, + 0x31, 0x2c, 0x36, 0x31, 0x7d, 0x5b, 0x61, 0x2d, 0x7a, 0x30, 0x2d, 0x39, 0x5d, 0x2f, 0x29, 0x2a, + 0x5b, 0x61, 0x2d, 0x7a, 0x5d, 0x5b, 0x61, 0x2d, 0x7a, 0x30, 0x2d, 0x39, 0x5f, 0x5d, 0x7b, 0x31, + 0x2c, 0x36, 0x32, 0x7d, 0x5b, 0x61, 0x2d, 0x7a, 0x30, 0x2d, 0x39, 0x5d, 0x24, 0x52, 0x09, 0x6e, + 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x4e, 0x0a, 0x08, 0x72, 0x65, 0x6c, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x30, 0xfa, 0x42, 0x2d, 0x72, + 0x2b, 0x28, 0x40, 0x32, 0x27, 0x5e, 0x28, 0x5c, 0x2e, 0x5c, 0x2e, 0x5c, 0x2e, 0x7c, 0x5b, 0x61, 0x2d, 0x7a, 0x5d, 0x5b, 0x61, 0x2d, 0x7a, 0x30, 0x2d, 0x39, 0x5f, 0x5d, 0x7b, 0x31, 0x2c, 0x36, - 0x32, 0x7d, 0x5b, 0x61, 0x2d, 0x7a, 0x30, 0x2d, 0x39, 0x5d, 0x24, 0x52, 0x08, 0x72, 0x65, 0x6c, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x48, 0x0a, 0x08, 0x46, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, - 0x6e, 0x12, 0x18, 0x0a, 0x14, 0x46, 0x55, 0x4e, 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x55, 0x4e, - 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x10, 0x0a, 0x0c, 0x46, - 0x55, 0x4e, 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x41, 0x4e, 0x59, 0x10, 0x01, 0x12, 0x10, 0x0a, - 0x0c, 0x46, 0x55, 0x4e, 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x41, 0x4c, 0x4c, 0x10, 0x02, 0x22, - 0x91, 0x02, 0x0a, 0x0f, 0x43, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x64, 0x55, 0x73, 0x65, 0x72, - 0x73, 0x65, 0x74, 0x12, 0x41, 0x0a, 0x06, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0e, 0x32, 0x1f, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, - 0x6d, 0x70, 0x75, 0x74, 0x65, 0x64, 0x55, 0x73, 0x65, 0x72, 0x73, 0x65, 0x74, 0x2e, 0x4f, 0x62, - 0x6a, 0x65, 0x63, 0x74, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x82, 0x01, 0x02, 0x10, 0x01, 0x52, 0x06, - 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x43, 0x0a, 0x08, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x27, 0xfa, 0x42, 0x24, 0x72, 0x22, 0x28, - 0x40, 0x32, 0x1e, 0x5e, 0x5b, 0x61, 0x2d, 0x7a, 0x5d, 0x5b, 0x61, 0x2d, 0x7a, 0x30, 0x2d, 0x39, - 0x5f, 0x5d, 0x7b, 0x31, 0x2c, 0x36, 0x32, 0x7d, 0x5b, 0x61, 0x2d, 0x7a, 0x30, 0x2d, 0x39, 0x5d, - 0x24, 0x52, 0x08, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x40, 0x0a, 0x0f, 0x73, - 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, + 0x32, 0x7d, 0x5b, 0x61, 0x2d, 0x7a, 0x30, 0x2d, 0x39, 0x5d, 0x29, 0x24, 0x48, 0x00, 0x52, 0x08, + 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x52, 0x0a, 0x0f, 0x70, 0x75, 0x62, 0x6c, + 0x69, 0x63, 0x5f, 0x77, 0x69, 0x6c, 0x64, 0x63, 0x61, 0x72, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x27, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x6c, 0x6c, 0x6f, + 0x77, 0x65, 0x64, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x50, 0x75, 0x62, 0x6c, + 0x69, 0x63, 0x57, 0x69, 0x6c, 0x64, 0x63, 0x61, 0x72, 0x64, 0x48, 0x00, 0x52, 0x0e, 0x70, 0x75, + 0x62, 0x6c, 0x69, 0x63, 0x57, 0x69, 0x6c, 0x64, 0x63, 0x61, 0x72, 0x64, 0x12, 0x40, 0x0a, 0x0f, + 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, + 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, + 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0e, + 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x3f, + 0x0a, 0x0f, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x5f, 0x63, 0x61, 0x76, 0x65, 0x61, + 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, + 0x31, 0x2e, 0x41, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x43, 0x61, 0x76, 0x65, 0x61, 0x74, 0x52, + 0x0e, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x43, 0x61, 0x76, 0x65, 0x61, 0x74, 0x12, + 0x49, 0x0a, 0x13, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x5f, 0x65, 0x78, 0x70, 0x69, + 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x63, + 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x70, 0x69, 0x72, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x54, 0x72, 0x61, 0x69, 0x74, 0x52, 0x12, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, + 0x45, 0x78, 0x70, 0x69, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x36, 0x0a, 0x0b, 0x64, 0x65, + 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x14, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x70, 0x72, 0x65, 0x63, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0b, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x1a, 0x10, 0x0a, 0x0e, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x57, 0x69, 0x6c, 0x64, + 0x63, 0x61, 0x72, 0x64, 0x42, 0x16, 0x0a, 0x14, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x5f, 0x6f, 0x72, 0x5f, 0x77, 0x69, 0x6c, 0x64, 0x63, 0x61, 0x72, 0x64, 0x22, 0x11, 0x0a, 0x0f, + 0x45, 0x78, 0x70, 0x69, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x72, 0x61, 0x69, 0x74, 0x22, + 0x30, 0x0a, 0x0d, 0x41, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x43, 0x61, 0x76, 0x65, 0x61, 0x74, + 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x61, 0x76, 0x65, 0x61, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x61, 0x76, 0x65, 0x61, 0x74, 0x4e, 0x61, 0x6d, + 0x65, 0x22, 0xad, 0x02, 0x0a, 0x0e, 0x55, 0x73, 0x65, 0x72, 0x73, 0x65, 0x74, 0x52, 0x65, 0x77, + 0x72, 0x69, 0x74, 0x65, 0x12, 0x37, 0x0a, 0x05, 0x75, 0x6e, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, + 0x74, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x8a, + 0x01, 0x02, 0x10, 0x01, 0x48, 0x00, 0x52, 0x05, 0x75, 0x6e, 0x69, 0x6f, 0x6e, 0x12, 0x45, 0x0a, + 0x0c, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x73, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, + 0x74, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x8a, + 0x01, 0x02, 0x10, 0x01, 0x48, 0x00, 0x52, 0x0c, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x73, 0x65, 0x63, + 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x3f, 0x0a, 0x09, 0x65, 0x78, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x6f, + 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, + 0x31, 0x2e, 0x53, 0x65, 0x74, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x08, + 0xfa, 0x42, 0x05, 0x8a, 0x01, 0x02, 0x10, 0x01, 0x48, 0x00, 0x52, 0x09, 0x65, 0x78, 0x63, 0x6c, + 0x75, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x40, 0x0a, 0x0f, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, + 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, + 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x50, + 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0e, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x50, + 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x18, 0x0a, 0x11, 0x72, 0x65, 0x77, 0x72, 0x69, + 0x74, 0x65, 0x5f, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x03, 0xf8, 0x42, + 0x01, 0x22, 0xb2, 0x05, 0x0a, 0x0c, 0x53, 0x65, 0x74, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x12, 0x42, 0x0a, 0x05, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x18, 0x01, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x1b, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x74, 0x4f, + 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x43, 0x68, 0x69, 0x6c, 0x64, 0x42, 0x0f, + 0xfa, 0x42, 0x0c, 0x92, 0x01, 0x09, 0x08, 0x01, 0x22, 0x05, 0x8a, 0x01, 0x02, 0x10, 0x01, 0x52, + 0x05, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x1a, 0xdd, 0x04, 0x0a, 0x05, 0x43, 0x68, 0x69, 0x6c, 0x64, + 0x12, 0x37, 0x0a, 0x05, 0x5f, 0x74, 0x68, 0x69, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x20, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x74, 0x4f, 0x70, 0x65, + 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x43, 0x68, 0x69, 0x6c, 0x64, 0x2e, 0x54, 0x68, 0x69, + 0x73, 0x48, 0x00, 0x52, 0x04, 0x54, 0x68, 0x69, 0x73, 0x12, 0x4f, 0x0a, 0x10, 0x63, 0x6f, 0x6d, + 0x70, 0x75, 0x74, 0x65, 0x64, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x73, 0x65, 0x74, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, + 0x6d, 0x70, 0x75, 0x74, 0x65, 0x64, 0x55, 0x73, 0x65, 0x72, 0x73, 0x65, 0x74, 0x42, 0x08, 0xfa, + 0x42, 0x05, 0x8a, 0x01, 0x02, 0x10, 0x01, 0x48, 0x00, 0x52, 0x0f, 0x63, 0x6f, 0x6d, 0x70, 0x75, + 0x74, 0x65, 0x64, 0x55, 0x73, 0x65, 0x72, 0x73, 0x65, 0x74, 0x12, 0x4d, 0x0a, 0x10, 0x74, 0x75, + 0x70, 0x6c, 0x65, 0x5f, 0x74, 0x6f, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x73, 0x65, 0x74, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x54, + 0x75, 0x70, 0x6c, 0x65, 0x54, 0x6f, 0x55, 0x73, 0x65, 0x72, 0x73, 0x65, 0x74, 0x42, 0x08, 0xfa, + 0x42, 0x05, 0x8a, 0x01, 0x02, 0x10, 0x01, 0x48, 0x00, 0x52, 0x0e, 0x74, 0x75, 0x70, 0x6c, 0x65, + 0x54, 0x6f, 0x55, 0x73, 0x65, 0x72, 0x73, 0x65, 0x74, 0x12, 0x4c, 0x0a, 0x0f, 0x75, 0x73, 0x65, + 0x72, 0x73, 0x65, 0x74, 0x5f, 0x72, 0x65, 0x77, 0x72, 0x69, 0x74, 0x65, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, + 0x72, 0x73, 0x65, 0x74, 0x52, 0x65, 0x77, 0x72, 0x69, 0x74, 0x65, 0x42, 0x08, 0xfa, 0x42, 0x05, + 0x8a, 0x01, 0x02, 0x10, 0x01, 0x48, 0x00, 0x52, 0x0e, 0x75, 0x73, 0x65, 0x72, 0x73, 0x65, 0x74, + 0x52, 0x65, 0x77, 0x72, 0x69, 0x74, 0x65, 0x12, 0x6c, 0x0a, 0x1b, 0x66, 0x75, 0x6e, 0x63, 0x74, + 0x69, 0x6f, 0x6e, 0x65, 0x64, 0x5f, 0x74, 0x75, 0x70, 0x6c, 0x65, 0x5f, 0x74, 0x6f, 0x5f, 0x75, + 0x73, 0x65, 0x72, 0x73, 0x65, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x63, + 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x46, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x65, + 0x64, 0x54, 0x75, 0x70, 0x6c, 0x65, 0x54, 0x6f, 0x55, 0x73, 0x65, 0x72, 0x73, 0x65, 0x74, 0x42, + 0x08, 0xfa, 0x42, 0x05, 0x8a, 0x01, 0x02, 0x10, 0x01, 0x48, 0x00, 0x52, 0x18, 0x66, 0x75, 0x6e, + 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x65, 0x64, 0x54, 0x75, 0x70, 0x6c, 0x65, 0x54, 0x6f, 0x55, 0x73, + 0x65, 0x72, 0x73, 0x65, 0x74, 0x12, 0x34, 0x0a, 0x04, 0x5f, 0x6e, 0x69, 0x6c, 0x18, 0x06, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, + 0x74, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x43, 0x68, 0x69, 0x6c, 0x64, + 0x2e, 0x4e, 0x69, 0x6c, 0x48, 0x00, 0x52, 0x03, 0x4e, 0x69, 0x6c, 0x12, 0x40, 0x0a, 0x0f, 0x73, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0e, 0x73, - 0x6f, 0x75, 0x72, 0x63, 0x65, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x34, 0x0a, - 0x06, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x10, 0x0a, 0x0c, 0x54, 0x55, 0x50, 0x4c, 0x45, - 0x5f, 0x4f, 0x42, 0x4a, 0x45, 0x43, 0x54, 0x10, 0x00, 0x12, 0x18, 0x0a, 0x14, 0x54, 0x55, 0x50, - 0x4c, 0x45, 0x5f, 0x55, 0x53, 0x45, 0x52, 0x53, 0x45, 0x54, 0x5f, 0x4f, 0x42, 0x4a, 0x45, 0x43, - 0x54, 0x10, 0x01, 0x22, 0x8a, 0x01, 0x0a, 0x0e, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x50, 0x6f, - 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x37, 0x0a, 0x18, 0x7a, 0x65, 0x72, 0x6f, 0x5f, 0x69, - 0x6e, 0x64, 0x65, 0x78, 0x65, 0x64, 0x5f, 0x6c, 0x69, 0x6e, 0x65, 0x5f, 0x6e, 0x75, 0x6d, 0x62, - 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x15, 0x7a, 0x65, 0x72, 0x6f, 0x49, 0x6e, - 0x64, 0x65, 0x78, 0x65, 0x64, 0x4c, 0x69, 0x6e, 0x65, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, - 0x3f, 0x0a, 0x1c, 0x7a, 0x65, 0x72, 0x6f, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x65, 0x64, 0x5f, - 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x19, 0x7a, 0x65, 0x72, 0x6f, 0x49, 0x6e, 0x64, 0x65, 0x78, - 0x65, 0x64, 0x43, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, - 0x22, 0x9c, 0x01, 0x0a, 0x10, 0x43, 0x61, 0x76, 0x65, 0x61, 0x74, 0x45, 0x78, 0x70, 0x72, 0x65, - 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x38, 0x0a, 0x09, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, - 0x76, 0x31, 0x2e, 0x43, 0x61, 0x76, 0x65, 0x61, 0x74, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x48, 0x00, 0x52, 0x09, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, - 0x37, 0x0a, 0x06, 0x63, 0x61, 0x76, 0x65, 0x61, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x1d, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, - 0x74, 0x75, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x43, 0x61, 0x76, 0x65, 0x61, 0x74, 0x48, 0x00, - 0x52, 0x06, 0x63, 0x61, 0x76, 0x65, 0x61, 0x74, 0x42, 0x15, 0x0a, 0x13, 0x6f, 0x70, 0x65, 0x72, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6f, 0x72, 0x5f, 0x63, 0x61, 0x76, 0x65, 0x61, 0x74, 0x22, - 0xb0, 0x01, 0x0a, 0x0f, 0x43, 0x61, 0x76, 0x65, 0x61, 0x74, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x12, 0x32, 0x0a, 0x02, 0x6f, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, - 0x22, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x61, 0x76, 0x65, 0x61, 0x74, - 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x52, 0x02, 0x6f, 0x70, 0x12, 0x35, 0x0a, 0x08, 0x63, 0x68, 0x69, 0x6c, 0x64, - 0x72, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x72, 0x65, - 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x61, 0x76, 0x65, 0x61, 0x74, 0x45, 0x78, 0x70, 0x72, 0x65, 0x73, - 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x08, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x72, 0x65, 0x6e, 0x22, 0x32, - 0x0a, 0x09, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x0b, 0x0a, 0x07, 0x55, - 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x06, 0x0a, 0x02, 0x4f, 0x52, 0x10, 0x01, - 0x12, 0x07, 0x0a, 0x03, 0x41, 0x4e, 0x44, 0x10, 0x02, 0x12, 0x07, 0x0a, 0x03, 0x4e, 0x4f, 0x54, - 0x10, 0x03, 0x22, 0xee, 0x03, 0x0a, 0x12, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, - 0x68, 0x69, 0x70, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x12, 0x70, 0x0a, 0x0d, 0x72, 0x65, 0x73, - 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x42, 0x4b, 0xfa, 0x42, 0x48, 0x72, 0x46, 0x28, 0x80, 0x01, 0x32, 0x41, 0x5e, 0x28, 0x28, 0x5b, - 0x61, 0x2d, 0x7a, 0x5d, 0x5b, 0x61, 0x2d, 0x7a, 0x30, 0x2d, 0x39, 0x5f, 0x5d, 0x7b, 0x31, 0x2c, - 0x36, 0x31, 0x7d, 0x5b, 0x61, 0x2d, 0x7a, 0x30, 0x2d, 0x39, 0x5d, 0x2f, 0x29, 0x2a, 0x5b, 0x61, - 0x2d, 0x7a, 0x5d, 0x5b, 0x61, 0x2d, 0x7a, 0x30, 0x2d, 0x39, 0x5f, 0x5d, 0x7b, 0x31, 0x2c, 0x36, - 0x32, 0x7d, 0x5b, 0x61, 0x2d, 0x7a, 0x30, 0x2d, 0x39, 0x5d, 0x29, 0x3f, 0x24, 0x52, 0x0c, 0x72, - 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x57, 0x0a, 0x14, 0x6f, - 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x5f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, - 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x25, 0xfa, 0x42, 0x22, 0x72, 0x20, - 0x28, 0x80, 0x08, 0x32, 0x1b, 0x5e, 0x28, 0x5b, 0x61, 0x2d, 0x7a, 0x41, 0x2d, 0x5a, 0x30, 0x2d, - 0x39, 0x2f, 0x5f, 0x7c, 0x5c, 0x2d, 0x3d, 0x2b, 0x5d, 0x7b, 0x31, 0x2c, 0x7d, 0x29, 0x3f, 0x24, - 0x52, 0x12, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, - 0x63, 0x65, 0x49, 0x64, 0x12, 0x64, 0x0a, 0x1b, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, - 0x5f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x5f, 0x70, 0x72, 0x65, - 0x66, 0x69, 0x78, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x42, 0x25, 0xfa, 0x42, 0x22, 0x72, 0x20, - 0x28, 0x80, 0x08, 0x32, 0x1b, 0x5e, 0x28, 0x5b, 0x61, 0x2d, 0x7a, 0x41, 0x2d, 0x5a, 0x30, 0x2d, - 0x39, 0x2f, 0x5f, 0x7c, 0x5c, 0x2d, 0x3d, 0x2b, 0x5d, 0x7b, 0x31, 0x2c, 0x7d, 0x29, 0x3f, 0x24, - 0x52, 0x18, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, - 0x63, 0x65, 0x49, 0x64, 0x50, 0x72, 0x65, 0x66, 0x69, 0x78, 0x12, 0x57, 0x0a, 0x11, 0x6f, 0x70, - 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x5f, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x2a, 0xfa, 0x42, 0x27, 0x72, 0x25, 0x28, 0x40, 0x32, 0x21, - 0x5e, 0x28, 0x5b, 0x61, 0x2d, 0x7a, 0x5d, 0x5b, 0x61, 0x2d, 0x7a, 0x30, 0x2d, 0x39, 0x5f, 0x5d, - 0x7b, 0x31, 0x2c, 0x36, 0x32, 0x7d, 0x5b, 0x61, 0x2d, 0x7a, 0x30, 0x2d, 0x39, 0x5d, 0x29, 0x3f, - 0x24, 0x52, 0x10, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x52, 0x65, 0x6c, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x12, 0x4e, 0x0a, 0x17, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x5f, - 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x18, 0x04, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, - 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x52, 0x15, 0x6f, 0x70, - 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x53, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x46, 0x69, 0x6c, - 0x74, 0x65, 0x72, 0x22, 0x86, 0x03, 0x0a, 0x0d, 0x53, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x46, - 0x69, 0x6c, 0x74, 0x65, 0x72, 0x12, 0x6b, 0x0a, 0x0c, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, - 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x48, 0xfa, 0x42, 0x45, - 0x72, 0x43, 0x28, 0x80, 0x01, 0x32, 0x3e, 0x5e, 0x28, 0x5b, 0x61, 0x2d, 0x7a, 0x5d, 0x5b, 0x61, - 0x2d, 0x7a, 0x30, 0x2d, 0x39, 0x5f, 0x5d, 0x7b, 0x31, 0x2c, 0x36, 0x31, 0x7d, 0x5b, 0x61, 0x2d, - 0x7a, 0x30, 0x2d, 0x39, 0x5d, 0x2f, 0x29, 0x2a, 0x5b, 0x61, 0x2d, 0x7a, 0x5d, 0x5b, 0x61, 0x2d, - 0x7a, 0x30, 0x2d, 0x39, 0x5f, 0x5d, 0x7b, 0x31, 0x2c, 0x36, 0x32, 0x7d, 0x5b, 0x61, 0x2d, 0x7a, - 0x30, 0x2d, 0x39, 0x5d, 0x24, 0x52, 0x0b, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x54, 0x79, - 0x70, 0x65, 0x12, 0x5a, 0x0a, 0x13, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x5f, 0x73, - 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, - 0x2a, 0xfa, 0x42, 0x27, 0x72, 0x25, 0x28, 0x80, 0x08, 0x32, 0x20, 0x5e, 0x28, 0x28, 0x5b, 0x61, - 0x2d, 0x7a, 0x41, 0x2d, 0x5a, 0x30, 0x2d, 0x39, 0x2f, 0x5f, 0x7c, 0x5c, 0x2d, 0x3d, 0x2b, 0x5d, - 0x7b, 0x31, 0x2c, 0x7d, 0x29, 0x7c, 0x5c, 0x2a, 0x29, 0x3f, 0x24, 0x52, 0x11, 0x6f, 0x70, 0x74, - 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x53, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x49, 0x64, 0x12, 0x52, - 0x0a, 0x11, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x5f, 0x72, 0x65, 0x6c, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x63, 0x6f, 0x72, 0x65, - 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x46, 0x69, 0x6c, 0x74, 0x65, - 0x72, 0x2e, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, - 0x52, 0x10, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x1a, 0x58, 0x0a, 0x0e, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x46, 0x69, - 0x6c, 0x74, 0x65, 0x72, 0x12, 0x46, 0x0a, 0x08, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x2a, 0xfa, 0x42, 0x27, 0x72, 0x25, 0x28, 0x40, 0x32, - 0x21, 0x5e, 0x28, 0x5b, 0x61, 0x2d, 0x7a, 0x5d, 0x5b, 0x61, 0x2d, 0x7a, 0x30, 0x2d, 0x39, 0x5f, - 0x5d, 0x7b, 0x31, 0x2c, 0x36, 0x32, 0x7d, 0x5b, 0x61, 0x2d, 0x7a, 0x30, 0x2d, 0x39, 0x5d, 0x29, - 0x3f, 0x24, 0x52, 0x08, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x8a, 0x01, 0x0a, - 0x0b, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x42, 0x09, 0x43, 0x6f, - 0x72, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x33, 0x67, 0x69, 0x74, 0x68, 0x75, - 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x7a, 0x65, 0x64, 0x2f, 0x73, 0x70, - 0x69, 0x63, 0x65, 0x64, 0x62, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, - 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x31, 0x3b, 0x63, 0x6f, 0x72, 0x65, 0x76, 0x31, 0xa2, 0x02, - 0x03, 0x43, 0x58, 0x58, 0xaa, 0x02, 0x07, 0x43, 0x6f, 0x72, 0x65, 0x2e, 0x56, 0x31, 0xca, 0x02, - 0x07, 0x43, 0x6f, 0x72, 0x65, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x13, 0x43, 0x6f, 0x72, 0x65, 0x5c, - 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, - 0x08, 0x43, 0x6f, 0x72, 0x65, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x33, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x25, 0x0a, + 0x0e, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x61, 0x74, 0x68, 0x18, + 0x07, 0x20, 0x03, 0x28, 0x0d, 0x52, 0x0d, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x50, 0x61, 0x74, 0x68, 0x1a, 0x06, 0x0a, 0x04, 0x54, 0x68, 0x69, 0x73, 0x1a, 0x05, 0x0a, 0x03, + 0x4e, 0x69, 0x6c, 0x42, 0x11, 0x0a, 0x0a, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x5f, 0x74, 0x79, 0x70, + 0x65, 0x12, 0x03, 0xf8, 0x42, 0x01, 0x22, 0xba, 0x02, 0x0a, 0x0e, 0x54, 0x75, 0x70, 0x6c, 0x65, + 0x54, 0x6f, 0x55, 0x73, 0x65, 0x72, 0x73, 0x65, 0x74, 0x12, 0x46, 0x0a, 0x08, 0x74, 0x75, 0x70, + 0x6c, 0x65, 0x73, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x63, 0x6f, + 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x75, 0x70, 0x6c, 0x65, 0x54, 0x6f, 0x55, 0x73, 0x65, + 0x72, 0x73, 0x65, 0x74, 0x2e, 0x54, 0x75, 0x70, 0x6c, 0x65, 0x73, 0x65, 0x74, 0x42, 0x08, 0xfa, + 0x42, 0x05, 0x8a, 0x01, 0x02, 0x10, 0x01, 0x52, 0x08, 0x74, 0x75, 0x70, 0x6c, 0x65, 0x73, 0x65, + 0x74, 0x12, 0x4d, 0x0a, 0x10, 0x63, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x64, 0x5f, 0x75, 0x73, + 0x65, 0x72, 0x73, 0x65, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x63, 0x6f, + 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x64, 0x55, 0x73, + 0x65, 0x72, 0x73, 0x65, 0x74, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x8a, 0x01, 0x02, 0x10, 0x01, 0x52, + 0x0f, 0x63, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x64, 0x55, 0x73, 0x65, 0x72, 0x73, 0x65, 0x74, + 0x12, 0x40, 0x0a, 0x0f, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, + 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x63, 0x6f, 0x72, 0x65, + 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, + 0x6f, 0x6e, 0x52, 0x0e, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, + 0x6f, 0x6e, 0x1a, 0x4f, 0x0a, 0x08, 0x54, 0x75, 0x70, 0x6c, 0x65, 0x73, 0x65, 0x74, 0x12, 0x43, + 0x0a, 0x08, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x42, 0x27, 0xfa, 0x42, 0x24, 0x72, 0x22, 0x28, 0x40, 0x32, 0x1e, 0x5e, 0x5b, 0x61, 0x2d, 0x7a, + 0x5d, 0x5b, 0x61, 0x2d, 0x7a, 0x30, 0x2d, 0x39, 0x5f, 0x5d, 0x7b, 0x31, 0x2c, 0x36, 0x32, 0x7d, + 0x5b, 0x61, 0x2d, 0x7a, 0x30, 0x2d, 0x39, 0x5d, 0x24, 0x52, 0x08, 0x72, 0x65, 0x6c, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x22, 0xec, 0x03, 0x0a, 0x18, 0x46, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, + 0x65, 0x64, 0x54, 0x75, 0x70, 0x6c, 0x65, 0x54, 0x6f, 0x55, 0x73, 0x65, 0x72, 0x73, 0x65, 0x74, + 0x12, 0x52, 0x0a, 0x08, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0e, 0x32, 0x2a, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x46, 0x75, 0x6e, + 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x65, 0x64, 0x54, 0x75, 0x70, 0x6c, 0x65, 0x54, 0x6f, 0x55, 0x73, + 0x65, 0x72, 0x73, 0x65, 0x74, 0x2e, 0x46, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x0a, + 0xfa, 0x42, 0x07, 0x82, 0x01, 0x04, 0x10, 0x01, 0x20, 0x00, 0x52, 0x08, 0x66, 0x75, 0x6e, 0x63, + 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x50, 0x0a, 0x08, 0x74, 0x75, 0x70, 0x6c, 0x65, 0x73, 0x65, 0x74, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, + 0x2e, 0x46, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x65, 0x64, 0x54, 0x75, 0x70, 0x6c, 0x65, + 0x54, 0x6f, 0x55, 0x73, 0x65, 0x72, 0x73, 0x65, 0x74, 0x2e, 0x54, 0x75, 0x70, 0x6c, 0x65, 0x73, + 0x65, 0x74, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x8a, 0x01, 0x02, 0x10, 0x01, 0x52, 0x08, 0x74, 0x75, + 0x70, 0x6c, 0x65, 0x73, 0x65, 0x74, 0x12, 0x4d, 0x0a, 0x10, 0x63, 0x6f, 0x6d, 0x70, 0x75, 0x74, + 0x65, 0x64, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x73, 0x65, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x18, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x75, + 0x74, 0x65, 0x64, 0x55, 0x73, 0x65, 0x72, 0x73, 0x65, 0x74, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x8a, + 0x01, 0x02, 0x10, 0x01, 0x52, 0x0f, 0x63, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x64, 0x55, 0x73, + 0x65, 0x72, 0x73, 0x65, 0x74, 0x12, 0x40, 0x0a, 0x0f, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, + 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, + 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x50, + 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0e, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x50, + 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0x4f, 0x0a, 0x08, 0x54, 0x75, 0x70, 0x6c, 0x65, + 0x73, 0x65, 0x74, 0x12, 0x43, 0x0a, 0x08, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x27, 0xfa, 0x42, 0x24, 0x72, 0x22, 0x28, 0x40, 0x32, 0x1e, + 0x5e, 0x5b, 0x61, 0x2d, 0x7a, 0x5d, 0x5b, 0x61, 0x2d, 0x7a, 0x30, 0x2d, 0x39, 0x5f, 0x5d, 0x7b, + 0x31, 0x2c, 0x36, 0x32, 0x7d, 0x5b, 0x61, 0x2d, 0x7a, 0x30, 0x2d, 0x39, 0x5d, 0x24, 0x52, 0x08, + 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x48, 0x0a, 0x08, 0x46, 0x75, 0x6e, 0x63, + 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x18, 0x0a, 0x14, 0x46, 0x55, 0x4e, 0x43, 0x54, 0x49, 0x4f, 0x4e, + 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x10, + 0x0a, 0x0c, 0x46, 0x55, 0x4e, 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x41, 0x4e, 0x59, 0x10, 0x01, + 0x12, 0x10, 0x0a, 0x0c, 0x46, 0x55, 0x4e, 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x41, 0x4c, 0x4c, + 0x10, 0x02, 0x22, 0x91, 0x02, 0x0a, 0x0f, 0x43, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x64, 0x55, + 0x73, 0x65, 0x72, 0x73, 0x65, 0x74, 0x12, 0x41, 0x0a, 0x06, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1f, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, + 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x64, 0x55, 0x73, 0x65, 0x72, 0x73, 0x65, 0x74, + 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x82, 0x01, 0x02, 0x10, + 0x01, 0x52, 0x06, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x43, 0x0a, 0x08, 0x72, 0x65, 0x6c, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x27, 0xfa, 0x42, 0x24, + 0x72, 0x22, 0x28, 0x40, 0x32, 0x1e, 0x5e, 0x5b, 0x61, 0x2d, 0x7a, 0x5d, 0x5b, 0x61, 0x2d, 0x7a, + 0x30, 0x2d, 0x39, 0x5f, 0x5d, 0x7b, 0x31, 0x2c, 0x36, 0x32, 0x7d, 0x5b, 0x61, 0x2d, 0x7a, 0x30, + 0x2d, 0x39, 0x5d, 0x24, 0x52, 0x08, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x40, + 0x0a, 0x0f, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, + 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, + 0x31, 0x2e, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, + 0x52, 0x0e, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, + 0x22, 0x34, 0x0a, 0x06, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x10, 0x0a, 0x0c, 0x54, 0x55, + 0x50, 0x4c, 0x45, 0x5f, 0x4f, 0x42, 0x4a, 0x45, 0x43, 0x54, 0x10, 0x00, 0x12, 0x18, 0x0a, 0x14, + 0x54, 0x55, 0x50, 0x4c, 0x45, 0x5f, 0x55, 0x53, 0x45, 0x52, 0x53, 0x45, 0x54, 0x5f, 0x4f, 0x42, + 0x4a, 0x45, 0x43, 0x54, 0x10, 0x01, 0x22, 0x8a, 0x01, 0x0a, 0x0e, 0x53, 0x6f, 0x75, 0x72, 0x63, + 0x65, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x37, 0x0a, 0x18, 0x7a, 0x65, 0x72, + 0x6f, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x65, 0x64, 0x5f, 0x6c, 0x69, 0x6e, 0x65, 0x5f, 0x6e, + 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x15, 0x7a, 0x65, 0x72, + 0x6f, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x65, 0x64, 0x4c, 0x69, 0x6e, 0x65, 0x4e, 0x75, 0x6d, 0x62, + 0x65, 0x72, 0x12, 0x3f, 0x0a, 0x1c, 0x7a, 0x65, 0x72, 0x6f, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, + 0x65, 0x64, 0x5f, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, + 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x19, 0x7a, 0x65, 0x72, 0x6f, 0x49, 0x6e, + 0x64, 0x65, 0x78, 0x65, 0x64, 0x43, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x50, 0x6f, 0x73, 0x69, 0x74, + 0x69, 0x6f, 0x6e, 0x22, 0x9c, 0x01, 0x0a, 0x10, 0x43, 0x61, 0x76, 0x65, 0x61, 0x74, 0x45, 0x78, + 0x70, 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x38, 0x0a, 0x09, 0x6f, 0x70, 0x65, 0x72, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x63, 0x6f, + 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x61, 0x76, 0x65, 0x61, 0x74, 0x4f, 0x70, 0x65, 0x72, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x00, 0x52, 0x09, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x12, 0x37, 0x0a, 0x06, 0x63, 0x61, 0x76, 0x65, 0x61, 0x74, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6e, + 0x74, 0x65, 0x78, 0x74, 0x75, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x43, 0x61, 0x76, 0x65, 0x61, + 0x74, 0x48, 0x00, 0x52, 0x06, 0x63, 0x61, 0x76, 0x65, 0x61, 0x74, 0x42, 0x15, 0x0a, 0x13, 0x6f, + 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6f, 0x72, 0x5f, 0x63, 0x61, 0x76, 0x65, + 0x61, 0x74, 0x22, 0xb0, 0x01, 0x0a, 0x0f, 0x43, 0x61, 0x76, 0x65, 0x61, 0x74, 0x4f, 0x70, 0x65, + 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x32, 0x0a, 0x02, 0x6f, 0x70, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0e, 0x32, 0x22, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x61, 0x76, + 0x65, 0x61, 0x74, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4f, 0x70, 0x65, + 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x02, 0x6f, 0x70, 0x12, 0x35, 0x0a, 0x08, 0x63, 0x68, + 0x69, 0x6c, 0x64, 0x72, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, + 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x61, 0x76, 0x65, 0x61, 0x74, 0x45, 0x78, 0x70, + 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x08, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x72, 0x65, + 0x6e, 0x22, 0x32, 0x0a, 0x09, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x0b, + 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x06, 0x0a, 0x02, 0x4f, + 0x52, 0x10, 0x01, 0x12, 0x07, 0x0a, 0x03, 0x41, 0x4e, 0x44, 0x10, 0x02, 0x12, 0x07, 0x0a, 0x03, + 0x4e, 0x4f, 0x54, 0x10, 0x03, 0x22, 0xee, 0x03, 0x0a, 0x12, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x68, 0x69, 0x70, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x12, 0x70, 0x0a, 0x0d, + 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x42, 0x4b, 0xfa, 0x42, 0x48, 0x72, 0x46, 0x28, 0x80, 0x01, 0x32, 0x41, 0x5e, + 0x28, 0x28, 0x5b, 0x61, 0x2d, 0x7a, 0x5d, 0x5b, 0x61, 0x2d, 0x7a, 0x30, 0x2d, 0x39, 0x5f, 0x5d, + 0x7b, 0x31, 0x2c, 0x36, 0x31, 0x7d, 0x5b, 0x61, 0x2d, 0x7a, 0x30, 0x2d, 0x39, 0x5d, 0x2f, 0x29, + 0x2a, 0x5b, 0x61, 0x2d, 0x7a, 0x5d, 0x5b, 0x61, 0x2d, 0x7a, 0x30, 0x2d, 0x39, 0x5f, 0x5d, 0x7b, + 0x31, 0x2c, 0x36, 0x32, 0x7d, 0x5b, 0x61, 0x2d, 0x7a, 0x30, 0x2d, 0x39, 0x5d, 0x29, 0x3f, 0x24, + 0x52, 0x0c, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x57, + 0x0a, 0x14, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x5f, 0x72, 0x65, 0x73, 0x6f, 0x75, + 0x72, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x25, 0xfa, 0x42, + 0x22, 0x72, 0x20, 0x28, 0x80, 0x08, 0x32, 0x1b, 0x5e, 0x28, 0x5b, 0x61, 0x2d, 0x7a, 0x41, 0x2d, + 0x5a, 0x30, 0x2d, 0x39, 0x2f, 0x5f, 0x7c, 0x5c, 0x2d, 0x3d, 0x2b, 0x5d, 0x7b, 0x31, 0x2c, 0x7d, + 0x29, 0x3f, 0x24, 0x52, 0x12, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x52, 0x65, 0x73, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x64, 0x12, 0x64, 0x0a, 0x1b, 0x6f, 0x70, 0x74, 0x69, 0x6f, + 0x6e, 0x61, 0x6c, 0x5f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x5f, + 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x42, 0x25, 0xfa, 0x42, + 0x22, 0x72, 0x20, 0x28, 0x80, 0x08, 0x32, 0x1b, 0x5e, 0x28, 0x5b, 0x61, 0x2d, 0x7a, 0x41, 0x2d, + 0x5a, 0x30, 0x2d, 0x39, 0x2f, 0x5f, 0x7c, 0x5c, 0x2d, 0x3d, 0x2b, 0x5d, 0x7b, 0x31, 0x2c, 0x7d, + 0x29, 0x3f, 0x24, 0x52, 0x18, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x52, 0x65, 0x73, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x64, 0x50, 0x72, 0x65, 0x66, 0x69, 0x78, 0x12, 0x57, 0x0a, + 0x11, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x5f, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x2a, 0xfa, 0x42, 0x27, 0x72, 0x25, 0x28, + 0x40, 0x32, 0x21, 0x5e, 0x28, 0x5b, 0x61, 0x2d, 0x7a, 0x5d, 0x5b, 0x61, 0x2d, 0x7a, 0x30, 0x2d, + 0x39, 0x5f, 0x5d, 0x7b, 0x31, 0x2c, 0x36, 0x32, 0x7d, 0x5b, 0x61, 0x2d, 0x7a, 0x30, 0x2d, 0x39, + 0x5d, 0x29, 0x3f, 0x24, 0x52, 0x10, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x52, 0x65, + 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x4e, 0x0a, 0x17, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, + 0x61, 0x6c, 0x5f, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x66, 0x69, 0x6c, 0x74, 0x65, + 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, + 0x31, 0x2e, 0x53, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x52, + 0x15, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x53, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, + 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x22, 0x86, 0x03, 0x0a, 0x0d, 0x53, 0x75, 0x62, 0x6a, 0x65, + 0x63, 0x74, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x12, 0x6b, 0x0a, 0x0c, 0x73, 0x75, 0x62, 0x6a, + 0x65, 0x63, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x48, + 0xfa, 0x42, 0x45, 0x72, 0x43, 0x28, 0x80, 0x01, 0x32, 0x3e, 0x5e, 0x28, 0x5b, 0x61, 0x2d, 0x7a, + 0x5d, 0x5b, 0x61, 0x2d, 0x7a, 0x30, 0x2d, 0x39, 0x5f, 0x5d, 0x7b, 0x31, 0x2c, 0x36, 0x31, 0x7d, + 0x5b, 0x61, 0x2d, 0x7a, 0x30, 0x2d, 0x39, 0x5d, 0x2f, 0x29, 0x2a, 0x5b, 0x61, 0x2d, 0x7a, 0x5d, + 0x5b, 0x61, 0x2d, 0x7a, 0x30, 0x2d, 0x39, 0x5f, 0x5d, 0x7b, 0x31, 0x2c, 0x36, 0x32, 0x7d, 0x5b, + 0x61, 0x2d, 0x7a, 0x30, 0x2d, 0x39, 0x5d, 0x24, 0x52, 0x0b, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, + 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x5a, 0x0a, 0x13, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, + 0x6c, 0x5f, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x42, 0x2a, 0xfa, 0x42, 0x27, 0x72, 0x25, 0x28, 0x80, 0x08, 0x32, 0x20, 0x5e, 0x28, + 0x28, 0x5b, 0x61, 0x2d, 0x7a, 0x41, 0x2d, 0x5a, 0x30, 0x2d, 0x39, 0x2f, 0x5f, 0x7c, 0x5c, 0x2d, + 0x3d, 0x2b, 0x5d, 0x7b, 0x31, 0x2c, 0x7d, 0x29, 0x7c, 0x5c, 0x2a, 0x29, 0x3f, 0x24, 0x52, 0x11, + 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x53, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x49, + 0x64, 0x12, 0x52, 0x0a, 0x11, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x5f, 0x72, 0x65, + 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x63, + 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x46, 0x69, + 0x6c, 0x74, 0x65, 0x72, 0x2e, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x46, 0x69, 0x6c, + 0x74, 0x65, 0x72, 0x52, 0x10, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x52, 0x65, 0x6c, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0x58, 0x0a, 0x0e, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x12, 0x46, 0x0a, 0x08, 0x72, 0x65, 0x6c, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x2a, 0xfa, 0x42, 0x27, 0x72, 0x25, + 0x28, 0x40, 0x32, 0x21, 0x5e, 0x28, 0x5b, 0x61, 0x2d, 0x7a, 0x5d, 0x5b, 0x61, 0x2d, 0x7a, 0x30, + 0x2d, 0x39, 0x5f, 0x5d, 0x7b, 0x31, 0x2c, 0x36, 0x32, 0x7d, 0x5b, 0x61, 0x2d, 0x7a, 0x30, 0x2d, + 0x39, 0x5d, 0x29, 0x3f, 0x24, 0x52, 0x08, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2a, + 0x6a, 0x0a, 0x0f, 0x44, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x79, + 0x70, 0x65, 0x12, 0x1f, 0x0a, 0x1b, 0x44, 0x45, 0x50, 0x52, 0x45, 0x43, 0x41, 0x54, 0x45, 0x44, + 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, + 0x44, 0x10, 0x00, 0x12, 0x1b, 0x0a, 0x17, 0x44, 0x45, 0x50, 0x52, 0x45, 0x43, 0x41, 0x54, 0x45, + 0x44, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x57, 0x41, 0x52, 0x4e, 0x49, 0x4e, 0x47, 0x10, 0x01, + 0x12, 0x19, 0x0a, 0x15, 0x44, 0x45, 0x50, 0x52, 0x45, 0x43, 0x41, 0x54, 0x45, 0x44, 0x5f, 0x54, + 0x59, 0x50, 0x45, 0x5f, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x10, 0x02, 0x42, 0x8a, 0x01, 0x0a, 0x0b, + 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x42, 0x09, 0x43, 0x6f, 0x72, + 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x33, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, + 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x7a, 0x65, 0x64, 0x2f, 0x73, 0x70, 0x69, + 0x63, 0x65, 0x64, 0x62, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x63, + 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x31, 0x3b, 0x63, 0x6f, 0x72, 0x65, 0x76, 0x31, 0xa2, 0x02, 0x03, + 0x43, 0x58, 0x58, 0xaa, 0x02, 0x07, 0x43, 0x6f, 0x72, 0x65, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x07, + 0x43, 0x6f, 0x72, 0x65, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x13, 0x43, 0x6f, 0x72, 0x65, 0x5c, 0x56, + 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x08, + 0x43, 0x6f, 0x72, 0x65, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -3685,141 +3882,148 @@ func file_core_v1_core_proto_rawDescGZIP() []byte { return file_core_v1_core_proto_rawDescData } -var file_core_v1_core_proto_enumTypes = make([]protoimpl.EnumInfo, 7) -var file_core_v1_core_proto_msgTypes = make([]protoimpl.MessageInfo, 43) +var file_core_v1_core_proto_enumTypes = make([]protoimpl.EnumInfo, 8) +var file_core_v1_core_proto_msgTypes = make([]protoimpl.MessageInfo, 44) var file_core_v1_core_proto_goTypes = []any{ - (RelationTupleUpdate_Operation)(0), // 0: core.v1.RelationTupleUpdate.Operation - (SetOperationUserset_Operation)(0), // 1: core.v1.SetOperationUserset.Operation - (ReachabilityEntrypoint_ReachabilityEntrypointKind)(0), // 2: core.v1.ReachabilityEntrypoint.ReachabilityEntrypointKind - (ReachabilityEntrypoint_EntrypointResultStatus)(0), // 3: core.v1.ReachabilityEntrypoint.EntrypointResultStatus - (FunctionedTupleToUserset_Function)(0), // 4: core.v1.FunctionedTupleToUserset.Function - (ComputedUserset_Object)(0), // 5: core.v1.ComputedUserset.Object - (CaveatOperation_Operation)(0), // 6: core.v1.CaveatOperation.Operation - (*RelationTuple)(nil), // 7: core.v1.RelationTuple - (*RelationshipIntegrity)(nil), // 8: core.v1.RelationshipIntegrity - (*ContextualizedCaveat)(nil), // 9: core.v1.ContextualizedCaveat - (*CaveatDefinition)(nil), // 10: core.v1.CaveatDefinition - (*CaveatTypeReference)(nil), // 11: core.v1.CaveatTypeReference - (*ObjectAndRelation)(nil), // 12: core.v1.ObjectAndRelation - (*RelationReference)(nil), // 13: core.v1.RelationReference - (*Zookie)(nil), // 14: core.v1.Zookie - (*RelationTupleUpdate)(nil), // 15: core.v1.RelationTupleUpdate - (*RelationTupleTreeNode)(nil), // 16: core.v1.RelationTupleTreeNode - (*SetOperationUserset)(nil), // 17: core.v1.SetOperationUserset - (*DirectSubject)(nil), // 18: core.v1.DirectSubject - (*DirectSubjects)(nil), // 19: core.v1.DirectSubjects - (*Metadata)(nil), // 20: core.v1.Metadata - (*NamespaceDefinition)(nil), // 21: core.v1.NamespaceDefinition - (*Relation)(nil), // 22: core.v1.Relation - (*ReachabilityGraph)(nil), // 23: core.v1.ReachabilityGraph - (*ReachabilityEntrypoints)(nil), // 24: core.v1.ReachabilityEntrypoints - (*ReachabilityEntrypoint)(nil), // 25: core.v1.ReachabilityEntrypoint - (*TypeInformation)(nil), // 26: core.v1.TypeInformation - (*AllowedRelation)(nil), // 27: core.v1.AllowedRelation - (*ExpirationTrait)(nil), // 28: core.v1.ExpirationTrait - (*AllowedCaveat)(nil), // 29: core.v1.AllowedCaveat - (*UsersetRewrite)(nil), // 30: core.v1.UsersetRewrite - (*SetOperation)(nil), // 31: core.v1.SetOperation - (*TupleToUserset)(nil), // 32: core.v1.TupleToUserset - (*FunctionedTupleToUserset)(nil), // 33: core.v1.FunctionedTupleToUserset - (*ComputedUserset)(nil), // 34: core.v1.ComputedUserset - (*SourcePosition)(nil), // 35: core.v1.SourcePosition - (*CaveatExpression)(nil), // 36: core.v1.CaveatExpression - (*CaveatOperation)(nil), // 37: core.v1.CaveatOperation - (*RelationshipFilter)(nil), // 38: core.v1.RelationshipFilter - (*SubjectFilter)(nil), // 39: core.v1.SubjectFilter - nil, // 40: core.v1.CaveatDefinition.ParameterTypesEntry - nil, // 41: core.v1.ReachabilityGraph.EntrypointsBySubjectTypeEntry - nil, // 42: core.v1.ReachabilityGraph.EntrypointsBySubjectRelationEntry - (*AllowedRelation_PublicWildcard)(nil), // 43: core.v1.AllowedRelation.PublicWildcard - (*SetOperation_Child)(nil), // 44: core.v1.SetOperation.Child - (*SetOperation_Child_This)(nil), // 45: core.v1.SetOperation.Child.This - (*SetOperation_Child_Nil)(nil), // 46: core.v1.SetOperation.Child.Nil - (*TupleToUserset_Tupleset)(nil), // 47: core.v1.TupleToUserset.Tupleset - (*FunctionedTupleToUserset_Tupleset)(nil), // 48: core.v1.FunctionedTupleToUserset.Tupleset - (*SubjectFilter_RelationFilter)(nil), // 49: core.v1.SubjectFilter.RelationFilter - (*timestamppb.Timestamp)(nil), // 50: google.protobuf.Timestamp - (*structpb.Struct)(nil), // 51: google.protobuf.Struct - (*anypb.Any)(nil), // 52: google.protobuf.Any + (DeprecationType)(0), // 0: core.v1.DeprecationType + (RelationTupleUpdate_Operation)(0), // 1: core.v1.RelationTupleUpdate.Operation + (SetOperationUserset_Operation)(0), // 2: core.v1.SetOperationUserset.Operation + (ReachabilityEntrypoint_ReachabilityEntrypointKind)(0), // 3: core.v1.ReachabilityEntrypoint.ReachabilityEntrypointKind + (ReachabilityEntrypoint_EntrypointResultStatus)(0), // 4: core.v1.ReachabilityEntrypoint.EntrypointResultStatus + (FunctionedTupleToUserset_Function)(0), // 5: core.v1.FunctionedTupleToUserset.Function + (ComputedUserset_Object)(0), // 6: core.v1.ComputedUserset.Object + (CaveatOperation_Operation)(0), // 7: core.v1.CaveatOperation.Operation + (*RelationTuple)(nil), // 8: core.v1.RelationTuple + (*RelationshipIntegrity)(nil), // 9: core.v1.RelationshipIntegrity + (*ContextualizedCaveat)(nil), // 10: core.v1.ContextualizedCaveat + (*CaveatDefinition)(nil), // 11: core.v1.CaveatDefinition + (*CaveatTypeReference)(nil), // 12: core.v1.CaveatTypeReference + (*ObjectAndRelation)(nil), // 13: core.v1.ObjectAndRelation + (*RelationReference)(nil), // 14: core.v1.RelationReference + (*Zookie)(nil), // 15: core.v1.Zookie + (*RelationTupleUpdate)(nil), // 16: core.v1.RelationTupleUpdate + (*RelationTupleTreeNode)(nil), // 17: core.v1.RelationTupleTreeNode + (*SetOperationUserset)(nil), // 18: core.v1.SetOperationUserset + (*DirectSubject)(nil), // 19: core.v1.DirectSubject + (*DirectSubjects)(nil), // 20: core.v1.DirectSubjects + (*Metadata)(nil), // 21: core.v1.Metadata + (*NamespaceDefinition)(nil), // 22: core.v1.NamespaceDefinition + (*Deprecation)(nil), // 23: core.v1.Deprecation + (*Relation)(nil), // 24: core.v1.Relation + (*ReachabilityGraph)(nil), // 25: core.v1.ReachabilityGraph + (*ReachabilityEntrypoints)(nil), // 26: core.v1.ReachabilityEntrypoints + (*ReachabilityEntrypoint)(nil), // 27: core.v1.ReachabilityEntrypoint + (*TypeInformation)(nil), // 28: core.v1.TypeInformation + (*AllowedRelation)(nil), // 29: core.v1.AllowedRelation + (*ExpirationTrait)(nil), // 30: core.v1.ExpirationTrait + (*AllowedCaveat)(nil), // 31: core.v1.AllowedCaveat + (*UsersetRewrite)(nil), // 32: core.v1.UsersetRewrite + (*SetOperation)(nil), // 33: core.v1.SetOperation + (*TupleToUserset)(nil), // 34: core.v1.TupleToUserset + (*FunctionedTupleToUserset)(nil), // 35: core.v1.FunctionedTupleToUserset + (*ComputedUserset)(nil), // 36: core.v1.ComputedUserset + (*SourcePosition)(nil), // 37: core.v1.SourcePosition + (*CaveatExpression)(nil), // 38: core.v1.CaveatExpression + (*CaveatOperation)(nil), // 39: core.v1.CaveatOperation + (*RelationshipFilter)(nil), // 40: core.v1.RelationshipFilter + (*SubjectFilter)(nil), // 41: core.v1.SubjectFilter + nil, // 42: core.v1.CaveatDefinition.ParameterTypesEntry + nil, // 43: core.v1.ReachabilityGraph.EntrypointsBySubjectTypeEntry + nil, // 44: core.v1.ReachabilityGraph.EntrypointsBySubjectRelationEntry + (*AllowedRelation_PublicWildcard)(nil), // 45: core.v1.AllowedRelation.PublicWildcard + (*SetOperation_Child)(nil), // 46: core.v1.SetOperation.Child + (*SetOperation_Child_This)(nil), // 47: core.v1.SetOperation.Child.This + (*SetOperation_Child_Nil)(nil), // 48: core.v1.SetOperation.Child.Nil + (*TupleToUserset_Tupleset)(nil), // 49: core.v1.TupleToUserset.Tupleset + (*FunctionedTupleToUserset_Tupleset)(nil), // 50: core.v1.FunctionedTupleToUserset.Tupleset + (*SubjectFilter_RelationFilter)(nil), // 51: core.v1.SubjectFilter.RelationFilter + (*timestamppb.Timestamp)(nil), // 52: google.protobuf.Timestamp + (*structpb.Struct)(nil), // 53: google.protobuf.Struct + (*anypb.Any)(nil), // 54: google.protobuf.Any } var file_core_v1_core_proto_depIdxs = []int32{ - 12, // 0: core.v1.RelationTuple.resource_and_relation:type_name -> core.v1.ObjectAndRelation - 12, // 1: core.v1.RelationTuple.subject:type_name -> core.v1.ObjectAndRelation - 9, // 2: core.v1.RelationTuple.caveat:type_name -> core.v1.ContextualizedCaveat - 8, // 3: core.v1.RelationTuple.integrity:type_name -> core.v1.RelationshipIntegrity - 50, // 4: core.v1.RelationTuple.optional_expiration_time:type_name -> google.protobuf.Timestamp - 50, // 5: core.v1.RelationshipIntegrity.hashed_at:type_name -> google.protobuf.Timestamp - 51, // 6: core.v1.ContextualizedCaveat.context:type_name -> google.protobuf.Struct - 40, // 7: core.v1.CaveatDefinition.parameter_types:type_name -> core.v1.CaveatDefinition.ParameterTypesEntry - 20, // 8: core.v1.CaveatDefinition.metadata:type_name -> core.v1.Metadata - 35, // 9: core.v1.CaveatDefinition.source_position:type_name -> core.v1.SourcePosition - 11, // 10: core.v1.CaveatTypeReference.child_types:type_name -> core.v1.CaveatTypeReference - 0, // 11: core.v1.RelationTupleUpdate.operation:type_name -> core.v1.RelationTupleUpdate.Operation - 7, // 12: core.v1.RelationTupleUpdate.tuple:type_name -> core.v1.RelationTuple - 17, // 13: core.v1.RelationTupleTreeNode.intermediate_node:type_name -> core.v1.SetOperationUserset - 19, // 14: core.v1.RelationTupleTreeNode.leaf_node:type_name -> core.v1.DirectSubjects - 12, // 15: core.v1.RelationTupleTreeNode.expanded:type_name -> core.v1.ObjectAndRelation - 36, // 16: core.v1.RelationTupleTreeNode.caveat_expression:type_name -> core.v1.CaveatExpression - 1, // 17: core.v1.SetOperationUserset.operation:type_name -> core.v1.SetOperationUserset.Operation - 16, // 18: core.v1.SetOperationUserset.child_nodes:type_name -> core.v1.RelationTupleTreeNode - 12, // 19: core.v1.DirectSubject.subject:type_name -> core.v1.ObjectAndRelation - 36, // 20: core.v1.DirectSubject.caveat_expression:type_name -> core.v1.CaveatExpression - 18, // 21: core.v1.DirectSubjects.subjects:type_name -> core.v1.DirectSubject - 52, // 22: core.v1.Metadata.metadata_message:type_name -> google.protobuf.Any - 22, // 23: core.v1.NamespaceDefinition.relation:type_name -> core.v1.Relation - 20, // 24: core.v1.NamespaceDefinition.metadata:type_name -> core.v1.Metadata - 35, // 25: core.v1.NamespaceDefinition.source_position:type_name -> core.v1.SourcePosition - 30, // 26: core.v1.Relation.userset_rewrite:type_name -> core.v1.UsersetRewrite - 26, // 27: core.v1.Relation.type_information:type_name -> core.v1.TypeInformation - 20, // 28: core.v1.Relation.metadata:type_name -> core.v1.Metadata - 35, // 29: core.v1.Relation.source_position:type_name -> core.v1.SourcePosition - 41, // 30: core.v1.ReachabilityGraph.entrypoints_by_subject_type:type_name -> core.v1.ReachabilityGraph.EntrypointsBySubjectTypeEntry - 42, // 31: core.v1.ReachabilityGraph.entrypoints_by_subject_relation:type_name -> core.v1.ReachabilityGraph.EntrypointsBySubjectRelationEntry - 25, // 32: core.v1.ReachabilityEntrypoints.entrypoints:type_name -> core.v1.ReachabilityEntrypoint - 13, // 33: core.v1.ReachabilityEntrypoints.subject_relation:type_name -> core.v1.RelationReference - 2, // 34: core.v1.ReachabilityEntrypoint.kind:type_name -> core.v1.ReachabilityEntrypoint.ReachabilityEntrypointKind - 13, // 35: core.v1.ReachabilityEntrypoint.target_relation:type_name -> core.v1.RelationReference - 3, // 36: core.v1.ReachabilityEntrypoint.result_status:type_name -> core.v1.ReachabilityEntrypoint.EntrypointResultStatus - 27, // 37: core.v1.TypeInformation.allowed_direct_relations:type_name -> core.v1.AllowedRelation - 43, // 38: core.v1.AllowedRelation.public_wildcard:type_name -> core.v1.AllowedRelation.PublicWildcard - 35, // 39: core.v1.AllowedRelation.source_position:type_name -> core.v1.SourcePosition - 29, // 40: core.v1.AllowedRelation.required_caveat:type_name -> core.v1.AllowedCaveat - 28, // 41: core.v1.AllowedRelation.required_expiration:type_name -> core.v1.ExpirationTrait - 31, // 42: core.v1.UsersetRewrite.union:type_name -> core.v1.SetOperation - 31, // 43: core.v1.UsersetRewrite.intersection:type_name -> core.v1.SetOperation - 31, // 44: core.v1.UsersetRewrite.exclusion:type_name -> core.v1.SetOperation - 35, // 45: core.v1.UsersetRewrite.source_position:type_name -> core.v1.SourcePosition - 44, // 46: core.v1.SetOperation.child:type_name -> core.v1.SetOperation.Child - 47, // 47: core.v1.TupleToUserset.tupleset:type_name -> core.v1.TupleToUserset.Tupleset - 34, // 48: core.v1.TupleToUserset.computed_userset:type_name -> core.v1.ComputedUserset - 35, // 49: core.v1.TupleToUserset.source_position:type_name -> core.v1.SourcePosition - 4, // 50: core.v1.FunctionedTupleToUserset.function:type_name -> core.v1.FunctionedTupleToUserset.Function - 48, // 51: core.v1.FunctionedTupleToUserset.tupleset:type_name -> core.v1.FunctionedTupleToUserset.Tupleset - 34, // 52: core.v1.FunctionedTupleToUserset.computed_userset:type_name -> core.v1.ComputedUserset - 35, // 53: core.v1.FunctionedTupleToUserset.source_position:type_name -> core.v1.SourcePosition - 5, // 54: core.v1.ComputedUserset.object:type_name -> core.v1.ComputedUserset.Object - 35, // 55: core.v1.ComputedUserset.source_position:type_name -> core.v1.SourcePosition - 37, // 56: core.v1.CaveatExpression.operation:type_name -> core.v1.CaveatOperation - 9, // 57: core.v1.CaveatExpression.caveat:type_name -> core.v1.ContextualizedCaveat - 6, // 58: core.v1.CaveatOperation.op:type_name -> core.v1.CaveatOperation.Operation - 36, // 59: core.v1.CaveatOperation.children:type_name -> core.v1.CaveatExpression - 39, // 60: core.v1.RelationshipFilter.optional_subject_filter:type_name -> core.v1.SubjectFilter - 49, // 61: core.v1.SubjectFilter.optional_relation:type_name -> core.v1.SubjectFilter.RelationFilter - 11, // 62: core.v1.CaveatDefinition.ParameterTypesEntry.value:type_name -> core.v1.CaveatTypeReference - 24, // 63: core.v1.ReachabilityGraph.EntrypointsBySubjectTypeEntry.value:type_name -> core.v1.ReachabilityEntrypoints - 24, // 64: core.v1.ReachabilityGraph.EntrypointsBySubjectRelationEntry.value:type_name -> core.v1.ReachabilityEntrypoints - 45, // 65: core.v1.SetOperation.Child._this:type_name -> core.v1.SetOperation.Child.This - 34, // 66: core.v1.SetOperation.Child.computed_userset:type_name -> core.v1.ComputedUserset - 32, // 67: core.v1.SetOperation.Child.tuple_to_userset:type_name -> core.v1.TupleToUserset - 30, // 68: core.v1.SetOperation.Child.userset_rewrite:type_name -> core.v1.UsersetRewrite - 33, // 69: core.v1.SetOperation.Child.functioned_tuple_to_userset:type_name -> core.v1.FunctionedTupleToUserset - 46, // 70: core.v1.SetOperation.Child._nil:type_name -> core.v1.SetOperation.Child.Nil - 35, // 71: core.v1.SetOperation.Child.source_position:type_name -> core.v1.SourcePosition - 72, // [72:72] is the sub-list for method output_type - 72, // [72:72] is the sub-list for method input_type - 72, // [72:72] is the sub-list for extension type_name - 72, // [72:72] is the sub-list for extension extendee - 0, // [0:72] is the sub-list for field type_name + 13, // 0: core.v1.RelationTuple.resource_and_relation:type_name -> core.v1.ObjectAndRelation + 13, // 1: core.v1.RelationTuple.subject:type_name -> core.v1.ObjectAndRelation + 10, // 2: core.v1.RelationTuple.caveat:type_name -> core.v1.ContextualizedCaveat + 9, // 3: core.v1.RelationTuple.integrity:type_name -> core.v1.RelationshipIntegrity + 52, // 4: core.v1.RelationTuple.optional_expiration_time:type_name -> google.protobuf.Timestamp + 52, // 5: core.v1.RelationshipIntegrity.hashed_at:type_name -> google.protobuf.Timestamp + 53, // 6: core.v1.ContextualizedCaveat.context:type_name -> google.protobuf.Struct + 42, // 7: core.v1.CaveatDefinition.parameter_types:type_name -> core.v1.CaveatDefinition.ParameterTypesEntry + 21, // 8: core.v1.CaveatDefinition.metadata:type_name -> core.v1.Metadata + 37, // 9: core.v1.CaveatDefinition.source_position:type_name -> core.v1.SourcePosition + 12, // 10: core.v1.CaveatTypeReference.child_types:type_name -> core.v1.CaveatTypeReference + 1, // 11: core.v1.RelationTupleUpdate.operation:type_name -> core.v1.RelationTupleUpdate.Operation + 8, // 12: core.v1.RelationTupleUpdate.tuple:type_name -> core.v1.RelationTuple + 18, // 13: core.v1.RelationTupleTreeNode.intermediate_node:type_name -> core.v1.SetOperationUserset + 20, // 14: core.v1.RelationTupleTreeNode.leaf_node:type_name -> core.v1.DirectSubjects + 13, // 15: core.v1.RelationTupleTreeNode.expanded:type_name -> core.v1.ObjectAndRelation + 38, // 16: core.v1.RelationTupleTreeNode.caveat_expression:type_name -> core.v1.CaveatExpression + 2, // 17: core.v1.SetOperationUserset.operation:type_name -> core.v1.SetOperationUserset.Operation + 17, // 18: core.v1.SetOperationUserset.child_nodes:type_name -> core.v1.RelationTupleTreeNode + 13, // 19: core.v1.DirectSubject.subject:type_name -> core.v1.ObjectAndRelation + 38, // 20: core.v1.DirectSubject.caveat_expression:type_name -> core.v1.CaveatExpression + 19, // 21: core.v1.DirectSubjects.subjects:type_name -> core.v1.DirectSubject + 54, // 22: core.v1.Metadata.metadata_message:type_name -> google.protobuf.Any + 24, // 23: core.v1.NamespaceDefinition.relation:type_name -> core.v1.Relation + 21, // 24: core.v1.NamespaceDefinition.metadata:type_name -> core.v1.Metadata + 37, // 25: core.v1.NamespaceDefinition.source_position:type_name -> core.v1.SourcePosition + 23, // 26: core.v1.NamespaceDefinition.deprecation:type_name -> core.v1.Deprecation + 0, // 27: core.v1.Deprecation.deprecation_type:type_name -> core.v1.DeprecationType + 37, // 28: core.v1.Deprecation.source_position:type_name -> core.v1.SourcePosition + 32, // 29: core.v1.Relation.userset_rewrite:type_name -> core.v1.UsersetRewrite + 28, // 30: core.v1.Relation.type_information:type_name -> core.v1.TypeInformation + 21, // 31: core.v1.Relation.metadata:type_name -> core.v1.Metadata + 37, // 32: core.v1.Relation.source_position:type_name -> core.v1.SourcePosition + 23, // 33: core.v1.Relation.deprecation:type_name -> core.v1.Deprecation + 43, // 34: core.v1.ReachabilityGraph.entrypoints_by_subject_type:type_name -> core.v1.ReachabilityGraph.EntrypointsBySubjectTypeEntry + 44, // 35: core.v1.ReachabilityGraph.entrypoints_by_subject_relation:type_name -> core.v1.ReachabilityGraph.EntrypointsBySubjectRelationEntry + 27, // 36: core.v1.ReachabilityEntrypoints.entrypoints:type_name -> core.v1.ReachabilityEntrypoint + 14, // 37: core.v1.ReachabilityEntrypoints.subject_relation:type_name -> core.v1.RelationReference + 3, // 38: core.v1.ReachabilityEntrypoint.kind:type_name -> core.v1.ReachabilityEntrypoint.ReachabilityEntrypointKind + 14, // 39: core.v1.ReachabilityEntrypoint.target_relation:type_name -> core.v1.RelationReference + 4, // 40: core.v1.ReachabilityEntrypoint.result_status:type_name -> core.v1.ReachabilityEntrypoint.EntrypointResultStatus + 29, // 41: core.v1.TypeInformation.allowed_direct_relations:type_name -> core.v1.AllowedRelation + 45, // 42: core.v1.AllowedRelation.public_wildcard:type_name -> core.v1.AllowedRelation.PublicWildcard + 37, // 43: core.v1.AllowedRelation.source_position:type_name -> core.v1.SourcePosition + 31, // 44: core.v1.AllowedRelation.required_caveat:type_name -> core.v1.AllowedCaveat + 30, // 45: core.v1.AllowedRelation.required_expiration:type_name -> core.v1.ExpirationTrait + 23, // 46: core.v1.AllowedRelation.deprecation:type_name -> core.v1.Deprecation + 33, // 47: core.v1.UsersetRewrite.union:type_name -> core.v1.SetOperation + 33, // 48: core.v1.UsersetRewrite.intersection:type_name -> core.v1.SetOperation + 33, // 49: core.v1.UsersetRewrite.exclusion:type_name -> core.v1.SetOperation + 37, // 50: core.v1.UsersetRewrite.source_position:type_name -> core.v1.SourcePosition + 46, // 51: core.v1.SetOperation.child:type_name -> core.v1.SetOperation.Child + 49, // 52: core.v1.TupleToUserset.tupleset:type_name -> core.v1.TupleToUserset.Tupleset + 36, // 53: core.v1.TupleToUserset.computed_userset:type_name -> core.v1.ComputedUserset + 37, // 54: core.v1.TupleToUserset.source_position:type_name -> core.v1.SourcePosition + 5, // 55: core.v1.FunctionedTupleToUserset.function:type_name -> core.v1.FunctionedTupleToUserset.Function + 50, // 56: core.v1.FunctionedTupleToUserset.tupleset:type_name -> core.v1.FunctionedTupleToUserset.Tupleset + 36, // 57: core.v1.FunctionedTupleToUserset.computed_userset:type_name -> core.v1.ComputedUserset + 37, // 58: core.v1.FunctionedTupleToUserset.source_position:type_name -> core.v1.SourcePosition + 6, // 59: core.v1.ComputedUserset.object:type_name -> core.v1.ComputedUserset.Object + 37, // 60: core.v1.ComputedUserset.source_position:type_name -> core.v1.SourcePosition + 39, // 61: core.v1.CaveatExpression.operation:type_name -> core.v1.CaveatOperation + 10, // 62: core.v1.CaveatExpression.caveat:type_name -> core.v1.ContextualizedCaveat + 7, // 63: core.v1.CaveatOperation.op:type_name -> core.v1.CaveatOperation.Operation + 38, // 64: core.v1.CaveatOperation.children:type_name -> core.v1.CaveatExpression + 41, // 65: core.v1.RelationshipFilter.optional_subject_filter:type_name -> core.v1.SubjectFilter + 51, // 66: core.v1.SubjectFilter.optional_relation:type_name -> core.v1.SubjectFilter.RelationFilter + 12, // 67: core.v1.CaveatDefinition.ParameterTypesEntry.value:type_name -> core.v1.CaveatTypeReference + 26, // 68: core.v1.ReachabilityGraph.EntrypointsBySubjectTypeEntry.value:type_name -> core.v1.ReachabilityEntrypoints + 26, // 69: core.v1.ReachabilityGraph.EntrypointsBySubjectRelationEntry.value:type_name -> core.v1.ReachabilityEntrypoints + 47, // 70: core.v1.SetOperation.Child._this:type_name -> core.v1.SetOperation.Child.This + 36, // 71: core.v1.SetOperation.Child.computed_userset:type_name -> core.v1.ComputedUserset + 34, // 72: core.v1.SetOperation.Child.tuple_to_userset:type_name -> core.v1.TupleToUserset + 32, // 73: core.v1.SetOperation.Child.userset_rewrite:type_name -> core.v1.UsersetRewrite + 35, // 74: core.v1.SetOperation.Child.functioned_tuple_to_userset:type_name -> core.v1.FunctionedTupleToUserset + 48, // 75: core.v1.SetOperation.Child._nil:type_name -> core.v1.SetOperation.Child.Nil + 37, // 76: core.v1.SetOperation.Child.source_position:type_name -> core.v1.SourcePosition + 77, // [77:77] is the sub-list for method output_type + 77, // [77:77] is the sub-list for method input_type + 77, // [77:77] is the sub-list for extension type_name + 77, // [77:77] is the sub-list for extension extendee + 0, // [0:77] is the sub-list for field type_name } func init() { file_core_v1_core_proto_init() } @@ -4009,7 +4213,7 @@ func file_core_v1_core_proto_init() { } } file_core_v1_core_proto_msgTypes[15].Exporter = func(v any, i int) any { - switch v := v.(*Relation); i { + switch v := v.(*Deprecation); i { case 0: return &v.state case 1: @@ -4021,7 +4225,7 @@ func file_core_v1_core_proto_init() { } } file_core_v1_core_proto_msgTypes[16].Exporter = func(v any, i int) any { - switch v := v.(*ReachabilityGraph); i { + switch v := v.(*Relation); i { case 0: return &v.state case 1: @@ -4033,7 +4237,7 @@ func file_core_v1_core_proto_init() { } } file_core_v1_core_proto_msgTypes[17].Exporter = func(v any, i int) any { - switch v := v.(*ReachabilityEntrypoints); i { + switch v := v.(*ReachabilityGraph); i { case 0: return &v.state case 1: @@ -4045,7 +4249,7 @@ func file_core_v1_core_proto_init() { } } file_core_v1_core_proto_msgTypes[18].Exporter = func(v any, i int) any { - switch v := v.(*ReachabilityEntrypoint); i { + switch v := v.(*ReachabilityEntrypoints); i { case 0: return &v.state case 1: @@ -4057,7 +4261,7 @@ func file_core_v1_core_proto_init() { } } file_core_v1_core_proto_msgTypes[19].Exporter = func(v any, i int) any { - switch v := v.(*TypeInformation); i { + switch v := v.(*ReachabilityEntrypoint); i { case 0: return &v.state case 1: @@ -4069,7 +4273,7 @@ func file_core_v1_core_proto_init() { } } file_core_v1_core_proto_msgTypes[20].Exporter = func(v any, i int) any { - switch v := v.(*AllowedRelation); i { + switch v := v.(*TypeInformation); i { case 0: return &v.state case 1: @@ -4081,7 +4285,7 @@ func file_core_v1_core_proto_init() { } } file_core_v1_core_proto_msgTypes[21].Exporter = func(v any, i int) any { - switch v := v.(*ExpirationTrait); i { + switch v := v.(*AllowedRelation); i { case 0: return &v.state case 1: @@ -4093,7 +4297,7 @@ func file_core_v1_core_proto_init() { } } file_core_v1_core_proto_msgTypes[22].Exporter = func(v any, i int) any { - switch v := v.(*AllowedCaveat); i { + switch v := v.(*ExpirationTrait); i { case 0: return &v.state case 1: @@ -4105,7 +4309,7 @@ func file_core_v1_core_proto_init() { } } file_core_v1_core_proto_msgTypes[23].Exporter = func(v any, i int) any { - switch v := v.(*UsersetRewrite); i { + switch v := v.(*AllowedCaveat); i { case 0: return &v.state case 1: @@ -4117,7 +4321,7 @@ func file_core_v1_core_proto_init() { } } file_core_v1_core_proto_msgTypes[24].Exporter = func(v any, i int) any { - switch v := v.(*SetOperation); i { + switch v := v.(*UsersetRewrite); i { case 0: return &v.state case 1: @@ -4129,7 +4333,7 @@ func file_core_v1_core_proto_init() { } } file_core_v1_core_proto_msgTypes[25].Exporter = func(v any, i int) any { - switch v := v.(*TupleToUserset); i { + switch v := v.(*SetOperation); i { case 0: return &v.state case 1: @@ -4141,7 +4345,7 @@ func file_core_v1_core_proto_init() { } } file_core_v1_core_proto_msgTypes[26].Exporter = func(v any, i int) any { - switch v := v.(*FunctionedTupleToUserset); i { + switch v := v.(*TupleToUserset); i { case 0: return &v.state case 1: @@ -4153,7 +4357,7 @@ func file_core_v1_core_proto_init() { } } file_core_v1_core_proto_msgTypes[27].Exporter = func(v any, i int) any { - switch v := v.(*ComputedUserset); i { + switch v := v.(*FunctionedTupleToUserset); i { case 0: return &v.state case 1: @@ -4165,7 +4369,7 @@ func file_core_v1_core_proto_init() { } } file_core_v1_core_proto_msgTypes[28].Exporter = func(v any, i int) any { - switch v := v.(*SourcePosition); i { + switch v := v.(*ComputedUserset); i { case 0: return &v.state case 1: @@ -4177,7 +4381,7 @@ func file_core_v1_core_proto_init() { } } file_core_v1_core_proto_msgTypes[29].Exporter = func(v any, i int) any { - switch v := v.(*CaveatExpression); i { + switch v := v.(*SourcePosition); i { case 0: return &v.state case 1: @@ -4189,7 +4393,7 @@ func file_core_v1_core_proto_init() { } } file_core_v1_core_proto_msgTypes[30].Exporter = func(v any, i int) any { - switch v := v.(*CaveatOperation); i { + switch v := v.(*CaveatExpression); i { case 0: return &v.state case 1: @@ -4201,7 +4405,7 @@ func file_core_v1_core_proto_init() { } } file_core_v1_core_proto_msgTypes[31].Exporter = func(v any, i int) any { - switch v := v.(*RelationshipFilter); i { + switch v := v.(*CaveatOperation); i { case 0: return &v.state case 1: @@ -4213,6 +4417,18 @@ func file_core_v1_core_proto_init() { } } file_core_v1_core_proto_msgTypes[32].Exporter = func(v any, i int) any { + switch v := v.(*RelationshipFilter); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_core_v1_core_proto_msgTypes[33].Exporter = func(v any, i int) any { switch v := v.(*SubjectFilter); i { case 0: return &v.state @@ -4224,7 +4440,7 @@ func file_core_v1_core_proto_init() { return nil } } - file_core_v1_core_proto_msgTypes[36].Exporter = func(v any, i int) any { + file_core_v1_core_proto_msgTypes[37].Exporter = func(v any, i int) any { switch v := v.(*AllowedRelation_PublicWildcard); i { case 0: return &v.state @@ -4236,7 +4452,7 @@ func file_core_v1_core_proto_init() { return nil } } - file_core_v1_core_proto_msgTypes[37].Exporter = func(v any, i int) any { + file_core_v1_core_proto_msgTypes[38].Exporter = func(v any, i int) any { switch v := v.(*SetOperation_Child); i { case 0: return &v.state @@ -4248,7 +4464,7 @@ func file_core_v1_core_proto_init() { return nil } } - file_core_v1_core_proto_msgTypes[38].Exporter = func(v any, i int) any { + file_core_v1_core_proto_msgTypes[39].Exporter = func(v any, i int) any { switch v := v.(*SetOperation_Child_This); i { case 0: return &v.state @@ -4260,7 +4476,7 @@ func file_core_v1_core_proto_init() { return nil } } - file_core_v1_core_proto_msgTypes[39].Exporter = func(v any, i int) any { + file_core_v1_core_proto_msgTypes[40].Exporter = func(v any, i int) any { switch v := v.(*SetOperation_Child_Nil); i { case 0: return &v.state @@ -4272,7 +4488,7 @@ func file_core_v1_core_proto_init() { return nil } } - file_core_v1_core_proto_msgTypes[40].Exporter = func(v any, i int) any { + file_core_v1_core_proto_msgTypes[41].Exporter = func(v any, i int) any { switch v := v.(*TupleToUserset_Tupleset); i { case 0: return &v.state @@ -4284,7 +4500,7 @@ func file_core_v1_core_proto_init() { return nil } } - file_core_v1_core_proto_msgTypes[41].Exporter = func(v any, i int) any { + file_core_v1_core_proto_msgTypes[42].Exporter = func(v any, i int) any { switch v := v.(*FunctionedTupleToUserset_Tupleset); i { case 0: return &v.state @@ -4296,7 +4512,7 @@ func file_core_v1_core_proto_init() { return nil } } - file_core_v1_core_proto_msgTypes[42].Exporter = func(v any, i int) any { + file_core_v1_core_proto_msgTypes[43].Exporter = func(v any, i int) any { switch v := v.(*SubjectFilter_RelationFilter); i { case 0: return &v.state @@ -4313,20 +4529,20 @@ func file_core_v1_core_proto_init() { (*RelationTupleTreeNode_IntermediateNode)(nil), (*RelationTupleTreeNode_LeafNode)(nil), } - file_core_v1_core_proto_msgTypes[20].OneofWrappers = []any{ + file_core_v1_core_proto_msgTypes[21].OneofWrappers = []any{ (*AllowedRelation_Relation)(nil), (*AllowedRelation_PublicWildcard_)(nil), } - file_core_v1_core_proto_msgTypes[23].OneofWrappers = []any{ + file_core_v1_core_proto_msgTypes[24].OneofWrappers = []any{ (*UsersetRewrite_Union)(nil), (*UsersetRewrite_Intersection)(nil), (*UsersetRewrite_Exclusion)(nil), } - file_core_v1_core_proto_msgTypes[29].OneofWrappers = []any{ + file_core_v1_core_proto_msgTypes[30].OneofWrappers = []any{ (*CaveatExpression_Operation)(nil), (*CaveatExpression_Caveat)(nil), } - file_core_v1_core_proto_msgTypes[37].OneofWrappers = []any{ + file_core_v1_core_proto_msgTypes[38].OneofWrappers = []any{ (*SetOperation_Child_XThis)(nil), (*SetOperation_Child_ComputedUserset)(nil), (*SetOperation_Child_TupleToUserset)(nil), @@ -4339,8 +4555,8 @@ func file_core_v1_core_proto_init() { File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_core_v1_core_proto_rawDesc, - NumEnums: 7, - NumMessages: 43, + NumEnums: 8, + NumMessages: 44, NumExtensions: 0, NumServices: 0, }, diff --git a/pkg/proto/core/v1/core.pb.validate.go b/pkg/proto/core/v1/core.pb.validate.go index f8a01af22e..bcc93ef290 100644 --- a/pkg/proto/core/v1/core.pb.validate.go +++ b/pkg/proto/core/v1/core.pb.validate.go @@ -2536,6 +2536,35 @@ func (m *NamespaceDefinition) validate(all bool) error { } } + if all { + switch v := interface{}(m.GetDeprecation()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, NamespaceDefinitionValidationError{ + field: "Deprecation", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, NamespaceDefinitionValidationError{ + field: "Deprecation", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetDeprecation()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return NamespaceDefinitionValidationError{ + field: "Deprecation", + reason: "embedded message failed validation", + cause: err, + } + } + } + if len(errors) > 0 { return NamespaceDefinitionMultiError(errors) } @@ -2618,6 +2647,160 @@ var _ interface { var _NamespaceDefinition_Name_Pattern = regexp.MustCompile("^([a-z][a-z0-9_]{1,62}[a-z0-9]/)*[a-z][a-z0-9_]{1,62}[a-z0-9]$") +// Validate checks the field values on Deprecation 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 *Deprecation) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on Deprecation 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 DeprecationMultiError, or +// nil if none found. +func (m *Deprecation) ValidateAll() error { + return m.validate(true) +} + +func (m *Deprecation) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if _, ok := DeprecationType_name[int32(m.GetDeprecationType())]; !ok { + err := DeprecationValidationError{ + field: "DeprecationType", + reason: "value must be one of the defined enum values", + } + if !all { + return err + } + errors = append(errors, err) + } + + // no validation rules for Object + + // no validation rules for Relation + + if len(m.GetComments()) > 256 { + err := DeprecationValidationError{ + field: "Comments", + reason: "value length must be at most 256 bytes", + } + if !all { + return err + } + errors = append(errors, err) + } + + if all { + switch v := interface{}(m.GetSourcePosition()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, DeprecationValidationError{ + field: "SourcePosition", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, DeprecationValidationError{ + field: "SourcePosition", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetSourcePosition()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return DeprecationValidationError{ + field: "SourcePosition", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if len(errors) > 0 { + return DeprecationMultiError(errors) + } + + return nil +} + +// DeprecationMultiError is an error wrapping multiple validation errors +// returned by Deprecation.ValidateAll() if the designated constraints aren't met. +type DeprecationMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m DeprecationMultiError) 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 DeprecationMultiError) AllErrors() []error { return m } + +// DeprecationValidationError is the validation error returned by +// Deprecation.Validate if the designated constraints aren't met. +type DeprecationValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e DeprecationValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e DeprecationValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e DeprecationValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e DeprecationValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e DeprecationValidationError) ErrorName() string { return "DeprecationValidationError" } + +// Error satisfies the builtin error interface +func (e DeprecationValidationError) 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 %sDeprecation.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = DeprecationValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = DeprecationValidationError{} + // Validate checks the field values on Relation 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. @@ -2782,6 +2965,35 @@ func (m *Relation) validate(all bool) error { // no validation rules for CanonicalCacheKey + if all { + switch v := interface{}(m.GetDeprecation()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, RelationValidationError{ + field: "Deprecation", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, RelationValidationError{ + field: "Deprecation", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetDeprecation()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return RelationValidationError{ + field: "Deprecation", + reason: "embedded message failed validation", + cause: err, + } + } + } + if len(errors) > 0 { return RelationMultiError(errors) } @@ -3626,6 +3838,35 @@ func (m *AllowedRelation) validate(all bool) error { } } + if all { + switch v := interface{}(m.GetDeprecation()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, AllowedRelationValidationError{ + field: "Deprecation", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, AllowedRelationValidationError{ + field: "Deprecation", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetDeprecation()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return AllowedRelationValidationError{ + field: "Deprecation", + reason: "embedded message failed validation", + cause: err, + } + } + } + switch v := m.RelationOrWildcard.(type) { case *AllowedRelation_Relation: if v == nil { diff --git a/pkg/proto/core/v1/core_vtproto.pb.go b/pkg/proto/core/v1/core_vtproto.pb.go index 160a1d9339..dbf9980ef1 100644 --- a/pkg/proto/core/v1/core_vtproto.pb.go +++ b/pkg/proto/core/v1/core_vtproto.pb.go @@ -351,6 +351,7 @@ func (m *NamespaceDefinition) CloneVT() *NamespaceDefinition { r.Name = m.Name r.Metadata = m.Metadata.CloneVT() r.SourcePosition = m.SourcePosition.CloneVT() + r.Deprecation = m.Deprecation.CloneVT() if rhs := m.Relation; rhs != nil { tmpContainer := make([]*Relation, len(rhs)) for k, v := range rhs { @@ -369,6 +370,27 @@ func (m *NamespaceDefinition) CloneMessageVT() proto.Message { return m.CloneVT() } +func (m *Deprecation) CloneVT() *Deprecation { + if m == nil { + return (*Deprecation)(nil) + } + r := new(Deprecation) + r.DeprecationType = m.DeprecationType + r.Object = m.Object + r.Relation = m.Relation + r.Comments = m.Comments + r.SourcePosition = m.SourcePosition.CloneVT() + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *Deprecation) CloneMessageVT() proto.Message { + return m.CloneVT() +} + func (m *Relation) CloneVT() *Relation { if m == nil { return (*Relation)(nil) @@ -381,6 +403,7 @@ func (m *Relation) CloneVT() *Relation { r.SourcePosition = m.SourcePosition.CloneVT() r.AliasingRelation = m.AliasingRelation r.CanonicalCacheKey = m.CanonicalCacheKey + r.Deprecation = m.Deprecation.CloneVT() if len(m.unknownFields) > 0 { r.unknownFields = make([]byte, len(m.unknownFields)) copy(r.unknownFields, m.unknownFields) @@ -516,6 +539,7 @@ func (m *AllowedRelation) CloneVT() *AllowedRelation { r.SourcePosition = m.SourcePosition.CloneVT() r.RequiredCaveat = m.RequiredCaveat.CloneVT() r.RequiredExpiration = m.RequiredExpiration.CloneVT() + r.Deprecation = m.Deprecation.CloneVT() if m.RelationOrWildcard != nil { r.RelationOrWildcard = m.RelationOrWildcard.(interface { CloneVT() isAllowedRelation_RelationOrWildcard @@ -1488,6 +1512,9 @@ func (this *NamespaceDefinition) EqualVT(that *NamespaceDefinition) bool { if !this.SourcePosition.EqualVT(that.SourcePosition) { return false } + if !this.Deprecation.EqualVT(that.Deprecation) { + return false + } return string(this.unknownFields) == string(that.unknownFields) } @@ -1498,6 +1525,37 @@ func (this *NamespaceDefinition) EqualMessageVT(thatMsg proto.Message) bool { } return this.EqualVT(that) } +func (this *Deprecation) EqualVT(that *Deprecation) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if this.DeprecationType != that.DeprecationType { + return false + } + if this.Object != that.Object { + return false + } + if this.Relation != that.Relation { + return false + } + if this.Comments != that.Comments { + return false + } + if !this.SourcePosition.EqualVT(that.SourcePosition) { + return false + } + return string(this.unknownFields) == string(that.unknownFields) +} + +func (this *Deprecation) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*Deprecation) + if !ok { + return false + } + return this.EqualVT(that) +} func (this *Relation) EqualVT(that *Relation) bool { if this == that { return true @@ -1525,6 +1583,9 @@ func (this *Relation) EqualVT(that *Relation) bool { if this.CanonicalCacheKey != that.CanonicalCacheKey { return false } + if !this.Deprecation.EqualVT(that.Deprecation) { + return false + } return string(this.unknownFields) == string(that.unknownFields) } @@ -1740,6 +1801,9 @@ func (this *AllowedRelation) EqualVT(that *AllowedRelation) bool { if !this.RequiredExpiration.EqualVT(that.RequiredExpiration) { return false } + if !this.Deprecation.EqualVT(that.Deprecation) { + return false + } return string(this.unknownFields) == string(that.unknownFields) } @@ -3366,6 +3430,16 @@ func (m *NamespaceDefinition) MarshalToSizedBufferVT(dAtA []byte) (int, error) { i -= len(m.unknownFields) copy(dAtA[i:], m.unknownFields) } + if m.Deprecation != nil { + size, err := m.Deprecation.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x2a + } if m.SourcePosition != nil { size, err := m.SourcePosition.MarshalToSizedBufferVT(dAtA[:i]) if err != nil { @@ -3408,6 +3482,75 @@ func (m *NamespaceDefinition) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *Deprecation) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Deprecation) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *Deprecation) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if m.SourcePosition != nil { + size, err := m.SourcePosition.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x2a + } + if len(m.Comments) > 0 { + i -= len(m.Comments) + copy(dAtA[i:], m.Comments) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Comments))) + i-- + dAtA[i] = 0x22 + } + if len(m.Relation) > 0 { + i -= len(m.Relation) + copy(dAtA[i:], m.Relation) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Relation))) + i-- + dAtA[i] = 0x1a + } + if len(m.Object) > 0 { + i -= len(m.Object) + copy(dAtA[i:], m.Object) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Object))) + i-- + dAtA[i] = 0x12 + } + if m.DeprecationType != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.DeprecationType)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + func (m *Relation) MarshalVT() (dAtA []byte, err error) { if m == nil { return nil, nil @@ -3438,6 +3581,16 @@ func (m *Relation) MarshalToSizedBufferVT(dAtA []byte) (int, error) { i -= len(m.unknownFields) copy(dAtA[i:], m.unknownFields) } + if m.Deprecation != nil { + size, err := m.Deprecation.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x42 + } if len(m.CanonicalCacheKey) > 0 { i -= len(m.CanonicalCacheKey) copy(dAtA[i:], m.CanonicalCacheKey) @@ -3825,6 +3978,16 @@ func (m *AllowedRelation) MarshalToSizedBufferVT(dAtA []byte) (int, error) { } i -= size } + if m.Deprecation != nil { + size, err := m.Deprecation.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x42 + } if m.RequiredExpiration != nil { size, err := m.RequiredExpiration.MarshalToSizedBufferVT(dAtA[:i]) if err != nil { @@ -5374,6 +5537,39 @@ func (m *NamespaceDefinition) SizeVT() (n int) { l = m.SourcePosition.SizeVT() n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } + if m.Deprecation != nil { + l = m.Deprecation.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + n += len(m.unknownFields) + return n +} + +func (m *Deprecation) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.DeprecationType != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.DeprecationType)) + } + l = len(m.Object) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + l = len(m.Relation) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + l = len(m.Comments) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.SourcePosition != nil { + l = m.SourcePosition.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } n += len(m.unknownFields) return n } @@ -5412,6 +5608,10 @@ func (m *Relation) SizeVT() (n int) { if l > 0 { n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } + if m.Deprecation != nil { + l = m.Deprecation.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } n += len(m.unknownFields) return n } @@ -5555,6 +5755,10 @@ func (m *AllowedRelation) SizeVT() (n int) { l = m.RequiredExpiration.SizeVT() n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } + if m.Deprecation != nil { + l = m.Deprecation.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } n += len(m.unknownFields) return n } @@ -8206,6 +8410,244 @@ func (m *NamespaceDefinition) UnmarshalVT(dAtA []byte) error { return err } iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Deprecation", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Deprecation == nil { + m.Deprecation = &Deprecation{} + } + if err := m.Deprecation.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Deprecation) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Deprecation: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Deprecation: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field DeprecationType", wireType) + } + m.DeprecationType = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.DeprecationType |= DeprecationType(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Object", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Object = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Relation", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Relation = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Comments", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Comments = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SourcePosition", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.SourcePosition == nil { + m.SourcePosition = &SourcePosition{} + } + if err := m.SourcePosition.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := protohelpers.Skip(dAtA[iNdEx:]) @@ -8497,6 +8939,42 @@ func (m *Relation) UnmarshalVT(dAtA []byte) error { } m.CanonicalCacheKey = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Deprecation", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Deprecation == nil { + m.Deprecation = &Deprecation{} + } + if err := m.Deprecation.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := protohelpers.Skip(dAtA[iNdEx:]) @@ -9548,6 +10026,42 @@ func (m *AllowedRelation) UnmarshalVT(dAtA []byte) error { return err } iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Deprecation", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Deprecation == nil { + m.Deprecation = &Deprecation{} + } + if err := m.Deprecation.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := protohelpers.Skip(dAtA[iNdEx:]) diff --git a/pkg/schemadsl/compiler/compiler.go b/pkg/schemadsl/compiler/compiler.go index cf0a074e2c..24c59f8728 100644 --- a/pkg/schemadsl/compiler/compiler.go +++ b/pkg/schemadsl/compiler/compiler.go @@ -76,7 +76,10 @@ func CaveatTypeSet(cts *caveattypes.TypeSet) Option { return func(cfg *config) { cfg.caveatTypeSet = cts } } -const expirationFlag = "expiration" +const ( + expirationFlag = "expiration" + deprecationFlag = "deprecation" +) func DisallowExpirationFlag() Option { return func(cfg *config) { @@ -86,6 +89,14 @@ func DisallowExpirationFlag() Option { } } +func DisallowDeprecationFlag() Option { + return func(cfg *config) { + cfg.allowedFlags = slicez.Filter(cfg.allowedFlags, func(s string) bool { + return s != deprecationFlag + }) + } +} + type Option func(*config) type ObjectPrefixOption func(*config) @@ -98,6 +109,7 @@ func Compile(schema InputSchema, prefix ObjectPrefixOption, opts ...Option) (*Co // Enable `expiration` flag by default. cfg.allowedFlags = append(cfg.allowedFlags, expirationFlag) + cfg.allowedFlags = append(cfg.allowedFlags, deprecationFlag) prefix(cfg) // required option diff --git a/pkg/schemadsl/compiler/translator.go b/pkg/schemadsl/compiler/translator.go index ce8f552ad8..008999eb21 100644 --- a/pkg/schemadsl/compiler/translator.go +++ b/pkg/schemadsl/compiler/translator.go @@ -18,13 +18,15 @@ import ( ) type translationContext struct { - objectTypePrefix *string - mapper input.PositionMapper - schemaString string - skipValidate bool - allowedFlags []string - enabledFlags []string - caveatTypeSet *caveattypes.TypeSet + objectTypePrefix *string + mapper input.PositionMapper + schemaString string + skipValidate bool + allowedFlags []string + enabledFlags []string + caveatTypeSet *caveattypes.TypeSet + deprecatedRelation bool + deprecation *core.Deprecation } func (tctx *translationContext) prefixedPath(definitionName string) (string, error) { @@ -50,6 +52,7 @@ func translate(tctx *translationContext, root *dslNode) (*CompiledSchema, error) orderedDefinitions := make([]SchemaDefinition, 0, len(root.GetChildren())) var objectDefinitions []*core.NamespaceDefinition var caveatDefinitions []*core.CaveatDefinition + var deprecationDefinition []*core.Deprecation nodes := make(map[string]*dslNode) @@ -81,15 +84,30 @@ func translate(tctx *translationContext, root *dslNode) (*CompiledSchema, error) definition = def objectDefinitions = append(objectDefinitions, def) - } - if _, ok := nodes[definition.GetName()]; ok { - return nil, definitionNode.WithSourceErrorf(definition.GetName(), "found name reused between multiple definitions and/or caveats: %s", definition.GetName()) + case dslshape.NodeTypeDeprecation: + def, err := translateDeprecation(tctx, definitionNode) + if err != nil { + return nil, err + } + deprecationDefinition = append(deprecationDefinition, def) } - nodes[definition.GetName()] = definitionNode + if definition != nil { + if _, ok := nodes[definition.GetName()]; ok { + return nil, definitionNode.WithSourceErrorf(definition.GetName(), "found name reused between multiple definitions and/or caveats: %s", definition.GetName()) + } + nodes[definition.GetName()] = definitionNode - orderedDefinitions = append(orderedDefinitions, definition) + orderedDefinitions = append(orderedDefinitions, definition) + } + } + + if slices.Contains(tctx.allowedFlags, "deprecation") && slices.Contains(tctx.enabledFlags, "deprecation") { + err := deprecateRelationsAndObjects(deprecationDefinition, objectDefinitions) + if err != nil { + return nil, err + } } // Strip the type annotation metadata if typechecking isn't enabled. @@ -231,6 +249,21 @@ func translateObjectDefinition(tctx *translationContext, defNode *dslNode) (*cor continue } + if relationOrPermissionNode.GetType() == dslshape.NodeTypeDeprecation { + if !slices.Contains(tctx.allowedFlags, "deprecation") || !slices.Contains(tctx.enabledFlags, "deprecation") { + return nil, relationOrPermissionNode.Errorf("deprecation not enabled") + } + // in case of a deprecation found in the definition, we mark the relation as deprecated with the help of a context bool + // which would help mark the immediately following relation as deprecated + tctx.deprecatedRelation = true + tctx.deprecation, err = translateDeprecation(tctx, relationOrPermissionNode) + if err != nil { + return nil, relationOrPermissionNode.Errorf("invalid deprecation: %w", err) + } + + continue + } + relationOrPermission, err := translateRelationOrPermission(tctx, relationOrPermissionNode) if err != nil { return nil, err @@ -271,6 +304,42 @@ func translateObjectDefinition(tctx *translationContext, defNode *dslNode) (*cor return ns, nil } +func deprecateRelationsAndObjects(deprecations []*core.Deprecation, namespaces []*core.NamespaceDefinition) error { + objectMap := make(map[string]*core.NamespaceDefinition) + relationMap := make(map[string]*core.Relation) + + for _, ns := range namespaces { + ns.Deprecation = &core.Deprecation{DeprecationType: core.DeprecationType_DEPRECATED_TYPE_UNSPECIFIED} + objectMap[ns.GetName()] = ns + for _, rel := range ns.GetRelation() { + // check if the relation already has a deprecation defined inside a definition + if rel.Deprecation == nil { + rel.Deprecation = &core.Deprecation{DeprecationType: core.DeprecationType_DEPRECATED_TYPE_UNSPECIFIED} + } + key := ns.GetName() + "#" + rel.GetName() + relationMap[key] = rel + } + } + + // Apply deprecations + for _, dep := range deprecations { + if dep.Object != "" && dep.Relation != "" { + rel, ok := relationMap[dep.Object+"#"+dep.Relation] + if !ok { + return fmt.Errorf("warning: Deprecation for relation %s not found in relation map", dep.Object) + } + rel.Deprecation = dep + } else { + obj, ok := objectMap[dep.Object] + if !ok { + return fmt.Errorf("warning: Deprecation for object %s not found in object map", dep.Object) + } + obj.Deprecation = dep + } + } + return nil +} + func getSourcePosition(dslNode *dslNode, mapper input.PositionMapper) *core.SourcePosition { if !dslNode.Has(dslshape.NodePredicateStartRune) { return nil @@ -318,6 +387,17 @@ func normalizeComment(value string) string { return strings.Join(lines, "\n") } +func deprecationTypeFromString(s string) core.DeprecationType { + switch strings.ToLower(s) { + case "warn": + return core.DeprecationType_DEPRECATED_TYPE_WARNING + case "error": + return core.DeprecationType_DEPRECATED_TYPE_ERROR + default: + return core.DeprecationType_DEPRECATED_TYPE_UNSPECIFIED + } +} + func translateRelationOrPermission(tctx *translationContext, relOrPermNode *dslNode) (*core.Relation, error) { switch relOrPermNode.GetType() { case dslshape.NodeTypeRelation: @@ -327,6 +407,11 @@ func translateRelationOrPermission(tctx *translationContext, relOrPermNode *dslN } rel.Metadata = addComments(rel.Metadata, relOrPermNode) rel.SourcePosition = getSourcePosition(relOrPermNode, tctx.mapper) + + if tctx.deprecatedRelation { + rel.Deprecation = tctx.deprecation + tctx.deprecatedRelation = false + } return rel, err case dslshape.NodeTypePermission: @@ -422,6 +507,38 @@ func translatePermission(tctx *translationContext, permissionNode *dslNode) (*co return permission, nil } +func translateDeprecation(tctx *translationContext, depNode *dslNode) (*core.Deprecation, error) { + if !slices.Contains(tctx.allowedFlags, "deprecation") || !slices.Contains(tctx.enabledFlags, "deprecation") { + return nil, depNode.Errorf("deprecation not enabled") + } + + deprecationType, err := depNode.GetString(dslshape.NodeDeprecatedType) + if err != nil { + return nil, depNode.Errorf("invalid deprecation type: %w", err) + } + + object, objErr := depNode.GetString(dslshape.NodeDeprecatedObject) + rel, relErr := depNode.GetString(dslshape.NodeTypeDeprecatedRelation) + comments, commentsErr := depNode.GetString(dslshape.NodeDeprecatedComments) + + deprecation := &core.Deprecation{ + DeprecationType: deprecationTypeFromString(deprecationType), + } + + // Conditionally add optional fields + if objErr == nil { + deprecation.Object = object + } + if relErr == nil { + deprecation.Relation = rel + } + if commentsErr == nil { + deprecation.Comments = comments + } + + return deprecation, nil +} + // extractTypeAnnotations is a helper function to return the literal identifiers under the type annotation node func extractTypeAnnotations(typeAnnotationNode *dslNode) ([]string, error) { children := typeAnnotationNode.List(dslshape.NodeTypeAnnotationPredicateTypes) diff --git a/pkg/schemadsl/dslshape/dslshape.go b/pkg/schemadsl/dslshape/dslshape.go index e9b8bd4f70..f59075d653 100644 --- a/pkg/schemadsl/dslshape/dslshape.go +++ b/pkg/schemadsl/dslshape/dslshape.go @@ -22,6 +22,9 @@ const ( NodeTypePermission // A permission NodeTypeTypeAnnotation // A type annotation for permissions + NodeTypeDeprecation // A deprecated relation. + NodeTypeDeprecationOptions // Options for a deprecation. + NodeTypeTypeReference // A type reference NodeTypeSpecificTypeReference // A reference to a specific type. NodeTypeCaveatReference // A caveat reference under a type. @@ -217,4 +220,28 @@ const ( // NodeExpressionPredicateLeftExpr = "left-expr" NodeExpressionPredicateRightExpr = "right-expr" + + // + // NodeTypeDeprecatedOptions + // + // The type of deprecation + NodeDeprecatedType = "deprecation-type" + + // + // NodeTypeDeprecatedObject + // + // The value of an object for a deprecation + NodeDeprecatedObject = "deprecation-object" + + // + // NodeTypeDeprecatedRelation + // + // The value of a relation for depreaction + NodeTypeDeprecatedRelation = "deprecation-relation" + + // + // NodeTypeDeprecatedOptions + // + // The value of an option for a deprecation + NodeDeprecatedComments = "deprecation-comments" ) diff --git a/pkg/schemadsl/dslshape/zz_generated.nodetype_string.go b/pkg/schemadsl/dslshape/zz_generated.nodetype_string.go index 3cd3450fb5..d30b2c8460 100644 --- a/pkg/schemadsl/dslshape/zz_generated.nodetype_string.go +++ b/pkg/schemadsl/dslshape/zz_generated.nodetype_string.go @@ -19,22 +19,24 @@ func _() { _ = x[NodeTypeRelation-8] _ = x[NodeTypePermission-9] _ = x[NodeTypeTypeAnnotation-10] - _ = x[NodeTypeTypeReference-11] - _ = x[NodeTypeSpecificTypeReference-12] - _ = x[NodeTypeCaveatReference-13] - _ = x[NodeTypeTraitReference-14] - _ = x[NodeTypeUnionExpression-15] - _ = x[NodeTypeIntersectExpression-16] - _ = x[NodeTypeExclusionExpression-17] - _ = x[NodeTypeArrowExpression-18] - _ = x[NodeTypeIdentifier-19] - _ = x[NodeTypeNilExpression-20] - _ = x[NodeTypeCaveatTypeReference-21] + _ = x[NodeTypeDeprecation-11] + _ = x[NodeTypeDeprecationOptions-12] + _ = x[NodeTypeTypeReference-13] + _ = x[NodeTypeSpecificTypeReference-14] + _ = x[NodeTypeCaveatReference-15] + _ = x[NodeTypeTraitReference-16] + _ = x[NodeTypeUnionExpression-17] + _ = x[NodeTypeIntersectExpression-18] + _ = x[NodeTypeExclusionExpression-19] + _ = x[NodeTypeArrowExpression-20] + _ = x[NodeTypeIdentifier-21] + _ = x[NodeTypeNilExpression-22] + _ = x[NodeTypeCaveatTypeReference-23] } -const _NodeType_name = "NodeTypeErrorNodeTypeFileNodeTypeCommentNodeTypeUseFlagNodeTypeDefinitionNodeTypeCaveatDefinitionNodeTypeCaveatParameterNodeTypeCaveatExpressionNodeTypeRelationNodeTypePermissionNodeTypeTypeAnnotationNodeTypeTypeReferenceNodeTypeSpecificTypeReferenceNodeTypeCaveatReferenceNodeTypeTraitReferenceNodeTypeUnionExpressionNodeTypeIntersectExpressionNodeTypeExclusionExpressionNodeTypeArrowExpressionNodeTypeIdentifierNodeTypeNilExpressionNodeTypeCaveatTypeReference" +const _NodeType_name = "NodeTypeErrorNodeTypeFileNodeTypeCommentNodeTypeUseFlagNodeTypeDefinitionNodeTypeCaveatDefinitionNodeTypeCaveatParameterNodeTypeCaveatExpressionNodeTypeRelationNodeTypePermissionNodeTypeTypeAnnotationNodeTypeDeprecationNodeTypeDeprecationOptionsNodeTypeTypeReferenceNodeTypeSpecificTypeReferenceNodeTypeCaveatReferenceNodeTypeTraitReferenceNodeTypeUnionExpressionNodeTypeIntersectExpressionNodeTypeExclusionExpressionNodeTypeArrowExpressionNodeTypeIdentifierNodeTypeNilExpressionNodeTypeCaveatTypeReference" -var _NodeType_index = [...]uint16{0, 13, 25, 40, 55, 73, 97, 120, 144, 160, 178, 200, 221, 250, 273, 295, 318, 345, 372, 395, 413, 434, 461} +var _NodeType_index = [...]uint16{0, 13, 25, 40, 55, 73, 97, 120, 144, 160, 178, 200, 219, 245, 266, 295, 318, 340, 363, 390, 417, 440, 458, 479, 506} func (i NodeType) String() string { if i < 0 || i >= NodeType(len(_NodeType_index)-1) { diff --git a/pkg/schemadsl/generator/generator.go b/pkg/schemadsl/generator/generator.go index 995b3ecdaa..8b1c311703 100644 --- a/pkg/schemadsl/generator/generator.go +++ b/pkg/schemadsl/generator/generator.go @@ -202,6 +202,20 @@ func (sg *sourceGenerator) emitNamespace(namespace *core.NamespaceDefinition) er sg.markNewScope() for _, relation := range namespace.Relation { + if relation.Deprecation != nil && relation.Deprecation.DeprecationType != core.DeprecationType_DEPRECATED_TYPE_UNSPECIFIED { + sg.flags.Add("deprecation") + sg.append("@deprecated(") + + switch relation.Deprecation.DeprecationType { + case core.DeprecationType_DEPRECATED_TYPE_WARNING: + sg.append("warn") + case core.DeprecationType_DEPRECATED_TYPE_ERROR: + sg.append("error") + } + sg.append(")") + sg.appendLine() + } + err := sg.emitRelation(relation) if err != nil { return err diff --git a/pkg/schemadsl/generator/generator_test.go b/pkg/schemadsl/generator/generator_test.go index d5e43cdc6e..67ded6b769 100644 --- a/pkg/schemadsl/generator/generator_test.go +++ b/pkg/schemadsl/generator/generator_test.go @@ -395,6 +395,41 @@ definition document { relation viewer: user }`, }, + { + "deprecation test", + `use deprecation + definition user{} + + definition document { + + @deprecated(warn) + relation viewer: user + + @deprecated(error) + relation editor: user + }`, + `use deprecation + +definition user {} + +definition document { + @deprecated(warn) + relation viewer: user + @deprecated(error) + relation editor: user +}`, + }, + { + "unused deprecation flag", + `use deprecation + + definition document{ + relation viewer: user + }`, + `definition document { + relation viewer: user +}`, + }, } for _, test := range tests { diff --git a/pkg/schemadsl/lexer/flaggablelexer_test.go b/pkg/schemadsl/lexer/flaggablelexer_test.go index 3ecc89bf11..330ab9c837 100644 --- a/pkg/schemadsl/lexer/flaggablelexer_test.go +++ b/pkg/schemadsl/lexer/flaggablelexer_test.go @@ -48,6 +48,12 @@ var flaggableLexerTests = []lexerTest{ {TokenTypeIdentifier, 0, "expiration", ""}, tEOF, }}, + {"use deprecation", "use deprecation", []Lexeme{ + {TokenTypeIdentifier, 0, "use", ""}, + {TokenTypeWhitespace, 0, " ", ""}, + {TokenTypeKeyword, 0, "deprecation", ""}, + tEOF, + }}, } func TestFlaggableLexer(t *testing.T) { diff --git a/pkg/schemadsl/lexer/flags.go b/pkg/schemadsl/lexer/flags.go index 184e7523a6..0034495e51 100644 --- a/pkg/schemadsl/lexer/flags.go +++ b/pkg/schemadsl/lexer/flags.go @@ -13,6 +13,10 @@ const ( // FlagTypeChecking indicates that `typechecking` is supported as a first-class // feature in the schema. FlagTypeChecking = "typechecking" + + // FlagDeprecation indicates that `deprecation` is supported as a first-class + // feature in the schema. + FlagDeprecation = "deprecation" ) var AllUseFlags []string @@ -41,6 +45,16 @@ var Flags = map[string]transformer{ return lexeme, false }, + + FlagDeprecation: func(lexeme Lexeme) (Lexeme, bool) { + if lexeme.Kind == TokenTypeIdentifier && lexeme.Value == "deprecation" { + lexeme.Kind = TokenTypeKeyword + return lexeme, true + } + + return lexeme, false + }, + FlagTypeChecking: func(lexeme Lexeme) (Lexeme, bool) { // `typechecking` becomes a keyword. if lexeme.Kind == TokenTypeIdentifier && lexeme.Value == "typechecking" { diff --git a/pkg/schemadsl/lexer/lex_def.go b/pkg/schemadsl/lexer/lex_def.go index 366db87fe6..ec855359e5 100644 --- a/pkg/schemadsl/lexer/lex_def.go +++ b/pkg/schemadsl/lexer/lex_def.go @@ -52,6 +52,7 @@ const ( TokenTypeStar // * // Additional tokens for CEL: https://github.com/google/cel-spec/blob/master/doc/langdef.md#syntax + TokenTypeAt // @ TokenTypeQuestionMark // ? TokenTypeConditionalOr // || TokenTypeConditionalAnd // && @@ -78,6 +79,7 @@ var keywords = map[string]struct{}{ "permission": {}, "nil": {}, "with": {}, + "deprecated": {}, } // IsKeyword returns whether the specified input string is a reserved keyword. @@ -153,6 +155,8 @@ Loop: case r == '%': l.emit(TokenTypePercent) + case r == '@': + l.emit(TokenTypeAt) case r == '<': if l.acceptString("=") { diff --git a/pkg/schemadsl/lexer/lex_test.go b/pkg/schemadsl/lexer/lex_test.go index a223cc2253..33198ceec7 100644 --- a/pkg/schemadsl/lexer/lex_test.go +++ b/pkg/schemadsl/lexer/lex_test.go @@ -46,6 +46,8 @@ var lexerTests = []lexerTest{ {"hash", "#", []Lexeme{{TokenTypeHash, 0, "#", ""}, tEOF}}, {"ellipsis", "...", []Lexeme{{TokenTypeEllipsis, 0, "...", ""}, tEOF}}, + {"token @", "@", []Lexeme{{TokenTypeAt, 0, "@", ""}, tEOF}}, + {"relation reference", "foo#...", []Lexeme{ {TokenTypeIdentifier, 0, "foo", ""}, {TokenTypeHash, 0, "#", ""}, @@ -257,6 +259,19 @@ var lexerTests = []lexerTest{ {TokenTypeRightParen, 0, ")", ""}, tEOF, }}, + {"deprecation test with keyword", "@deprecated", []Lexeme{ + {TokenTypeAt, 0, "@", ""}, + {TokenTypeKeyword, 0, "deprecated", ""}, + tEOF, + }}, + {"deprecation test with keyword and identifier", "@deprecated(something)", []Lexeme{ + {TokenTypeAt, 0, "@", ""}, + {TokenTypeKeyword, 0, "deprecated", ""}, + {TokenTypeLeftParen, 0, "(", ""}, + {TokenTypeIdentifier, 0, "something", ""}, + {TokenTypeRightParen, 0, ")", ""}, + tEOF, + }}, } func TestLexer(t *testing.T) { diff --git a/pkg/schemadsl/lexer/tokentype_string.go b/pkg/schemadsl/lexer/tokentype_string.go index 79f358589c..7c29e0484c 100644 --- a/pkg/schemadsl/lexer/tokentype_string.go +++ b/pkg/schemadsl/lexer/tokentype_string.go @@ -34,27 +34,28 @@ func _() { _ = x[TokenTypeHash-23] _ = x[TokenTypeEllipsis-24] _ = x[TokenTypeStar-25] - _ = x[TokenTypeQuestionMark-26] - _ = x[TokenTypeConditionalOr-27] - _ = x[TokenTypeConditionalAnd-28] - _ = x[TokenTypeExclamationPoint-29] - _ = x[TokenTypeLeftBracket-30] - _ = x[TokenTypeRightBracket-31] - _ = x[TokenTypePeriod-32] - _ = x[TokenTypeComma-33] - _ = x[TokenTypePercent-34] - _ = x[TokenTypeLessThan-35] - _ = x[TokenTypeGreaterThan-36] - _ = x[TokenTypeLessThanOrEqual-37] - _ = x[TokenTypeGreaterThanOrEqual-38] - _ = x[TokenTypeEqualEqual-39] - _ = x[TokenTypeNotEqual-40] - _ = x[TokenTypeString-41] + _ = x[TokenTypeAt-26] + _ = x[TokenTypeQuestionMark-27] + _ = x[TokenTypeConditionalOr-28] + _ = x[TokenTypeConditionalAnd-29] + _ = x[TokenTypeExclamationPoint-30] + _ = x[TokenTypeLeftBracket-31] + _ = x[TokenTypeRightBracket-32] + _ = x[TokenTypePeriod-33] + _ = x[TokenTypeComma-34] + _ = x[TokenTypePercent-35] + _ = x[TokenTypeLessThan-36] + _ = x[TokenTypeGreaterThan-37] + _ = x[TokenTypeLessThanOrEqual-38] + _ = x[TokenTypeGreaterThanOrEqual-39] + _ = x[TokenTypeEqualEqual-40] + _ = x[TokenTypeNotEqual-41] + _ = x[TokenTypeString-42] } -const _TokenType_name = "TokenTypeErrorTokenTypeSyntheticSemicolonTokenTypeEOFTokenTypeWhitespaceTokenTypeSinglelineCommentTokenTypeMultilineCommentTokenTypeNewlineTokenTypeKeywordTokenTypeIdentifierTokenTypeNumberTokenTypeLeftBraceTokenTypeRightBraceTokenTypeLeftParenTokenTypeRightParenTokenTypePipeTokenTypePlusTokenTypeMinusTokenTypeAndTokenTypeDivTokenTypeEqualsTokenTypeColonTokenTypeSemicolonTokenTypeRightArrowTokenTypeHashTokenTypeEllipsisTokenTypeStarTokenTypeQuestionMarkTokenTypeConditionalOrTokenTypeConditionalAndTokenTypeExclamationPointTokenTypeLeftBracketTokenTypeRightBracketTokenTypePeriodTokenTypeCommaTokenTypePercentTokenTypeLessThanTokenTypeGreaterThanTokenTypeLessThanOrEqualTokenTypeGreaterThanOrEqualTokenTypeEqualEqualTokenTypeNotEqualTokenTypeString" +const _TokenType_name = "TokenTypeErrorTokenTypeSyntheticSemicolonTokenTypeEOFTokenTypeWhitespaceTokenTypeSinglelineCommentTokenTypeMultilineCommentTokenTypeNewlineTokenTypeKeywordTokenTypeIdentifierTokenTypeNumberTokenTypeLeftBraceTokenTypeRightBraceTokenTypeLeftParenTokenTypeRightParenTokenTypePipeTokenTypePlusTokenTypeMinusTokenTypeAndTokenTypeDivTokenTypeEqualsTokenTypeColonTokenTypeSemicolonTokenTypeRightArrowTokenTypeHashTokenTypeEllipsisTokenTypeStarTokenTypeAtTokenTypeQuestionMarkTokenTypeConditionalOrTokenTypeConditionalAndTokenTypeExclamationPointTokenTypeLeftBracketTokenTypeRightBracketTokenTypePeriodTokenTypeCommaTokenTypePercentTokenTypeLessThanTokenTypeGreaterThanTokenTypeLessThanOrEqualTokenTypeGreaterThanOrEqualTokenTypeEqualEqualTokenTypeNotEqualTokenTypeString" -var _TokenType_index = [...]uint16{0, 14, 41, 53, 72, 98, 123, 139, 155, 174, 189, 207, 226, 244, 263, 276, 289, 303, 315, 327, 342, 356, 374, 393, 406, 423, 436, 457, 479, 502, 527, 547, 568, 583, 597, 613, 630, 650, 674, 701, 720, 737, 752} +var _TokenType_index = [...]uint16{0, 14, 41, 53, 72, 98, 123, 139, 155, 174, 189, 207, 226, 244, 263, 276, 289, 303, 315, 327, 342, 356, 374, 393, 406, 423, 436, 447, 468, 490, 513, 538, 558, 579, 594, 608, 624, 641, 661, 685, 712, 731, 748, 763} func (i TokenType) String() string { if i < 0 || i >= TokenType(len(_TokenType_index)-1) { diff --git a/pkg/schemadsl/parser/parser.go b/pkg/schemadsl/parser/parser.go index 507188c339..14e93618b3 100644 --- a/pkg/schemadsl/parser/parser.go +++ b/pkg/schemadsl/parser/parser.go @@ -69,6 +69,9 @@ Loop: hasSeenDefinition = true rootNode.Connect(dslshape.NodePredicateChild, p.consumeCaveat()) + case p.isToken(lexer.TokenTypeAt): + rootNode.Connect(dslshape.NodePredicateChild, p.consumeDeprecation()) + default: p.emitErrorf("Unexpected token at root level: %v", p.currentToken.Kind) break Loop @@ -298,7 +301,7 @@ func (p *sourceParser) consumeDefinition() AstNode { return defNode } - // Relations and permissions. + // Relations and permissions and associated deprecations for objects and relations. for { // } if _, ok := p.tryConsume(lexer.TokenTypeRightBrace); ok { @@ -308,19 +311,23 @@ func (p *sourceParser) consumeDefinition() AstNode { // relation ... // permission ... switch { + case p.isToken(lexer.TokenTypeAt): + defNode.Connect(dslshape.NodePredicateChild, p.consumeDeprecation()) + + case p.isToken(lexer.TokenTypeAt): + defNode.Connect(dslshape.NodePredicateChild, p.consumeDeprecation()) + case p.isKeyword("relation"): defNode.Connect(dslshape.NodePredicateChild, p.consumeRelation()) case p.isKeyword("permission"): defNode.Connect(dslshape.NodePredicateChild, p.consumePermission()) } - ok := p.consumeStatementTerminator() if !ok { break } } - return defNode } @@ -351,6 +358,96 @@ func (p *sourceParser) consumeRelation() AstNode { return relNode } +// consumeDeprecation consumes a deprecation statement +// ```@deprecated(type, object, relation)``` +func (p *sourceParser) consumeDeprecation() AstNode { + depNode := p.startNode(dslshape.NodeTypeDeprecation) + defer p.mustFinishNode() + + p.consume(lexer.TokenTypeAt) + + ok := p.consumeKeyword("deprecated") + if !ok { + return depNode + } + + _, ok = p.tryConsume(lexer.TokenTypeLeftParen) + if !ok { + p.emitErrorf("Expected '(' after 'deprecated' keyword") + return depNode + } + + // Required: deprecation type + deprecationType, ok := p.tryConsume(lexer.TokenTypeIdentifier) + if !ok { + p.emitErrorf("Expected identifier for deprecation type") + return depNode + } + depNode.MustDecorate(dslshape.NodeDeprecatedType, deprecationType.Value) + + // Try consume after every opt. + if p.isToken(lexer.TokenTypeRightParen) { + p.consume(lexer.TokenTypeRightParen) + return depNode + } + + _, ok = p.tryConsume(lexer.TokenTypeComma) + if !ok { + p.emitErrorf("Expected ',' after deprecation type") + return depNode + } + + // A comment + if p.isToken(lexer.TokenTypeString) { + commentTok, _ := p.tryConsume(lexer.TokenTypeString) + comment := strings.Trim(commentTok.Value, `"`) + depNode.MustDecorate(dslshape.NodeDeprecatedComments, comment) + + p.consume(lexer.TokenTypeRightParen) + return depNode + } + + if p.isToken(lexer.TokenTypeIdentifier) { + // Object + objectTok, _ := p.tryConsume(lexer.TokenTypeIdentifier) + depNode.MustDecorate(dslshape.NodeDeprecatedObject, objectTok.Value) + + // Check if relation follows: # + if p.isToken(lexer.TokenTypeHash) { + p.consume(lexer.TokenTypeHash) + if !p.isToken(lexer.TokenTypeIdentifier) { + p.emitErrorf("Expected identifier for deprecation relation after '#'") + } else { + relTok, _ := p.tryConsume(lexer.TokenTypeIdentifier) + depNode.MustDecorate(dslshape.NodeTypeDeprecatedRelation, relTok.Value) + } + } + + if p.isToken(lexer.TokenTypeRightParen) { + p.consume(lexer.TokenTypeRightParen) + return depNode + } + + _, ok = p.tryConsume(lexer.TokenTypeComma) + if !ok { + p.emitErrorf("Expected ',' after deprecation object or object#relation") + } else if p.isToken(lexer.TokenTypeString) { + commentTok, _ := p.tryConsume(lexer.TokenTypeString) + comment := strings.Trim(commentTok.Value, `"`) + depNode.MustDecorate(dslshape.NodeDeprecatedComments, comment) + } else { + p.emitErrorf("Expected string value for deprecation comment") + } + + p.consume(lexer.TokenTypeRightParen) + return depNode + } + + // If it's neither string nor identifier, it's invalid + p.emitErrorf("Unexpected token after deprecation type: %s", p.currentToken.Value) + return depNode +} + // consumeTypeReference consumes a reference to a type or types of relations. // ```sometype | anothertype | anothertype:* ``` func (p *sourceParser) consumeTypeReference() AstNode { diff --git a/pkg/schemadsl/parser/parser_test.go b/pkg/schemadsl/parser/parser_test.go index 8ec639f581..a8fad175d4 100644 --- a/pkg/schemadsl/parser/parser_test.go +++ b/pkg/schemadsl/parser/parser_test.go @@ -142,6 +142,23 @@ func TestParser(t *testing.T) { {"permission type annotation double colon test", "permission_type_annotation_double_colon"}, {"permission type annotation newline after colon test", "permission_type_annotation_newline_after_colon"}, {"permission type annotation just pipe test", "permission_type_annotation_just_pipe"}, + {"use typechecking test", "use_typechecking"}, + {"permission type annotation test", "permission_type_annotation"}, + {"permission mixed annotations test", "permission_mixed_annotations"}, + {"permission multiple types test", "permission_multiple_types"}, + {"permission mixed single multiple test", "permission_mixed_single_multiple"}, + {"permission edge cases test", "permission_edge_cases"}, + {"permission type annotation empty after colon test", "permission_type_annotation_empty_after_colon"}, + {"permission type annotation pipe no type before test", "permission_type_annotation_pipe_no_type_before"}, + {"permission type annotation trailing pipe no type after test", "permission_type_annotation_trailing_pipe_no_type_after"}, + {"permission type annotation double colon test", "permission_type_annotation_double_colon"}, + {"permission type annotation newline after colon test", "permission_type_annotation_newline_after_colon"}, + {"permission type annotation just pipe test", "permission_type_annotation_just_pipe"}, + {"deprecated relation test", "deprecation"}, + {"invalid deprecated relation test", "invalid-deprecation"}, + {"deprecated options test", "deprecated_options"}, + {"deprecation which is outside of a definition", "deprecation_outside_definition"}, + {"multiple deprecations with comments", "multiple_deprecations"}, } for _, test := range parserTests { diff --git a/pkg/schemadsl/parser/tests/deprecated_options.zed b/pkg/schemadsl/parser/tests/deprecated_options.zed new file mode 100644 index 0000000000..8b8e617105 --- /dev/null +++ b/pkg/schemadsl/parser/tests/deprecated_options.zed @@ -0,0 +1,14 @@ +use deprecation + +definition deprecated_relation { + + @deprecated(warn, user, "comments") + relation writer: user + + + @deprecated(error, testuser) + relation reader: user +} + +definition user {} +definition testuser {} \ No newline at end of file diff --git a/pkg/schemadsl/parser/tests/deprecated_options.zed.expected b/pkg/schemadsl/parser/tests/deprecated_options.zed.expected new file mode 100644 index 0000000000..d79574cecc --- /dev/null +++ b/pkg/schemadsl/parser/tests/deprecated_options.zed.expected @@ -0,0 +1,71 @@ +NodeTypeFile + end-rune = 221 + input-source = deprecated options test + start-rune = 0 + child-node => + NodeTypeUseFlag + end-rune = 14 + input-source = deprecated options test + start-rune = 0 + use-flag-name = deprecation + NodeTypeDefinition + definition-name = deprecated_relation + end-rune = 178 + input-source = deprecated options test + start-rune = 17 + child-node => + NodeTypeDeprecation + deprecation-comments = comments + deprecation-object = user + deprecation-type = warn + end-rune = 89 + input-source = deprecated options test + start-rune = 55 + NodeTypeRelation + end-rune = 115 + input-source = deprecated options test + relation-name = writer + start-rune = 95 + allowed-types => + NodeTypeTypeReference + end-rune = 115 + input-source = deprecated options test + start-rune = 112 + type-ref-type => + NodeTypeSpecificTypeReference + end-rune = 115 + input-source = deprecated options test + start-rune = 112 + type-name = user + NodeTypeDeprecation + deprecation-object = testuser + deprecation-type = error + end-rune = 150 + input-source = deprecated options test + start-rune = 123 + NodeTypeRelation + end-rune = 176 + input-source = deprecated options test + relation-name = reader + start-rune = 156 + allowed-types => + NodeTypeTypeReference + end-rune = 176 + input-source = deprecated options test + start-rune = 173 + type-ref-type => + NodeTypeSpecificTypeReference + end-rune = 176 + input-source = deprecated options test + start-rune = 173 + type-name = user + NodeTypeDefinition + definition-name = user + end-rune = 198 + input-source = deprecated options test + start-rune = 181 + NodeTypeDefinition + definition-name = testuser + end-rune = 221 + input-source = deprecated options test + start-rune = 200 diff --git a/pkg/schemadsl/parser/tests/deprecation.zed b/pkg/schemadsl/parser/tests/deprecation.zed new file mode 100644 index 0000000000..f41bda7b8e --- /dev/null +++ b/pkg/schemadsl/parser/tests/deprecation.zed @@ -0,0 +1,12 @@ +use deprecation + +definition deprecated_relation { + + @deprecated(warn) + relation writer: user + + @deprecated(error) + relation reader: user +} + +definition user {} \ No newline at end of file diff --git a/pkg/schemadsl/parser/tests/deprecation.zed.expected b/pkg/schemadsl/parser/tests/deprecation.zed.expected new file mode 100644 index 0000000000..38332ddb83 --- /dev/null +++ b/pkg/schemadsl/parser/tests/deprecation.zed.expected @@ -0,0 +1,63 @@ +NodeTypeFile + end-rune = 169 + input-source = deprecated relation test + start-rune = 0 + child-node => + NodeTypeUseFlag + end-rune = 14 + input-source = deprecated relation test + start-rune = 0 + use-flag-name = deprecation + NodeTypeDefinition + definition-name = deprecated_relation + end-rune = 149 + input-source = deprecated relation test + start-rune = 17 + child-node => + NodeTypeDeprecation + deprecation-type = warn + end-rune = 71 + input-source = deprecated relation test + start-rune = 55 + NodeTypeRelation + end-rune = 97 + input-source = deprecated relation test + relation-name = writer + start-rune = 77 + allowed-types => + NodeTypeTypeReference + end-rune = 97 + input-source = deprecated relation test + start-rune = 94 + type-ref-type => + NodeTypeSpecificTypeReference + end-rune = 97 + input-source = deprecated relation test + start-rune = 94 + type-name = user + NodeTypeDeprecation + deprecation-type = error + end-rune = 121 + input-source = deprecated relation test + start-rune = 104 + NodeTypeRelation + end-rune = 147 + input-source = deprecated relation test + relation-name = reader + start-rune = 127 + allowed-types => + NodeTypeTypeReference + end-rune = 147 + input-source = deprecated relation test + start-rune = 144 + type-ref-type => + NodeTypeSpecificTypeReference + end-rune = 147 + input-source = deprecated relation test + start-rune = 144 + type-name = user + NodeTypeDefinition + definition-name = user + end-rune = 169 + input-source = deprecated relation test + start-rune = 152 \ No newline at end of file diff --git a/pkg/schemadsl/parser/tests/deprecation_outside_definition.zed b/pkg/schemadsl/parser/tests/deprecation_outside_definition.zed new file mode 100644 index 0000000000..60a7ac59c5 --- /dev/null +++ b/pkg/schemadsl/parser/tests/deprecation_outside_definition.zed @@ -0,0 +1,15 @@ +use deprecation + +definition user {} +definition testuser {} + +definition deprecated_relation { + + relation writer: user + + + @deprecated(error, testuser) + relation reader: user +} + +@deprecated(warn, user, "comments") \ No newline at end of file diff --git a/pkg/schemadsl/parser/tests/deprecation_outside_definition.zed.expected b/pkg/schemadsl/parser/tests/deprecation_outside_definition.zed.expected new file mode 100644 index 0000000000..4ef41d852c --- /dev/null +++ b/pkg/schemadsl/parser/tests/deprecation_outside_definition.zed.expected @@ -0,0 +1,71 @@ +NodeTypeFile + end-rune = 218 + input-source = deprecation which is outside of a definition + start-rune = 0 + child-node => + NodeTypeUseFlag + end-rune = 14 + input-source = deprecation which is outside of a definition + start-rune = 0 + use-flag-name = deprecation + NodeTypeDefinition + definition-name = user + end-rune = 34 + input-source = deprecation which is outside of a definition + start-rune = 17 + NodeTypeDefinition + definition-name = testuser + end-rune = 57 + input-source = deprecation which is outside of a definition + start-rune = 36 + NodeTypeDefinition + definition-name = deprecated_relation + end-rune = 181 + input-source = deprecation which is outside of a definition + start-rune = 60 + child-node => + NodeTypeRelation + end-rune = 118 + input-source = deprecation which is outside of a definition + relation-name = writer + start-rune = 98 + allowed-types => + NodeTypeTypeReference + end-rune = 118 + input-source = deprecation which is outside of a definition + start-rune = 115 + type-ref-type => + NodeTypeSpecificTypeReference + end-rune = 118 + input-source = deprecation which is outside of a definition + start-rune = 115 + type-name = user + NodeTypeDeprecation + deprecation-object = testuser + deprecation-type = error + end-rune = 153 + input-source = deprecation which is outside of a definition + start-rune = 126 + NodeTypeRelation + end-rune = 179 + input-source = deprecation which is outside of a definition + relation-name = reader + start-rune = 159 + allowed-types => + NodeTypeTypeReference + end-rune = 179 + input-source = deprecation which is outside of a definition + start-rune = 176 + type-ref-type => + NodeTypeSpecificTypeReference + end-rune = 179 + input-source = deprecation which is outside of a definition + start-rune = 176 + type-name = user + NodeTypeDeprecation + deprecation-comments = comments + deprecation-object = user + deprecation-type = warn + end-rune = 218 + input-source = deprecation which is outside of a definition + start-rune = 184 diff --git a/pkg/schemadsl/parser/tests/invalid-deprecation.zed b/pkg/schemadsl/parser/tests/invalid-deprecation.zed new file mode 100644 index 0000000000..24a730bdc6 --- /dev/null +++ b/pkg/schemadsl/parser/tests/invalid-deprecation.zed @@ -0,0 +1,6 @@ +definition deprecated_relation { + @deprecated() + relation reader: user +} + +definition user {} \ No newline at end of file diff --git a/pkg/schemadsl/parser/tests/invalid-deprecation.zed.expected b/pkg/schemadsl/parser/tests/invalid-deprecation.zed.expected new file mode 100644 index 0000000000..8300143dac --- /dev/null +++ b/pkg/schemadsl/parser/tests/invalid-deprecation.zed.expected @@ -0,0 +1,34 @@ +NodeTypeFile + end-rune = 48 + input-source = invalid deprecated relation test + start-rune = 0 + child-node => + NodeTypeDefinition + definition-name = deprecated_relation + end-rune = 48 + input-source = invalid deprecated relation test + start-rune = 0 + child-node => + NodeTypeDeprecation + end-rune = 48 + input-source = invalid deprecated relation test + start-rune = 37 + child-node => + NodeTypeError + end-rune = 48 + error-message = Expected identifier for deprecation type + error-source = ) + input-source = invalid deprecated relation test + start-rune = 49 + NodeTypeError + end-rune = 48 + error-message = Expected end of statement or definition, found: TokenTypeRightParen + error-source = ) + input-source = invalid deprecated relation test + start-rune = 49 + NodeTypeError + end-rune = 48 + error-message = Unexpected token at root level: TokenTypeRightParen + error-source = ) + input-source = invalid deprecated relation test + start-rune = 49 \ No newline at end of file diff --git a/pkg/schemadsl/parser/tests/invaliduse.zed.expected b/pkg/schemadsl/parser/tests/invaliduse.zed.expected index 50f1468985..f399586130 100644 --- a/pkg/schemadsl/parser/tests/invaliduse.zed.expected +++ b/pkg/schemadsl/parser/tests/invaliduse.zed.expected @@ -10,7 +10,7 @@ NodeTypeFile child-node => NodeTypeError end-rune = 12 - error-message = Unknown use flag: `something`. Options are: expiration, typechecking + error-message = Unknown use flag: `something`. Options are: deprecation, expiration, typechecking error-source = input-source = invalid use diff --git a/pkg/schemadsl/parser/tests/multiple_deprecations.zed b/pkg/schemadsl/parser/tests/multiple_deprecations.zed new file mode 100644 index 0000000000..2c246d6d8e --- /dev/null +++ b/pkg/schemadsl/parser/tests/multiple_deprecations.zed @@ -0,0 +1,19 @@ +use deprecation + +definition user {} +definition testuser {} +definition superuser{} + +definition deprecated_relation { + + relation writer: user + + + @deprecated(warn, testuser, "oops deprecated!") + relation reader: testuser + + relation editor: superuser +} + +@deprecated(error, user, "obj user is deprecated, use superuser instead") +@deprecated(warn, deprecated_relation#editor, "rel editor is deprecated") \ No newline at end of file diff --git a/pkg/schemadsl/parser/tests/multiple_deprecations.zed.expected b/pkg/schemadsl/parser/tests/multiple_deprecations.zed.expected new file mode 100644 index 0000000000..ab5a291314 --- /dev/null +++ b/pkg/schemadsl/parser/tests/multiple_deprecations.zed.expected @@ -0,0 +1,101 @@ +NodeTypeFile + end-rune = 408 + input-source = multiple deprecations with comments + start-rune = 0 + child-node => + NodeTypeUseFlag + end-rune = 14 + input-source = multiple deprecations with comments + start-rune = 0 + use-flag-name = deprecation + NodeTypeDefinition + definition-name = user + end-rune = 34 + input-source = multiple deprecations with comments + start-rune = 17 + NodeTypeDefinition + definition-name = testuser + end-rune = 57 + input-source = multiple deprecations with comments + start-rune = 36 + NodeTypeDefinition + definition-name = superuser + end-rune = 80 + input-source = multiple deprecations with comments + start-rune = 59 + NodeTypeDefinition + definition-name = deprecated_relation + end-rune = 259 + input-source = multiple deprecations with comments + start-rune = 83 + child-node => + NodeTypeRelation + end-rune = 141 + input-source = multiple deprecations with comments + relation-name = writer + start-rune = 121 + allowed-types => + NodeTypeTypeReference + end-rune = 141 + input-source = multiple deprecations with comments + start-rune = 138 + type-ref-type => + NodeTypeSpecificTypeReference + end-rune = 141 + input-source = multiple deprecations with comments + start-rune = 138 + type-name = user + NodeTypeDeprecation + deprecation-comments = oops deprecated! + deprecation-object = testuser + deprecation-type = warn + end-rune = 195 + input-source = multiple deprecations with comments + start-rune = 149 + NodeTypeRelation + end-rune = 225 + input-source = multiple deprecations with comments + relation-name = reader + start-rune = 201 + allowed-types => + NodeTypeTypeReference + end-rune = 225 + input-source = multiple deprecations with comments + start-rune = 218 + type-ref-type => + NodeTypeSpecificTypeReference + end-rune = 225 + input-source = multiple deprecations with comments + start-rune = 218 + type-name = testuser + NodeTypeRelation + end-rune = 257 + input-source = multiple deprecations with comments + relation-name = editor + start-rune = 232 + allowed-types => + NodeTypeTypeReference + end-rune = 257 + input-source = multiple deprecations with comments + start-rune = 249 + type-ref-type => + NodeTypeSpecificTypeReference + end-rune = 257 + input-source = multiple deprecations with comments + start-rune = 249 + type-name = superuser + NodeTypeDeprecation + deprecation-comments = obj user is deprecated, use superuser instead + deprecation-object = user + deprecation-type = error + end-rune = 334 + input-source = multiple deprecations with comments + start-rune = 262 + NodeTypeDeprecation + deprecation-comments = rel editor is deprecated + deprecation-object = deprecated_relation + deprecation-relation = editor + deprecation-type = warn + end-rune = 408 + input-source = multiple deprecations with comments + start-rune = 336 \ No newline at end of file diff --git a/proto/internal/core/v1/core.proto b/proto/internal/core/v1/core.proto index a393eed149..41f7938358 100644 --- a/proto/internal/core/v1/core.proto +++ b/proto/internal/core/v1/core.proto @@ -204,6 +204,43 @@ message NamespaceDefinition { /** source_position contains the position of the namespace in the source schema, if any */ SourcePosition source_position = 4; + + /** deprecation contains the deprecation information for the namespace, if any */ + Deprecation deprecation = 5; +} + +/** + * DeprecationType is the type of deprecation for a relation. + */ +enum DeprecationType { + DEPRECATED_TYPE_UNSPECIFIED = 0; + DEPRECATED_TYPE_WARNING = 1; + DEPRECATED_TYPE_ERROR = 2; +} +/** + * Deprecation represents the deprecation information for a relation and object. + * It contains the type of deprecation, a comment to show when the relation is used, + * and the source position of the deprecation in the source schema, if any. + */ + +message Deprecation { + /** + * deprecation_type is the type of deprecation for the relation. + * It can be either a warning or an error, defaults to unspecified. + */ + DeprecationType deprecation_type = 1 [(validate.rules).enum.defined_only = true]; + + /** object is the object that is deprecated */ + string object = 2; + + /** relation is the relation that is deprecated */ + string relation = 3; + + /** comments are the comments to show when the relation is used */ + string comments = 4 [(validate.rules).string = {max_bytes: 256}]; + + /** source_position contains the position of the deprecation in the source schema, if any */ + SourcePosition source_position = 5; } /** @@ -233,6 +270,9 @@ message Relation { string aliasing_relation = 6; string canonical_cache_key = 7; + + /** deprecation_type is the type of deprecation for the relation */ + Deprecation deprecation = 8; } /** @@ -420,6 +460,11 @@ message AllowedRelation { * required_expiration defines the required expiration on this relation. */ ExpirationTrait required_expiration = 7; + + /** + * deprecation_type defines the type of deprecation for this relation. + */ + Deprecation deprecation = 8; } /**