From 1ae74c86024081c8fb5af5c8e30237014c64aeb3 Mon Sep 17 00:00:00 2001 From: Ryan Schumacher Date: Fri, 19 Jan 2024 17:21:20 -0600 Subject: [PATCH 1/8] refactor --- examples/attributes/main.go | 40 ++--- internal/db/attributes.go | 76 +++++++-- internal/db/db.go | 231 ++------------------------ internal/db/db_migration.go | 55 +++++++ internal/db/db_test.go | 184 ++++++++++----------- internal/db/helpers.go | 6 + services/attributes/attributes.go | 258 +++++++++++------------------- 7 files changed, 324 insertions(+), 526 deletions(-) create mode 100644 internal/db/db_migration.go diff --git a/examples/attributes/main.go b/examples/attributes/main.go index d2bf0273de..5b8bf1190c 100644 --- a/examples/attributes/main.go +++ b/examples/attributes/main.go @@ -4,34 +4,13 @@ import ( "context" "log/slog" "os" + "strconv" "github.com/opentdf/opentdf-v2-poc/sdk" "github.com/opentdf/opentdf-v2-poc/sdk/attributes" - "github.com/opentdf/opentdf-v2-poc/sdk/common" ) func main() { - definition := attributes.AttributeDefinition{ - Name: "relto", - Rule: attributes.AttributeDefinition_ATTRIBUTE_RULE_TYPE_ANY_OF, - Values: []*attributes.AttributeDefinitionValue{ - { - Value: "USA", - }, - { - Value: "GBR", - }, - }, - Descriptor_: &common.ResourceDescriptor{ - Version: 1, - Namespace: "demo.com", - Fqn: "http://demo.com/attr/relto", - Description: "The relto attribute is used to describe the relationship of the resource to the country of origin. ", - Labels: map[string]string{"origin": "Country of Origin"}, - Type: common.PolicyResourceType_POLICY_RESOURCE_TYPE_ATTRIBUTE_DEFINITION, - }, - } - s, err := sdk.New("localhost:9000", sdk.WithInsecureConn()) if err != nil { slog.Error("could not connect", slog.String("error", err.Error())) @@ -40,7 +19,11 @@ func main() { defer s.Close() _, err = s.Attributes.CreateAttribute(context.Background(), &attributes.CreateAttributeRequest{ - Definition: &definition, + Attribute: &attributes.AttributeCreateUpdate{ + Name: "relto", + NamespaceId: "", + Rule: *attributes.AttributeRuleTypeEnum_ATTRIBUTE_RULE_TYPE_ENUM_ALL_OF.Enum(), + }, }) if err != nil { slog.Error("could not create attribute", slog.String("error", err.Error())) @@ -54,11 +37,16 @@ func main() { slog.Error("could not list attributes", slog.String("error", err.Error())) os.Exit(1) } - for _, attr := range allAttr.Definitions { + for _, attr := range allAttr.Attributes { + slog.Info("attribute", slog.String("id", attr.Id)) slog.Info("attribute", slog.String("name", attr.Name)) slog.Info("attribute", slog.String("rule", attr.Rule.String())) - for _, val := range attr.Values { - slog.Info("attribute", slog.String("name", attr.Name), slog.String("value", val.Value)) + slog.Info("attribute", slog.Any("metadata", attr.Metadata)) + for i, val := range attr.Values { + slog.Info("attribute: "+strconv.Itoa(i), slog.String("id", val.Id)) + slog.Info("attribute: "+strconv.Itoa(i), slog.String("value", val.Value)) + slog.Info("attribute: "+strconv.Itoa(i), slog.Any("members", val.Members)) + slog.Info("attribute: "+strconv.Itoa(i), slog.Any("metadata", val.Metadata)) } } diff --git a/internal/db/attributes.go b/internal/db/attributes.go index c0470cbab2..4fa1563ff8 100644 --- a/internal/db/attributes.go +++ b/internal/db/attributes.go @@ -8,11 +8,32 @@ import ( "github.com/opentdf/opentdf-v2-poc/sdk/attributes" ) +var AttributeTable = Schema + "." + TableAttributes +var AttributeValueTable = Schema + "." + TableAttributeValues + +func tableField(table string, field string) string { + return table + "." + field +} + +func selectAttributeValue() sq.SelectBuilder { + return newStatementBuilder().Select( + tableField(AttributeTable, "id"), + tableField(AttributeTable, "name"), + tableField(AttributeTable, "rule"), + tableField(AttributeTable, "metadata"), + `JSON_AGG( + JSON_BUILD_OBJECT( + 'id', `+tableField(AttributeValueTable, "id")+`, + 'value', `+tableField(AttributeValueTable, "value")+`, + 'members', `+tableField(AttributeValueTable, "members")+` + ) + ) AS values`, + ).Join(AttributeValueTable + " ON " + AttributeValueTable + ".id = " + AttributeTable + ".id") +} + func listAllAttributesSql() (string, []interface{}, error) { - return newStatementBuilder(). - Select("*"). - Join("attribute_definitions ON attribute_definitions.id = attribute_values.id"). - From("attribute_values"). + return selectAttributeValue(). + From(AttributeTable). ToSql() } func (c Client) ListAllAttributes(ctx context.Context) (pgx.Rows, error) { @@ -20,25 +41,21 @@ func (c Client) ListAllAttributes(ctx context.Context) (pgx.Rows, error) { return c.query(ctx, sql, args, err) } -func getAttributeByDefinitionSql(id string) (string, []interface{}, error) { - return newStatementBuilder(). - Select("*"). - Join("attribute_definitions ON attribute_definitions.id = attribute_values.id"). +func getAttributeSql(id string) (string, []interface{}, error) { + return selectAttributeValue(). Where(sq.Eq{"id": id}). - From("attribute_values"). + From(AttributeValueTable). ToSql() } func (c Client) GetAttribute(ctx context.Context, id string) (pgx.Row, error) { - sql, args, err := getAttributeByDefinitionSql(id) + sql, args, err := getAttributeSql(id) return c.queryRow(ctx, sql, args, err) } func getAttributesByNamespaceSql(namespaceId string) (string, []interface{}, error) { - return newStatementBuilder(). - Select("*"). - Join("attribute_definitions ON attribute_definitions.id = attribute_values.id"). + return selectAttributeValue(). Where(sq.Eq{"namespace_id": namespaceId}). - From("attribute_values"). + From(AttributeTable). ToSql() } func (c Client) GetAttributesByNamespace(ctx context.Context, namespaceId string) (pgx.Rows, error) { @@ -48,7 +65,7 @@ func (c Client) GetAttributesByNamespace(ctx context.Context, namespaceId string func createAttributeSql(namespaceId string, name string, rule string, metadata []byte) (string, []interface{}, error) { return newStatementBuilder(). - Insert("attribute_values"). + Insert(AttributeValueTable). Columns("namespace_id", "name", "rule", "metadata"). Values(namespaceId, name, rule, metadata). ToSql() @@ -61,3 +78,32 @@ func (c Client) CreateAttribute(ctx context.Context, attr *attributes.AttributeC sql, args, err := createAttributeSql(attr.NamespaceId, attr.Name, removeProtobufEnumPrefix(attr.Rule.String()), metadata) return c.exec(ctx, sql, args, err) } + +func updateAttributeSql(id string, name string, rule string, metadata []byte) (string, []interface{}, error) { + return newStatementBuilder(). + Update(AttributeTable). + Set("name", name). + Set("rule", rule). + Set("metadata", metadata). + Where(sq.Eq{"id": id}). + ToSql() +} +func (c Client) UpdateAttribute(ctx context.Context, id string, attr *attributes.AttributeCreateUpdate) error { + metadata, err := marshalPolicyMetadata(attr.Metadata) + if err != nil { + return err + } + sql, args, err := updateAttributeSql(id, attr.Name, removeProtobufEnumPrefix(attr.Rule.String()), metadata) + return c.exec(ctx, sql, args, err) +} + +func deleteAttributeSql(id string) (string, []interface{}, error) { + return newStatementBuilder(). + Delete(AttributeTable). + Where(sq.Eq{"id": id}). + ToSql() +} +func (c Client) DeleteAttribute(ctx context.Context, id string) error { + sql, args, err := deleteAttributeSql(id) + return c.exec(ctx, sql, args, err) +} diff --git a/internal/db/db.go b/internal/db/db.go index 9e13510f6b..4dee03fc1b 100644 --- a/internal/db/db.go +++ b/internal/db/db.go @@ -2,20 +2,26 @@ package db import ( "context" - "encoding/json" - "errors" "fmt" "log/slog" "net" - sq "github.com/Masterminds/squirrel" "github.com/jackc/pgx/v5" "github.com/jackc/pgx/v5/pgconn" "github.com/jackc/pgx/v5/pgxpool" - "github.com/jackc/pgx/v5/stdlib" - "github.com/opentdf/opentdf-v2-poc/migrations" - "github.com/opentdf/opentdf-v2-poc/sdk/common" - "github.com/pressly/goose/v3" +) + +var ( + Schema = "opentdf" + + TableAttributes = "attribute_definitions" + TableAttributeValues = "attribute_values" + TableNamespaces = "attribute_namespaces" + TableKeyAccessServerRegistry = "key_access_server" + TableAttributeKeyAccessGrants = "attribute_definition_key_access_grants" + TableAttributeValueKeyAccessGrants = "attribute_value_key_access_grants" + TableResourceMappings = "resource_mappings" + TableSubjectMappings = "subject_mappings" ) // We can rename this but wanted to get mocks working. @@ -65,217 +71,6 @@ func (c Config) buildURL() string { ) } -func (c *Client) RunMigrations() (int, error) { - var ( - applied int - ) - - if !c.config.RunMigrations { - slog.Info("skipping migrations", - slog.String("reason", "runMigrations is false"), - slog.Bool("runMigrations", c.config.RunMigrations)) - return applied, nil - } - - pool, ok := c.PgxIface.(*pgxpool.Pool) - if !ok || pool == nil { - return applied, fmt.Errorf("failed to cast pgxpool.Pool") - } - - conn := stdlib.OpenDBFromPool(pool) - defer conn.Close() - - provider, err := goose.NewProvider(goose.DialectPostgres, conn, migrations.MigrationsFS) - if err != nil { - return applied, errors.Join(fmt.Errorf("failed to create goose provider"), err) - } - - res, err := provider.Up(context.Background()) - if err != nil { - return applied, errors.Join(fmt.Errorf("failed to run migrations"), err) - } - - for _, r := range res { - if r.Error != nil { - return applied, errors.Join(fmt.Errorf("failed to run migrations"), err) - } - if !r.Empty { - applied++ - } - } - - return applied, nil -} - -func (c Client) CreateResource(ctx context.Context, - descriptor *common.ResourceDescriptor, resource []byte) error { - sql, args, err := createResourceSQL(descriptor, resource) - if err != nil { - return fmt.Errorf("failed to create resource sql: %w", err) - } - - slog.Debug("sql", slog.String("sql", sql), slog.Any("args", args)) - - _, err = c.Exec(ctx, sql, args...) - - return err -} - -func createResourceSQL(descriptor *common.ResourceDescriptor, - resource []byte) (string, []interface{}, error) { - psql := sq.StatementBuilder.PlaceholderFormat(sq.Dollar) - - builder := psql.Insert("opentdf.resources") - - builder = builder.Columns("name", "namespace", "version", "fqn", "labels", "description", "policytype", "resource") - - builder = builder.Values( - descriptor.Name, - descriptor.Namespace, - descriptor.Version, - descriptor.Fqn, - descriptor.Labels, - descriptor.Description, - descriptor.Type.String(), - resource, - ) - - //nolint:wrapcheck // Wrapped error in CreateResource - return builder.ToSql() -} - -func (c Client) ListResources(ctx context.Context, - policyType string, selectors *common.ResourceSelector) (pgx.Rows, error) { - sql, args, err := listResourceSQL(policyType, selectors) - if err != nil { - return nil, fmt.Errorf("failed to create list resource sql: %w", err) - } - - slog.Debug("sql", slog.String("sql", sql), slog.Any("args", args)) - - //nolint:rowserrcheck // Rows error check should not flag this https://github.com/jingyugao/rowserrcheck/issues/32 - return c.Query(ctx, sql, args...) -} - -func listResourceSQL(policyType string, selectors *common.ResourceSelector) (string, []interface{}, error) { - psql := sq.StatementBuilder.PlaceholderFormat(sq.Dollar) - - builder := psql.Select("id", "resource").From("opentdf.resources") - - builder = builder.Where(sq.Eq{"policytype": policyType}) - - if selectors != nil { - // Set the namespace if it is not empty - if selectors.Namespace != "" { - builder = builder.Where(sq.Eq{"namespace": selectors.Namespace}) - } - - switch selector := selectors.Selector.(type) { - case *common.ResourceSelector_Name: - builder = builder.Where(sq.Eq{"name": selector.Name}) - case *common.ResourceSelector_LabelSelector_: - bLabels, err := json.Marshal(selector.LabelSelector.Labels) - if err != nil { - return "", nil, fmt.Errorf("failed to marshal labels: %w", err) - } - builder = builder.Where(sq.Expr("labels @> ?::jsonb", bLabels)) - } - // Set the version if it is not empty - if selectors.Version != 0 { - builder = builder.Where(sq.Eq{"version": selectors.Version}) - } - } - - //nolint:wrapcheck // Wrapped error in ListResources - return builder.ToSql() -} - -func (c Client) GetResource(ctx context.Context, id int32, policyType string) (pgx.Row, error) { - sql, args, err := getResourceSQL(id, policyType) - if err != nil { - return nil, fmt.Errorf("failed to create get resource sql: %w", err) - } - - slog.Debug("sql", slog.String("sql", sql), slog.Any("args", args)) - - return c.QueryRow(ctx, sql, args...), nil -} - -func getResourceSQL(id int32, policyType string) (string, []interface{}, error) { - psql := sq.StatementBuilder.PlaceholderFormat(sq.Dollar) - - builder := psql.Select("id", "resource").From("opentdf.resources") - - builder = builder.Where(sq.Eq{"id": id, "policytype": policyType}) - - //nolint:wrapcheck // Wrapped error in GetResource - return builder.ToSql() -} - -func (c Client) UpdateResource(ctx context.Context, descriptor *common.ResourceDescriptor, - resource []byte, policyType string) error { - sql, args, err := updateResourceSQL(descriptor, resource, policyType) - if err != nil { - return fmt.Errorf("failed to create update resource sql: %w", err) - } - - slog.Debug("sql", slog.String("sql", sql), slog.Any("args", args)) - - _, err = c.Exec(ctx, sql, args...) - - return err -} - -func updateResourceSQL(descriptor *common.ResourceDescriptor, - resource []byte, policyType string) (string, []interface{}, error) { - psql := newStatementBuilder() - - builder := psql.Update("opentdf.resources") - - builder = builder.Set("name", descriptor.Name) - builder = builder.Set("namespace", descriptor.Namespace) - builder = builder.Set("version", descriptor.Version) - builder = builder.Set("description", descriptor.Description) - builder = builder.Set("fqn", descriptor.Fqn) - builder = builder.Set("labels", descriptor.Labels) - builder = builder.Set("policyType", policyType) - builder = builder.Set("resource", resource) - - builder = builder.Where(sq.Eq{"id": descriptor.Id}) - - //nolint:wrapcheck // Wrapped error in UpdateResource - return builder.ToSql() -} - -func (c Client) DeleteResource(ctx context.Context, id int32, policyType string) error { - sql, args, err := deleteResourceSQL(id, policyType) - if err != nil { - return fmt.Errorf("failed to create delete resource sql: %w", err) - } - - slog.Debug("sql", slog.String("sql", sql), slog.Any("args", args)) - - _, err = c.Exec(ctx, sql, args...) - - return err -} - -func deleteResourceSQL(id int32, policyType string) (string, []interface{}, error) { - psql := sq.StatementBuilder.PlaceholderFormat(sq.Dollar) - - builder := psql.Delete("opentdf.resources") - - builder = builder.Where(sq.Eq{"id": id, "policytype": policyType}) - - //nolint:wrapcheck // Wrapped error in DeleteResource - return builder.ToSql() -} - -// Postgres specific statement builder -func newStatementBuilder() sq.StatementBuilderType { - return sq.StatementBuilder.PlaceholderFormat(sq.Dollar) -} - // Common function for all queryRow calls func (c Client) queryRow(ctx context.Context, sql string, args []interface{}, err error) (pgx.Row, error) { if err != nil { diff --git a/internal/db/db_migration.go b/internal/db/db_migration.go new file mode 100644 index 0000000000..1e21edc6ca --- /dev/null +++ b/internal/db/db_migration.go @@ -0,0 +1,55 @@ +package db + +import ( + "context" + "errors" + "fmt" + "log/slog" + + "github.com/jackc/pgx/v5/pgxpool" + "github.com/jackc/pgx/v5/stdlib" + "github.com/opentdf/opentdf-v2-poc/migrations" + "github.com/pressly/goose/v3" +) + +func (c *Client) RunMigrations() (int, error) { + var ( + applied int + ) + + if !c.config.RunMigrations { + slog.Info("skipping migrations", + slog.String("reason", "runMigrations is false"), + slog.Bool("runMigrations", c.config.RunMigrations)) + return applied, nil + } + + pool, ok := c.PgxIface.(*pgxpool.Pool) + if !ok || pool == nil { + return applied, fmt.Errorf("failed to cast pgxpool.Pool") + } + + conn := stdlib.OpenDBFromPool(pool) + defer conn.Close() + + provider, err := goose.NewProvider(goose.DialectPostgres, conn, migrations.MigrationsFS) + if err != nil { + return applied, errors.Join(fmt.Errorf("failed to create goose provider"), err) + } + + res, err := provider.Up(context.Background()) + if err != nil { + return applied, errors.Join(fmt.Errorf("failed to run migrations"), err) + } + + for _, r := range res { + if r.Error != nil { + return applied, errors.Join(fmt.Errorf("failed to run migrations"), err) + } + if !r.Empty { + applied++ + } + } + + return applied, nil +} diff --git a/internal/db/db_test.go b/internal/db/db_test.go index 665886517d..7c66c3e7ea 100644 --- a/internal/db/db_test.go +++ b/internal/db/db_test.go @@ -1,100 +1,88 @@ package db -import ( - "context" - "testing" - - "github.com/jackc/pgx/v5" - "github.com/jackc/pgx/v5/pgconn" - "github.com/jackc/pgx/v5/pgxpool" - "github.com/opentdf/opentdf-v2-poc/sdk/acre" - "github.com/opentdf/opentdf-v2-poc/sdk/common" - "github.com/stretchr/testify/assert" -) - -var ( - //nolint:gochecknoglobals // Test data and should be reintialized for each test - resourceDescriptor = &common.ResourceDescriptor{ - Name: "relto", - Namespace: "opentdf", - Version: 1, - Fqn: "http://opentdf.com/attr/relto", - Labels: map[string]string{"origin": "Country of Origin"}, - Description: "The relto attribute is used to describe the relationship of the resource to the country of origin.", - Type: common.PolicyResourceType_POLICY_RESOURCE_TYPE_RESOURCE_ENCODING_SYNONYM, - } - - //nolint:gochecknoglobals // Test data and should be reintialized for each test - testResource = &acre.Synonyms{ - Terms: []string{"relto", "rel-to", "rel_to"}, - } -) - -func Test_RunMigrations_Returns_Expected_Applied(t *testing.T) { - client := &Client{ - PgxIface: nil, - config: Config{ - RunMigrations: false, - }, - } - - applied, err := client.RunMigrations() - - assert.Nil(t, err) - assert.Equal(t, 0, applied) -} - -func Test_RunMigrations_Returns_Error_When_PGX_Iface_Is_Nil(t *testing.T) { - client := &Client{ - PgxIface: nil, - config: Config{ - RunMigrations: true, - }, - } - - applied, err := client.RunMigrations() - - assert.ErrorContains(t, err, "failed to cast pgxpool.Pool") - assert.Equal(t, 0, applied) -} - -type BadPGX struct{} - -func (b BadPGX) Acquire(_ context.Context) (*pgxpool.Conn, error) { return &pgxpool.Conn{}, nil } -func (b BadPGX) Exec(context.Context, string, ...any) (pgconn.CommandTag, error) { - return pgconn.CommandTag{}, nil -} -func (b BadPGX) QueryRow(context.Context, string, ...any) pgx.Row { return nil } -func (b BadPGX) Query(context.Context, string, ...any) (pgx.Rows, error) { return nil, nil } -func (b BadPGX) Ping(context.Context) error { return nil } -func (b BadPGX) Close() {} -func (b BadPGX) Config() *pgxpool.Config { return nil } - -func Test_RunMigrations_Returns_Error_When_PGX_Iface_Is_Wrong_Type(t *testing.T) { - client := &Client{ - PgxIface: &BadPGX{}, - config: Config{ - RunMigrations: true, - }, - } - - applied, err := client.RunMigrations() - - assert.ErrorContains(t, err, "failed to cast pgxpool.Pool") - assert.Equal(t, 0, applied) -} - -func Test_BuildURL_Returns_Expected_Connection_String(t *testing.T) { - c := Config{ - Host: "localhost", - Port: 5432, - Database: "opentdf", - User: "postgres", - Password: "postgres", - SSLMode: "require", - } - - url := c.buildURL() - - assert.Equal(t, "postgres://postgres:postgres@localhost:5432/opentdf?sslmode=require", url) -} +// var ( +// //nolint:gochecknoglobals // Test data and should be reintialized for each test +// resourceDescriptor = &common.ResourceDescriptor{ +// Name: "relto", +// Namespace: "opentdf", +// Version: 1, +// Fqn: "http://opentdf.com/attr/relto", +// Labels: map[string]string{"origin": "Country of Origin"}, +// Description: "The relto attribute is used to describe the relationship of the resource to the country of origin.", +// Type: common.PolicyResourceType_POLICY_RESOURCE_TYPE_RESOURCE_ENCODING_SYNONYM, +// } + +// //nolint:gochecknoglobals // Test data and should be reintialized for each test +// testResource = &acre.Synonyms{ +// Terms: []string{"relto", "rel-to", "rel_to"}, +// } +// ) + +// func Test_RunMigrations_Returns_Expected_Applied(t *testing.T) { +// client := &Client{ +// PgxIface: nil, +// config: Config{ +// RunMigrations: false, +// }, +// } + +// applied, err := client.RunMigrations() + +// assert.Nil(t, err) +// assert.Equal(t, 0, applied) +// } + +// func Test_RunMigrations_Returns_Error_When_PGX_Iface_Is_Nil(t *testing.T) { +// client := &Client{ +// PgxIface: nil, +// config: Config{ +// RunMigrations: true, +// }, +// } + +// applied, err := client.RunMigrations() + +// assert.ErrorContains(t, err, "failed to cast pgxpool.Pool") +// assert.Equal(t, 0, applied) +// } + +// type BadPGX struct{} + +// func (b BadPGX) Acquire(_ context.Context) (*pgxpool.Conn, error) { return &pgxpool.Conn{}, nil } +// func (b BadPGX) Exec(context.Context, string, ...any) (pgconn.CommandTag, error) { +// return pgconn.CommandTag{}, nil +// } +// func (b BadPGX) QueryRow(context.Context, string, ...any) pgx.Row { return nil } +// func (b BadPGX) Query(context.Context, string, ...any) (pgx.Rows, error) { return nil, nil } +// func (b BadPGX) Ping(context.Context) error { return nil } +// func (b BadPGX) Close() {} +// func (b BadPGX) Config() *pgxpool.Config { return nil } + +// func Test_RunMigrations_Returns_Error_When_PGX_Iface_Is_Wrong_Type(t *testing.T) { +// client := &Client{ +// PgxIface: &BadPGX{}, +// config: Config{ +// RunMigrations: true, +// }, +// } + +// applied, err := client.RunMigrations() + +// assert.ErrorContains(t, err, "failed to cast pgxpool.Pool") +// assert.Equal(t, 0, applied) +// } + +// func Test_BuildURL_Returns_Expected_Connection_String(t *testing.T) { +// c := Config{ +// Host: "localhost", +// Port: 5432, +// Database: "opentdf", +// User: "postgres", +// Password: "postgres", +// SSLMode: "require", +// } + +// url := c.buildURL() + +// assert.Equal(t, "postgres://postgres:postgres@localhost:5432/opentdf?sslmode=require", url) +// } diff --git a/internal/db/helpers.go b/internal/db/helpers.go index cf405415b0..71acf9919f 100644 --- a/internal/db/helpers.go +++ b/internal/db/helpers.go @@ -3,6 +3,7 @@ package db import ( "strings" + sq "github.com/Masterminds/squirrel" "github.com/opentdf/opentdf-v2-poc/sdk/common" "github.com/opentdf/opentdf-v2-poc/services" "google.golang.org/grpc/codes" @@ -10,6 +11,11 @@ import ( "google.golang.org/protobuf/encoding/protojson" ) +// Postgres specific statement builder +func newStatementBuilder() sq.StatementBuilderType { + return sq.StatementBuilder.PlaceholderFormat(sq.Dollar) +} + func removeProtobufEnumPrefix(s string) string { // find the first instance of ENUM_ if strings.Contains(s, "ENUM_") { diff --git a/services/attributes/attributes.go b/services/attributes/attributes.go index 4f01faf69d..de02b81f67 100644 --- a/services/attributes/attributes.go +++ b/services/attributes/attributes.go @@ -2,6 +2,7 @@ package attributes import ( "context" + "encoding/json" "errors" "fmt" "log/slog" @@ -15,7 +16,6 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" - "google.golang.org/protobuf/encoding/protojson" ) type AttributesService struct { @@ -23,6 +23,51 @@ type AttributesService struct { dbClient *db.Client } +func attributeRuleTypeEnumTransformer(rule string) attributes.AttributeRuleTypeEnum { + rule = "ATTRIBUTE_RULE_TYPE_ENUM" + rule + return attributes.AttributeRuleTypeEnum(attributes.AttributeRuleTypeEnum_value[rule]) +} + +func hydrateAttributeValuesFromJson(v []byte) (values []*attributes.Value, err error) { + var data []struct { + Id string `json:"id,omitempty"` + Value string `json:"value,omitempty"` + Members []string `json:"members,omitempty"` + } + + if err = json.Unmarshal(v, &data); err != nil { + return nil, err + } + + for _, v := range data { + values = append(values, &attributes.Value{ + Id: v.Id, + Value: v.Value, + Members: v.Members, + }) + } + + return values, nil +} + +func hydrateMetadataFromJson(m []byte) (metadata *common.PolicyMetadata, err error) { + var data struct { + CreatedAt string `json:"createdAt,omitempty"` + UpdatedAt string `json:"updatedAt,omitempty"` + Labels map[string]string `json:"labels,omitempty"` + Description string `json:"description,omitempty"` + } + + if err = json.Unmarshal(m, &data); err != nil { + return nil, err + } + + return &common.PolicyMetadata{ + Labels: data.Labels, + Description: data.Description, + }, nil +} + func NewAttributesServer(dbClient *db.Client, g *grpc.Server, s *runtime.ServeMux) error { as := &AttributesService{ dbClient: dbClient, @@ -35,7 +80,7 @@ func NewAttributesServer(dbClient *db.Client, g *grpc.Server, s *runtime.ServeMu return nil } -func (s AttributesService) CreateAttributeDefinition(ctx context.Context, +func (s AttributesService) CreateAttribute(ctx context.Context, req *attributes.CreateAttributeRequest) (*attributes.CreateAttributeResponse, error) { slog.Debug("creating new attribute definition", slog.String("name", req.Attribute.Name)) @@ -55,185 +100,96 @@ func (s *AttributesService) ListAttributes(ctx context.Context, rows, err := s.dbClient.ListAllAttributes(ctx) if err != nil { slog.Error(services.ErrListingResource, slog.String("error", err.Error())) - return attributesList, status.Error(codes.Internal, services.ErrListingResource) + return nil, status.Error(codes.Internal, services.ErrListingResource) } defer rows.Close() for rows.Next() { var ( - id string - definition = new(attributes.Attribute) - bDefinition []byte + id string + name string + rule string + metadata []byte + values []byte ) - err = rows.Scan(&id, &bDefinition) + err = rows.Scan(&id, &name, &rule, &metadata, &values) if err != nil { slog.Error(services.ErrListingResource, slog.String("error", err.Error())) - return attributesList, status.Error(codes.Internal, services.ErrListingResource) + return nil, status.Error(codes.Internal, services.ErrListingResource) } - err = protojson.Unmarshal(bDefinition, definition) - if err != nil { - slog.Error(services.ErrListingResource, slog.String("error", err.Error())) - return attributesList, status.Error(codes.Internal, services.ErrListingResource) + attribute := &attributes.Attribute{ + Id: id, + Name: name, + Rule: attributeRuleTypeEnumTransformer(rule), } - definition.Descriptor_.Id = id - attributesList.Definitions = append(attributesList.Definitions, definition) + attributesList.Attributes = append(attributesList.Attributes, attribute) } if err := rows.Err(); err != nil { slog.Error(services.ErrListingResource, slog.String("error", err.Error())) - return attributesList, status.Error(codes.Internal, services.ErrListingResource) + return nil, status.Error(codes.Internal, services.ErrListingResource) } return attributesList, nil } -func (s *AttributesService) ListAttributeGroups(ctx context.Context, - req *attributes.ListAttributeGroupsRequest) (*attributes.ListAttributeGroupsResponse, error) { - var ( - groups = new(attributes.ListAttributeGroupsResponse) - ) - rows, err := s.dbClient.ListResources( - ctx, - common.PolicyResourceType_POLICY_RESOURCE_TYPE_ATTRIBUTE_GROUP.String(), - req.Selector, - ) - if err != nil { - slog.Error(services.ErrListingResource, slog.String("error", err.Error())) - return groups, status.Error(codes.Internal, services.ErrListingResource) - } - defer rows.Close() - for rows.Next() { - var ( - id int32 - group = new(attributes.AttributeGroup) - bGroup []byte - ) - // var tmpDefinition []byte - err = rows.Scan(&id, &bGroup) - if err != nil { - slog.Error(services.ErrListingResource, slog.String("error", err.Error())) - return groups, status.Error(codes.Internal, services.ErrListingResource) - } - - err = protojson.Unmarshal(bGroup, group) - if err != nil { - slog.Error(services.ErrListingResource, slog.String("error", err.Error())) - return groups, status.Error(codes.Internal, services.ErrListingResource) - } - - group.Descriptor_.Id = id - groups.Groups = append(groups.Groups, group) - } - - if err := rows.Err(); err != nil { - slog.Error(services.ErrListingResource, slog.String("error", err.Error())) - return groups, status.Error(codes.Internal, services.ErrListingResource) - } - - return groups, nil -} - //nolint:dupl // there probably is duplication in these crud operations but its not worth refactoring yet. func (s *AttributesService) GetAttribute(ctx context.Context, req *attributes.GetAttributeRequest) (*attributes.GetAttributeResponse, error) { var ( - definition = &attributes.GetAttributeResponse{ - Definition: new(attributes.AttributeDefinition), - } - id int32 - bDefinition []byte + id string + name string + rule string + metadata []byte + valuesJson []byte ) - row, err := s.dbClient.GetResource( + row, err := s.dbClient.GetAttribute( ctx, req.Id, - common.PolicyResourceType_POLICY_RESOURCE_TYPE_ATTRIBUTE_DEFINITION.String(), ) if err != nil { slog.Error(services.ErrGettingResource, slog.String("error", err.Error())) - return definition, status.Error(codes.Internal, services.ErrGettingResource) + return nil, status.Error(codes.Internal, services.ErrGettingResource) } - err = row.Scan(&id, &bDefinition) + err = row.Scan(&id, &name, &rule, &metadata, &valuesJson) if err != nil { if errors.Is(err, pgx.ErrNoRows) { - slog.Info(services.ErrNotFound, slog.Int("id", int(req.Id))) - return definition, status.Error(codes.NotFound, services.ErrNotFound) + slog.Info(services.ErrNotFound, slog.String("id", req.Id)) + return nil, status.Error(codes.NotFound, services.ErrNotFound) } slog.Error(services.ErrGettingResource, slog.String("error", err.Error())) - return definition, status.Error(codes.Internal, services.ErrGettingResource) + return nil, status.Error(codes.Internal, services.ErrGettingResource) } - err = protojson.Unmarshal(bDefinition, definition.Definition) + attrVals, err := hydrateAttributeValuesFromJson(valuesJson) if err != nil { slog.Error(services.ErrGettingResource, slog.String("error", err.Error())) - return definition, status.Error(codes.Internal, services.ErrGettingResource) + return nil, status.Error(codes.Internal, services.ErrGettingResource) } - definition.Definition.Descriptor_.Id = id - - return definition, nil -} - -//nolint:dupl // there probably is duplication in these crud operations but its not worth refactoring yet. -func (s *AttributesService) GetAttributeGroup(ctx context.Context, - req *attributes.GetAttributeGroupRequest) (*attributes.GetAttributeGroupResponse, error) { - var ( - group = &attributes.GetAttributeGroupResponse{ - Group: new(attributes.AttributeGroup), - } - id int32 - bGroup []byte - ) - - row, err := s.dbClient.GetResource( - ctx, - req.Id, - common.PolicyResourceType_POLICY_RESOURCE_TYPE_ATTRIBUTE_GROUP.String(), - ) - if err != nil { - slog.Error(services.ErrGettingResource, slog.String("error", err.Error())) - return group, status.Error(codes.Internal, services.ErrGettingResource) - } - - err = row.Scan(&id, &bGroup) - if err != nil { - if errors.Is(err, pgx.ErrNoRows) { - slog.Info(services.ErrNotFound, slog.Int("id", int(req.Id))) - return group, status.Error(codes.NotFound, services.ErrNotFound) - } - slog.Error(services.ErrGettingResource, slog.String("error", err.Error())) - return group, status.Error(codes.Internal, services.ErrGettingResource) - } - - err = protojson.Unmarshal(bGroup, group.Group) - if err != nil { - slog.Error(services.ErrGettingResource, slog.String("error", err.Error())) - return group, status.Error(codes.Internal, services.ErrGettingResource) + attr := &attributes.Attribute{ + Id: id, + Name: name, + Rule: attributeRuleTypeEnumTransformer(rule), + Values: attrVals, } - group.Group.Descriptor_.Id = id - - return group, nil + return &attributes.GetAttributeResponse{ + Attribute: attr, + }, nil } func (s *AttributesService) UpdateAttribute(ctx context.Context, req *attributes.UpdateAttributeRequest) (*attributes.UpdateAttributeResponse, error) { - resource, err := protojson.Marshal(req.Definition) - if err != nil { - return &attributes.UpdateAttributeResponse{}, - status.Error(codes.Internal, services.ErrCreatingResource) - } - - err = s.dbClient.UpdateResource( + if err := s.dbClient.UpdateAttribute( ctx, - req.Definition.Descriptor_, - resource, - common.PolicyResourceType_POLICY_RESOURCE_TYPE_ATTRIBUTE_DEFINITION.String(), - ) - if err != nil { + req.Id, + req.Attribute, + ); err != nil { slog.Error(services.ErrUpdatingResource, slog.String("error", err.Error())) return &attributes.UpdateAttributeResponse{}, status.Error(codes.Internal, services.ErrUpdatingResource) @@ -241,51 +197,15 @@ func (s *AttributesService) UpdateAttribute(ctx context.Context, return &attributes.UpdateAttributeResponse{}, nil } -func (s *AttributesService) UpdateAttributeGroup(ctx context.Context, - req *attributes.UpdateAttributeGroupRequest) (*attributes.UpdateAttributeGroupResponse, error) { - resource, err := protojson.Marshal(req.Group) - if err != nil { - return &attributes.UpdateAttributeGroupResponse{}, - status.Error(codes.Internal, services.ErrCreatingResource) - } - - err = s.dbClient.UpdateResource( - ctx, - req.Group.Descriptor_, resource, - common.PolicyResourceType_POLICY_RESOURCE_TYPE_ATTRIBUTE_GROUP.String(), - ) - if err != nil { - slog.Error(services.ErrUpdatingResource, slog.String("error", err.Error())) - return &attributes.UpdateAttributeGroupResponse{}, - status.Error(codes.Internal, services.ErrUpdatingResource) - } - return &attributes.UpdateAttributeGroupResponse{}, nil -} - func (s *AttributesService) DeleteAttribute(ctx context.Context, req *attributes.DeleteAttributeRequest) (*attributes.DeleteAttributeResponse, error) { - if err := s.dbClient.DeleteResource( + if err := s.dbClient.DeleteAttribute( ctx, req.Id, - common.PolicyResourceType_POLICY_RESOURCE_TYPE_ATTRIBUTE_DEFINITION.String(), ); err != nil { slog.Error(services.ErrDeletingResource, slog.String("error", err.Error())) - return &attributes.DeleteAttributeResponse{}, status.Error(codes.Internal, - services.ErrDeletingResource) + return nil, status.Error(codes.Internal, services.ErrDeletingResource) } - return &attributes.DeleteAttributeResponse{}, nil -} -func (s *AttributesService) DeleteAttributeGroup(ctx context.Context, - req *attributes.DeleteAttributeGroupRequest) (*attributes.DeleteAttributeGroupResponse, error) { - if err := s.dbClient.DeleteResource( - ctx, - req.Id, - common.PolicyResourceType_POLICY_RESOURCE_TYPE_ATTRIBUTE_GROUP.String(), - ); err != nil { - slog.Error(services.ErrDeletingResource, slog.String("error", err.Error())) - return &attributes.DeleteAttributeGroupResponse{}, - status.Error(codes.Internal, services.ErrDeletingResource) - } - return &attributes.DeleteAttributeGroupResponse{}, nil + return &attributes.DeleteAttributeResponse{}, nil } From 3ac745d9f0d0507920554301edbca9be316ca32a Mon Sep 17 00:00:00 2001 From: Ryan Schumacher Date: Sun, 21 Jan 2024 22:55:03 -0600 Subject: [PATCH 2/8] Add migrate down command --- cmd/migrate.go | 56 +++++++++++++++++++ internal/db/db_migration.go | 36 ++++++++++++ .../20240118000000_create_new_tables.sql | 19 ++++--- 3 files changed, 102 insertions(+), 9 deletions(-) create mode 100644 cmd/migrate.go diff --git a/cmd/migrate.go b/cmd/migrate.go new file mode 100644 index 0000000000..a518034bd1 --- /dev/null +++ b/cmd/migrate.go @@ -0,0 +1,56 @@ +package cmd + +import ( + "fmt" + "log/slog" + + "github.com/opentdf/opentdf-v2-poc/internal/config" + "github.com/opentdf/opentdf-v2-poc/internal/db" + "github.com/spf13/cobra" +) + +var ( + migrateCmd = &cobra.Command{ + Use: "migrate", + Short: "Run database migrations", + } + + migrateDownCmd = &cobra.Command{ + Use: "down", + Short: "Run database migrations", + Run: func(cmd *cobra.Command, args []string) { + dbClient, err := migrateDbClient() + if err != nil { + panic(fmt.Errorf("could not load config: %w", err)) + } + + res, err := dbClient.MigrationDown() + if err != nil { + panic(fmt.Errorf("migration down failed: %w", err)) + } + fmt.Print("migration down applied: ", slog.Any("res", res)) + }, + } +) + +func migrateDbClient() (*db.Client, error) { + // Load the config + conf, err := config.LoadConfig() + if err != nil { + return nil, err + } + + slog.Info("creating database client") + dbClient, err := db.NewClient(conf.DB) + if err != nil { + //nolint:wrapcheck // we want to return the error as is. the start command will wrap it + return nil, err + } + return dbClient, nil + +} + +func init() { + migrateCmd.AddCommand(migrateDownCmd) + rootCmd.AddCommand(migrateCmd) +} diff --git a/internal/db/db_migration.go b/internal/db/db_migration.go index 1e21edc6ca..6884d9b132 100644 --- a/internal/db/db_migration.go +++ b/internal/db/db_migration.go @@ -53,3 +53,39 @@ func (c *Client) RunMigrations() (int, error) { return applied, nil } + +func (c *Client) MigrationDown() (int, error) { + var ( + applied int + ) + + if !c.config.RunMigrations { + slog.Info("skipping migrations", + slog.String("reason", "runMigrations is false"), + slog.Bool("runMigrations", c.config.RunMigrations)) + return applied, nil + } + + pool, ok := c.PgxIface.(*pgxpool.Pool) + if !ok || pool == nil { + return applied, fmt.Errorf("failed to cast pgxpool.Pool") + } + + conn := stdlib.OpenDBFromPool(pool) + defer conn.Close() + + provider, err := goose.NewProvider(goose.DialectPostgres, conn, migrations.MigrationsFS) + if err != nil { + return applied, errors.Join(fmt.Errorf("failed to create goose provider"), err) + } + + res, err := provider.Down(context.Background()) + if err != nil { + return applied, errors.Join(fmt.Errorf("failed to run migrations"), err) + } + if res.Error != nil { + return applied, errors.Join(fmt.Errorf("failed to run migrations"), err) + } + + return applied, nil +} diff --git a/migrations/20240118000000_create_new_tables.sql b/migrations/20240118000000_create_new_tables.sql index e909d5bd56..0421602e96 100644 --- a/migrations/20240118000000_create_new_tables.sql +++ b/migrations/20240118000000_create_new_tables.sql @@ -7,13 +7,14 @@ CREATE TYPE subject_mappings_operator AS ENUM ('UNSPECIFIED', 'IN', 'NOT_IN'); CREATE TABLE IF NOT EXISTS opentdf.namespaces ( - id UUID PRIMARY KEY, + -- generate on create + id UUID PRIMARY KEY DEFAULT gen_random_uuid(), name VARCHAR NOT NULL UNIQUE ); CREATE TABLE IF NOT EXISTS opentdf.attribute_definitions ( - id UUID PRIMARY KEY, + id UUID PRIMARY KEY DEFAULT gen_random_uuid(), namespace_id UUID NOT NULL REFERENCES opentdf.namespaces(id), name VARCHAR NOT NULL, rule attribute_definition_rule NOT NULL, @@ -23,7 +24,7 @@ CREATE TABLE IF NOT EXISTS opentdf.attribute_definitions CREATE TABLE IF NOT EXISTS opentdf.attribute_values ( - id UUID PRIMARY KEY, + id UUID PRIMARY KEY DEFAULT gen_random_uuid(), attribute_definition_id UUID NOT NULL REFERENCES opentdf.attribute_definitions(id), value VARCHAR NOT NULL, members UUID[] NOT NULL, @@ -33,7 +34,7 @@ CREATE TABLE IF NOT EXISTS opentdf.attribute_values CREATE TABLE IF NOT EXISTS opentdf.key_access_servers ( - id UUID PRIMARY KEY, + id UUID PRIMARY KEY DEFAULT gen_random_uuid(), key_access_server VARCHAR NOT NULL UNIQUE, public_key VARCHAR NOT NULL, metadata JSONB @@ -55,7 +56,7 @@ CREATE TABLE IF NOT EXISTS opentdf.attribute_value_key_access_grants CREATE TABLE IF NOT EXISTS opentdf.resource_mappings ( - id UUID PRIMARY KEY, + id UUID PRIMARY KEY DEFAULT gen_random_uuid(), attribute_value_id UUID NOT NULL REFERENCES opentdf.attribute_values(id), name VARCHAR NOT NULL, terms VARCHAR[], @@ -64,7 +65,7 @@ CREATE TABLE IF NOT EXISTS opentdf.resource_mappings CREATE TABLE IF NOT EXISTS opentdf.subject_mappings ( - id UUID PRIMARY KEY, + id UUID PRIMARY KEY DEFAULT gen_random_uuid(), attribute_value_id UUID NOT NULL REFERENCES opentdf.attribute_values(id), operator subject_mappings_operator NOT NULL, subject_attribute VARCHAR NOT NULL, @@ -75,15 +76,15 @@ CREATE TABLE IF NOT EXISTS opentdf.subject_mappings -- +goose Down -- +goose StatementBegin -DROP TABLE IF EXISTS opentdf.key_access_servers; DROP TABLE IF EXISTS opentdf.subject_mappings; DROP TABLE IF EXISTS opentdf.resource_mappings; DROP TABLE IF EXISTS opentdf.attribute_value_key_access_grants; DROP TABLE IF EXISTS opentdf.attribute_definition_key_access_grants; +DROP TABLE IF EXISTS opentdf.key_access_servers; DROP TABLE IF EXISTS opentdf.attribute_values; DROP TABLE IF EXISTS opentdf.attribute_definitions; DROP TABLE IF EXISTS opentdf.namespaces; -DELETE TYPE attribute_definition_rule; -DELETE TYPE subject_mappings_operator; +DROP TYPE attribute_definition_rule; +DROP TYPE subject_mappings_operator; -- +goose StatementEnd \ No newline at end of file From c6f1ccc879cfe2c274b167d82564dadcb58317d0 Mon Sep 17 00:00:00 2001 From: Ryan Schumacher Date: Sun, 21 Jan 2024 22:55:41 -0600 Subject: [PATCH 3/8] Fix sql command --- internal/db/attributes.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/internal/db/attributes.go b/internal/db/attributes.go index 4fa1563ff8..3146ba73fc 100644 --- a/internal/db/attributes.go +++ b/internal/db/attributes.go @@ -28,7 +28,9 @@ func selectAttributeValue() sq.SelectBuilder { 'members', `+tableField(AttributeValueTable, "members")+` ) ) AS values`, - ).Join(AttributeValueTable + " ON " + AttributeValueTable + ".id = " + AttributeTable + ".id") + ). + LeftJoin(AttributeValueTable + " ON " + AttributeValueTable + ".id = " + AttributeTable + ".id"). + GroupBy(tableField(AttributeTable, "id")) } func listAllAttributesSql() (string, []interface{}, error) { @@ -65,7 +67,7 @@ func (c Client) GetAttributesByNamespace(ctx context.Context, namespaceId string func createAttributeSql(namespaceId string, name string, rule string, metadata []byte) (string, []interface{}, error) { return newStatementBuilder(). - Insert(AttributeValueTable). + Insert(AttributeTable). Columns("namespace_id", "name", "rule", "metadata"). Values(namespaceId, name, rule, metadata). ToSql() From f4c393420d8118ce6691943269400a7b9b2ad4a5 Mon Sep 17 00:00:00 2001 From: Ryan Schumacher Date: Sun, 21 Jan 2024 22:56:21 -0600 Subject: [PATCH 4/8] Use protojson.Unmarshal with json.RawMessage --- services/attributes/attributes.go | 84 ++++++++++++------------------- 1 file changed, 32 insertions(+), 52 deletions(-) diff --git a/services/attributes/attributes.go b/services/attributes/attributes.go index de02b81f67..296976d112 100644 --- a/services/attributes/attributes.go +++ b/services/attributes/attributes.go @@ -16,6 +16,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" + "google.golang.org/protobuf/encoding/protojson" ) type AttributesService struct { @@ -28,46 +29,6 @@ func attributeRuleTypeEnumTransformer(rule string) attributes.AttributeRuleTypeE return attributes.AttributeRuleTypeEnum(attributes.AttributeRuleTypeEnum_value[rule]) } -func hydrateAttributeValuesFromJson(v []byte) (values []*attributes.Value, err error) { - var data []struct { - Id string `json:"id,omitempty"` - Value string `json:"value,omitempty"` - Members []string `json:"members,omitempty"` - } - - if err = json.Unmarshal(v, &data); err != nil { - return nil, err - } - - for _, v := range data { - values = append(values, &attributes.Value{ - Id: v.Id, - Value: v.Value, - Members: v.Members, - }) - } - - return values, nil -} - -func hydrateMetadataFromJson(m []byte) (metadata *common.PolicyMetadata, err error) { - var data struct { - CreatedAt string `json:"createdAt,omitempty"` - UpdatedAt string `json:"updatedAt,omitempty"` - Labels map[string]string `json:"labels,omitempty"` - Description string `json:"description,omitempty"` - } - - if err = json.Unmarshal(m, &data); err != nil { - return nil, err - } - - return &common.PolicyMetadata{ - Labels: data.Labels, - Description: data.Description, - }, nil -} - func NewAttributesServer(dbClient *db.Client, g *grpc.Server, s *runtime.ServeMux) error { as := &AttributesService{ dbClient: dbClient, @@ -139,11 +100,11 @@ func (s *AttributesService) ListAttributes(ctx context.Context, func (s *AttributesService) GetAttribute(ctx context.Context, req *attributes.GetAttributeRequest) (*attributes.GetAttributeResponse, error) { var ( - id string - name string - rule string - metadata []byte - valuesJson []byte + id string + name string + rule string + metadataJson []byte + valuesJson []byte ) row, err := s.dbClient.GetAttribute( @@ -155,7 +116,7 @@ func (s *AttributesService) GetAttribute(ctx context.Context, return nil, status.Error(codes.Internal, services.ErrGettingResource) } - err = row.Scan(&id, &name, &rule, &metadata, &valuesJson) + err = row.Scan(&id, &name, &rule, &metadataJson, &valuesJson) if err != nil { if errors.Is(err, pgx.ErrNoRows) { slog.Info(services.ErrNotFound, slog.String("id", req.Id)) @@ -165,17 +126,36 @@ func (s *AttributesService) GetAttribute(ctx context.Context, return nil, status.Error(codes.Internal, services.ErrGettingResource) } - attrVals, err := hydrateAttributeValuesFromJson(valuesJson) - if err != nil { + var metadata common.PolicyMetadata + if metadataJson != nil { + if err := protojson.Unmarshal(metadataJson, &metadata); err != nil { + slog.Error(services.ErrGettingResource, slog.String("error", err.Error())) + return nil, status.Error(codes.Internal, services.ErrGettingResource) + } + } + + var raw []json.RawMessage + if err := json.Unmarshal(valuesJson, &raw); err != nil { slog.Error(services.ErrGettingResource, slog.String("error", err.Error())) return nil, status.Error(codes.Internal, services.ErrGettingResource) } + values := make([]*attributes.Value, 0) + for _, r := range raw { + value := attributes.Value{} + if err := protojson.Unmarshal(r, &value); err != nil { + slog.Error(services.ErrGettingResource, slog.String("error", err.Error())) + return nil, status.Error(codes.Internal, services.ErrGettingResource) + } + values = append(values, &value) + } + attr := &attributes.Attribute{ - Id: id, - Name: name, - Rule: attributeRuleTypeEnumTransformer(rule), - Values: attrVals, + Id: id, + Name: name, + Rule: attributeRuleTypeEnumTransformer(rule), + Values: values, + Metadata: &metadata, } return &attributes.GetAttributeResponse{ From cb6f0e8225b8af43c5a85ed85d0ab6284122a5a8 Mon Sep 17 00:00:00 2001 From: Ryan Schumacher Date: Sun, 21 Jan 2024 22:56:39 -0600 Subject: [PATCH 5/8] Add examples to proto --- proto/attributes/attributes.proto | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/proto/attributes/attributes.proto b/proto/attributes/attributes.proto index 7cb75b0c23..1587cf2917 100644 --- a/proto/attributes/attributes.proto +++ b/proto/attributes/attributes.proto @@ -170,12 +170,20 @@ message DeleteValueResponse {} /// Attribute Service /// service AttributesService { + /* + List Attributes + Example: + grpcurl -plaintext -d '{"namespace_id": "namespace_id"}' localhost:8080 attributes.AttributesService/ListAttributes + */ rpc ListAttributes(ListAttributesRequest) returns (ListAttributesResponse) {} rpc GetAttribute(GetAttributeRequest) returns (GetAttributeResponse) { option (google.api.http) = {get: "/attributes/{id}"}; } + // Create Attribute + // Example: + // grpcurl -plaintext -d '{"attribute": {"namespace_id": "namespace_id", "name": "attribute_name", "rule": "ATTRIBUTE_RULE_TYPE_ENUM_ALL_OF"}}' localhost:8080 attributes.AttributesService/CreateAttribute rpc CreateAttribute(CreateAttributeRequest) returns (CreateAttributeResponse) { option (google.api.http) = { post: "/attributes" @@ -199,6 +207,9 @@ service AttributesService { option (google.api.http) = {get: "/attributes/_/values/{id}"}; } + // Create Attribute Value + // Example: + // grpcurl -plaintext -d '{"attribute_id": "attribute_id", "value": {"value": "value"}}' localhost:8080 attributes.AttributesService/CreateValue rpc CreateValue(CreateValueRequest) returns (CreateValueResponse) { option (google.api.http) = { post: "/attributes/{attribute_id}/values" From f388b959b84c5e8712b2ad6c6c4f2597480aef66 Mon Sep 17 00:00:00 2001 From: Ryan Schumacher Date: Mon, 22 Jan 2024 15:47:09 -0600 Subject: [PATCH 6/8] Update attributes based on feedback --- internal/db/attributes.go | 269 ++++++- internal/db/db.go | 34 +- internal/db/helpers.go | 34 - internal/db/metadata.go | 48 ++ proto/attributes/attributes.proto | 12 +- proto/common/common.proto | 4 +- .../key_access_server_registry.proto | 2 +- proto/resourcemapping/resource_mapping.proto | 2 +- proto/subjectmapping/subject_mapping.proto | 2 +- sdk/attributes/attributes.pb.go | 570 ++++++++------- sdk/attributes/attributes_grpc.pb.go | 22 + sdk/common/common.pb.go | 142 ++-- .../key_access_server_registry.pb.go | 282 ++++---- sdk/resourcemapping/resource_mapping.pb.go | 233 +++--- sdk/subjectmapping/subject_mapping.pb.go | 262 +++---- services/attributes/attributes.go | 137 +--- services/attributes/attributes_test.gox | 679 ++++++++++++++++++ 17 files changed, 1795 insertions(+), 939 deletions(-) delete mode 100644 internal/db/helpers.go create mode 100644 internal/db/metadata.go create mode 100644 services/attributes/attributes_test.gox diff --git a/internal/db/attributes.go b/internal/db/attributes.go index 3146ba73fc..ab72a621ed 100644 --- a/internal/db/attributes.go +++ b/internal/db/attributes.go @@ -2,67 +2,222 @@ package db import ( "context" + "encoding/json" + "log/slog" + "strings" sq "github.com/Masterminds/squirrel" "github.com/jackc/pgx/v5" "github.com/opentdf/opentdf-v2-poc/sdk/attributes" + "github.com/opentdf/opentdf-v2-poc/sdk/common" + "github.com/opentdf/opentdf-v2-poc/services" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + "google.golang.org/protobuf/encoding/protojson" ) -var AttributeTable = Schema + "." + TableAttributes -var AttributeValueTable = Schema + "." + TableAttributeValues +var AttributeTable = tableName(TableAttributes) +var AttributeValueTable = tableName(TableAttributeValues) +var AttributeRuleTypeEnumPrefix = "ATTRIBUTE_RULE_TYPE_ENUM_" -func tableField(table string, field string) string { - return table + "." + field +func attributesRuleTypeEnumTransformIn(value string) string { + return strings.TrimPrefix(value, AttributeRuleTypeEnumPrefix) } -func selectAttributeValue() sq.SelectBuilder { +func attributesRuleTypeEnumTransformOut(value string) attributes.AttributeRuleTypeEnum { + return attributes.AttributeRuleTypeEnum(attributes.AttributeRuleTypeEnum_value[AttributeRuleTypeEnumPrefix+value]) +} + +func attributesValuesProtojson(valuesJson []byte, values []*attributes.Value) error { + var raw []json.RawMessage + if err := json.Unmarshal(valuesJson, &raw); err != nil { + return err + } + + for _, r := range raw { + value := attributes.Value{} + if err := protojson.Unmarshal(r, &value); err != nil { + return err + } + values = append(values, &value) + } + return nil +} + +func attributesSelect() sq.SelectBuilder { return newStatementBuilder().Select( tableField(AttributeTable, "id"), tableField(AttributeTable, "name"), tableField(AttributeTable, "rule"), tableField(AttributeTable, "metadata"), - `JSON_AGG( - JSON_BUILD_OBJECT( - 'id', `+tableField(AttributeValueTable, "id")+`, - 'value', `+tableField(AttributeValueTable, "value")+`, - 'members', `+tableField(AttributeValueTable, "members")+` - ) - ) AS values`, + "JSON_AGG("+ + "JSON_BUILD_OBJECT("+ + "'id', "+tableField(AttributeValueTable, "id")+", "+ + "'value', "+tableField(AttributeValueTable, "value")+","+ + "'members', "+tableField(AttributeValueTable, "members")+ + ")"+ + ") AS values", ). LeftJoin(AttributeValueTable + " ON " + AttributeValueTable + ".id = " + AttributeTable + ".id"). GroupBy(tableField(AttributeTable, "id")) } +func attributesHydrateItem(row pgx.Row) (*attributes.Attribute, error) { + var ( + id string + name string + rule string + metadataJson []byte + valuesJson []byte + ) + err := row.Scan(&id, &name, &rule, &metadataJson, &valuesJson) + if err != nil { + if err == pgx.ErrNoRows { + return nil, err + } + return nil, err + } + + m := &common.Metadata{} + if metadataJson != nil { + if err := protojson.Unmarshal(metadataJson, m); err != nil { + return nil, err + } + } + + v := make([]*attributes.Value, 0) + if valuesJson != nil { + if err := attributesValuesProtojson(valuesJson, v); err != nil { + return nil, err + } + } + + attr := &attributes.Attribute{ + Id: id, + Name: name, + Rule: attributesRuleTypeEnumTransformOut(rule), + Metadata: m, + Values: v, + } + + return attr, nil +} + +func attributesHydrateList(rows pgx.Rows) ([]*attributes.Attribute, error) { + list := make([]*attributes.Attribute, 0) + for rows.Next() { + slog.Info("next") + var ( + id string + name string + rule string + metadataJson []byte + valuesJson []byte + ) + err := rows.Scan(&id, &name, &rule, &metadataJson, &valuesJson) + if err != nil { + return nil, err + } + + attribute := &attributes.Attribute{ + Id: id, + Name: name, + Rule: attributesRuleTypeEnumTransformOut(rule), + } + + if metadataJson != nil { + m := &common.Metadata{} + if err := protojson.Unmarshal(metadataJson, m); err != nil { + return nil, err + } + attribute.Metadata = m + } + + if valuesJson != nil { + v := make([]*attributes.Value, 0) + if err := attributesValuesProtojson(valuesJson, v); err != nil { + return nil, err + } + attribute.Values = v + } + + list = append(list, attribute) + } + return list, nil +} + +/// +// CRUD operations +/// + func listAllAttributesSql() (string, []interface{}, error) { - return selectAttributeValue(). + return attributesSelect(). From(AttributeTable). ToSql() } -func (c Client) ListAllAttributes(ctx context.Context) (pgx.Rows, error) { +func (c Client) ListAllAttributes(ctx context.Context) ([]*attributes.Attribute, error) { sql, args, err := listAllAttributesSql() - return c.query(ctx, sql, args, err) + rows, err := c.query(ctx, sql, args, err) + if err != nil { + return nil, err + } + defer rows.Close() + + list, err := attributesHydrateList(rows) + if err != nil { + slog.Error(services.ErrGettingResource, slog.String("error", err.Error())) + return nil, status.Error(codes.Internal, services.ErrGettingResource) + } + slog.Info("list", slog.Any("list", list)) + + return list, nil } func getAttributeSql(id string) (string, []interface{}, error) { - return selectAttributeValue(). - Where(sq.Eq{"id": id}). - From(AttributeValueTable). + return attributesSelect(). + Where(sq.Eq{tableField(AttributeTable, "id"): id}). + From(AttributeTable). ToSql() } -func (c Client) GetAttribute(ctx context.Context, id string) (pgx.Row, error) { +func (c Client) GetAttribute(ctx context.Context, id string) (*attributes.Attribute, error) { sql, args, err := getAttributeSql(id) - return c.queryRow(ctx, sql, args, err) + row, err := c.queryRow(ctx, sql, args, err) + if err != nil { + slog.Error(services.ErrGettingResource, slog.String("error", err.Error())) + return nil, status.Error(codes.Internal, services.ErrGettingResource) + } + + attribute, err := attributesHydrateItem(row) + if err != nil { + slog.Error("could not hydrate item", slog.String("error", err.Error())) + return nil, status.Error(codes.Internal, services.ErrGettingResource) + } + + return attribute, nil } func getAttributesByNamespaceSql(namespaceId string) (string, []interface{}, error) { - return selectAttributeValue(). + return attributesSelect(). Where(sq.Eq{"namespace_id": namespaceId}). From(AttributeTable). ToSql() } -func (c Client) GetAttributesByNamespace(ctx context.Context, namespaceId string) (pgx.Rows, error) { +func (c Client) GetAttributesByNamespace(ctx context.Context, namespaceId string) ([]*attributes.Attribute, error) { sql, args, err := getAttributesByNamespaceSql(namespaceId) - return c.query(ctx, sql, args, err) + + rows, err := c.query(ctx, sql, args, err) + if err != nil { + return nil, status.Error(codes.Internal, services.ErrListingResource) + } + defer rows.Close() + + list, err := attributesHydrateList(rows) + if err != nil { + slog.Error(services.ErrGettingResource, slog.String("error", err.Error())) + return nil, status.Error(codes.Internal, services.ErrGettingResource) + } + + return list, nil } func createAttributeSql(namespaceId string, name string, rule string, metadata []byte) (string, []interface{}, error) { @@ -70,15 +225,34 @@ func createAttributeSql(namespaceId string, name string, rule string, metadata [ Insert(AttributeTable). Columns("namespace_id", "name", "rule", "metadata"). Values(namespaceId, name, rule, metadata). + Suffix("RETURNING \"id\""). ToSql() } -func (c Client) CreateAttribute(ctx context.Context, attr *attributes.AttributeCreateUpdate) error { - metadata, err := marshalPolicyMetadata(attr.Metadata) +func (c Client) CreateAttribute(ctx context.Context, attr *attributes.AttributeCreateUpdate) (*attributes.Attribute, error) { + metadataJson, metadata, err := marshalCreateMetadata(attr.Metadata) if err != nil { - return err + return nil, status.Error(codes.Internal, services.ErrCreatingResource) } - sql, args, err := createAttributeSql(attr.NamespaceId, attr.Name, removeProtobufEnumPrefix(attr.Rule.String()), metadata) - return c.exec(ctx, sql, args, err) + + sql, args, err := createAttributeSql(attr.NamespaceId, attr.Name, attributesRuleTypeEnumTransformIn(attr.Rule.String()), metadataJson) + // TODO: abstract error checking to be DRY + // TODO: check for constraint violation + // - duplicate name + // - namespace id exists + var id string + if r, err := c.queryRow(ctx, sql, args, err); err != nil { + return nil, status.Error(codes.Internal, services.ErrCreatingResource) + } else if err := r.Scan(&id); err != nil { + return nil, status.Error(codes.Internal, services.ErrCreatingResource) + } + + a := &attributes.Attribute{ + Id: id, + Name: attr.Name, + Rule: attr.Rule, + Metadata: metadata, + } + return a, nil } func updateAttributeSql(id string, name string, rule string, metadata []byte) (string, []interface{}, error) { @@ -90,13 +264,26 @@ func updateAttributeSql(id string, name string, rule string, metadata []byte) (s Where(sq.Eq{"id": id}). ToSql() } -func (c Client) UpdateAttribute(ctx context.Context, id string, attr *attributes.AttributeCreateUpdate) error { - metadata, err := marshalPolicyMetadata(attr.Metadata) +func (c Client) UpdateAttribute(ctx context.Context, id string, attr *attributes.AttributeCreateUpdate) (*attributes.Attribute, error) { + // get attribute before updating + a, err := c.GetAttribute(ctx, id) if err != nil { - return err + slog.Error(services.ErrDeletingResource, slog.String("scope", "getAttribute"), slog.String("error", err.Error())) + return nil, status.Error(status.Code(err), services.ErrUpdatingResource) + } + + metadataJson, _, err := marshalUpdateMetadata(a.Metadata, attr.Metadata) + if err != nil { + return nil, status.Error(codes.Internal, services.ErrUpdatingResource) + } + + sql, args, err := updateAttributeSql(id, attr.Name, attributesRuleTypeEnumTransformIn(attr.Rule.String()), metadataJson) + if err := c.exec(ctx, sql, args, err); err != nil { + return nil, status.Error(codes.Internal, services.ErrUpdatingResource) } - sql, args, err := updateAttributeSql(id, attr.Name, removeProtobufEnumPrefix(attr.Rule.String()), metadata) - return c.exec(ctx, sql, args, err) + + // return the attribute before updating + return a, nil } func deleteAttributeSql(id string) (string, []interface{}, error) { @@ -105,7 +292,19 @@ func deleteAttributeSql(id string) (string, []interface{}, error) { Where(sq.Eq{"id": id}). ToSql() } -func (c Client) DeleteAttribute(ctx context.Context, id string) error { +func (c Client) DeleteAttribute(ctx context.Context, id string) (*attributes.Attribute, error) { + // get attribute before deleting + a, err := c.GetAttribute(ctx, id) + if err != nil { + return nil, status.Error(status.Code(err), services.ErrDeletingResource) + } + sql, args, err := deleteAttributeSql(id) - return c.exec(ctx, sql, args, err) + + if err := c.exec(ctx, sql, args, err); err != nil { + return nil, status.Error(codes.Internal, services.ErrDeletingResource) + } + + // return the attribute before deleting + return a, nil } diff --git a/internal/db/db.go b/internal/db/db.go index 4dee03fc1b..df255ef98b 100644 --- a/internal/db/db.go +++ b/internal/db/db.go @@ -6,6 +6,7 @@ import ( "log/slog" "net" + sq "github.com/Masterminds/squirrel" "github.com/jackc/pgx/v5" "github.com/jackc/pgx/v5/pgconn" "github.com/jackc/pgx/v5/pgxpool" @@ -73,31 +74,46 @@ func (c Config) buildURL() string { // Common function for all queryRow calls func (c Client) queryRow(ctx context.Context, sql string, args []interface{}, err error) (pgx.Row, error) { + slog.Debug("sql", slog.String("sql", sql), slog.Any("args", args)) if err != nil { - slog.Debug("sql", slog.String("sql", sql), slog.Any("args", args)) - return nil, fmt.Errorf("failed to create get resource sql: %w", err) + slog.Error("sql.error", "failed to query get resource sql", slog.String("error", err.Error())) + return nil, err } - slog.Debug("sql", slog.String("sql", sql), slog.Any("args", args)) return c.QueryRow(ctx, sql, args...), nil } // Common function for all query calls func (c Client) query(ctx context.Context, sql string, args []interface{}, err error) (pgx.Rows, error) { + slog.Debug("sql", slog.String("sql", sql), slog.Any("args", args)) if err != nil { - slog.Debug("sql", slog.String("sql", sql), slog.Any("args", args)) - return nil, fmt.Errorf("failed to create list resource sql: %w", err) + return nil, err } - slog.Debug("sql", slog.String("sql", sql), slog.Any("args", args)) return c.Query(ctx, sql, args...) } // Common function for all exec calls func (c Client) exec(ctx context.Context, sql string, args []interface{}, err error) error { + slog.Debug("sql", slog.String("sql", sql), slog.Any("args", args)) if err != nil { - slog.Debug("sql", slog.String("sql", sql), slog.Any("args", args)) - return fmt.Errorf("failed to create list resource sql: %w", err) + return err } - slog.Debug("sql", slog.String("sql", sql), slog.Any("args", args)) _, err = c.Exec(ctx, sql, args...) return err } + +// +// Helper functions for building SQL +// + +// Postgres uses $1, $2, etc. for placeholders +func newStatementBuilder() sq.StatementBuilderType { + return sq.StatementBuilder.PlaceholderFormat(sq.Dollar) +} + +func tableName(table string) string { + return Schema + "." + table +} + +func tableField(table string, field string) string { + return table + "." + field +} diff --git a/internal/db/helpers.go b/internal/db/helpers.go deleted file mode 100644 index 71acf9919f..0000000000 --- a/internal/db/helpers.go +++ /dev/null @@ -1,34 +0,0 @@ -package db - -import ( - "strings" - - sq "github.com/Masterminds/squirrel" - "github.com/opentdf/opentdf-v2-poc/sdk/common" - "github.com/opentdf/opentdf-v2-poc/services" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" - "google.golang.org/protobuf/encoding/protojson" -) - -// Postgres specific statement builder -func newStatementBuilder() sq.StatementBuilderType { - return sq.StatementBuilder.PlaceholderFormat(sq.Dollar) -} - -func removeProtobufEnumPrefix(s string) string { - // find the first instance of ENUM_ - if strings.Contains(s, "ENUM_") { - // remove everything left of it - return s[strings.Index(s, "ENUM_")+5:] - } - return s -} - -func marshalPolicyMetadata(metadata *common.PolicyMetadataMutable) ([]byte, error) { - if m, err := protojson.Marshal(metadata); err != nil { - return nil, status.Error(codes.Internal, services.ErrCreatingResource) - } else { - return m, nil - } -} diff --git a/internal/db/metadata.go b/internal/db/metadata.go new file mode 100644 index 0000000000..749762cf08 --- /dev/null +++ b/internal/db/metadata.go @@ -0,0 +1,48 @@ +package db + +import ( + "github.com/opentdf/opentdf-v2-poc/sdk/common" + "google.golang.org/protobuf/encoding/protojson" + "google.golang.org/protobuf/types/known/timestamppb" +) + +type ImmutableMetadata struct { + CreatedAt *timestamppb.Timestamp + UpdatedAt *timestamppb.Timestamp +} + +type MutableMetadata struct { + Labels map[string]string + Description string +} + +// Marshal policy metadata is used by the marshalCreateMetadata and marshalUpdateMetadata functions to enable +// the creation and update of policy metadata without exposing it to developers. Take note of the immutableMetadata and +// mutableMetadata parameters. The mutableMetadata is the metadata that is passed in by the developer. The immutableMetadata +// is created by the service. +func marshalMetadata(mutableMetadata *common.MetadataMutable, immutableMetadata *common.Metadata) ([]byte, *common.Metadata, error) { + m := &common.Metadata{ + CreatedAt: immutableMetadata.GetCreatedAt(), + UpdatedAt: immutableMetadata.GetUpdatedAt(), + Labels: mutableMetadata.GetLabels(), + Description: mutableMetadata.GetDescription(), + } + mJson, err := protojson.Marshal(m) + return mJson, m, err +} + +func marshalCreateMetadata(metadata *common.MetadataMutable) ([]byte, *common.Metadata, error) { + m := &common.Metadata{ + CreatedAt: timestamppb.Now(), + UpdatedAt: timestamppb.Now(), + } + return marshalMetadata(metadata, m) +} + +func marshalUpdateMetadata(existingMetadata *common.Metadata, metadata *common.MetadataMutable) ([]byte, *common.Metadata, error) { + m := &common.Metadata{ + CreatedAt: existingMetadata.GetCreatedAt(), + UpdatedAt: timestamppb.Now(), + } + return marshalMetadata(metadata, m) +} diff --git a/proto/attributes/attributes.proto b/proto/attributes/attributes.proto index 1587cf2917..9da4b0efa4 100644 --- a/proto/attributes/attributes.proto +++ b/proto/attributes/attributes.proto @@ -19,7 +19,7 @@ message Attribute { string id = 1; // Optional metadata for the attribute definition - common.PolicyMetadata metadata = 2; + common.Metadata metadata = 2; // TODO: enable this when merging with Jake's work // namespace.Namespace namespace = 3; @@ -38,7 +38,7 @@ message Attribute { message AttributeCreateUpdate { // Optional metadata for the attribute definition - common.PolicyMetadataMutable metadata = 1; + common.MetadataMutable metadata = 1; // namespace of the attribute string namespace_id = 2 [(buf.validate.field).required = true]; @@ -60,7 +60,7 @@ message Value { // generated uuid in database string id = 1; - common.PolicyMetadata metadata = 2; + common.Metadata metadata = 2; string attribute_definition_id = 3 [(buf.validate.field).required = true]; @@ -72,7 +72,7 @@ message Value { // Definition of a single attribute value message ValueCreateUpdate { - common.PolicyMetadataMutable metadata = 1; + common.MetadataMutable metadata = 1; string value = 2; @@ -128,7 +128,9 @@ message UpdateAttributeResponse { message DeleteAttributeRequest { string id = 1 [(buf.validate.field).required = true]; } -message DeleteAttributeResponse {} +message DeleteAttributeResponse { + Attribute attribute = 1; +} /// /// Value RPC messages diff --git a/proto/common/common.proto b/proto/common/common.proto index 8a397186db..b74a3e3970 100644 --- a/proto/common/common.proto +++ b/proto/common/common.proto @@ -5,7 +5,7 @@ package common; import "google/protobuf/timestamp.proto"; // Struct to uniquely identify a resource with optional additional metadata -message PolicyMetadata { +message Metadata { // created_at set by server (entity who created will recorded in an audit event) google.protobuf.Timestamp created_at = 1; // updated_at set by server (entity who updated will recorded in an audit event) @@ -16,7 +16,7 @@ message PolicyMetadata { string description = 4; } -message PolicyMetadataMutable { +message MetadataMutable { // optional short description map labels = 3; // optional long description diff --git a/proto/keyaccessserverregistry/key_access_server_registry.proto b/proto/keyaccessserverregistry/key_access_server_registry.proto index 0fd72026a0..ad71dcae75 100644 --- a/proto/keyaccessserverregistry/key_access_server_registry.proto +++ b/proto/keyaccessserverregistry/key_access_server_registry.proto @@ -10,7 +10,7 @@ import "google/api/annotations.proto"; Descriptor for a KAS */ message KeyAccessServer { - common.PolicyMetadata metadata = 1; + common.Metadata metadata = 1; string id = 2; diff --git a/proto/resourcemapping/resource_mapping.proto b/proto/resourcemapping/resource_mapping.proto index 20d0eaf5be..9cd4915af3 100644 --- a/proto/resourcemapping/resource_mapping.proto +++ b/proto/resourcemapping/resource_mapping.proto @@ -47,7 +47,7 @@ import "google/api/annotations.proto"; */ message ResourceMapping { - common.PolicyMetadata metadata = 1; + common.Metadata metadata = 1; string name = 2; diff --git a/proto/subjectmapping/subject_mapping.proto b/proto/subjectmapping/subject_mapping.proto index caa26da9e9..e619283ce8 100644 --- a/proto/subjectmapping/subject_mapping.proto +++ b/proto/subjectmapping/subject_mapping.proto @@ -58,7 +58,7 @@ import "google/api/annotations.proto"; */ message SubjectMapping { - common.PolicyMetadata metadata = 1; + common.Metadata metadata = 1; // buflint ENUM_VALUE_PREFIX: to make sure that C++ scoping rules aren't violated when users add new enum values to an enum in a given package enum SubjectMappingOperatorEnum { diff --git a/sdk/attributes/attributes.pb.go b/sdk/attributes/attributes.pb.go index b7ca473f0e..5014d62bfb 100644 --- a/sdk/attributes/attributes.pb.go +++ b/sdk/attributes/attributes.pb.go @@ -84,7 +84,7 @@ type Attribute struct { // Namespace namespace = 1; Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // Optional metadata for the attribute definition - Metadata *common.PolicyMetadata `protobuf:"bytes,2,opt,name=metadata,proto3" json:"metadata,omitempty"` + Metadata *common.Metadata `protobuf:"bytes,2,opt,name=metadata,proto3" json:"metadata,omitempty"` // attribute name Name string `protobuf:"bytes,5,opt,name=name,proto3" json:"name,omitempty"` // attribute rule enum @@ -131,7 +131,7 @@ func (x *Attribute) GetId() string { return "" } -func (x *Attribute) GetMetadata() *common.PolicyMetadata { +func (x *Attribute) GetMetadata() *common.Metadata { if x != nil { return x.Metadata } @@ -165,7 +165,7 @@ type AttributeCreateUpdate struct { unknownFields protoimpl.UnknownFields // Optional metadata for the attribute definition - Metadata *common.PolicyMetadataMutable `protobuf:"bytes,1,opt,name=metadata,proto3" json:"metadata,omitempty"` + Metadata *common.MetadataMutable `protobuf:"bytes,1,opt,name=metadata,proto3" json:"metadata,omitempty"` // namespace of the attribute NamespaceId string `protobuf:"bytes,2,opt,name=namespace_id,json=namespaceId,proto3" json:"namespace_id,omitempty"` // attribute name @@ -208,7 +208,7 @@ func (*AttributeCreateUpdate) Descriptor() ([]byte, []int) { return file_attributes_attributes_proto_rawDescGZIP(), []int{1} } -func (x *AttributeCreateUpdate) GetMetadata() *common.PolicyMetadataMutable { +func (x *AttributeCreateUpdate) GetMetadata() *common.MetadataMutable { if x != nil { return x.Metadata } @@ -249,10 +249,10 @@ type Value struct { unknownFields protoimpl.UnknownFields // generated uuid in database - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - Metadata *common.PolicyMetadata `protobuf:"bytes,2,opt,name=metadata,proto3" json:"metadata,omitempty"` - AttributeDefinitionId string `protobuf:"bytes,3,opt,name=attribute_definition_id,json=attributeDefinitionId,proto3" json:"attribute_definition_id,omitempty"` - Value string `protobuf:"bytes,4,opt,name=value,proto3" json:"value,omitempty"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Metadata *common.Metadata `protobuf:"bytes,2,opt,name=metadata,proto3" json:"metadata,omitempty"` + AttributeDefinitionId string `protobuf:"bytes,3,opt,name=attribute_definition_id,json=attributeDefinitionId,proto3" json:"attribute_definition_id,omitempty"` + Value string `protobuf:"bytes,4,opt,name=value,proto3" json:"value,omitempty"` // list of attribute values that this value is related to (attribute group) Members []string `protobuf:"bytes,5,rep,name=members,proto3" json:"members,omitempty"` } @@ -296,7 +296,7 @@ func (x *Value) GetId() string { return "" } -func (x *Value) GetMetadata() *common.PolicyMetadata { +func (x *Value) GetMetadata() *common.Metadata { if x != nil { return x.Metadata } @@ -330,8 +330,8 @@ type ValueCreateUpdate struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Metadata *common.PolicyMetadataMutable `protobuf:"bytes,1,opt,name=metadata,proto3" json:"metadata,omitempty"` - Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` + Metadata *common.MetadataMutable `protobuf:"bytes,1,opt,name=metadata,proto3" json:"metadata,omitempty"` + Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` // list of attribute values that this value is related to (attribute group) Members []string `protobuf:"bytes,3,rep,name=members,proto3" json:"members,omitempty"` } @@ -368,7 +368,7 @@ func (*ValueCreateUpdate) Descriptor() ([]byte, []int) { return file_attributes_attributes_proto_rawDescGZIP(), []int{3} } -func (x *ValueCreateUpdate) GetMetadata() *common.PolicyMetadataMutable { +func (x *ValueCreateUpdate) GetMetadata() *common.MetadataMutable { if x != nil { return x.Metadata } @@ -925,6 +925,8 @@ type DeleteAttributeResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields + + Attribute *Attribute `protobuf:"bytes,1,opt,name=attribute,proto3" json:"attribute,omitempty"` } func (x *DeleteAttributeResponse) Reset() { @@ -959,6 +961,13 @@ func (*DeleteAttributeResponse) Descriptor() ([]byte, []int) { return file_attributes_attributes_proto_rawDescGZIP(), []int{15} } +func (x *DeleteAttributeResponse) GetAttribute() *Attribute { + if x != nil { + return x.Attribute + } + return nil +} + // / // / Value RPC messages // / @@ -1440,244 +1449,246 @@ var file_attributes_attributes_proto_rawDesc = []byte{ 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x13, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xd2, 0x01, 0x0a, 0x09, 0x41, 0x74, + 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xcc, 0x01, 0x0a, 0x09, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x32, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, - 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, - 0x6f, 0x6e, 0x2e, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, - 0x61, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x12, 0x0a, 0x04, 0x6e, - 0x61, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, - 0x42, 0x0a, 0x04, 0x72, 0x75, 0x6c, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x21, 0x2e, - 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x2e, 0x41, 0x74, 0x74, 0x72, 0x69, - 0x62, 0x75, 0x74, 0x65, 0x52, 0x75, 0x6c, 0x65, 0x54, 0x79, 0x70, 0x65, 0x45, 0x6e, 0x75, 0x6d, - 0x42, 0x0b, 0xba, 0x48, 0x08, 0xc8, 0x01, 0x01, 0x82, 0x01, 0x02, 0x10, 0x01, 0x52, 0x04, 0x72, - 0x75, 0x6c, 0x65, 0x12, 0x29, 0x0a, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x07, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, - 0x2e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x22, 0x94, - 0x02, 0x0a, 0x15, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x43, 0x72, 0x65, 0x61, - 0x74, 0x65, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x12, 0x39, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, - 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x63, 0x6f, 0x6d, - 0x6d, 0x6f, 0x6e, 0x2e, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, - 0x74, 0x61, 0x4d, 0x75, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, - 0x61, 0x74, 0x61, 0x12, 0x29, 0x0a, 0x0c, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, - 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x06, 0xba, 0x48, 0x03, 0xc8, 0x01, - 0x01, 0x52, 0x0b, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x49, 0x64, 0x12, 0x1a, - 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x06, 0xba, 0x48, - 0x03, 0xc8, 0x01, 0x01, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x42, 0x0a, 0x04, 0x72, 0x75, - 0x6c, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x21, 0x2e, 0x61, 0x74, 0x74, 0x72, 0x69, - 0x62, 0x75, 0x74, 0x65, 0x73, 0x2e, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x52, - 0x75, 0x6c, 0x65, 0x54, 0x79, 0x70, 0x65, 0x45, 0x6e, 0x75, 0x6d, 0x42, 0x0b, 0xba, 0x48, 0x08, - 0xc8, 0x01, 0x01, 0x82, 0x01, 0x02, 0x10, 0x01, 0x52, 0x04, 0x72, 0x75, 0x6c, 0x65, 0x12, 0x35, - 0x0a, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, - 0x2e, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x75, - 0x65, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x06, 0x76, - 0x61, 0x6c, 0x75, 0x65, 0x73, 0x22, 0xbb, 0x01, 0x0a, 0x05, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, - 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, - 0x32, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x16, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x50, 0x6f, 0x6c, 0x69, 0x63, - 0x79, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, - 0x61, 0x74, 0x61, 0x12, 0x3e, 0x0a, 0x17, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, - 0x5f, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x09, 0x42, 0x06, 0xba, 0x48, 0x03, 0xc8, 0x01, 0x01, 0x52, 0x15, 0x61, 0x74, - 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x44, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, - 0x6e, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x6d, - 0x62, 0x65, 0x72, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x6d, 0x62, - 0x65, 0x72, 0x73, 0x22, 0x7e, 0x0a, 0x11, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x43, 0x72, 0x65, 0x61, - 0x74, 0x65, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x12, 0x39, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, - 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x63, 0x6f, 0x6d, - 0x6d, 0x6f, 0x6e, 0x2e, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, - 0x74, 0x61, 0x4d, 0x75, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, - 0x61, 0x74, 0x61, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x6d, - 0x62, 0x65, 0x72, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x6d, 0x62, - 0x65, 0x72, 0x73, 0x22, 0x89, 0x01, 0x0a, 0x1e, 0x44, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, - 0x6f, 0x6e, 0x4b, 0x65, 0x79, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x53, 0x65, 0x72, 0x76, 0x65, - 0x72, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x12, 0x36, 0x0a, 0x17, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, - 0x75, 0x74, 0x65, 0x5f, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, - 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x15, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, - 0x74, 0x65, 0x44, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x2f, - 0x0a, 0x14, 0x6b, 0x65, 0x79, 0x5f, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x73, 0x65, 0x72, - 0x76, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x11, 0x6b, 0x65, - 0x79, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x49, 0x64, 0x22, - 0x7a, 0x0a, 0x19, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x4b, 0x65, 0x79, 0x41, 0x63, 0x63, 0x65, 0x73, - 0x73, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x12, 0x2c, 0x0a, 0x12, - 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x5f, - 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, - 0x75, 0x74, 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x49, 0x64, 0x12, 0x2f, 0x0a, 0x14, 0x6b, 0x65, - 0x79, 0x5f, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, - 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x11, 0x6b, 0x65, 0x79, 0x41, 0x63, 0x63, - 0x65, 0x73, 0x73, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x49, 0x64, 0x22, 0x17, 0x0a, 0x15, 0x4c, - 0x69, 0x73, 0x74, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x22, 0x4f, 0x0a, 0x16, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x74, 0x74, 0x72, - 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x35, - 0x0a, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x2e, - 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x52, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, - 0x62, 0x75, 0x74, 0x65, 0x73, 0x22, 0x2d, 0x0a, 0x13, 0x47, 0x65, 0x74, 0x41, 0x74, 0x74, 0x72, - 0x69, 0x62, 0x75, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x02, - 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x06, 0xba, 0x48, 0x03, 0xc8, 0x01, 0x01, - 0x52, 0x02, 0x69, 0x64, 0x22, 0x4b, 0x0a, 0x14, 0x47, 0x65, 0x74, 0x41, 0x74, 0x74, 0x72, 0x69, - 0x62, 0x75, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x33, 0x0a, 0x09, - 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x15, 0x2e, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x2e, 0x41, 0x74, 0x74, - 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x52, 0x09, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, - 0x65, 0x22, 0x61, 0x0a, 0x16, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x74, 0x74, 0x72, 0x69, - 0x62, 0x75, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x47, 0x0a, 0x09, 0x61, - 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, - 0x2e, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x2e, 0x41, 0x74, 0x74, 0x72, - 0x69, 0x62, 0x75, 0x74, 0x65, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x70, 0x64, 0x61, 0x74, - 0x65, 0x42, 0x06, 0xba, 0x48, 0x03, 0xc8, 0x01, 0x01, 0x52, 0x09, 0x61, 0x74, 0x74, 0x72, 0x69, - 0x62, 0x75, 0x74, 0x65, 0x22, 0x4e, 0x0a, 0x17, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x74, - 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, - 0x33, 0x0a, 0x09, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x2e, - 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x52, 0x09, 0x61, 0x74, 0x74, 0x72, 0x69, - 0x62, 0x75, 0x74, 0x65, 0x22, 0x79, 0x0a, 0x16, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x74, - 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, - 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x06, 0xba, 0x48, 0x03, 0xc8, - 0x01, 0x01, 0x52, 0x02, 0x69, 0x64, 0x12, 0x47, 0x0a, 0x09, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, - 0x75, 0x74, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x61, 0x74, 0x74, 0x72, - 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x2e, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, - 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x42, 0x06, 0xba, 0x48, - 0x03, 0xc8, 0x01, 0x01, 0x52, 0x09, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x22, - 0x4e, 0x0a, 0x17, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, - 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x33, 0x0a, 0x09, 0x61, 0x74, - 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, - 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x2e, 0x41, 0x74, 0x74, 0x72, 0x69, - 0x62, 0x75, 0x74, 0x65, 0x52, 0x09, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x22, - 0x30, 0x0a, 0x16, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, - 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x02, 0x69, 0x64, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x06, 0xba, 0x48, 0x03, 0xc8, 0x01, 0x01, 0x52, 0x02, 0x69, - 0x64, 0x22, 0x19, 0x0a, 0x17, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x41, 0x74, 0x74, 0x72, 0x69, - 0x62, 0x75, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x29, 0x0a, 0x0f, - 0x47, 0x65, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, - 0x16, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x06, 0xba, 0x48, 0x03, - 0xc8, 0x01, 0x01, 0x52, 0x02, 0x69, 0x64, 0x22, 0x3b, 0x0a, 0x10, 0x47, 0x65, 0x74, 0x56, 0x61, - 0x6c, 0x75, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x27, 0x0a, 0x05, 0x76, - 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x61, 0x74, 0x74, - 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x05, 0x76, - 0x61, 0x6c, 0x75, 0x65, 0x22, 0x13, 0x0a, 0x11, 0x4c, 0x69, 0x73, 0x74, 0x56, 0x61, 0x6c, 0x75, - 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x3f, 0x0a, 0x12, 0x4c, 0x69, 0x73, - 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, - 0x29, 0x0a, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x11, 0x2e, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, - 0x75, 0x65, 0x52, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x22, 0x7c, 0x0a, 0x12, 0x43, 0x72, - 0x65, 0x61, 0x74, 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x12, 0x29, 0x0a, 0x0c, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x5f, 0x69, 0x64, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x06, 0xba, 0x48, 0x03, 0xc8, 0x01, 0x01, 0x52, 0x0b, - 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x49, 0x64, 0x12, 0x3b, 0x0a, 0x05, 0x76, - 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x61, 0x74, 0x74, - 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x43, 0x72, 0x65, + 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x2c, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, + 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, + 0x6f, 0x6e, 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x08, 0x6d, 0x65, 0x74, + 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x05, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x42, 0x0a, 0x04, 0x72, 0x75, 0x6c, + 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x21, 0x2e, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, + 0x75, 0x74, 0x65, 0x73, 0x2e, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x52, 0x75, + 0x6c, 0x65, 0x54, 0x79, 0x70, 0x65, 0x45, 0x6e, 0x75, 0x6d, 0x42, 0x0b, 0xba, 0x48, 0x08, 0xc8, + 0x01, 0x01, 0x82, 0x01, 0x02, 0x10, 0x01, 0x52, 0x04, 0x72, 0x75, 0x6c, 0x65, 0x12, 0x29, 0x0a, + 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x11, 0x2e, + 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x75, 0x65, + 0x52, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x22, 0x8e, 0x02, 0x0a, 0x15, 0x41, 0x74, 0x74, + 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x12, 0x33, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x4d, 0x65, + 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x4d, 0x75, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x08, 0x6d, + 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x29, 0x0a, 0x0c, 0x6e, 0x61, 0x6d, 0x65, 0x73, + 0x70, 0x61, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x06, 0xba, + 0x48, 0x03, 0xc8, 0x01, 0x01, 0x52, 0x0b, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, + 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, + 0x42, 0x06, 0xba, 0x48, 0x03, 0xc8, 0x01, 0x01, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x42, + 0x0a, 0x04, 0x72, 0x75, 0x6c, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x21, 0x2e, 0x61, + 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x2e, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, + 0x75, 0x74, 0x65, 0x52, 0x75, 0x6c, 0x65, 0x54, 0x79, 0x70, 0x65, 0x45, 0x6e, 0x75, 0x6d, 0x42, + 0x0b, 0xba, 0x48, 0x08, 0xc8, 0x01, 0x01, 0x82, 0x01, 0x02, 0x10, 0x01, 0x52, 0x04, 0x72, 0x75, + 0x6c, 0x65, 0x12, 0x35, 0x0a, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x05, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x2e, + 0x56, 0x61, 0x6c, 0x75, 0x65, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x52, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x22, 0xb5, 0x01, 0x0a, 0x05, 0x56, 0x61, + 0x6c, 0x75, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x02, 0x69, 0x64, 0x12, 0x2c, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x4d, + 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, + 0x61, 0x12, 0x3e, 0x0a, 0x17, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x5f, 0x64, + 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x09, 0x42, 0x06, 0xba, 0x48, 0x03, 0xc8, 0x01, 0x01, 0x52, 0x15, 0x61, 0x74, 0x74, 0x72, + 0x69, 0x62, 0x75, 0x74, 0x65, 0x44, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x49, + 0x64, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x6d, 0x62, 0x65, + 0x72, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, + 0x73, 0x22, 0x78, 0x0a, 0x11, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x12, 0x33, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, + 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, + 0x6e, 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x4d, 0x75, 0x74, 0x61, 0x62, 0x6c, + 0x65, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x14, 0x0a, 0x05, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x18, 0x03, 0x20, 0x03, + 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x22, 0x89, 0x01, 0x0a, 0x1e, + 0x44, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x4b, 0x65, 0x79, 0x41, 0x63, 0x63, + 0x65, 0x73, 0x73, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x12, 0x36, + 0x0a, 0x17, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x5f, 0x64, 0x65, 0x66, 0x69, + 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x15, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x44, 0x65, 0x66, 0x69, 0x6e, 0x69, + 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x2f, 0x0a, 0x14, 0x6b, 0x65, 0x79, 0x5f, 0x61, 0x63, + 0x63, 0x65, 0x73, 0x73, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x11, 0x6b, 0x65, 0x79, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x53, + 0x65, 0x72, 0x76, 0x65, 0x72, 0x49, 0x64, 0x22, 0x7a, 0x0a, 0x19, 0x56, 0x61, 0x6c, 0x75, 0x65, + 0x4b, 0x65, 0x79, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x47, + 0x72, 0x61, 0x6e, 0x74, 0x12, 0x2c, 0x0a, 0x12, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, + 0x65, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x10, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, + 0x49, 0x64, 0x12, 0x2f, 0x0a, 0x14, 0x6b, 0x65, 0x79, 0x5f, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, + 0x5f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x11, 0x6b, 0x65, 0x79, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x53, 0x65, 0x72, 0x76, 0x65, + 0x72, 0x49, 0x64, 0x22, 0x17, 0x0a, 0x15, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x74, 0x74, 0x72, 0x69, + 0x62, 0x75, 0x74, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x4f, 0x0a, 0x16, + 0x4c, 0x69, 0x73, 0x74, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x35, 0x0a, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, + 0x75, 0x74, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x61, 0x74, 0x74, + 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x2e, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, + 0x65, 0x52, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x22, 0x2d, 0x0a, + 0x13, 0x47, 0x65, 0x74, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x42, 0x06, 0xba, 0x48, 0x03, 0xc8, 0x01, 0x01, 0x52, 0x02, 0x69, 0x64, 0x22, 0x4b, 0x0a, 0x14, + 0x47, 0x65, 0x74, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x33, 0x0a, 0x09, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, + 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, + 0x75, 0x74, 0x65, 0x73, 0x2e, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x52, 0x09, + 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x22, 0x61, 0x0a, 0x16, 0x43, 0x72, 0x65, + 0x61, 0x74, 0x65, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x47, 0x0a, 0x09, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, + 0x74, 0x65, 0x73, 0x2e, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x42, 0x06, 0xba, 0x48, 0x03, 0xc8, 0x01, - 0x01, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x3e, 0x0a, 0x13, 0x43, 0x72, 0x65, 0x61, - 0x74, 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, - 0x27, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, - 0x2e, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x75, - 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x69, 0x0a, 0x12, 0x55, 0x70, 0x64, 0x61, - 0x74, 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, - 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x06, 0xba, 0x48, 0x03, 0xc8, - 0x01, 0x01, 0x52, 0x02, 0x69, 0x64, 0x12, 0x3b, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, - 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x70, - 0x64, 0x61, 0x74, 0x65, 0x42, 0x06, 0xba, 0x48, 0x03, 0xc8, 0x01, 0x01, 0x52, 0x05, 0x76, 0x61, - 0x6c, 0x75, 0x65, 0x22, 0x3e, 0x0a, 0x13, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x56, 0x61, 0x6c, - 0x75, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x27, 0x0a, 0x05, 0x76, 0x61, - 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x61, 0x74, 0x74, 0x72, - 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x05, 0x76, 0x61, - 0x6c, 0x75, 0x65, 0x22, 0x2c, 0x0a, 0x12, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x56, 0x61, 0x6c, - 0x75, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x02, 0x69, 0x64, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x06, 0xba, 0x48, 0x03, 0xc8, 0x01, 0x01, 0x52, 0x02, 0x69, - 0x64, 0x22, 0x15, 0x0a, 0x13, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2a, 0xb3, 0x01, 0x0a, 0x15, 0x41, 0x74, 0x74, - 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x52, 0x75, 0x6c, 0x65, 0x54, 0x79, 0x70, 0x65, 0x45, 0x6e, - 0x75, 0x6d, 0x12, 0x28, 0x0a, 0x24, 0x41, 0x54, 0x54, 0x52, 0x49, 0x42, 0x55, 0x54, 0x45, 0x5f, - 0x52, 0x55, 0x4c, 0x45, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x45, 0x4e, 0x55, 0x4d, 0x5f, 0x55, - 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x23, 0x0a, 0x1f, - 0x41, 0x54, 0x54, 0x52, 0x49, 0x42, 0x55, 0x54, 0x45, 0x5f, 0x52, 0x55, 0x4c, 0x45, 0x5f, 0x54, - 0x59, 0x50, 0x45, 0x5f, 0x45, 0x4e, 0x55, 0x4d, 0x5f, 0x41, 0x4c, 0x4c, 0x5f, 0x4f, 0x46, 0x10, - 0x01, 0x12, 0x23, 0x0a, 0x1f, 0x41, 0x54, 0x54, 0x52, 0x49, 0x42, 0x55, 0x54, 0x45, 0x5f, 0x52, - 0x55, 0x4c, 0x45, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x45, 0x4e, 0x55, 0x4d, 0x5f, 0x41, 0x4e, - 0x59, 0x5f, 0x4f, 0x46, 0x10, 0x02, 0x12, 0x26, 0x0a, 0x22, 0x41, 0x54, 0x54, 0x52, 0x49, 0x42, - 0x55, 0x54, 0x45, 0x5f, 0x52, 0x55, 0x4c, 0x45, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x45, 0x4e, - 0x55, 0x4d, 0x5f, 0x48, 0x49, 0x45, 0x52, 0x41, 0x52, 0x43, 0x48, 0x59, 0x10, 0x03, 0x32, 0xa8, - 0x08, 0x0a, 0x11, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x53, 0x65, 0x72, - 0x76, 0x69, 0x63, 0x65, 0x12, 0x59, 0x0a, 0x0e, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x74, 0x74, 0x72, - 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x12, 0x21, 0x2e, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, + 0x01, 0x52, 0x09, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x22, 0x4e, 0x0a, 0x17, + 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x33, 0x0a, 0x09, 0x61, 0x74, 0x74, 0x72, 0x69, + 0x62, 0x75, 0x74, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x61, 0x74, 0x74, + 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x2e, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, + 0x65, 0x52, 0x09, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x22, 0x79, 0x0a, 0x16, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x42, 0x06, 0xba, 0x48, 0x03, 0xc8, 0x01, 0x01, 0x52, 0x02, 0x69, 0x64, 0x12, 0x47, + 0x0a, 0x09, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x21, 0x2e, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x2e, 0x41, + 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x70, + 0x64, 0x61, 0x74, 0x65, 0x42, 0x06, 0xba, 0x48, 0x03, 0xc8, 0x01, 0x01, 0x52, 0x09, 0x61, 0x74, + 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x22, 0x4e, 0x0a, 0x17, 0x55, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x33, 0x0a, 0x09, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, + 0x65, 0x73, 0x2e, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x52, 0x09, 0x61, 0x74, + 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x22, 0x30, 0x0a, 0x16, 0x44, 0x65, 0x6c, 0x65, 0x74, + 0x65, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x16, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x06, 0xba, + 0x48, 0x03, 0xc8, 0x01, 0x01, 0x52, 0x02, 0x69, 0x64, 0x22, 0x4e, 0x0a, 0x17, 0x44, 0x65, 0x6c, + 0x65, 0x74, 0x65, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x33, 0x0a, 0x09, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, + 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, + 0x75, 0x74, 0x65, 0x73, 0x2e, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x52, 0x09, + 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x22, 0x29, 0x0a, 0x0f, 0x47, 0x65, 0x74, + 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x02, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x06, 0xba, 0x48, 0x03, 0xc8, 0x01, 0x01, + 0x52, 0x02, 0x69, 0x64, 0x22, 0x3b, 0x0a, 0x10, 0x47, 0x65, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x27, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, + 0x75, 0x74, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x22, 0x13, 0x0a, 0x11, 0x4c, 0x69, 0x73, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x3f, 0x0a, 0x12, 0x4c, 0x69, 0x73, 0x74, 0x56, 0x61, + 0x6c, 0x75, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x29, 0x0a, 0x06, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x61, + 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, + 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x22, 0x7c, 0x0a, 0x12, 0x43, 0x72, 0x65, 0x61, 0x74, + 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x29, 0x0a, + 0x0c, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x42, 0x06, 0xba, 0x48, 0x03, 0xc8, 0x01, 0x01, 0x52, 0x0b, 0x61, 0x74, 0x74, + 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x49, 0x64, 0x12, 0x3b, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, + 0x75, 0x74, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x42, 0x06, 0xba, 0x48, 0x03, 0xc8, 0x01, 0x01, 0x52, 0x05, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x3e, 0x0a, 0x13, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x56, + 0x61, 0x6c, 0x75, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x27, 0x0a, 0x05, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x61, 0x74, + 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x05, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x69, 0x0a, 0x12, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x56, + 0x61, 0x6c, 0x75, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x02, 0x69, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x06, 0xba, 0x48, 0x03, 0xc8, 0x01, 0x01, 0x52, + 0x02, 0x69, 0x64, 0x12, 0x3b, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x2e, + 0x56, 0x61, 0x6c, 0x75, 0x65, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x42, 0x06, 0xba, 0x48, 0x03, 0xc8, 0x01, 0x01, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x22, 0x3e, 0x0a, 0x13, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x27, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, + 0x74, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x22, 0x2c, 0x0a, 0x12, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x42, 0x06, 0xba, 0x48, 0x03, 0xc8, 0x01, 0x01, 0x52, 0x02, 0x69, 0x64, 0x22, 0x15, + 0x0a, 0x13, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2a, 0xb3, 0x01, 0x0a, 0x15, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, + 0x75, 0x74, 0x65, 0x52, 0x75, 0x6c, 0x65, 0x54, 0x79, 0x70, 0x65, 0x45, 0x6e, 0x75, 0x6d, 0x12, + 0x28, 0x0a, 0x24, 0x41, 0x54, 0x54, 0x52, 0x49, 0x42, 0x55, 0x54, 0x45, 0x5f, 0x52, 0x55, 0x4c, + 0x45, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x45, 0x4e, 0x55, 0x4d, 0x5f, 0x55, 0x4e, 0x53, 0x50, + 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x23, 0x0a, 0x1f, 0x41, 0x54, 0x54, + 0x52, 0x49, 0x42, 0x55, 0x54, 0x45, 0x5f, 0x52, 0x55, 0x4c, 0x45, 0x5f, 0x54, 0x59, 0x50, 0x45, + 0x5f, 0x45, 0x4e, 0x55, 0x4d, 0x5f, 0x41, 0x4c, 0x4c, 0x5f, 0x4f, 0x46, 0x10, 0x01, 0x12, 0x23, + 0x0a, 0x1f, 0x41, 0x54, 0x54, 0x52, 0x49, 0x42, 0x55, 0x54, 0x45, 0x5f, 0x52, 0x55, 0x4c, 0x45, + 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x45, 0x4e, 0x55, 0x4d, 0x5f, 0x41, 0x4e, 0x59, 0x5f, 0x4f, + 0x46, 0x10, 0x02, 0x12, 0x26, 0x0a, 0x22, 0x41, 0x54, 0x54, 0x52, 0x49, 0x42, 0x55, 0x54, 0x45, + 0x5f, 0x52, 0x55, 0x4c, 0x45, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x45, 0x4e, 0x55, 0x4d, 0x5f, + 0x48, 0x49, 0x45, 0x52, 0x41, 0x52, 0x43, 0x48, 0x59, 0x10, 0x03, 0x32, 0xa8, 0x08, 0x0a, 0x11, + 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x12, 0x59, 0x0a, 0x0e, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, + 0x74, 0x65, 0x73, 0x12, 0x21, 0x2e, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, + 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, - 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x61, 0x74, 0x74, 0x72, - 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x74, 0x74, 0x72, 0x69, - 0x62, 0x75, 0x74, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, - 0x6b, 0x0a, 0x0c, 0x47, 0x65, 0x74, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x12, - 0x1f, 0x2e, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x2e, 0x47, 0x65, 0x74, + 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x6b, 0x0a, 0x0c, + 0x47, 0x65, 0x74, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x12, 0x1f, 0x2e, 0x61, + 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x2e, 0x47, 0x65, 0x74, 0x41, 0x74, 0x74, + 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, + 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x2e, 0x47, 0x65, 0x74, 0x41, 0x74, + 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x18, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x12, 0x12, 0x10, 0x2f, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, + 0x75, 0x74, 0x65, 0x73, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x12, 0x7a, 0x0a, 0x0f, 0x43, 0x72, 0x65, + 0x61, 0x74, 0x65, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x12, 0x22, 0x2e, 0x61, + 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x20, 0x2e, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x2e, 0x47, 0x65, - 0x74, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x22, 0x18, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x12, 0x12, 0x10, 0x2f, 0x61, 0x74, 0x74, - 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x12, 0x7a, 0x0a, 0x0f, - 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x12, - 0x22, 0x2e, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x2e, 0x43, 0x72, 0x65, - 0x61, 0x74, 0x65, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, - 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x18, - 0x3a, 0x09, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x22, 0x0b, 0x2f, 0x61, 0x74, - 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x12, 0x7f, 0x0a, 0x0f, 0x55, 0x70, 0x64, 0x61, - 0x74, 0x65, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x12, 0x22, 0x2e, 0x61, 0x74, - 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, - 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x23, 0x2e, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x2e, 0x55, 0x70, 0x64, - 0x61, 0x74, 0x65, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x23, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1d, 0x3a, 0x09, 0x61, 0x74, - 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x22, 0x10, 0x2f, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, - 0x75, 0x74, 0x65, 0x73, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x12, 0x74, 0x0a, 0x0f, 0x44, 0x65, 0x6c, - 0x65, 0x74, 0x65, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x12, 0x22, 0x2e, 0x61, - 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, - 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x23, 0x2e, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x2e, 0x44, 0x65, - 0x6c, 0x65, 0x74, 0x65, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x18, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x12, 0x2a, 0x10, 0x2f, - 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x12, - 0x68, 0x0a, 0x08, 0x47, 0x65, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x1b, 0x2e, 0x61, 0x74, - 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x2e, 0x47, 0x65, 0x74, 0x56, 0x61, 0x6c, 0x75, - 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x61, 0x74, 0x74, 0x72, 0x69, + 0x1a, 0x23, 0x2e, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x2e, 0x43, 0x72, + 0x65, 0x61, 0x74, 0x65, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x18, 0x3a, 0x09, 0x61, + 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x22, 0x0b, 0x2f, 0x61, 0x74, 0x74, 0x72, 0x69, + 0x62, 0x75, 0x74, 0x65, 0x73, 0x12, 0x7f, 0x0a, 0x0f, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, + 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x12, 0x22, 0x2e, 0x61, 0x74, 0x74, 0x72, 0x69, + 0x62, 0x75, 0x74, 0x65, 0x73, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x74, 0x74, 0x72, + 0x69, 0x62, 0x75, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x61, + 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x23, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1d, 0x3a, 0x09, 0x61, 0x74, 0x74, 0x72, 0x69, + 0x62, 0x75, 0x74, 0x65, 0x22, 0x10, 0x2f, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, + 0x73, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x12, 0x74, 0x0a, 0x0f, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, + 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x12, 0x22, 0x2e, 0x61, 0x74, 0x74, 0x72, + 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x41, 0x74, 0x74, + 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, + 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, + 0x65, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x22, 0x18, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x12, 0x2a, 0x10, 0x2f, 0x61, 0x74, 0x74, + 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x12, 0x68, 0x0a, 0x08, + 0x47, 0x65, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x1b, 0x2e, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x2e, 0x47, 0x65, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x21, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1b, 0x12, 0x19, - 0x2f, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x2f, 0x5f, 0x2f, 0x76, 0x61, - 0x6c, 0x75, 0x65, 0x73, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x12, 0x80, 0x01, 0x0a, 0x0b, 0x43, 0x72, - 0x65, 0x61, 0x74, 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x1e, 0x2e, 0x61, 0x74, 0x74, 0x72, - 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x56, 0x61, 0x6c, - 0x75, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x61, 0x74, 0x74, 0x72, - 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x56, 0x61, 0x6c, - 0x75, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x30, 0x82, 0xd3, 0xe4, 0x93, - 0x02, 0x2a, 0x3a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x21, 0x2f, 0x61, 0x74, 0x74, 0x72, - 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x2f, 0x7b, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, - 0x65, 0x5f, 0x69, 0x64, 0x7d, 0x2f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, 0x78, 0x0a, 0x0b, - 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x1e, 0x2e, 0x61, 0x74, - 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x56, - 0x61, 0x6c, 0x75, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x61, 0x74, - 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x56, - 0x61, 0x6c, 0x75, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x28, 0x82, 0xd3, - 0xe4, 0x93, 0x02, 0x22, 0x3a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x19, 0x2f, 0x61, 0x74, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, + 0x65, 0x73, 0x2e, 0x47, 0x65, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0x21, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1b, 0x12, 0x19, 0x2f, 0x61, 0x74, + 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x2f, 0x5f, 0x2f, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x73, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x12, 0x80, 0x01, 0x0a, 0x0b, 0x43, 0x72, 0x65, 0x61, 0x74, + 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x1e, 0x2e, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, + 0x74, 0x65, 0x73, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, + 0x74, 0x65, 0x73, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x30, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2a, 0x3a, + 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x21, 0x2f, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, + 0x74, 0x65, 0x73, 0x2f, 0x7b, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x5f, 0x69, + 0x64, 0x7d, 0x2f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, 0x78, 0x0a, 0x0b, 0x55, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x1e, 0x2e, 0x61, 0x74, 0x74, 0x72, 0x69, + 0x62, 0x75, 0x74, 0x65, 0x73, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x56, 0x61, 0x6c, 0x75, + 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x61, 0x74, 0x74, 0x72, 0x69, + 0x62, 0x75, 0x74, 0x65, 0x73, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x56, 0x61, 0x6c, 0x75, + 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x28, 0x82, 0xd3, 0xe4, 0x93, 0x02, + 0x22, 0x3a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x19, 0x2f, 0x61, 0x74, 0x74, 0x72, 0x69, + 0x62, 0x75, 0x74, 0x65, 0x73, 0x2f, 0x5f, 0x2f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x2f, 0x7b, + 0x69, 0x64, 0x7d, 0x12, 0x71, 0x0a, 0x0b, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x56, 0x61, 0x6c, + 0x75, 0x65, 0x12, 0x1e, 0x2e, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x2e, + 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x2e, + 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0x21, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1b, 0x2a, 0x19, 0x2f, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x2f, 0x5f, 0x2f, 0x76, 0x61, 0x6c, 0x75, 0x65, - 0x73, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x12, 0x71, 0x0a, 0x0b, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, - 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x1e, 0x2e, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, - 0x65, 0x73, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, - 0x65, 0x73, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x21, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1b, 0x2a, 0x19, - 0x2f, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x2f, 0x5f, 0x2f, 0x76, 0x61, - 0x6c, 0x75, 0x65, 0x73, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x42, 0x9b, 0x01, 0x0a, 0x0e, 0x63, 0x6f, - 0x6d, 0x2e, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x42, 0x0f, 0x41, 0x74, - 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, - 0x30, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x70, 0x65, 0x6e, - 0x74, 0x64, 0x66, 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x64, 0x66, 0x2d, 0x76, 0x32, 0x2d, 0x70, - 0x6f, 0x63, 0x2f, 0x73, 0x64, 0x6b, 0x2f, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, - 0x73, 0xa2, 0x02, 0x03, 0x41, 0x58, 0x58, 0xaa, 0x02, 0x0a, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, - 0x75, 0x74, 0x65, 0x73, 0xca, 0x02, 0x0a, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, - 0x73, 0xe2, 0x02, 0x16, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x5c, 0x47, - 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0a, 0x41, 0x74, 0x74, - 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x73, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x42, 0x9b, 0x01, 0x0a, 0x0e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, + 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x42, 0x0f, 0x41, 0x74, 0x74, 0x72, 0x69, + 0x62, 0x75, 0x74, 0x65, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x30, 0x67, 0x69, + 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x64, 0x66, + 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x64, 0x66, 0x2d, 0x76, 0x32, 0x2d, 0x70, 0x6f, 0x63, 0x2f, + 0x73, 0x64, 0x6b, 0x2f, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0xa2, 0x02, + 0x03, 0x41, 0x58, 0x58, 0xaa, 0x02, 0x0a, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, + 0x73, 0xca, 0x02, 0x0a, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0xe2, 0x02, + 0x16, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x5c, 0x47, 0x50, 0x42, 0x4d, + 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0a, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, + 0x75, 0x74, 0x65, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -1722,53 +1733,54 @@ var file_attributes_attributes_proto_goTypes = []interface{}{ (*UpdateValueResponse)(nil), // 24: attributes.UpdateValueResponse (*DeleteValueRequest)(nil), // 25: attributes.DeleteValueRequest (*DeleteValueResponse)(nil), // 26: attributes.DeleteValueResponse - (*common.PolicyMetadata)(nil), // 27: common.PolicyMetadata - (*common.PolicyMetadataMutable)(nil), // 28: common.PolicyMetadataMutable + (*common.Metadata)(nil), // 27: common.Metadata + (*common.MetadataMutable)(nil), // 28: common.MetadataMutable } var file_attributes_attributes_proto_depIdxs = []int32{ - 27, // 0: attributes.Attribute.metadata:type_name -> common.PolicyMetadata + 27, // 0: attributes.Attribute.metadata:type_name -> common.Metadata 0, // 1: attributes.Attribute.rule:type_name -> attributes.AttributeRuleTypeEnum 3, // 2: attributes.Attribute.values:type_name -> attributes.Value - 28, // 3: attributes.AttributeCreateUpdate.metadata:type_name -> common.PolicyMetadataMutable + 28, // 3: attributes.AttributeCreateUpdate.metadata:type_name -> common.MetadataMutable 0, // 4: attributes.AttributeCreateUpdate.rule:type_name -> attributes.AttributeRuleTypeEnum 4, // 5: attributes.AttributeCreateUpdate.values:type_name -> attributes.ValueCreateUpdate - 27, // 6: attributes.Value.metadata:type_name -> common.PolicyMetadata - 28, // 7: attributes.ValueCreateUpdate.metadata:type_name -> common.PolicyMetadataMutable + 27, // 6: attributes.Value.metadata:type_name -> common.Metadata + 28, // 7: attributes.ValueCreateUpdate.metadata:type_name -> common.MetadataMutable 1, // 8: attributes.ListAttributesResponse.attributes:type_name -> attributes.Attribute 1, // 9: attributes.GetAttributeResponse.attribute:type_name -> attributes.Attribute 2, // 10: attributes.CreateAttributeRequest.attribute:type_name -> attributes.AttributeCreateUpdate 1, // 11: attributes.CreateAttributeResponse.attribute:type_name -> attributes.Attribute 2, // 12: attributes.UpdateAttributeRequest.attribute:type_name -> attributes.AttributeCreateUpdate 1, // 13: attributes.UpdateAttributeResponse.attribute:type_name -> attributes.Attribute - 3, // 14: attributes.GetValueResponse.value:type_name -> attributes.Value - 3, // 15: attributes.ListValuesResponse.values:type_name -> attributes.Value - 4, // 16: attributes.CreateValueRequest.value:type_name -> attributes.ValueCreateUpdate - 3, // 17: attributes.CreateValueResponse.value:type_name -> attributes.Value - 4, // 18: attributes.UpdateValueRequest.value:type_name -> attributes.ValueCreateUpdate - 3, // 19: attributes.UpdateValueResponse.value:type_name -> attributes.Value - 7, // 20: attributes.AttributesService.ListAttributes:input_type -> attributes.ListAttributesRequest - 9, // 21: attributes.AttributesService.GetAttribute:input_type -> attributes.GetAttributeRequest - 11, // 22: attributes.AttributesService.CreateAttribute:input_type -> attributes.CreateAttributeRequest - 13, // 23: attributes.AttributesService.UpdateAttribute:input_type -> attributes.UpdateAttributeRequest - 15, // 24: attributes.AttributesService.DeleteAttribute:input_type -> attributes.DeleteAttributeRequest - 17, // 25: attributes.AttributesService.GetValue:input_type -> attributes.GetValueRequest - 21, // 26: attributes.AttributesService.CreateValue:input_type -> attributes.CreateValueRequest - 23, // 27: attributes.AttributesService.UpdateValue:input_type -> attributes.UpdateValueRequest - 25, // 28: attributes.AttributesService.DeleteValue:input_type -> attributes.DeleteValueRequest - 8, // 29: attributes.AttributesService.ListAttributes:output_type -> attributes.ListAttributesResponse - 10, // 30: attributes.AttributesService.GetAttribute:output_type -> attributes.GetAttributeResponse - 12, // 31: attributes.AttributesService.CreateAttribute:output_type -> attributes.CreateAttributeResponse - 14, // 32: attributes.AttributesService.UpdateAttribute:output_type -> attributes.UpdateAttributeResponse - 16, // 33: attributes.AttributesService.DeleteAttribute:output_type -> attributes.DeleteAttributeResponse - 18, // 34: attributes.AttributesService.GetValue:output_type -> attributes.GetValueResponse - 22, // 35: attributes.AttributesService.CreateValue:output_type -> attributes.CreateValueResponse - 24, // 36: attributes.AttributesService.UpdateValue:output_type -> attributes.UpdateValueResponse - 26, // 37: attributes.AttributesService.DeleteValue:output_type -> attributes.DeleteValueResponse - 29, // [29:38] is the sub-list for method output_type - 20, // [20:29] is the sub-list for method input_type - 20, // [20:20] is the sub-list for extension type_name - 20, // [20:20] is the sub-list for extension extendee - 0, // [0:20] is the sub-list for field type_name + 1, // 14: attributes.DeleteAttributeResponse.attribute:type_name -> attributes.Attribute + 3, // 15: attributes.GetValueResponse.value:type_name -> attributes.Value + 3, // 16: attributes.ListValuesResponse.values:type_name -> attributes.Value + 4, // 17: attributes.CreateValueRequest.value:type_name -> attributes.ValueCreateUpdate + 3, // 18: attributes.CreateValueResponse.value:type_name -> attributes.Value + 4, // 19: attributes.UpdateValueRequest.value:type_name -> attributes.ValueCreateUpdate + 3, // 20: attributes.UpdateValueResponse.value:type_name -> attributes.Value + 7, // 21: attributes.AttributesService.ListAttributes:input_type -> attributes.ListAttributesRequest + 9, // 22: attributes.AttributesService.GetAttribute:input_type -> attributes.GetAttributeRequest + 11, // 23: attributes.AttributesService.CreateAttribute:input_type -> attributes.CreateAttributeRequest + 13, // 24: attributes.AttributesService.UpdateAttribute:input_type -> attributes.UpdateAttributeRequest + 15, // 25: attributes.AttributesService.DeleteAttribute:input_type -> attributes.DeleteAttributeRequest + 17, // 26: attributes.AttributesService.GetValue:input_type -> attributes.GetValueRequest + 21, // 27: attributes.AttributesService.CreateValue:input_type -> attributes.CreateValueRequest + 23, // 28: attributes.AttributesService.UpdateValue:input_type -> attributes.UpdateValueRequest + 25, // 29: attributes.AttributesService.DeleteValue:input_type -> attributes.DeleteValueRequest + 8, // 30: attributes.AttributesService.ListAttributes:output_type -> attributes.ListAttributesResponse + 10, // 31: attributes.AttributesService.GetAttribute:output_type -> attributes.GetAttributeResponse + 12, // 32: attributes.AttributesService.CreateAttribute:output_type -> attributes.CreateAttributeResponse + 14, // 33: attributes.AttributesService.UpdateAttribute:output_type -> attributes.UpdateAttributeResponse + 16, // 34: attributes.AttributesService.DeleteAttribute:output_type -> attributes.DeleteAttributeResponse + 18, // 35: attributes.AttributesService.GetValue:output_type -> attributes.GetValueResponse + 22, // 36: attributes.AttributesService.CreateValue:output_type -> attributes.CreateValueResponse + 24, // 37: attributes.AttributesService.UpdateValue:output_type -> attributes.UpdateValueResponse + 26, // 38: attributes.AttributesService.DeleteValue:output_type -> attributes.DeleteValueResponse + 30, // [30:39] is the sub-list for method output_type + 21, // [21:30] is the sub-list for method input_type + 21, // [21:21] is the sub-list for extension type_name + 21, // [21:21] is the sub-list for extension extendee + 0, // [0:21] is the sub-list for field type_name } func init() { file_attributes_attributes_proto_init() } diff --git a/sdk/attributes/attributes_grpc.pb.go b/sdk/attributes/attributes_grpc.pb.go index 9ec5fbe9b2..b5f7cd966e 100644 --- a/sdk/attributes/attributes_grpc.pb.go +++ b/sdk/attributes/attributes_grpc.pb.go @@ -34,13 +34,24 @@ const ( // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. type AttributesServiceClient interface { + // List Attributes + // Example: + // grpcurl -plaintext -d '{"namespace_id": "namespace_id"}' localhost:8080 attributes.AttributesService/ListAttributes ListAttributes(ctx context.Context, in *ListAttributesRequest, opts ...grpc.CallOption) (*ListAttributesResponse, error) GetAttribute(ctx context.Context, in *GetAttributeRequest, opts ...grpc.CallOption) (*GetAttributeResponse, error) + // Create Attribute + // Example: + // + // grpcurl -plaintext -d '{"attribute": {"namespace_id": "namespace_id", "name": "attribute_name", "rule": "ATTRIBUTE_RULE_TYPE_ENUM_ALL_OF"}}' localhost:8080 attributes.AttributesService/CreateAttribute CreateAttribute(ctx context.Context, in *CreateAttributeRequest, opts ...grpc.CallOption) (*CreateAttributeResponse, error) UpdateAttribute(ctx context.Context, in *UpdateAttributeRequest, opts ...grpc.CallOption) (*UpdateAttributeResponse, error) DeleteAttribute(ctx context.Context, in *DeleteAttributeRequest, opts ...grpc.CallOption) (*DeleteAttributeResponse, error) // * Attribute Value * GetValue(ctx context.Context, in *GetValueRequest, opts ...grpc.CallOption) (*GetValueResponse, error) + // Create Attribute Value + // Example: + // + // grpcurl -plaintext -d '{"attribute_id": "attribute_id", "value": {"value": "value"}}' localhost:8080 attributes.AttributesService/CreateValue CreateValue(ctx context.Context, in *CreateValueRequest, opts ...grpc.CallOption) (*CreateValueResponse, error) UpdateValue(ctx context.Context, in *UpdateValueRequest, opts ...grpc.CallOption) (*UpdateValueResponse, error) DeleteValue(ctx context.Context, in *DeleteValueRequest, opts ...grpc.CallOption) (*DeleteValueResponse, error) @@ -139,13 +150,24 @@ func (c *attributesServiceClient) DeleteValue(ctx context.Context, in *DeleteVal // All implementations must embed UnimplementedAttributesServiceServer // for forward compatibility type AttributesServiceServer interface { + // List Attributes + // Example: + // grpcurl -plaintext -d '{"namespace_id": "namespace_id"}' localhost:8080 attributes.AttributesService/ListAttributes ListAttributes(context.Context, *ListAttributesRequest) (*ListAttributesResponse, error) GetAttribute(context.Context, *GetAttributeRequest) (*GetAttributeResponse, error) + // Create Attribute + // Example: + // + // grpcurl -plaintext -d '{"attribute": {"namespace_id": "namespace_id", "name": "attribute_name", "rule": "ATTRIBUTE_RULE_TYPE_ENUM_ALL_OF"}}' localhost:8080 attributes.AttributesService/CreateAttribute CreateAttribute(context.Context, *CreateAttributeRequest) (*CreateAttributeResponse, error) UpdateAttribute(context.Context, *UpdateAttributeRequest) (*UpdateAttributeResponse, error) DeleteAttribute(context.Context, *DeleteAttributeRequest) (*DeleteAttributeResponse, error) // * Attribute Value * GetValue(context.Context, *GetValueRequest) (*GetValueResponse, error) + // Create Attribute Value + // Example: + // + // grpcurl -plaintext -d '{"attribute_id": "attribute_id", "value": {"value": "value"}}' localhost:8080 attributes.AttributesService/CreateValue CreateValue(context.Context, *CreateValueRequest) (*CreateValueResponse, error) UpdateValue(context.Context, *UpdateValueRequest) (*UpdateValueResponse, error) DeleteValue(context.Context, *DeleteValueRequest) (*DeleteValueResponse, error) diff --git a/sdk/common/common.pb.go b/sdk/common/common.pb.go index 8a77d1c414..2702e9aee7 100644 --- a/sdk/common/common.pb.go +++ b/sdk/common/common.pb.go @@ -22,7 +22,7 @@ const ( ) // Struct to uniquely identify a resource with optional additional metadata -type PolicyMetadata struct { +type Metadata struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields @@ -37,8 +37,8 @@ type PolicyMetadata struct { Description string `protobuf:"bytes,4,opt,name=description,proto3" json:"description,omitempty"` } -func (x *PolicyMetadata) Reset() { - *x = PolicyMetadata{} +func (x *Metadata) Reset() { + *x = Metadata{} if protoimpl.UnsafeEnabled { mi := &file_common_common_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -46,13 +46,13 @@ func (x *PolicyMetadata) Reset() { } } -func (x *PolicyMetadata) String() string { +func (x *Metadata) String() string { return protoimpl.X.MessageStringOf(x) } -func (*PolicyMetadata) ProtoMessage() {} +func (*Metadata) ProtoMessage() {} -func (x *PolicyMetadata) ProtoReflect() protoreflect.Message { +func (x *Metadata) ProtoReflect() protoreflect.Message { mi := &file_common_common_proto_msgTypes[0] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -64,40 +64,40 @@ func (x *PolicyMetadata) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use PolicyMetadata.ProtoReflect.Descriptor instead. -func (*PolicyMetadata) Descriptor() ([]byte, []int) { +// Deprecated: Use Metadata.ProtoReflect.Descriptor instead. +func (*Metadata) Descriptor() ([]byte, []int) { return file_common_common_proto_rawDescGZIP(), []int{0} } -func (x *PolicyMetadata) GetCreatedAt() *timestamppb.Timestamp { +func (x *Metadata) GetCreatedAt() *timestamppb.Timestamp { if x != nil { return x.CreatedAt } return nil } -func (x *PolicyMetadata) GetUpdatedAt() *timestamppb.Timestamp { +func (x *Metadata) GetUpdatedAt() *timestamppb.Timestamp { if x != nil { return x.UpdatedAt } return nil } -func (x *PolicyMetadata) GetLabels() map[string]string { +func (x *Metadata) GetLabels() map[string]string { if x != nil { return x.Labels } return nil } -func (x *PolicyMetadata) GetDescription() string { +func (x *Metadata) GetDescription() string { if x != nil { return x.Description } return "" } -type PolicyMetadataMutable struct { +type MetadataMutable struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields @@ -108,8 +108,8 @@ type PolicyMetadataMutable struct { Description string `protobuf:"bytes,4,opt,name=description,proto3" json:"description,omitempty"` } -func (x *PolicyMetadataMutable) Reset() { - *x = PolicyMetadataMutable{} +func (x *MetadataMutable) Reset() { + *x = MetadataMutable{} if protoimpl.UnsafeEnabled { mi := &file_common_common_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -117,13 +117,13 @@ func (x *PolicyMetadataMutable) Reset() { } } -func (x *PolicyMetadataMutable) String() string { +func (x *MetadataMutable) String() string { return protoimpl.X.MessageStringOf(x) } -func (*PolicyMetadataMutable) ProtoMessage() {} +func (*MetadataMutable) ProtoMessage() {} -func (x *PolicyMetadataMutable) ProtoReflect() protoreflect.Message { +func (x *MetadataMutable) ProtoReflect() protoreflect.Message { mi := &file_common_common_proto_msgTypes[1] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -135,19 +135,19 @@ func (x *PolicyMetadataMutable) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use PolicyMetadataMutable.ProtoReflect.Descriptor instead. -func (*PolicyMetadataMutable) Descriptor() ([]byte, []int) { +// Deprecated: Use MetadataMutable.ProtoReflect.Descriptor instead. +func (*MetadataMutable) Descriptor() ([]byte, []int) { return file_common_common_proto_rawDescGZIP(), []int{1} } -func (x *PolicyMetadataMutable) GetLabels() map[string]string { +func (x *MetadataMutable) GetLabels() map[string]string { if x != nil { return x.Labels } return nil } -func (x *PolicyMetadataMutable) GetDescription() string { +func (x *MetadataMutable) GetDescription() string { if x != nil { return x.Description } @@ -160,46 +160,44 @@ var file_common_common_proto_rawDesc = []byte{ 0x0a, 0x13, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, - 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x9f, - 0x02, 0x0a, 0x0e, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, - 0x61, 0x12, 0x39, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, - 0x70, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x39, 0x0a, 0x0a, - 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, - 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x75, 0x70, - 0x64, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x3a, 0x0a, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, - 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, - 0x2e, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x2e, - 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x6c, 0x61, 0x62, - 0x65, 0x6c, 0x73, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, - 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, - 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0x39, 0x0a, 0x0b, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x45, - 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, - 0x22, 0xb7, 0x01, 0x0a, 0x15, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x4d, 0x65, 0x74, 0x61, 0x64, - 0x61, 0x74, 0x61, 0x4d, 0x75, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x12, 0x41, 0x0a, 0x06, 0x6c, 0x61, - 0x62, 0x65, 0x6c, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x63, 0x6f, 0x6d, - 0x6d, 0x6f, 0x6e, 0x2e, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, - 0x74, 0x61, 0x4d, 0x75, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, - 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x12, 0x20, 0x0a, - 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x1a, - 0x39, 0x0a, 0x0b, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, - 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, - 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x42, 0x7f, 0x0a, 0x0a, 0x63, 0x6f, - 0x6d, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x42, 0x0b, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, - 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x2c, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, - 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x64, 0x66, 0x2f, 0x6f, 0x70, 0x65, 0x6e, - 0x74, 0x64, 0x66, 0x2d, 0x76, 0x32, 0x2d, 0x70, 0x6f, 0x63, 0x2f, 0x73, 0x64, 0x6b, 0x2f, 0x63, - 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0xa2, 0x02, 0x03, 0x43, 0x58, 0x58, 0xaa, 0x02, 0x06, 0x43, 0x6f, - 0x6d, 0x6d, 0x6f, 0x6e, 0xca, 0x02, 0x06, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0xe2, 0x02, 0x12, - 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, - 0x74, 0x61, 0xea, 0x02, 0x06, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x33, + 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x93, + 0x02, 0x0a, 0x08, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x39, 0x0a, 0x0a, 0x63, + 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x63, 0x72, 0x65, + 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x39, 0x0a, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x64, 0x5f, 0x61, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, + 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x41, + 0x74, 0x12, 0x34, 0x0a, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x1c, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x64, + 0x61, 0x74, 0x61, 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, + 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, + 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, + 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0x39, 0x0a, 0x0b, 0x4c, 0x61, 0x62, + 0x65, 0x6c, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x3a, 0x02, 0x38, 0x01, 0x22, 0xab, 0x01, 0x0a, 0x0f, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, + 0x61, 0x4d, 0x75, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x12, 0x3b, 0x0a, 0x06, 0x6c, 0x61, 0x62, 0x65, + 0x6c, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, + 0x6e, 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x4d, 0x75, 0x74, 0x61, 0x62, 0x6c, + 0x65, 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x6c, + 0x61, 0x62, 0x65, 0x6c, 0x73, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, + 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, + 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0x39, 0x0a, 0x0b, 0x4c, 0x61, 0x62, 0x65, 0x6c, + 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, + 0x38, 0x01, 0x42, 0x7f, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, + 0x42, 0x0b, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, + 0x2c, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x70, 0x65, 0x6e, + 0x74, 0x64, 0x66, 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x64, 0x66, 0x2d, 0x76, 0x32, 0x2d, 0x70, + 0x6f, 0x63, 0x2f, 0x73, 0x64, 0x6b, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0xa2, 0x02, 0x03, + 0x43, 0x58, 0x58, 0xaa, 0x02, 0x06, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0xca, 0x02, 0x06, 0x43, + 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0xe2, 0x02, 0x12, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x5c, 0x47, + 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x06, 0x43, 0x6f, 0x6d, + 0x6d, 0x6f, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -216,17 +214,17 @@ func file_common_common_proto_rawDescGZIP() []byte { var file_common_common_proto_msgTypes = make([]protoimpl.MessageInfo, 4) var file_common_common_proto_goTypes = []interface{}{ - (*PolicyMetadata)(nil), // 0: common.PolicyMetadata - (*PolicyMetadataMutable)(nil), // 1: common.PolicyMetadataMutable - nil, // 2: common.PolicyMetadata.LabelsEntry - nil, // 3: common.PolicyMetadataMutable.LabelsEntry + (*Metadata)(nil), // 0: common.Metadata + (*MetadataMutable)(nil), // 1: common.MetadataMutable + nil, // 2: common.Metadata.LabelsEntry + nil, // 3: common.MetadataMutable.LabelsEntry (*timestamppb.Timestamp)(nil), // 4: google.protobuf.Timestamp } var file_common_common_proto_depIdxs = []int32{ - 4, // 0: common.PolicyMetadata.created_at:type_name -> google.protobuf.Timestamp - 4, // 1: common.PolicyMetadata.updated_at:type_name -> google.protobuf.Timestamp - 2, // 2: common.PolicyMetadata.labels:type_name -> common.PolicyMetadata.LabelsEntry - 3, // 3: common.PolicyMetadataMutable.labels:type_name -> common.PolicyMetadataMutable.LabelsEntry + 4, // 0: common.Metadata.created_at:type_name -> google.protobuf.Timestamp + 4, // 1: common.Metadata.updated_at:type_name -> google.protobuf.Timestamp + 2, // 2: common.Metadata.labels:type_name -> common.Metadata.LabelsEntry + 3, // 3: common.MetadataMutable.labels:type_name -> common.MetadataMutable.LabelsEntry 4, // [4:4] is the sub-list for method output_type 4, // [4:4] is the sub-list for method input_type 4, // [4:4] is the sub-list for extension type_name @@ -241,7 +239,7 @@ func file_common_common_proto_init() { } if !protoimpl.UnsafeEnabled { file_common_common_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PolicyMetadata); i { + switch v := v.(*Metadata); i { case 0: return &v.state case 1: @@ -253,7 +251,7 @@ func file_common_common_proto_init() { } } file_common_common_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PolicyMetadataMutable); i { + switch v := v.(*MetadataMutable); i { case 0: return &v.state case 1: diff --git a/sdk/keyaccessserverregistry/key_access_server_registry.pb.go b/sdk/keyaccessserverregistry/key_access_server_registry.pb.go index 860b584f2e..01ee5da15e 100644 --- a/sdk/keyaccessserverregistry/key_access_server_registry.pb.go +++ b/sdk/keyaccessserverregistry/key_access_server_registry.pb.go @@ -29,8 +29,8 @@ type KeyAccessServer struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Metadata *common.PolicyMetadata `protobuf:"bytes,1,opt,name=metadata,proto3" json:"metadata,omitempty"` - Id string `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"` + Metadata *common.Metadata `protobuf:"bytes,1,opt,name=metadata,proto3" json:"metadata,omitempty"` + Id string `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"` // Kas Url Url string `protobuf:"bytes,3,opt,name=url,proto3" json:"url,omitempty"` // public key - optional since can also be retrieved via url @@ -69,7 +69,7 @@ func (*KeyAccessServer) Descriptor() ([]byte, []int) { return file_keyaccessserverregistry_key_access_server_registry_proto_rawDescGZIP(), []int{0} } -func (x *KeyAccessServer) GetMetadata() *common.PolicyMetadata { +func (x *KeyAccessServer) GetMetadata() *common.Metadata { if x != nil { return x.Metadata } @@ -552,152 +552,152 @@ var file_keyaccessserverregistry_key_access_server_registry_proto_rawDesc = []by 0x1a, 0x13, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x22, 0xfe, 0x03, 0x0a, 0x0f, 0x4b, 0x65, 0x79, 0x41, 0x63, 0x63, 0x65, 0x73, - 0x73, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x12, 0x32, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, - 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, - 0x6f, 0x6e, 0x2e, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, - 0x61, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x0e, 0x0a, 0x02, 0x69, - 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x87, 0x03, 0x0a, 0x03, - 0x75, 0x72, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0xf4, 0x02, 0xba, 0x48, 0xf0, 0x02, - 0xba, 0x01, 0xe9, 0x02, 0x0a, 0x0a, 0x66, 0x71, 0x6e, 0x5f, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, - 0x12, 0xd7, 0x01, 0x46, 0x51, 0x4e, 0x20, 0x6d, 0x75, 0x73, 0x74, 0x20, 0x73, 0x74, 0x61, 0x72, - 0x74, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x61, 0x20, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x20, 0x55, - 0x52, 0x4c, 0x20, 0x28, 0x65, 0x2e, 0x67, 0x2e, 0x2c, 0x20, 0x27, 0x68, 0x74, 0x74, 0x70, 0x73, - 0x3a, 0x2f, 0x2f, 0x64, 0x65, 0x6d, 0x6f, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x27, 0x29, 0x20, 0x66, - 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x20, 0x62, 0x79, 0x20, 0x61, 0x64, 0x64, 0x69, 0x74, - 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x73, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x20, - 0x45, 0x61, 0x63, 0x68, 0x20, 0x73, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x6d, 0x75, 0x73, - 0x74, 0x20, 0x73, 0x74, 0x61, 0x72, 0x74, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x65, 0x6e, 0x64, 0x20, - 0x77, 0x69, 0x74, 0x68, 0x20, 0x61, 0x6e, 0x20, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x6e, 0x75, 0x6d, - 0x65, 0x72, 0x69, 0x63, 0x20, 0x63, 0x68, 0x61, 0x72, 0x61, 0x63, 0x74, 0x65, 0x72, 0x2c, 0x20, - 0x63, 0x61, 0x6e, 0x20, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x20, 0x68, 0x79, 0x70, 0x68, - 0x65, 0x6e, 0x73, 0x2c, 0x20, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x6e, 0x75, 0x6d, 0x65, 0x72, 0x69, - 0x63, 0x20, 0x63, 0x68, 0x61, 0x72, 0x61, 0x63, 0x74, 0x65, 0x72, 0x73, 0x2c, 0x20, 0x61, 0x6e, - 0x64, 0x20, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x65, 0x73, 0x2e, 0x1a, 0x80, 0x01, 0x74, 0x68, 0x69, - 0x73, 0x2e, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x73, 0x28, 0x27, 0x5e, 0x68, 0x74, 0x74, 0x70, - 0x73, 0x3a, 0x2f, 0x2f, 0x5b, 0x61, 0x2d, 0x7a, 0x41, 0x2d, 0x5a, 0x30, 0x2d, 0x39, 0x5d, 0x28, - 0x5b, 0x61, 0x2d, 0x7a, 0x41, 0x2d, 0x5a, 0x30, 0x2d, 0x39, 0x5c, 0x5c, 0x2d, 0x5d, 0x7b, 0x30, - 0x2c, 0x36, 0x31, 0x7d, 0x5b, 0x61, 0x2d, 0x7a, 0x41, 0x2d, 0x5a, 0x30, 0x2d, 0x39, 0x5d, 0x29, - 0x3f, 0x28, 0x5c, 0x5c, 0x2e, 0x5b, 0x61, 0x2d, 0x7a, 0x41, 0x2d, 0x5a, 0x30, 0x2d, 0x39, 0x5d, - 0x28, 0x5b, 0x61, 0x2d, 0x7a, 0x41, 0x2d, 0x5a, 0x30, 0x2d, 0x39, 0x5c, 0x5c, 0x2d, 0x5d, 0x7b, - 0x30, 0x2c, 0x36, 0x31, 0x7d, 0x5b, 0x61, 0x2d, 0x7a, 0x41, 0x2d, 0x5a, 0x30, 0x2d, 0x39, 0x5d, - 0x29, 0x3f, 0x29, 0x2a, 0x28, 0x2f, 0x2e, 0x2a, 0x29, 0x3f, 0x24, 0x27, 0x29, 0xc8, 0x01, 0x01, - 0x52, 0x03, 0x75, 0x72, 0x6c, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, - 0x6b, 0x65, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, - 0x63, 0x4b, 0x65, 0x79, 0x22, 0x33, 0x0a, 0x19, 0x47, 0x65, 0x74, 0x4b, 0x65, 0x79, 0x41, 0x63, - 0x63, 0x65, 0x73, 0x73, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x12, 0x16, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x06, 0xba, - 0x48, 0x03, 0xc8, 0x01, 0x01, 0x52, 0x02, 0x69, 0x64, 0x22, 0x5e, 0x0a, 0x1a, 0x47, 0x65, 0x74, - 0x4b, 0x65, 0x79, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x40, 0x0a, 0x06, 0x73, 0x65, 0x72, 0x76, 0x65, - 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x6b, 0x65, 0x79, 0x61, 0x63, 0x63, - 0x65, 0x73, 0x73, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, - 0x79, 0x2e, 0x4b, 0x65, 0x79, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x53, 0x65, 0x72, 0x76, 0x65, - 0x72, 0x52, 0x06, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x22, 0x1d, 0x0a, 0x1b, 0x4c, 0x69, 0x73, - 0x74, 0x4b, 0x65, 0x79, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, - 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x62, 0x0a, 0x1c, 0x4c, 0x69, 0x73, 0x74, - 0x4b, 0x65, 0x79, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x73, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x42, 0x0a, 0x07, 0x73, 0x65, 0x72, 0x76, - 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x6b, 0x65, 0x79, 0x61, - 0x63, 0x63, 0x65, 0x73, 0x73, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x72, 0x65, 0x67, 0x69, 0x73, - 0x74, 0x72, 0x79, 0x2e, 0x4b, 0x65, 0x79, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x53, 0x65, 0x72, - 0x76, 0x65, 0x72, 0x52, 0x07, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x73, 0x22, 0x68, 0x0a, 0x1c, - 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4b, 0x65, 0x79, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x53, - 0x65, 0x72, 0x76, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x48, 0x0a, 0x06, - 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x6b, - 0x65, 0x79, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x72, 0x65, - 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x4b, 0x65, 0x79, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, - 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x42, 0x06, 0xba, 0x48, 0x03, 0xc8, 0x01, 0x01, 0x52, 0x06, - 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x22, 0x1f, 0x0a, 0x1d, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, - 0x4b, 0x65, 0x79, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x80, 0x01, 0x0a, 0x1c, 0x55, 0x70, 0x64, 0x61, - 0x74, 0x65, 0x4b, 0x65, 0x79, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x53, 0x65, 0x72, 0x76, 0x65, - 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x05, 0x42, 0x06, 0xba, 0x48, 0x03, 0xc8, 0x01, 0x01, 0x52, 0x02, 0x69, 0x64, - 0x12, 0x48, 0x0a, 0x06, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x28, 0x2e, 0x6b, 0x65, 0x79, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x73, 0x65, 0x72, 0x76, - 0x65, 0x72, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x4b, 0x65, 0x79, 0x41, 0x63, - 0x63, 0x65, 0x73, 0x73, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x42, 0x06, 0xba, 0x48, 0x03, 0xc8, - 0x01, 0x01, 0x52, 0x06, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x22, 0x1f, 0x0a, 0x1d, 0x55, 0x70, - 0x64, 0x61, 0x74, 0x65, 0x4b, 0x65, 0x79, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x53, 0x65, 0x72, - 0x76, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x36, 0x0a, 0x1c, 0x44, - 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4b, 0x65, 0x79, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x53, 0x65, + 0x6f, 0x74, 0x6f, 0x22, 0xf8, 0x03, 0x0a, 0x0f, 0x4b, 0x65, 0x79, 0x41, 0x63, 0x63, 0x65, 0x73, + 0x73, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x12, 0x2c, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, + 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, + 0x6f, 0x6e, 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x08, 0x6d, 0x65, 0x74, + 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x87, 0x03, 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x09, 0x42, 0xf4, 0x02, 0xba, 0x48, 0xf0, 0x02, 0xba, 0x01, 0xe9, 0x02, 0x0a, 0x0a, + 0x66, 0x71, 0x6e, 0x5f, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x12, 0xd7, 0x01, 0x46, 0x51, 0x4e, + 0x20, 0x6d, 0x75, 0x73, 0x74, 0x20, 0x73, 0x74, 0x61, 0x72, 0x74, 0x20, 0x77, 0x69, 0x74, 0x68, + 0x20, 0x61, 0x20, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x20, 0x55, 0x52, 0x4c, 0x20, 0x28, 0x65, 0x2e, + 0x67, 0x2e, 0x2c, 0x20, 0x27, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x64, 0x65, 0x6d, + 0x6f, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x27, 0x29, 0x20, 0x66, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x65, + 0x64, 0x20, 0x62, 0x79, 0x20, 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20, + 0x73, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x20, 0x45, 0x61, 0x63, 0x68, 0x20, 0x73, + 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x6d, 0x75, 0x73, 0x74, 0x20, 0x73, 0x74, 0x61, 0x72, + 0x74, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x65, 0x6e, 0x64, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x61, + 0x6e, 0x20, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x6e, 0x75, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x20, 0x63, + 0x68, 0x61, 0x72, 0x61, 0x63, 0x74, 0x65, 0x72, 0x2c, 0x20, 0x63, 0x61, 0x6e, 0x20, 0x63, 0x6f, + 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x20, 0x68, 0x79, 0x70, 0x68, 0x65, 0x6e, 0x73, 0x2c, 0x20, 0x61, + 0x6c, 0x70, 0x68, 0x61, 0x6e, 0x75, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x20, 0x63, 0x68, 0x61, 0x72, + 0x61, 0x63, 0x74, 0x65, 0x72, 0x73, 0x2c, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x73, 0x6c, 0x61, 0x73, + 0x68, 0x65, 0x73, 0x2e, 0x1a, 0x80, 0x01, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x6d, 0x61, 0x74, 0x63, + 0x68, 0x65, 0x73, 0x28, 0x27, 0x5e, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x5b, 0x61, + 0x2d, 0x7a, 0x41, 0x2d, 0x5a, 0x30, 0x2d, 0x39, 0x5d, 0x28, 0x5b, 0x61, 0x2d, 0x7a, 0x41, 0x2d, + 0x5a, 0x30, 0x2d, 0x39, 0x5c, 0x5c, 0x2d, 0x5d, 0x7b, 0x30, 0x2c, 0x36, 0x31, 0x7d, 0x5b, 0x61, + 0x2d, 0x7a, 0x41, 0x2d, 0x5a, 0x30, 0x2d, 0x39, 0x5d, 0x29, 0x3f, 0x28, 0x5c, 0x5c, 0x2e, 0x5b, + 0x61, 0x2d, 0x7a, 0x41, 0x2d, 0x5a, 0x30, 0x2d, 0x39, 0x5d, 0x28, 0x5b, 0x61, 0x2d, 0x7a, 0x41, + 0x2d, 0x5a, 0x30, 0x2d, 0x39, 0x5c, 0x5c, 0x2d, 0x5d, 0x7b, 0x30, 0x2c, 0x36, 0x31, 0x7d, 0x5b, + 0x61, 0x2d, 0x7a, 0x41, 0x2d, 0x5a, 0x30, 0x2d, 0x39, 0x5d, 0x29, 0x3f, 0x29, 0x2a, 0x28, 0x2f, + 0x2e, 0x2a, 0x29, 0x3f, 0x24, 0x27, 0x29, 0xc8, 0x01, 0x01, 0x52, 0x03, 0x75, 0x72, 0x6c, 0x12, + 0x1d, 0x0a, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x22, 0x33, + 0x0a, 0x19, 0x47, 0x65, 0x74, 0x4b, 0x65, 0x79, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x06, 0xba, 0x48, 0x03, 0xc8, 0x01, 0x01, 0x52, - 0x02, 0x69, 0x64, 0x22, 0x1f, 0x0a, 0x1d, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4b, 0x65, 0x79, - 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x32, 0xf1, 0x06, 0x0a, 0x1e, 0x4b, 0x65, 0x79, 0x41, 0x63, 0x63, 0x65, - 0x73, 0x73, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, - 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0xa0, 0x01, 0x0a, 0x14, 0x4c, 0x69, 0x73, 0x74, - 0x4b, 0x65, 0x79, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x73, - 0x12, 0x34, 0x2e, 0x6b, 0x65, 0x79, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x73, 0x65, 0x72, 0x76, - 0x65, 0x72, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4b, - 0x65, 0x79, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x73, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x35, 0x2e, 0x6b, 0x65, 0x79, 0x61, 0x63, 0x63, 0x65, - 0x73, 0x73, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, - 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4b, 0x65, 0x79, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x53, 0x65, - 0x72, 0x76, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1b, 0x82, - 0xd3, 0xe4, 0x93, 0x02, 0x15, 0x12, 0x13, 0x2f, 0x6b, 0x65, 0x79, 0x2d, 0x61, 0x63, 0x63, 0x65, - 0x73, 0x73, 0x2d, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x73, 0x12, 0x9f, 0x01, 0x0a, 0x12, 0x47, - 0x65, 0x74, 0x4b, 0x65, 0x79, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x53, 0x65, 0x72, 0x76, 0x65, - 0x72, 0x12, 0x32, 0x2e, 0x6b, 0x65, 0x79, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x73, 0x65, 0x72, - 0x76, 0x65, 0x72, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x47, 0x65, 0x74, 0x4b, - 0x65, 0x79, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x33, 0x2e, 0x6b, 0x65, 0x79, 0x61, 0x63, 0x63, 0x65, 0x73, - 0x73, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, - 0x47, 0x65, 0x74, 0x4b, 0x65, 0x79, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x53, 0x65, 0x72, 0x76, - 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x20, 0x82, 0xd3, 0xe4, 0x93, - 0x02, 0x1a, 0x12, 0x18, 0x2f, 0x6b, 0x65, 0x79, 0x2d, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x2d, - 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x73, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x12, 0xab, 0x01, 0x0a, - 0x15, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4b, 0x65, 0x79, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, - 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x12, 0x35, 0x2e, 0x6b, 0x65, 0x79, 0x61, 0x63, 0x63, 0x65, + 0x02, 0x69, 0x64, 0x22, 0x5e, 0x0a, 0x1a, 0x47, 0x65, 0x74, 0x4b, 0x65, 0x79, 0x41, 0x63, 0x63, + 0x65, 0x73, 0x73, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x40, 0x0a, 0x06, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x28, 0x2e, 0x6b, 0x65, 0x79, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x73, 0x65, 0x72, + 0x76, 0x65, 0x72, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x4b, 0x65, 0x79, 0x41, + 0x63, 0x63, 0x65, 0x73, 0x73, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x52, 0x06, 0x73, 0x65, 0x72, + 0x76, 0x65, 0x72, 0x22, 0x1d, 0x0a, 0x1b, 0x4c, 0x69, 0x73, 0x74, 0x4b, 0x65, 0x79, 0x41, 0x63, + 0x63, 0x65, 0x73, 0x73, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x22, 0x62, 0x0a, 0x1c, 0x4c, 0x69, 0x73, 0x74, 0x4b, 0x65, 0x79, 0x41, 0x63, 0x63, + 0x65, 0x73, 0x73, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x42, 0x0a, 0x07, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x6b, 0x65, 0x79, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x73, + 0x65, 0x72, 0x76, 0x65, 0x72, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x4b, 0x65, + 0x79, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x52, 0x07, 0x73, + 0x65, 0x72, 0x76, 0x65, 0x72, 0x73, 0x22, 0x68, 0x0a, 0x1c, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, + 0x4b, 0x65, 0x79, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x48, 0x0a, 0x06, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x6b, 0x65, 0x79, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, - 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4b, 0x65, 0x79, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, - 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x36, 0x2e, - 0x6b, 0x65, 0x79, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x72, - 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4b, 0x65, + 0x2e, 0x4b, 0x65, 0x79, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, + 0x42, 0x06, 0xba, 0x48, 0x03, 0xc8, 0x01, 0x01, 0x52, 0x06, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, + 0x22, 0x1f, 0x0a, 0x1d, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4b, 0x65, 0x79, 0x41, 0x63, 0x63, + 0x65, 0x73, 0x73, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x80, 0x01, 0x0a, 0x1c, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4b, 0x65, 0x79, 0x41, + 0x63, 0x63, 0x65, 0x73, 0x73, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x16, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x42, 0x06, + 0xba, 0x48, 0x03, 0xc8, 0x01, 0x01, 0x52, 0x02, 0x69, 0x64, 0x12, 0x48, 0x0a, 0x06, 0x73, 0x65, + 0x72, 0x76, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x6b, 0x65, 0x79, + 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x72, 0x65, 0x67, 0x69, + 0x73, 0x74, 0x72, 0x79, 0x2e, 0x4b, 0x65, 0x79, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x53, 0x65, + 0x72, 0x76, 0x65, 0x72, 0x42, 0x06, 0xba, 0x48, 0x03, 0xc8, 0x01, 0x01, 0x52, 0x06, 0x73, 0x65, + 0x72, 0x76, 0x65, 0x72, 0x22, 0x1f, 0x0a, 0x1d, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4b, 0x65, 0x79, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x23, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1d, 0x3a, 0x06, 0x73, - 0x65, 0x72, 0x76, 0x65, 0x72, 0x22, 0x13, 0x2f, 0x6b, 0x65, 0x79, 0x2d, 0x61, 0x63, 0x63, 0x65, - 0x73, 0x73, 0x2d, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x73, 0x12, 0xb0, 0x01, 0x0a, 0x15, 0x55, - 0x70, 0x64, 0x61, 0x74, 0x65, 0x4b, 0x65, 0x79, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x53, 0x65, - 0x72, 0x76, 0x65, 0x72, 0x12, 0x35, 0x2e, 0x6b, 0x65, 0x79, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, - 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x55, - 0x70, 0x64, 0x61, 0x74, 0x65, 0x4b, 0x65, 0x79, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x53, 0x65, - 0x72, 0x76, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x36, 0x2e, 0x6b, 0x65, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x36, 0x0a, 0x1c, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4b, + 0x65, 0x79, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x42, 0x06, 0xba, 0x48, 0x03, 0xc8, 0x01, 0x01, 0x52, 0x02, 0x69, 0x64, 0x22, 0x1f, 0x0a, + 0x1d, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4b, 0x65, 0x79, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, + 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0xf1, + 0x06, 0x0a, 0x1e, 0x4b, 0x65, 0x79, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x53, 0x65, 0x72, 0x76, + 0x65, 0x72, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x12, 0xa0, 0x01, 0x0a, 0x14, 0x4c, 0x69, 0x73, 0x74, 0x4b, 0x65, 0x79, 0x41, 0x63, 0x63, + 0x65, 0x73, 0x73, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x73, 0x12, 0x34, 0x2e, 0x6b, 0x65, 0x79, + 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x72, 0x65, 0x67, 0x69, + 0x73, 0x74, 0x72, 0x79, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4b, 0x65, 0x79, 0x41, 0x63, 0x63, 0x65, + 0x73, 0x73, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x35, 0x2e, 0x6b, 0x65, 0x79, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x73, 0x65, 0x72, 0x76, + 0x65, 0x72, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4b, + 0x65, 0x79, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x73, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x15, 0x12, + 0x13, 0x2f, 0x6b, 0x65, 0x79, 0x2d, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x2d, 0x73, 0x65, 0x72, + 0x76, 0x65, 0x72, 0x73, 0x12, 0x9f, 0x01, 0x0a, 0x12, 0x47, 0x65, 0x74, 0x4b, 0x65, 0x79, 0x41, + 0x63, 0x63, 0x65, 0x73, 0x73, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x12, 0x32, 0x2e, 0x6b, 0x65, 0x79, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x72, 0x65, 0x67, - 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4b, 0x65, 0x79, 0x41, - 0x63, 0x63, 0x65, 0x73, 0x73, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x22, 0x28, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x22, 0x3a, 0x06, 0x73, 0x65, 0x72, - 0x76, 0x65, 0x72, 0x1a, 0x18, 0x2f, 0x6b, 0x65, 0x79, 0x2d, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, - 0x2d, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x73, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x12, 0xa8, 0x01, - 0x0a, 0x15, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4b, 0x65, 0x79, 0x41, 0x63, 0x63, 0x65, 0x73, - 0x73, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x12, 0x35, 0x2e, 0x6b, 0x65, 0x79, 0x61, 0x63, 0x63, + 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x47, 0x65, 0x74, 0x4b, 0x65, 0x79, 0x41, 0x63, 0x63, 0x65, + 0x73, 0x73, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x33, 0x2e, 0x6b, 0x65, 0x79, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x73, 0x65, 0x72, 0x76, 0x65, + 0x72, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x47, 0x65, 0x74, 0x4b, 0x65, 0x79, + 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x20, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1a, 0x12, 0x18, 0x2f, 0x6b, + 0x65, 0x79, 0x2d, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x2d, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, + 0x73, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x12, 0xab, 0x01, 0x0a, 0x15, 0x43, 0x72, 0x65, 0x61, 0x74, + 0x65, 0x4b, 0x65, 0x79, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, + 0x12, 0x35, 0x2e, 0x6b, 0x65, 0x79, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x73, 0x65, 0x72, 0x76, + 0x65, 0x72, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, + 0x65, 0x4b, 0x65, 0x79, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x36, 0x2e, 0x6b, 0x65, 0x79, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, - 0x79, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4b, 0x65, 0x79, 0x41, 0x63, 0x63, 0x65, 0x73, - 0x73, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x36, + 0x79, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4b, 0x65, 0x79, 0x41, 0x63, 0x63, 0x65, 0x73, + 0x73, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x23, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1d, 0x3a, 0x06, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x22, + 0x13, 0x2f, 0x6b, 0x65, 0x79, 0x2d, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x2d, 0x73, 0x65, 0x72, + 0x76, 0x65, 0x72, 0x73, 0x12, 0xb0, 0x01, 0x0a, 0x15, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4b, + 0x65, 0x79, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x12, 0x35, 0x2e, 0x6b, 0x65, 0x79, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, - 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4b, + 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4b, 0x65, 0x79, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x20, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1a, 0x2a, 0x18, - 0x2f, 0x6b, 0x65, 0x79, 0x2d, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x2d, 0x73, 0x65, 0x72, 0x76, - 0x65, 0x72, 0x73, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x42, 0xf6, 0x01, 0x0a, 0x1b, 0x63, 0x6f, 0x6d, - 0x2e, 0x6b, 0x65, 0x79, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, - 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x42, 0x1c, 0x4b, 0x65, 0x79, 0x41, 0x63, 0x63, - 0x65, 0x73, 0x73, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, - 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3d, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, - 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x64, 0x66, 0x2f, 0x6f, 0x70, 0x65, - 0x6e, 0x74, 0x64, 0x66, 0x2d, 0x76, 0x32, 0x2d, 0x70, 0x6f, 0x63, 0x2f, 0x73, 0x64, 0x6b, 0x2f, - 0x6b, 0x65, 0x79, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x72, - 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0xa2, 0x02, 0x03, 0x4b, 0x58, 0x58, 0xaa, 0x02, 0x17, - 0x4b, 0x65, 0x79, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x72, - 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0xca, 0x02, 0x17, 0x4b, 0x65, 0x79, 0x61, 0x63, 0x63, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x36, 0x2e, 0x6b, 0x65, 0x79, 0x61, 0x63, 0x63, 0x65, 0x73, + 0x73, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4b, 0x65, 0x79, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x53, + 0x65, 0x72, 0x76, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x28, 0x82, + 0xd3, 0xe4, 0x93, 0x02, 0x22, 0x3a, 0x06, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x1a, 0x18, 0x2f, + 0x6b, 0x65, 0x79, 0x2d, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x2d, 0x73, 0x65, 0x72, 0x76, 0x65, + 0x72, 0x73, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x12, 0xa8, 0x01, 0x0a, 0x15, 0x44, 0x65, 0x6c, 0x65, + 0x74, 0x65, 0x4b, 0x65, 0x79, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x53, 0x65, 0x72, 0x76, 0x65, + 0x72, 0x12, 0x35, 0x2e, 0x6b, 0x65, 0x79, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x73, 0x65, 0x72, + 0x76, 0x65, 0x72, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x44, 0x65, 0x6c, 0x65, + 0x74, 0x65, 0x4b, 0x65, 0x79, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x53, 0x65, 0x72, 0x76, 0x65, + 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x36, 0x2e, 0x6b, 0x65, 0x79, 0x61, 0x63, + 0x63, 0x65, 0x73, 0x73, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, + 0x72, 0x79, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4b, 0x65, 0x79, 0x41, 0x63, 0x63, 0x65, + 0x73, 0x73, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x20, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1a, 0x2a, 0x18, 0x2f, 0x6b, 0x65, 0x79, 0x2d, 0x61, + 0x63, 0x63, 0x65, 0x73, 0x73, 0x2d, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x73, 0x2f, 0x7b, 0x69, + 0x64, 0x7d, 0x42, 0xf6, 0x01, 0x0a, 0x1b, 0x63, 0x6f, 0x6d, 0x2e, 0x6b, 0x65, 0x79, 0x61, 0x63, + 0x63, 0x65, 0x73, 0x73, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, + 0x72, 0x79, 0x42, 0x1c, 0x4b, 0x65, 0x79, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x53, 0x65, 0x72, + 0x76, 0x65, 0x72, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f, + 0x50, 0x01, 0x5a, 0x3d, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, + 0x70, 0x65, 0x6e, 0x74, 0x64, 0x66, 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x64, 0x66, 0x2d, 0x76, + 0x32, 0x2d, 0x70, 0x6f, 0x63, 0x2f, 0x73, 0x64, 0x6b, 0x2f, 0x6b, 0x65, 0x79, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, - 0x79, 0xe2, 0x02, 0x23, 0x4b, 0x65, 0x79, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x73, 0x65, 0x72, - 0x76, 0x65, 0x72, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x5c, 0x47, 0x50, 0x42, 0x4d, - 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x17, 0x4b, 0x65, 0x79, 0x61, 0x63, 0x63, + 0x79, 0xa2, 0x02, 0x03, 0x4b, 0x58, 0x58, 0xaa, 0x02, 0x17, 0x4b, 0x65, 0x79, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, - 0x79, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x79, 0xca, 0x02, 0x17, 0x4b, 0x65, 0x79, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x73, 0x65, 0x72, + 0x76, 0x65, 0x72, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0xe2, 0x02, 0x23, 0x4b, 0x65, + 0x79, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x72, 0x65, 0x67, + 0x69, 0x73, 0x74, 0x72, 0x79, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, + 0x61, 0xea, 0x02, 0x17, 0x4b, 0x65, 0x79, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x73, 0x65, 0x72, + 0x76, 0x65, 0x72, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x62, 0x06, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x33, } var ( @@ -725,10 +725,10 @@ var file_keyaccessserverregistry_key_access_server_registry_proto_goTypes = []in (*UpdateKeyAccessServerResponse)(nil), // 8: keyaccessserverregistry.UpdateKeyAccessServerResponse (*DeleteKeyAccessServerRequest)(nil), // 9: keyaccessserverregistry.DeleteKeyAccessServerRequest (*DeleteKeyAccessServerResponse)(nil), // 10: keyaccessserverregistry.DeleteKeyAccessServerResponse - (*common.PolicyMetadata)(nil), // 11: common.PolicyMetadata + (*common.Metadata)(nil), // 11: common.Metadata } var file_keyaccessserverregistry_key_access_server_registry_proto_depIdxs = []int32{ - 11, // 0: keyaccessserverregistry.KeyAccessServer.metadata:type_name -> common.PolicyMetadata + 11, // 0: keyaccessserverregistry.KeyAccessServer.metadata:type_name -> common.Metadata 0, // 1: keyaccessserverregistry.GetKeyAccessServerResponse.server:type_name -> keyaccessserverregistry.KeyAccessServer 0, // 2: keyaccessserverregistry.ListKeyAccessServersResponse.servers:type_name -> keyaccessserverregistry.KeyAccessServer 0, // 3: keyaccessserverregistry.CreateKeyAccessServerRequest.server:type_name -> keyaccessserverregistry.KeyAccessServer diff --git a/sdk/resourcemapping/resource_mapping.pb.go b/sdk/resourcemapping/resource_mapping.pb.go index f356891bc8..22381f465b 100644 --- a/sdk/resourcemapping/resource_mapping.pb.go +++ b/sdk/resourcemapping/resource_mapping.pb.go @@ -65,10 +65,10 @@ type ResourceMapping struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Metadata *common.PolicyMetadata `protobuf:"bytes,1,opt,name=metadata,proto3" json:"metadata,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - AttributeValueId string `protobuf:"bytes,3,opt,name=attribute_value_id,json=attributeValueId,proto3" json:"attribute_value_id,omitempty"` - Terms []string `protobuf:"bytes,4,rep,name=terms,proto3" json:"terms,omitempty"` + Metadata *common.Metadata `protobuf:"bytes,1,opt,name=metadata,proto3" json:"metadata,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + AttributeValueId string `protobuf:"bytes,3,opt,name=attribute_value_id,json=attributeValueId,proto3" json:"attribute_value_id,omitempty"` + Terms []string `protobuf:"bytes,4,rep,name=terms,proto3" json:"terms,omitempty"` } func (x *ResourceMapping) Reset() { @@ -103,7 +103,7 @@ func (*ResourceMapping) Descriptor() ([]byte, []int) { return file_resourcemapping_resource_mapping_proto_rawDescGZIP(), []int{0} } -func (x *ResourceMapping) GetMetadata() *common.PolicyMetadata { +func (x *ResourceMapping) GetMetadata() *common.Metadata { if x != nil { return x.Metadata } @@ -584,120 +584,119 @@ var file_resourcemapping_resource_mapping_proto_rawDesc = []byte{ 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x13, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x9d, 0x01, 0x0a, 0x0f, 0x52, 0x65, - 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x12, 0x32, 0x0a, + 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x97, 0x01, 0x0a, 0x0f, 0x52, 0x65, + 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x12, 0x2c, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x16, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x4d, - 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, - 0x61, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x2c, 0x0a, 0x12, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, - 0x74, 0x65, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x10, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x56, 0x61, 0x6c, 0x75, - 0x65, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x65, 0x72, 0x6d, 0x73, 0x18, 0x04, 0x20, 0x03, - 0x28, 0x09, 0x52, 0x05, 0x74, 0x65, 0x72, 0x6d, 0x73, 0x22, 0x1d, 0x0a, 0x1b, 0x4c, 0x69, 0x73, - 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, - 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x5c, 0x0a, 0x1c, 0x4c, 0x69, 0x73, 0x74, - 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x73, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3c, 0x0a, 0x08, 0x6d, 0x61, 0x70, 0x70, - 0x69, 0x6e, 0x67, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x72, 0x65, 0x73, - 0x6f, 0x75, 0x72, 0x63, 0x65, 0x6d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x2e, 0x52, 0x65, 0x73, - 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x52, 0x08, 0x6d, 0x61, - 0x70, 0x70, 0x69, 0x6e, 0x67, 0x73, 0x22, 0x33, 0x0a, 0x19, 0x47, 0x65, 0x74, 0x52, 0x65, 0x73, - 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, - 0x06, 0xba, 0x48, 0x03, 0xc8, 0x01, 0x01, 0x52, 0x02, 0x69, 0x64, 0x22, 0x58, 0x0a, 0x1a, 0x47, - 0x65, 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4d, 0x61, 0x70, 0x70, 0x69, 0x6e, - 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3a, 0x0a, 0x07, 0x6d, 0x61, 0x70, - 0x70, 0x69, 0x6e, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x72, 0x65, 0x73, - 0x6f, 0x75, 0x72, 0x63, 0x65, 0x6d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x2e, 0x52, 0x65, 0x73, - 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x52, 0x07, 0x6d, 0x61, - 0x70, 0x70, 0x69, 0x6e, 0x67, 0x22, 0x62, 0x0a, 0x1c, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, - 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x42, 0x0a, 0x07, 0x6d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, - 0x65, 0x6d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, - 0x65, 0x4d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x42, 0x06, 0xba, 0x48, 0x03, 0xc8, 0x01, 0x01, - 0x52, 0x07, 0x6d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x22, 0x1f, 0x0a, 0x1d, 0x43, 0x72, 0x65, - 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4d, 0x61, 0x70, 0x70, 0x69, - 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x7a, 0x0a, 0x1c, 0x55, 0x70, - 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4d, 0x61, 0x70, 0x70, - 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x02, 0x69, 0x64, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x42, 0x06, 0xba, 0x48, 0x03, 0xc8, 0x01, 0x01, 0x52, 0x02, - 0x69, 0x64, 0x12, 0x42, 0x0a, 0x07, 0x6d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x6d, 0x61, - 0x70, 0x70, 0x69, 0x6e, 0x67, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4d, 0x61, - 0x70, 0x70, 0x69, 0x6e, 0x67, 0x42, 0x06, 0xba, 0x48, 0x03, 0xc8, 0x01, 0x01, 0x52, 0x07, 0x6d, - 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x22, 0x1f, 0x0a, 0x1d, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, - 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x36, 0x0a, 0x1c, 0x44, 0x65, 0x6c, 0x65, 0x74, - 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x05, 0x42, 0x06, 0xba, 0x48, 0x03, 0xc8, 0x01, 0x01, 0x52, 0x02, 0x69, 0x64, 0x22, - 0x1f, 0x0a, 0x1d, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, - 0x65, 0x4d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x32, 0x96, 0x06, 0x0a, 0x16, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4d, 0x61, 0x70, - 0x70, 0x69, 0x6e, 0x67, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x8f, 0x01, 0x0a, 0x14, - 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4d, 0x61, 0x70, 0x70, - 0x69, 0x6e, 0x67, 0x73, 0x12, 0x2c, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x6d, - 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, + 0x10, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, + 0x61, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x12, 0x0a, 0x04, 0x6e, + 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, + 0x2c, 0x0a, 0x12, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x5f, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x61, 0x74, 0x74, + 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x49, 0x64, 0x12, 0x14, 0x0a, + 0x05, 0x74, 0x65, 0x72, 0x6d, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, 0x05, 0x74, 0x65, + 0x72, 0x6d, 0x73, 0x22, 0x1d, 0x0a, 0x1b, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x2d, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x6d, 0x61, 0x70, - 0x70, 0x69, 0x6e, 0x67, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, - 0x65, 0x4d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x22, 0x1a, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x14, 0x12, 0x12, 0x2f, 0x72, 0x65, 0x73, 0x6f, - 0x75, 0x72, 0x63, 0x65, 0x2d, 0x6d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x8e, 0x01, - 0x0a, 0x12, 0x47, 0x65, 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4d, 0x61, 0x70, - 0x70, 0x69, 0x6e, 0x67, 0x12, 0x2a, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x6d, - 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, - 0x63, 0x65, 0x4d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x2b, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x6d, 0x61, 0x70, 0x70, 0x69, - 0x6e, 0x67, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4d, 0x61, - 0x70, 0x70, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1f, 0x82, - 0xd3, 0xe4, 0x93, 0x02, 0x19, 0x12, 0x17, 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, - 0x2d, 0x6d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x73, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x12, 0x9b, - 0x01, 0x0a, 0x15, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, - 0x65, 0x4d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x12, 0x2d, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, - 0x72, 0x63, 0x65, 0x6d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, - 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2e, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, - 0x63, 0x65, 0x6d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, + 0x73, 0x74, 0x22, 0x5c, 0x0a, 0x1c, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x4d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x3c, 0x0a, 0x08, 0x6d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x01, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x6d, + 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4d, + 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x52, 0x08, 0x6d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x73, + 0x22, 0x33, 0x0a, 0x19, 0x47, 0x65, 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4d, + 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, + 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x06, 0xba, 0x48, 0x03, 0xc8, 0x01, + 0x01, 0x52, 0x02, 0x69, 0x64, 0x22, 0x58, 0x0a, 0x1a, 0x47, 0x65, 0x74, 0x52, 0x65, 0x73, 0x6f, + 0x75, 0x72, 0x63, 0x65, 0x4d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x3a, 0x0a, 0x07, 0x6d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x6d, + 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4d, + 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x52, 0x07, 0x6d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x22, + 0x62, 0x0a, 0x1c, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, + 0x65, 0x4d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, + 0x42, 0x0a, 0x07, 0x6d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x20, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x6d, 0x61, 0x70, 0x70, 0x69, + 0x6e, 0x67, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4d, 0x61, 0x70, 0x70, 0x69, + 0x6e, 0x67, 0x42, 0x06, 0xba, 0x48, 0x03, 0xc8, 0x01, 0x01, 0x52, 0x07, 0x6d, 0x61, 0x70, 0x70, + 0x69, 0x6e, 0x67, 0x22, 0x1f, 0x0a, 0x1d, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x7a, 0x0a, 0x1c, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, + 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, + 0x42, 0x06, 0xba, 0x48, 0x03, 0xc8, 0x01, 0x01, 0x52, 0x02, 0x69, 0x64, 0x12, 0x42, 0x0a, 0x07, + 0x6d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, + 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x6d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x2e, + 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x42, + 0x06, 0xba, 0x48, 0x03, 0xc8, 0x01, 0x01, 0x52, 0x07, 0x6d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, + 0x22, 0x1f, 0x0a, 0x1d, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x4d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x36, 0x0a, 0x1c, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, + 0x72, 0x63, 0x65, 0x4d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x16, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x42, 0x06, 0xba, + 0x48, 0x03, 0xc8, 0x01, 0x01, 0x52, 0x02, 0x69, 0x64, 0x22, 0x1f, 0x0a, 0x1d, 0x44, 0x65, 0x6c, + 0x65, 0x74, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4d, 0x61, 0x70, 0x70, 0x69, + 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0x96, 0x06, 0x0a, 0x16, 0x52, + 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x53, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x8f, 0x01, 0x0a, 0x14, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, + 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x2c, + 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x6d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, + 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4d, 0x61, 0x70, + 0x70, 0x69, 0x6e, 0x67, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2d, 0x2e, 0x72, + 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x6d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x2e, 0x4c, + 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4d, 0x61, 0x70, 0x70, 0x69, + 0x6e, 0x67, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1a, 0x82, 0xd3, 0xe4, + 0x93, 0x02, 0x14, 0x12, 0x12, 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2d, 0x6d, + 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x8e, 0x01, 0x0a, 0x12, 0x47, 0x65, 0x74, 0x52, + 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x12, 0x2a, + 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x6d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, + 0x2e, 0x47, 0x65, 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4d, 0x61, 0x70, 0x70, + 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x72, 0x65, 0x73, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x6d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x23, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1d, 0x3a, - 0x07, 0x6d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x22, 0x12, 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, - 0x72, 0x63, 0x65, 0x2d, 0x6d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x73, 0x12, 0xa0, 0x01, 0x0a, - 0x15, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4d, - 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x12, 0x2d, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, - 0x65, 0x6d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, - 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2e, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, - 0x6d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, - 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x28, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x22, 0x3a, 0x07, 0x6d, - 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x22, 0x17, 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, - 0x65, 0x2d, 0x6d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x73, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x12, - 0x97, 0x01, 0x0a, 0x15, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, - 0x63, 0x65, 0x4d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x12, 0x2d, 0x2e, 0x72, 0x65, 0x73, 0x6f, - 0x75, 0x72, 0x63, 0x65, 0x6d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x2e, 0x44, 0x65, 0x6c, 0x65, - 0x74, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4d, 0x61, 0x70, 0x70, 0x69, 0x6e, - 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2e, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, - 0x72, 0x63, 0x65, 0x6d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1f, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x19, 0x12, + 0x17, 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2d, 0x6d, 0x61, 0x70, 0x70, 0x69, + 0x6e, 0x67, 0x73, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x12, 0x9b, 0x01, 0x0a, 0x15, 0x43, 0x72, 0x65, + 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4d, 0x61, 0x70, 0x70, 0x69, + 0x6e, 0x67, 0x12, 0x2d, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x6d, 0x61, 0x70, + 0x70, 0x69, 0x6e, 0x67, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, + 0x72, 0x63, 0x65, 0x4d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x2e, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x6d, 0x61, 0x70, 0x70, + 0x69, 0x6e, 0x67, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x4d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x23, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1d, 0x3a, 0x07, 0x6d, 0x61, 0x70, 0x70, 0x69, + 0x6e, 0x67, 0x22, 0x12, 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2d, 0x6d, 0x61, + 0x70, 0x70, 0x69, 0x6e, 0x67, 0x73, 0x12, 0xa0, 0x01, 0x0a, 0x15, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1f, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x19, - 0x2a, 0x17, 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2d, 0x6d, 0x61, 0x70, 0x70, - 0x69, 0x6e, 0x67, 0x73, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x42, 0xbe, 0x01, 0x0a, 0x13, 0x63, 0x6f, - 0x6d, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x6d, 0x61, 0x70, 0x70, 0x69, 0x6e, - 0x67, 0x42, 0x14, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4d, 0x61, 0x70, 0x70, 0x69, - 0x6e, 0x67, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x35, 0x67, 0x69, 0x74, 0x68, 0x75, - 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x64, 0x66, 0x2f, 0x6f, 0x70, - 0x65, 0x6e, 0x74, 0x64, 0x66, 0x2d, 0x76, 0x32, 0x2d, 0x70, 0x6f, 0x63, 0x2f, 0x73, 0x64, 0x6b, - 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x6d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, - 0xa2, 0x02, 0x03, 0x52, 0x58, 0x58, 0xaa, 0x02, 0x0f, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, - 0x65, 0x6d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0xca, 0x02, 0x0f, 0x52, 0x65, 0x73, 0x6f, 0x75, - 0x72, 0x63, 0x65, 0x6d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0xe2, 0x02, 0x1b, 0x52, 0x65, 0x73, - 0x6f, 0x75, 0x72, 0x63, 0x65, 0x6d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x5c, 0x47, 0x50, 0x42, - 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0f, 0x52, 0x65, 0x73, 0x6f, 0x75, - 0x72, 0x63, 0x65, 0x6d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x33, + 0x12, 0x2d, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x6d, 0x61, 0x70, 0x70, 0x69, + 0x6e, 0x67, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, + 0x65, 0x4d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x2e, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x6d, 0x61, 0x70, 0x70, 0x69, 0x6e, + 0x67, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x4d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x28, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x22, 0x3a, 0x07, 0x6d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, + 0x22, 0x17, 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2d, 0x6d, 0x61, 0x70, 0x70, + 0x69, 0x6e, 0x67, 0x73, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x12, 0x97, 0x01, 0x0a, 0x15, 0x44, 0x65, + 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4d, 0x61, 0x70, 0x70, + 0x69, 0x6e, 0x67, 0x12, 0x2d, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x6d, 0x61, + 0x70, 0x70, 0x69, 0x6e, 0x67, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x73, 0x6f, + 0x75, 0x72, 0x63, 0x65, 0x4d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x2e, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x6d, 0x61, 0x70, + 0x70, 0x69, 0x6e, 0x67, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, + 0x72, 0x63, 0x65, 0x4d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x22, 0x1f, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x19, 0x2a, 0x17, 0x2f, 0x72, 0x65, 0x73, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2d, 0x6d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x73, 0x2f, 0x7b, + 0x69, 0x64, 0x7d, 0x42, 0xbe, 0x01, 0x0a, 0x13, 0x63, 0x6f, 0x6d, 0x2e, 0x72, 0x65, 0x73, 0x6f, + 0x75, 0x72, 0x63, 0x65, 0x6d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x42, 0x14, 0x52, 0x65, 0x73, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x50, 0x72, 0x6f, 0x74, + 0x6f, 0x50, 0x01, 0x5a, 0x35, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, + 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x64, 0x66, 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x64, 0x66, 0x2d, + 0x76, 0x32, 0x2d, 0x70, 0x6f, 0x63, 0x2f, 0x73, 0x64, 0x6b, 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, + 0x72, 0x63, 0x65, 0x6d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0xa2, 0x02, 0x03, 0x52, 0x58, 0x58, + 0xaa, 0x02, 0x0f, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x6d, 0x61, 0x70, 0x70, 0x69, + 0x6e, 0x67, 0xca, 0x02, 0x0f, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x6d, 0x61, 0x70, + 0x70, 0x69, 0x6e, 0x67, 0xe2, 0x02, 0x1b, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x6d, + 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, + 0x74, 0x61, 0xea, 0x02, 0x0f, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x6d, 0x61, 0x70, + 0x70, 0x69, 0x6e, 0x67, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -725,10 +724,10 @@ var file_resourcemapping_resource_mapping_proto_goTypes = []interface{}{ (*UpdateResourceMappingResponse)(nil), // 8: resourcemapping.UpdateResourceMappingResponse (*DeleteResourceMappingRequest)(nil), // 9: resourcemapping.DeleteResourceMappingRequest (*DeleteResourceMappingResponse)(nil), // 10: resourcemapping.DeleteResourceMappingResponse - (*common.PolicyMetadata)(nil), // 11: common.PolicyMetadata + (*common.Metadata)(nil), // 11: common.Metadata } var file_resourcemapping_resource_mapping_proto_depIdxs = []int32{ - 11, // 0: resourcemapping.ResourceMapping.metadata:type_name -> common.PolicyMetadata + 11, // 0: resourcemapping.ResourceMapping.metadata:type_name -> common.Metadata 0, // 1: resourcemapping.ListResourceMappingsResponse.mappings:type_name -> resourcemapping.ResourceMapping 0, // 2: resourcemapping.GetResourceMappingResponse.mapping:type_name -> resourcemapping.ResourceMapping 0, // 3: resourcemapping.CreateResourceMappingRequest.mapping:type_name -> resourcemapping.ResourceMapping diff --git a/sdk/subjectmapping/subject_mapping.pb.go b/sdk/subjectmapping/subject_mapping.pb.go index 8c2dd93a46..1495f8bd2a 100644 --- a/sdk/subjectmapping/subject_mapping.pb.go +++ b/sdk/subjectmapping/subject_mapping.pb.go @@ -126,7 +126,7 @@ type SubjectMapping struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Metadata *common.PolicyMetadata `protobuf:"bytes,1,opt,name=metadata,proto3" json:"metadata,omitempty"` + Metadata *common.Metadata `protobuf:"bytes,1,opt,name=metadata,proto3" json:"metadata,omitempty"` // Attribute Value to be mapped to AttributeValueId string `protobuf:"bytes,2,opt,name=attribute_value_id,json=attributeValueId,proto3" json:"attribute_value_id,omitempty"` // Resource Attribute Key; NOT Attribute Definition Attribute name @@ -169,7 +169,7 @@ func (*SubjectMapping) Descriptor() ([]byte, []int) { return file_subjectmapping_subject_mapping_proto_rawDescGZIP(), []int{0} } -func (x *SubjectMapping) GetMetadata() *common.PolicyMetadata { +func (x *SubjectMapping) GetMetadata() *common.Metadata { if x != nil { return x.Metadata } @@ -657,139 +657,139 @@ var file_subjectmapping_subject_mapping_proto_rawDesc = []byte{ 0x6f, 0x74, 0x6f, 0x1a, 0x13, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xc8, 0x03, 0x0a, 0x0e, 0x53, 0x75, 0x62, 0x6a, 0x65, - 0x63, 0x74, 0x4d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x12, 0x32, 0x0a, 0x08, 0x6d, 0x65, 0x74, - 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x63, 0x6f, - 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x4d, 0x65, 0x74, 0x61, 0x64, - 0x61, 0x74, 0x61, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x2c, 0x0a, - 0x12, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, - 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x61, 0x74, 0x74, 0x72, 0x69, - 0x62, 0x75, 0x74, 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x49, 0x64, 0x12, 0x2b, 0x0a, 0x11, 0x73, - 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x41, - 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x73, 0x75, 0x62, 0x6a, - 0x65, 0x63, 0x74, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x09, - 0x52, 0x0d, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, - 0x62, 0x0a, 0x08, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, - 0x0e, 0x32, 0x39, 0x2e, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x6d, 0x61, 0x70, 0x70, 0x69, - 0x6e, 0x67, 0x2e, 0x53, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x4d, 0x61, 0x70, 0x70, 0x69, 0x6e, - 0x67, 0x2e, 0x53, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x4d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, - 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x45, 0x6e, 0x75, 0x6d, 0x42, 0x0b, 0xba, 0x48, - 0x08, 0xc8, 0x01, 0x01, 0x82, 0x01, 0x02, 0x10, 0x01, 0x52, 0x08, 0x6f, 0x70, 0x65, 0x72, 0x61, - 0x74, 0x6f, 0x72, 0x22, 0x9b, 0x01, 0x0a, 0x1a, 0x53, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x4d, - 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x45, 0x6e, - 0x75, 0x6d, 0x12, 0x2d, 0x0a, 0x29, 0x53, 0x55, 0x42, 0x4a, 0x45, 0x43, 0x54, 0x5f, 0x4d, 0x41, - 0x50, 0x50, 0x49, 0x4e, 0x47, 0x5f, 0x4f, 0x50, 0x45, 0x52, 0x41, 0x54, 0x4f, 0x52, 0x5f, 0x45, - 0x4e, 0x55, 0x4d, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, - 0x00, 0x12, 0x24, 0x0a, 0x20, 0x53, 0x55, 0x42, 0x4a, 0x45, 0x43, 0x54, 0x5f, 0x4d, 0x41, 0x50, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xc2, 0x03, 0x0a, 0x0e, 0x53, 0x75, 0x62, 0x6a, 0x65, + 0x63, 0x74, 0x4d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x12, 0x2c, 0x0a, 0x08, 0x6d, 0x65, 0x74, + 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x63, 0x6f, + 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x08, 0x6d, + 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x2c, 0x0a, 0x12, 0x61, 0x74, 0x74, 0x72, 0x69, + 0x62, 0x75, 0x74, 0x65, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x10, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x56, 0x61, + 0x6c, 0x75, 0x65, 0x49, 0x64, 0x12, 0x2b, 0x0a, 0x11, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, + 0x5f, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x10, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, + 0x74, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0d, 0x73, 0x75, 0x62, 0x6a, + 0x65, 0x63, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, 0x62, 0x0a, 0x08, 0x6f, 0x70, 0x65, + 0x72, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x39, 0x2e, 0x73, 0x75, + 0x62, 0x6a, 0x65, 0x63, 0x74, 0x6d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x2e, 0x53, 0x75, 0x62, + 0x6a, 0x65, 0x63, 0x74, 0x4d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x2e, 0x53, 0x75, 0x62, 0x6a, + 0x65, 0x63, 0x74, 0x4d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, + 0x6f, 0x72, 0x45, 0x6e, 0x75, 0x6d, 0x42, 0x0b, 0xba, 0x48, 0x08, 0xc8, 0x01, 0x01, 0x82, 0x01, + 0x02, 0x10, 0x01, 0x52, 0x08, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x22, 0x9b, 0x01, + 0x0a, 0x1a, 0x53, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x4d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, + 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x45, 0x6e, 0x75, 0x6d, 0x12, 0x2d, 0x0a, 0x29, + 0x53, 0x55, 0x42, 0x4a, 0x45, 0x43, 0x54, 0x5f, 0x4d, 0x41, 0x50, 0x50, 0x49, 0x4e, 0x47, 0x5f, + 0x4f, 0x50, 0x45, 0x52, 0x41, 0x54, 0x4f, 0x52, 0x5f, 0x45, 0x4e, 0x55, 0x4d, 0x5f, 0x55, 0x4e, + 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x24, 0x0a, 0x20, 0x53, + 0x55, 0x42, 0x4a, 0x45, 0x43, 0x54, 0x5f, 0x4d, 0x41, 0x50, 0x50, 0x49, 0x4e, 0x47, 0x5f, 0x4f, + 0x50, 0x45, 0x52, 0x41, 0x54, 0x4f, 0x52, 0x5f, 0x45, 0x4e, 0x55, 0x4d, 0x5f, 0x49, 0x4e, 0x10, + 0x01, 0x12, 0x28, 0x0a, 0x24, 0x53, 0x55, 0x42, 0x4a, 0x45, 0x43, 0x54, 0x5f, 0x4d, 0x41, 0x50, 0x50, 0x49, 0x4e, 0x47, 0x5f, 0x4f, 0x50, 0x45, 0x52, 0x41, 0x54, 0x4f, 0x52, 0x5f, 0x45, 0x4e, - 0x55, 0x4d, 0x5f, 0x49, 0x4e, 0x10, 0x01, 0x12, 0x28, 0x0a, 0x24, 0x53, 0x55, 0x42, 0x4a, 0x45, - 0x43, 0x54, 0x5f, 0x4d, 0x41, 0x50, 0x50, 0x49, 0x4e, 0x47, 0x5f, 0x4f, 0x50, 0x45, 0x52, 0x41, - 0x54, 0x4f, 0x52, 0x5f, 0x45, 0x4e, 0x55, 0x4d, 0x5f, 0x4e, 0x4f, 0x54, 0x5f, 0x49, 0x4e, 0x10, - 0x02, 0x22, 0x32, 0x0a, 0x18, 0x47, 0x65, 0x74, 0x53, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x4d, + 0x55, 0x4d, 0x5f, 0x4e, 0x4f, 0x54, 0x5f, 0x49, 0x4e, 0x10, 0x02, 0x22, 0x32, 0x0a, 0x18, 0x47, + 0x65, 0x74, 0x53, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x4d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x42, 0x06, 0xba, 0x48, 0x03, 0xc8, 0x01, 0x01, 0x52, 0x02, 0x69, 0x64, 0x22, + 0x64, 0x0a, 0x19, 0x47, 0x65, 0x74, 0x53, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x4d, 0x61, 0x70, + 0x70, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x47, 0x0a, 0x0f, + 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x6d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x6d, + 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x2e, 0x53, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x4d, 0x61, + 0x70, 0x70, 0x69, 0x6e, 0x67, 0x52, 0x0e, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x4d, 0x61, + 0x70, 0x70, 0x69, 0x6e, 0x67, 0x22, 0x1c, 0x0a, 0x1a, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x75, 0x62, + 0x6a, 0x65, 0x63, 0x74, 0x4d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x73, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x22, 0x68, 0x0a, 0x1b, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x75, 0x62, 0x6a, 0x65, + 0x63, 0x74, 0x4d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x49, 0x0a, 0x10, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x6d, 0x61, + 0x70, 0x70, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x73, + 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x6d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x2e, 0x53, 0x75, + 0x62, 0x6a, 0x65, 0x63, 0x74, 0x4d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x52, 0x0f, 0x73, 0x75, + 0x62, 0x6a, 0x65, 0x63, 0x74, 0x4d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x73, 0x22, 0x6e, 0x0a, + 0x1b, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x4d, 0x61, + 0x70, 0x70, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x4f, 0x0a, 0x0f, + 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x6d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x6d, + 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x2e, 0x53, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x4d, 0x61, + 0x70, 0x70, 0x69, 0x6e, 0x67, 0x42, 0x06, 0xba, 0x48, 0x03, 0xc8, 0x01, 0x01, 0x52, 0x0e, 0x73, + 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x4d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x22, 0x1e, 0x0a, + 0x1c, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x4d, 0x61, + 0x70, 0x70, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x86, 0x01, + 0x0a, 0x1b, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x4d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x06, 0xba, 0x48, 0x03, 0xc8, 0x01, - 0x01, 0x52, 0x02, 0x69, 0x64, 0x22, 0x64, 0x0a, 0x19, 0x47, 0x65, 0x74, 0x53, 0x75, 0x62, 0x6a, - 0x65, 0x63, 0x74, 0x4d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x12, 0x47, 0x0a, 0x0f, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x6d, 0x61, - 0x70, 0x70, 0x69, 0x6e, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x73, 0x75, - 0x62, 0x6a, 0x65, 0x63, 0x74, 0x6d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x2e, 0x53, 0x75, 0x62, - 0x6a, 0x65, 0x63, 0x74, 0x4d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x52, 0x0e, 0x73, 0x75, 0x62, - 0x6a, 0x65, 0x63, 0x74, 0x4d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x22, 0x1c, 0x0a, 0x1a, 0x4c, - 0x69, 0x73, 0x74, 0x53, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x4d, 0x61, 0x70, 0x70, 0x69, 0x6e, - 0x67, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x68, 0x0a, 0x1b, 0x4c, 0x69, 0x73, + 0x01, 0x52, 0x02, 0x69, 0x64, 0x12, 0x4f, 0x0a, 0x0f, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, + 0x5f, 0x6d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, + 0x2e, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x6d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x2e, + 0x53, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x4d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x42, 0x06, + 0xba, 0x48, 0x03, 0xc8, 0x01, 0x01, 0x52, 0x0e, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x4d, + 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x22, 0x1e, 0x0a, 0x1c, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x53, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x4d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x35, 0x0a, 0x1b, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, + 0x53, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x4d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x42, 0x06, 0xba, 0x48, 0x03, 0xc8, 0x01, 0x01, 0x52, 0x02, 0x69, 0x64, 0x22, 0x1e, 0x0a, + 0x1c, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x53, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x4d, 0x61, + 0x70, 0x70, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0x87, 0x06, + 0x0a, 0x15, 0x53, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x4d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, + 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x89, 0x01, 0x0a, 0x13, 0x4c, 0x69, 0x73, 0x74, + 0x53, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x4d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x73, 0x12, + 0x2a, 0x2e, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x6d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, + 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x4d, 0x61, 0x70, 0x70, + 0x69, 0x6e, 0x67, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x73, 0x75, + 0x62, 0x6a, 0x65, 0x63, 0x74, 0x6d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x4d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x73, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x49, 0x0a, 0x10, 0x73, 0x75, 0x62, 0x6a, - 0x65, 0x63, 0x74, 0x5f, 0x6d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x01, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x6d, 0x61, 0x70, 0x70, - 0x69, 0x6e, 0x67, 0x2e, 0x53, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x4d, 0x61, 0x70, 0x70, 0x69, - 0x6e, 0x67, 0x52, 0x0f, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x4d, 0x61, 0x70, 0x70, 0x69, - 0x6e, 0x67, 0x73, 0x22, 0x6e, 0x0a, 0x1b, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x75, 0x62, - 0x6a, 0x65, 0x63, 0x74, 0x4d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x4f, 0x0a, 0x0f, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x6d, 0x61, - 0x70, 0x70, 0x69, 0x6e, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x73, 0x75, - 0x62, 0x6a, 0x65, 0x63, 0x74, 0x6d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x2e, 0x53, 0x75, 0x62, - 0x6a, 0x65, 0x63, 0x74, 0x4d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x42, 0x06, 0xba, 0x48, 0x03, - 0xc8, 0x01, 0x01, 0x52, 0x0e, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x4d, 0x61, 0x70, 0x70, - 0x69, 0x6e, 0x67, 0x22, 0x1e, 0x0a, 0x1c, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x75, 0x62, - 0x6a, 0x65, 0x63, 0x74, 0x4d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x22, 0x86, 0x01, 0x0a, 0x1b, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x75, - 0x62, 0x6a, 0x65, 0x63, 0x74, 0x4d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, - 0x06, 0xba, 0x48, 0x03, 0xc8, 0x01, 0x01, 0x52, 0x02, 0x69, 0x64, 0x12, 0x4f, 0x0a, 0x0f, 0x73, - 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x6d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x6d, 0x61, - 0x70, 0x70, 0x69, 0x6e, 0x67, 0x2e, 0x53, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x4d, 0x61, 0x70, - 0x70, 0x69, 0x6e, 0x67, 0x42, 0x06, 0xba, 0x48, 0x03, 0xc8, 0x01, 0x01, 0x52, 0x0e, 0x73, 0x75, - 0x62, 0x6a, 0x65, 0x63, 0x74, 0x4d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x22, 0x1e, 0x0a, 0x1c, - 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x4d, 0x61, 0x70, - 0x70, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x35, 0x0a, 0x1b, - 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x53, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x4d, 0x61, 0x70, - 0x70, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x02, 0x69, - 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x06, 0xba, 0x48, 0x03, 0xc8, 0x01, 0x01, 0x52, - 0x02, 0x69, 0x64, 0x22, 0x1e, 0x0a, 0x1c, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x53, 0x75, 0x62, - 0x6a, 0x65, 0x63, 0x74, 0x4d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x32, 0x87, 0x06, 0x0a, 0x15, 0x53, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x4d, - 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x89, 0x01, - 0x0a, 0x13, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x4d, 0x61, 0x70, - 0x70, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x2a, 0x2e, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x6d, - 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x75, 0x62, 0x6a, 0x65, - 0x63, 0x74, 0x4d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x2b, 0x2e, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x6d, 0x61, 0x70, 0x70, 0x69, - 0x6e, 0x67, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x4d, 0x61, - 0x70, 0x70, 0x69, 0x6e, 0x67, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x19, - 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x13, 0x12, 0x11, 0x2f, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, - 0x2d, 0x6d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x88, 0x01, 0x0a, 0x11, 0x47, 0x65, - 0x74, 0x53, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x4d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x12, - 0x28, 0x2e, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x6d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, - 0x2e, 0x47, 0x65, 0x74, 0x53, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x4d, 0x61, 0x70, 0x70, 0x69, - 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x29, 0x2e, 0x73, 0x75, 0x62, 0x6a, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x19, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x13, + 0x12, 0x11, 0x2f, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2d, 0x6d, 0x61, 0x70, 0x70, 0x69, + 0x6e, 0x67, 0x73, 0x12, 0x88, 0x01, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x53, 0x75, 0x62, 0x6a, 0x65, + 0x63, 0x74, 0x4d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x12, 0x28, 0x2e, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x6d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x75, - 0x62, 0x6a, 0x65, 0x63, 0x74, 0x4d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x18, 0x12, 0x16, 0x2f, 0x73, - 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2d, 0x6d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x73, 0x2f, - 0x7b, 0x69, 0x64, 0x7d, 0x12, 0x9d, 0x01, 0x0a, 0x14, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, - 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x4d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x12, 0x2b, 0x2e, - 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x6d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x2e, 0x43, - 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x4d, 0x61, 0x70, 0x70, - 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2c, 0x2e, 0x73, 0x75, 0x62, - 0x6a, 0x65, 0x63, 0x74, 0x6d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x2e, 0x43, 0x72, 0x65, 0x61, - 0x74, 0x65, 0x53, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x4d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2a, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x24, - 0x3a, 0x0f, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x6d, 0x61, 0x70, 0x70, 0x69, 0x6e, - 0x67, 0x22, 0x11, 0x2f, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2d, 0x6d, 0x61, 0x70, 0x70, - 0x69, 0x6e, 0x67, 0x73, 0x12, 0xa2, 0x01, 0x0a, 0x14, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, - 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x4d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x12, 0x2b, 0x2e, - 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x6d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x2e, 0x55, - 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x4d, 0x61, 0x70, 0x70, - 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2c, 0x2e, 0x73, 0x75, 0x62, - 0x6a, 0x65, 0x63, 0x74, 0x6d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x2e, 0x55, 0x70, 0x64, 0x61, - 0x74, 0x65, 0x53, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x4d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2f, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x29, - 0x3a, 0x0f, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x6d, 0x61, 0x70, 0x70, 0x69, 0x6e, - 0x67, 0x22, 0x16, 0x2f, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2d, 0x6d, 0x61, 0x70, 0x70, - 0x69, 0x6e, 0x67, 0x73, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x12, 0x91, 0x01, 0x0a, 0x14, 0x44, 0x65, + 0x62, 0x6a, 0x65, 0x63, 0x74, 0x4d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x29, 0x2e, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x6d, 0x61, 0x70, + 0x70, 0x69, 0x6e, 0x67, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x4d, + 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1e, + 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x18, 0x12, 0x16, 0x2f, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, + 0x2d, 0x6d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x73, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x12, 0x9d, + 0x01, 0x0a, 0x14, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, + 0x4d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x12, 0x2b, 0x2e, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, + 0x74, 0x6d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, + 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x4d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2c, 0x2e, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x6d, 0x61, + 0x70, 0x70, 0x69, 0x6e, 0x67, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x75, 0x62, 0x6a, + 0x65, 0x63, 0x74, 0x4d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x22, 0x2a, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x24, 0x3a, 0x0f, 0x73, 0x75, 0x62, 0x6a, + 0x65, 0x63, 0x74, 0x5f, 0x6d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x22, 0x11, 0x2f, 0x73, 0x75, + 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2d, 0x6d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x73, 0x12, 0xa2, + 0x01, 0x0a, 0x14, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, + 0x4d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x12, 0x2b, 0x2e, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, + 0x74, 0x6d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, + 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x4d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2c, 0x2e, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x6d, 0x61, + 0x70, 0x70, 0x69, 0x6e, 0x67, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x75, 0x62, 0x6a, + 0x65, 0x63, 0x74, 0x4d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x22, 0x2f, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x29, 0x3a, 0x0f, 0x73, 0x75, 0x62, 0x6a, + 0x65, 0x63, 0x74, 0x5f, 0x6d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x22, 0x16, 0x2f, 0x73, 0x75, + 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2d, 0x6d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x73, 0x2f, 0x7b, + 0x69, 0x64, 0x7d, 0x12, 0x91, 0x01, 0x0a, 0x14, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x53, 0x75, + 0x62, 0x6a, 0x65, 0x63, 0x74, 0x4d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x12, 0x2b, 0x2e, 0x73, + 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x6d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x53, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x4d, 0x61, 0x70, 0x70, 0x69, - 0x6e, 0x67, 0x12, 0x2b, 0x2e, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x6d, 0x61, 0x70, 0x70, - 0x69, 0x6e, 0x67, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x53, 0x75, 0x62, 0x6a, 0x65, 0x63, - 0x74, 0x4d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x2c, 0x2e, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x6d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, - 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x53, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x4d, 0x61, - 0x70, 0x70, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1e, 0x82, - 0xd3, 0xe4, 0x93, 0x02, 0x18, 0x2a, 0x16, 0x2f, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2d, - 0x6d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x73, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x42, 0xb7, 0x01, - 0x0a, 0x12, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x6d, 0x61, 0x70, - 0x70, 0x69, 0x6e, 0x67, 0x42, 0x13, 0x53, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x4d, 0x61, 0x70, - 0x70, 0x69, 0x6e, 0x67, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x34, 0x67, 0x69, 0x74, - 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x64, 0x66, 0x2f, - 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x64, 0x66, 0x2d, 0x76, 0x32, 0x2d, 0x70, 0x6f, 0x63, 0x2f, 0x73, - 0x64, 0x6b, 0x2f, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x6d, 0x61, 0x70, 0x70, 0x69, 0x6e, - 0x67, 0xa2, 0x02, 0x03, 0x53, 0x58, 0x58, 0xaa, 0x02, 0x0e, 0x53, 0x75, 0x62, 0x6a, 0x65, 0x63, - 0x74, 0x6d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0xca, 0x02, 0x0e, 0x53, 0x75, 0x62, 0x6a, 0x65, - 0x63, 0x74, 0x6d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0xe2, 0x02, 0x1a, 0x53, 0x75, 0x62, 0x6a, - 0x65, 0x63, 0x74, 0x6d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, - 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0e, 0x53, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, - 0x6d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2c, 0x2e, 0x73, 0x75, 0x62, 0x6a, + 0x65, 0x63, 0x74, 0x6d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, + 0x65, 0x53, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x4d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x18, 0x2a, + 0x16, 0x2f, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2d, 0x6d, 0x61, 0x70, 0x70, 0x69, 0x6e, + 0x67, 0x73, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x42, 0xb7, 0x01, 0x0a, 0x12, 0x63, 0x6f, 0x6d, 0x2e, + 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x6d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x42, 0x13, + 0x53, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x4d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x50, 0x72, + 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x34, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, + 0x6d, 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x64, 0x66, 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x64, + 0x66, 0x2d, 0x76, 0x32, 0x2d, 0x70, 0x6f, 0x63, 0x2f, 0x73, 0x64, 0x6b, 0x2f, 0x73, 0x75, 0x62, + 0x6a, 0x65, 0x63, 0x74, 0x6d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0xa2, 0x02, 0x03, 0x53, 0x58, + 0x58, 0xaa, 0x02, 0x0e, 0x53, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x6d, 0x61, 0x70, 0x70, 0x69, + 0x6e, 0x67, 0xca, 0x02, 0x0e, 0x53, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x6d, 0x61, 0x70, 0x70, + 0x69, 0x6e, 0x67, 0xe2, 0x02, 0x1a, 0x53, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x6d, 0x61, 0x70, + 0x70, 0x69, 0x6e, 0x67, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, + 0xea, 0x02, 0x0e, 0x53, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x6d, 0x61, 0x70, 0x70, 0x69, 0x6e, + 0x67, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -819,10 +819,10 @@ var file_subjectmapping_subject_mapping_proto_goTypes = []interface{}{ (*UpdateSubjectMappingResponse)(nil), // 9: subjectmapping.UpdateSubjectMappingResponse (*DeleteSubjectMappingRequest)(nil), // 10: subjectmapping.DeleteSubjectMappingRequest (*DeleteSubjectMappingResponse)(nil), // 11: subjectmapping.DeleteSubjectMappingResponse - (*common.PolicyMetadata)(nil), // 12: common.PolicyMetadata + (*common.Metadata)(nil), // 12: common.Metadata } var file_subjectmapping_subject_mapping_proto_depIdxs = []int32{ - 12, // 0: subjectmapping.SubjectMapping.metadata:type_name -> common.PolicyMetadata + 12, // 0: subjectmapping.SubjectMapping.metadata:type_name -> common.Metadata 0, // 1: subjectmapping.SubjectMapping.operator:type_name -> subjectmapping.SubjectMapping.SubjectMappingOperatorEnum 1, // 2: subjectmapping.GetSubjectMappingResponse.subject_mapping:type_name -> subjectmapping.SubjectMapping 1, // 3: subjectmapping.ListSubjectMappingsResponse.subject_mappings:type_name -> subjectmapping.SubjectMapping diff --git a/services/attributes/attributes.go b/services/attributes/attributes.go index 296976d112..9bcc5a33f4 100644 --- a/services/attributes/attributes.go +++ b/services/attributes/attributes.go @@ -2,21 +2,16 @@ package attributes import ( "context" - "encoding/json" - "errors" "fmt" "log/slog" "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" - "github.com/jackc/pgx/v5" "github.com/opentdf/opentdf-v2-poc/internal/db" "github.com/opentdf/opentdf-v2-poc/sdk/attributes" - "github.com/opentdf/opentdf-v2-poc/sdk/common" "github.com/opentdf/opentdf-v2-poc/services" "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" - "google.golang.org/protobuf/encoding/protojson" ) type AttributesService struct { @@ -24,11 +19,6 @@ type AttributesService struct { dbClient *db.Client } -func attributeRuleTypeEnumTransformer(rule string) attributes.AttributeRuleTypeEnum { - rule = "ATTRIBUTE_RULE_TYPE_ENUM" + rule - return attributes.AttributeRuleTypeEnum(attributes.AttributeRuleTypeEnum_value[rule]) -} - func NewAttributesServer(dbClient *db.Client, g *grpc.Server, s *runtime.ServeMux) error { as := &AttributesService{ dbClient: dbClient, @@ -44,148 +34,73 @@ func NewAttributesServer(dbClient *db.Client, g *grpc.Server, s *runtime.ServeMu func (s AttributesService) CreateAttribute(ctx context.Context, req *attributes.CreateAttributeRequest) (*attributes.CreateAttributeResponse, error) { slog.Debug("creating new attribute definition", slog.String("name", req.Attribute.Name)) + rsp := &attributes.CreateAttributeResponse{} - if err := s.dbClient.CreateAttribute(ctx, req.Attribute); err != nil { + item, err := s.dbClient.CreateAttribute(ctx, req.Attribute) + if err != nil { slog.Error(services.ErrCreatingResource, slog.String("error", err.Error())) return nil, status.Error(codes.Internal, services.ErrCreatingResource) } + rsp.Attribute = item slog.Debug("created new attribute definition", slog.String("name", req.Attribute.Name)) - return &attributes.CreateAttributeResponse{}, nil + return rsp, nil } func (s *AttributesService) ListAttributes(ctx context.Context, req *attributes.ListAttributesRequest) (*attributes.ListAttributesResponse, error) { - attributesList := &attributes.ListAttributesResponse{} + rsp := &attributes.ListAttributesResponse{} - rows, err := s.dbClient.ListAllAttributes(ctx) + list, err := s.dbClient.ListAllAttributes(ctx) if err != nil { slog.Error(services.ErrListingResource, slog.String("error", err.Error())) return nil, status.Error(codes.Internal, services.ErrListingResource) } - defer rows.Close() - - for rows.Next() { - var ( - id string - name string - rule string - metadata []byte - values []byte - ) - err = rows.Scan(&id, &name, &rule, &metadata, &values) - if err != nil { - slog.Error(services.ErrListingResource, slog.String("error", err.Error())) - return nil, status.Error(codes.Internal, services.ErrListingResource) - } - - attribute := &attributes.Attribute{ - Id: id, - Name: name, - Rule: attributeRuleTypeEnumTransformer(rule), - } - - attributesList.Attributes = append(attributesList.Attributes, attribute) - } - - if err := rows.Err(); err != nil { - slog.Error(services.ErrListingResource, slog.String("error", err.Error())) - return nil, status.Error(codes.Internal, services.ErrListingResource) - } + rsp.Attributes = list - return attributesList, nil + return rsp, nil } //nolint:dupl // there probably is duplication in these crud operations but its not worth refactoring yet. func (s *AttributesService) GetAttribute(ctx context.Context, req *attributes.GetAttributeRequest) (*attributes.GetAttributeResponse, error) { - var ( - id string - name string - rule string - metadataJson []byte - valuesJson []byte - ) - - row, err := s.dbClient.GetAttribute( - ctx, - req.Id, - ) - if err != nil { - slog.Error(services.ErrGettingResource, slog.String("error", err.Error())) - return nil, status.Error(codes.Internal, services.ErrGettingResource) - } + rsp := &attributes.GetAttributeResponse{} - err = row.Scan(&id, &name, &rule, &metadataJson, &valuesJson) + item, err := s.dbClient.GetAttribute(ctx, req.Id) if err != nil { - if errors.Is(err, pgx.ErrNoRows) { - slog.Info(services.ErrNotFound, slog.String("id", req.Id)) - return nil, status.Error(codes.NotFound, services.ErrNotFound) - } slog.Error(services.ErrGettingResource, slog.String("error", err.Error())) return nil, status.Error(codes.Internal, services.ErrGettingResource) } + rsp.Attribute = item - var metadata common.PolicyMetadata - if metadataJson != nil { - if err := protojson.Unmarshal(metadataJson, &metadata); err != nil { - slog.Error(services.ErrGettingResource, slog.String("error", err.Error())) - return nil, status.Error(codes.Internal, services.ErrGettingResource) - } - } - - var raw []json.RawMessage - if err := json.Unmarshal(valuesJson, &raw); err != nil { - slog.Error(services.ErrGettingResource, slog.String("error", err.Error())) - return nil, status.Error(codes.Internal, services.ErrGettingResource) - } - - values := make([]*attributes.Value, 0) - for _, r := range raw { - value := attributes.Value{} - if err := protojson.Unmarshal(r, &value); err != nil { - slog.Error(services.ErrGettingResource, slog.String("error", err.Error())) - return nil, status.Error(codes.Internal, services.ErrGettingResource) - } - values = append(values, &value) - } - - attr := &attributes.Attribute{ - Id: id, - Name: name, - Rule: attributeRuleTypeEnumTransformer(rule), - Values: values, - Metadata: &metadata, - } - - return &attributes.GetAttributeResponse{ - Attribute: attr, - }, nil + return rsp, err } func (s *AttributesService) UpdateAttribute(ctx context.Context, req *attributes.UpdateAttributeRequest) (*attributes.UpdateAttributeResponse, error) { - if err := s.dbClient.UpdateAttribute( - ctx, - req.Id, - req.Attribute, - ); err != nil { + rsp := &attributes.UpdateAttributeResponse{} + + a, err := s.dbClient.UpdateAttribute(ctx, req.Id, req.Attribute) + if err != nil { slog.Error(services.ErrUpdatingResource, slog.String("error", err.Error())) return &attributes.UpdateAttributeResponse{}, status.Error(codes.Internal, services.ErrUpdatingResource) } - return &attributes.UpdateAttributeResponse{}, nil + rsp.Attribute = a + + return rsp, nil } func (s *AttributesService) DeleteAttribute(ctx context.Context, req *attributes.DeleteAttributeRequest) (*attributes.DeleteAttributeResponse, error) { - if err := s.dbClient.DeleteAttribute( - ctx, - req.Id, - ); err != nil { + rsp := &attributes.DeleteAttributeResponse{} + + a, err := s.dbClient.DeleteAttribute(ctx, req.Id) + if err != nil { slog.Error(services.ErrDeletingResource, slog.String("error", err.Error())) return nil, status.Error(codes.Internal, services.ErrDeletingResource) } + rsp.Attribute = a - return &attributes.DeleteAttributeResponse{}, nil + return rsp, nil } diff --git a/services/attributes/attributes_test.gox b/services/attributes/attributes_test.gox new file mode 100644 index 0000000000..6fc5c67fcd --- /dev/null +++ b/services/attributes/attributes_test.gox @@ -0,0 +1,679 @@ +package attributes + +import ( + "context" + "errors" + "log/slog" + "testing" + + "github.com/opentdf/opentdf-v2-poc/internal/db" + "github.com/opentdf/opentdf-v2-poc/sdk/attributes" + "github.com/opentdf/opentdf-v2-poc/sdk/common" + "github.com/opentdf/opentdf-v2-poc/services" + "github.com/pashagolub/pgxmock/v3" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/suite" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + "google.golang.org/protobuf/encoding/protojson" +) + +type AttributesSuite struct { + suite.Suite + mock pgxmock.PgxPoolIface + attrServer *AttributesService +} + +func (suite *AttributesSuite) SetupSuite() { + mock, err := pgxmock.NewPool() + if err != nil { + slog.Error("could not create pgxpool mock", slog.String("error", err.Error())) + } + suite.mock = mock + + suite.attrServer = &AttributesService{ + dbClient: &db.Client{ + PgxIface: mock, + }, + } +} + +func (suite *AttributesSuite) TearDownSuite() { + suite.mock.Close() +} + +func TestAttributesSuite(t *testing.T) { + suite.Run(t, new(AttributesSuite)) +} + +//nolint:gochecknoglobals // This is test data and should be reinitialized for each test +var attributeDefinition = &attributes.CreateAttributeRequest{ + Definition: &attributes.AttributeDefinition{ + Name: "relto", + Rule: attributes.AttributeDefinition_ATTRIBUTE_RULE_TYPE_ANY_OF, + Values: []*attributes.AttributeDefinitionValue{ + { + Value: "USA", + }, + }, + Descriptor_: &common.ResourceDescriptor{ + Version: 1, + Name: "example attribute", + Namespace: "demo.com", + Fqn: "http://demo.com/attr/relto", + Labels: map[string]string{ + "origin": "Country of Origin", + }, + Description: "The relto attribute is used to describe the relationship of the resource to the country of origin.", + Type: common.PolicyResourceType_POLICY_RESOURCE_TYPE_ATTRIBUTE_DEFINITION, + Id: 1, + }, + }, +} + +//nolint:gochecknoglobals // This is test data and should be reinitialized for each test +var attributeGroup = &attributes.CreateAttributeGroupRequest{ + Group: &attributes.AttributeGroup{ + Descriptor_: &common.ResourceDescriptor{ + Version: 1, + Name: "example attribute group", + Namespace: "demo.com", + Fqn: "http://demo.com/attr/group", + Labels: map[string]string{ + "origin": "Country of Origin", + }, + Type: common.PolicyResourceType_POLICY_RESOURCE_TYPE_ATTRIBUTE_GROUP, + Id: 1, + }, + MemberValues: []*attributes.AttributeValueReference{ + { + Ref: &attributes.AttributeValueReference_AttributeValue{ + AttributeValue: &attributes.AttributeDefinitionValue{ + Value: "USA", + }, + }, + }, + }, + GroupValue: &attributes.AttributeValueReference{}, + }, +} + +func (suite *AttributesSuite) Test_CreateAttribute_Returns_InternalError_When_Database_Error() { + // Copy Global Test Data to Local + definition := attributeDefinition + + bDefinition, err := protojson.Marshal(definition.Definition) + + assert.NoError(suite.T(), err) + + suite.mock.ExpectExec("INSERT INTO opentdf.resources"). + WithArgs(definition.Definition.Descriptor_.Name, + definition.Definition.Descriptor_.Namespace, + definition.Definition.Descriptor_.Version, + definition.Definition.Descriptor_.Fqn, + definition.Definition.Descriptor_.Labels, + definition.Definition.Descriptor_.Description, + common.PolicyResourceType_POLICY_RESOURCE_TYPE_ATTRIBUTE_DEFINITION.String(), + bDefinition, + ). + WillReturnError(errors.New("error inserting resource")) + + _, err = suite.attrServer.CreateAttribute(context.Background(), definition) + if assert.Error(suite.T(), err) { + grpcStatus, _ := status.FromError(err) + + assert.Equal(suite.T(), codes.Internal, grpcStatus.Code()) + + assert.Contains(suite.T(), grpcStatus.Message(), services.ErrCreatingResource) + } + + if err := suite.mock.ExpectationsWereMet(); err != nil { + suite.T().Errorf("there were unfulfilled expectations: %s", err) + } +} + +func (suite *AttributesSuite) Test_CreateAttribute_Returns_OK_When_Successful() { + // Copy Global Test Data to Local + definition := attributeDefinition + + bDefinition, err := protojson.Marshal(definition.Definition) + + assert.NoError(suite.T(), err) + + suite.mock.ExpectExec("INSERT INTO opentdf.resources"). + WithArgs(definition.Definition.Descriptor_.Name, + definition.Definition.Descriptor_.Namespace, + definition.Definition.Descriptor_.Version, + definition.Definition.Descriptor_.Fqn, + definition.Definition.Descriptor_.Labels, + definition.Definition.Descriptor_.Description, + common.PolicyResourceType_POLICY_RESOURCE_TYPE_ATTRIBUTE_DEFINITION.String(), + bDefinition, + ). + WillReturnResult(pgxmock.NewResult("INSERT", 1)) + + _, err = suite.attrServer.CreateAttribute(context.Background(), definition) + + assert.NoError(suite.T(), err) + + if err := suite.mock.ExpectationsWereMet(); err != nil { + suite.T().Errorf("there were unfulfilled expectations: %s", err) + } +} + +func (suite *AttributesSuite) Test_CreateAttributeGroup_Returns_InternalError_When_Database_Error() { + // Copy Global Test Data to Local + group := attributeGroup + + bGroup, err := protojson.Marshal(group.Group) + + assert.NoError(suite.T(), err) + + suite.mock.ExpectExec("INSERT INTO opentdf.resources"). + WithArgs(group.Group.Descriptor_.Name, + group.Group.Descriptor_.Namespace, + group.Group.Descriptor_.Version, + group.Group.Descriptor_.Fqn, + group.Group.Descriptor_.Labels, + group.Group.Descriptor_.Description, + common.PolicyResourceType_POLICY_RESOURCE_TYPE_ATTRIBUTE_GROUP.String(), + bGroup, + ). + WillReturnError(errors.New("error inserting resource")) + + _, err = suite.attrServer.CreateAttributeGroup(context.Background(), group) + if assert.Error(suite.T(), err) { + grpcStatus, _ := status.FromError(err) + + assert.Equal(suite.T(), codes.Internal, grpcStatus.Code()) + + assert.Contains(suite.T(), grpcStatus.Message(), services.ErrCreatingResource) + } + + if err := suite.mock.ExpectationsWereMet(); err != nil { + suite.T().Errorf("there were unfulfilled expectations: %s", err) + } +} + +func (suite *AttributesSuite) Test_CreateAttributeGroup_Returns_OK_When_Successful() { + // Copy Global Test Data to Local + group := attributeGroup + + bGroup, err := protojson.Marshal(group.Group) + + assert.NoError(suite.T(), err) + + suite.mock.ExpectExec("INSERT INTO opentdf.resources"). + WithArgs(group.Group.Descriptor_.Name, + group.Group.Descriptor_.Namespace, + group.Group.Descriptor_.Version, + group.Group.Descriptor_.Fqn, + group.Group.Descriptor_.Labels, + group.Group.Descriptor_.Description, + common.PolicyResourceType_POLICY_RESOURCE_TYPE_ATTRIBUTE_GROUP.String(), + bGroup, + ). + WillReturnResult(pgxmock.NewResult("INSERT", 1)) + + _, err = suite.attrServer.CreateAttributeGroup(context.Background(), group) + + assert.NoError(suite.T(), err) + + if err := suite.mock.ExpectationsWereMet(); err != nil { + suite.T().Errorf("there were unfulfilled expectations: %s", err) + } +} + +func (suite *AttributesSuite) Test_ListAttributes_Returns_InternalError_When_Database_Error() { + suite.mock.ExpectQuery("SELECT id, resource FROM opentdf.resources"). + WithArgs(common.PolicyResourceType_POLICY_RESOURCE_TYPE_ATTRIBUTE_DEFINITION.String(), "opentdf", int32(1)). + WillReturnError(errors.New("error listing attribute defintions")) + + _, err := suite.attrServer.ListAttributes(context.Background(), &attributes.ListAttributesRequest{ + Selector: &common.ResourceSelector{ + Namespace: "opentdf", + Version: 1, + }, + }) + if assert.Error(suite.T(), err) { + grpcStatus, _ := status.FromError(err) + + assert.Equal(suite.T(), codes.Internal, grpcStatus.Code()) + + assert.Contains(suite.T(), grpcStatus.Message(), services.ErrListingResource) + } + + if err := suite.mock.ExpectationsWereMet(); err != nil { + suite.T().Errorf("there were unfulfilled expectations: %s", err) + } +} + +func (suite *AttributesSuite) Test_ListAttributes_Returns_OK_When_Successful() { + // Copy Global Test Data to Local + definition := attributeDefinition + + bDefinition, err := protojson.Marshal(definition.Definition) + + assert.NoError(suite.T(), err) + + suite.mock.ExpectQuery("SELECT id, resource FROM opentdf.resources"). + WithArgs(common.PolicyResourceType_POLICY_RESOURCE_TYPE_ATTRIBUTE_DEFINITION.String(), "opentdf", int32(1)). + WillReturnRows(pgxmock.NewRows([]string{"id", "resource"}). + AddRow(int32(1), bDefinition)) + + definitions, err := suite.attrServer.ListAttributes(context.Background(), &attributes.ListAttributesRequest{ + Selector: &common.ResourceSelector{ + Namespace: "opentdf", + Version: 1, + }, + }) + + assert.NoError(suite.T(), err) + assert.Equal(suite.T(), []*attributes.AttributeDefinition{definition.Definition}, definitions.Definitions) + + if err := suite.mock.ExpectationsWereMet(); err != nil { + suite.T().Errorf("there were unfulfilled expectations: %s", err) + } +} + +func (suite *AttributesSuite) Test_ListAttributeGroups_Returns_InternalError_When_Database_Error() { + suite.mock.ExpectQuery("SELECT id, resource FROM opentdf.resources"). + WithArgs(common.PolicyResourceType_POLICY_RESOURCE_TYPE_ATTRIBUTE_GROUP.String(), "opentdf", int32(1)). + WillReturnError(errors.New("error listing attribute groups")) + + _, err := suite.attrServer.ListAttributeGroups(context.Background(), &attributes.ListAttributeGroupsRequest{ + Selector: &common.ResourceSelector{ + Namespace: "opentdf", + Version: 1, + }, + }) + if assert.Error(suite.T(), err) { + grpcStatus, _ := status.FromError(err) + + assert.Equal(suite.T(), codes.Internal, grpcStatus.Code()) + + assert.Contains(suite.T(), grpcStatus.Message(), services.ErrListingResource) + } + + if err := suite.mock.ExpectationsWereMet(); err != nil { + suite.T().Errorf("there were unfulfilled expectations: %s", err) + } +} + +func (suite *AttributesSuite) Test_ListAttributeGroups_Returns_OK_When_Successful() { + // Copy Global Test Data to Local + group := attributeGroup + + bGroup, err := protojson.Marshal(group.Group) + + assert.NoError(suite.T(), err) + + suite.mock.ExpectQuery("SELECT id, resource FROM opentdf.resources"). + WithArgs(common.PolicyResourceType_POLICY_RESOURCE_TYPE_ATTRIBUTE_GROUP.String(), "opentdf", int32(1)). + WillReturnRows(pgxmock.NewRows([]string{"id", "resource"}). + AddRow(int32(1), bGroup)) + + groups, err := suite.attrServer.ListAttributeGroups(context.Background(), &attributes.ListAttributeGroupsRequest{ + Selector: &common.ResourceSelector{ + Namespace: "opentdf", + Version: 1, + }, + }) + + assert.NoError(suite.T(), err) + assert.Equal(suite.T(), []*attributes.AttributeGroup{group.Group}, groups.Groups) + + if err := suite.mock.ExpectationsWereMet(); err != nil { + suite.T().Errorf("there were unfulfilled expectations: %s", err) + } +} + +func (suite *AttributesSuite) Test_GetAttribute_Returns_InternalError_When_Database_Error() { + suite.mock.ExpectQuery("SELECT id, resource FROM opentdf.resources"). + WithArgs(int32(1), common.PolicyResourceType_POLICY_RESOURCE_TYPE_ATTRIBUTE_DEFINITION.String()). + WillReturnError(errors.New("error getting attribute definition")) + + _, err := suite.attrServer.GetAttribute(context.Background(), &attributes.GetAttributeRequest{ + Id: 1, + }) + if assert.Error(suite.T(), err) { + grpcStatus, _ := status.FromError(err) + + assert.Equal(suite.T(), codes.Internal, grpcStatus.Code()) + + assert.Contains(suite.T(), grpcStatus.Message(), services.ErrGettingResource) + } + + if err := suite.mock.ExpectationsWereMet(); err != nil { + suite.T().Errorf("there were unfulfilled expectations: %s", err) + } +} + +func (suite *AttributesSuite) Test_GetAttribute_Returns_NotFound_When_No_Resource_Found() { + suite.mock.ExpectQuery("SELECT id, resource FROM opentdf.resources"). + WithArgs(int32(1), common.PolicyResourceType_POLICY_RESOURCE_TYPE_ATTRIBUTE_DEFINITION.String()). + WillReturnRows(pgxmock.NewRows([]string{"id", "resource"})) + + _, err := suite.attrServer.GetAttribute(context.Background(), &attributes.GetAttributeRequest{ + Id: 1, + }) + if assert.Error(suite.T(), err) { + grpcStatus, _ := status.FromError(err) + + assert.Equal(suite.T(), codes.NotFound, grpcStatus.Code()) + + assert.Contains(suite.T(), grpcStatus.Message(), services.ErrNotFound) + } + + if err := suite.mock.ExpectationsWereMet(); err != nil { + suite.T().Errorf("there were unfulfilled expectations: %s", err) + } +} + +func (suite *AttributesSuite) Test_GetAttribute_Returns_OK_When_Successful() { + // Copy Global Test Data to Local + definition := attributeDefinition + + bDefinition, err := protojson.Marshal(definition.Definition) + + assert.NoError(suite.T(), err) + + suite.mock.ExpectQuery("SELECT id, resource FROM opentdf.resources"). + WithArgs(int32(1), common.PolicyResourceType_POLICY_RESOURCE_TYPE_ATTRIBUTE_DEFINITION.String()). + WillReturnRows(pgxmock.NewRows([]string{"id", "resource"}). + AddRow(int32(1), bDefinition)) + + resp, err := suite.attrServer.GetAttribute(context.Background(), &attributes.GetAttributeRequest{ + Id: 1, + }) + + assert.NoError(suite.T(), err) + assert.Equal(suite.T(), definition.Definition, resp.Definition) + + if err := suite.mock.ExpectationsWereMet(); err != nil { + suite.T().Errorf("there were unfulfilled expectations: %s", err) + } +} + +func (suite *AttributesSuite) Test_GetAttributeGroup_Returns_InternalError_When_Database_Error() { + suite.mock.ExpectQuery("SELECT id, resource FROM opentdf.resources"). + WithArgs(int32(1), common.PolicyResourceType_POLICY_RESOURCE_TYPE_ATTRIBUTE_GROUP.String()). + WillReturnError(errors.New("error getting attribute group")) + + _, err := suite.attrServer.GetAttributeGroup(context.Background(), &attributes.GetAttributeGroupRequest{ + Id: 1, + }) + if assert.Error(suite.T(), err) { + grpcStatus, _ := status.FromError(err) + + assert.Equal(suite.T(), codes.Internal, grpcStatus.Code()) + + assert.Contains(suite.T(), grpcStatus.Message(), services.ErrGettingResource) + } + + if err := suite.mock.ExpectationsWereMet(); err != nil { + suite.T().Errorf("there were unfulfilled expectations: %s", err) + } +} + +func (suite *AttributesSuite) Test_GetAttributeGroup_Returns_NotFound_When_No_Resource_Found() { + suite.mock.ExpectQuery("SELECT id, resource FROM opentdf.resources"). + WithArgs(int32(1), common.PolicyResourceType_POLICY_RESOURCE_TYPE_ATTRIBUTE_GROUP.String()). + WillReturnRows(pgxmock.NewRows([]string{"id", "resource"})) + + _, err := suite.attrServer.GetAttributeGroup(context.Background(), &attributes.GetAttributeGroupRequest{ + Id: 1, + }) + if assert.Error(suite.T(), err) { + grpcStatus, _ := status.FromError(err) + + assert.Equal(suite.T(), codes.NotFound, grpcStatus.Code()) + + assert.Contains(suite.T(), grpcStatus.Message(), services.ErrNotFound) + } + + if err := suite.mock.ExpectationsWereMet(); err != nil { + suite.T().Errorf("there were unfulfilled expectations: %s", err) + } +} + +func (suite *AttributesSuite) Test_GetAttributeGroup_Returns_OK_When_Successful() { + // Copy Global Test Data to Local + group := attributeGroup + + bGroup, err := protojson.Marshal(group.Group) + + assert.NoError(suite.T(), err) + + suite.mock.ExpectQuery("SELECT id, resource FROM opentdf.resources"). + WithArgs(int32(1), common.PolicyResourceType_POLICY_RESOURCE_TYPE_ATTRIBUTE_GROUP.String()). + WillReturnRows(pgxmock.NewRows([]string{"id", "resource"}). + AddRow(int32(1), bGroup)) + + resp, err := suite.attrServer.GetAttributeGroup(context.Background(), &attributes.GetAttributeGroupRequest{ + Id: 1, + }) + + assert.NoError(suite.T(), err) + assert.Equal(suite.T(), group.Group, resp.Group) + + if err := suite.mock.ExpectationsWereMet(); err != nil { + suite.T().Errorf("there were unfulfilled expectations: %s", err) + } +} + +func (suite *AttributesSuite) Test_UpdateAttribute_Returns_InternalError_When_Database_Error() { + // Copy Global Test Data to Local + definition := attributeDefinition + + bDefinition, err := protojson.Marshal(definition.Definition) + + assert.NoError(suite.T(), err) + + suite.mock.ExpectExec("UPDATE opentdf.resources"). + WithArgs(definition.Definition.Descriptor_.Name, + definition.Definition.Descriptor_.Namespace, + definition.Definition.Descriptor_.Version, + definition.Definition.Descriptor_.Description, + definition.Definition.Descriptor_.Fqn, + definition.Definition.Descriptor_.Labels, + common.PolicyResourceType_POLICY_RESOURCE_TYPE_ATTRIBUTE_DEFINITION.String(), + bDefinition, + int32(1), + ). + WillReturnError(errors.New("error updating attribute definition")) + + _, err = suite.attrServer.UpdateAttribute(context.Background(), &attributes.UpdateAttributeRequest{ + Definition: definition.Definition, + Id: 1, + }) + if assert.Error(suite.T(), err) { + grpcStatus, _ := status.FromError(err) + + assert.Equal(suite.T(), codes.Internal, grpcStatus.Code()) + + assert.Contains(suite.T(), grpcStatus.Message(), services.ErrUpdatingResource) + } + + if err := suite.mock.ExpectationsWereMet(); err != nil { + suite.T().Errorf("there were unfulfilled expectations: %s", err) + } +} + +func (suite *AttributesSuite) Test_UpdateAttribute_Returns_OK_When_Successful() { + // Copy Global Test Data to Local + definition := attributeDefinition + + bDefinition, err := protojson.Marshal(definition.Definition) + + assert.NoError(suite.T(), err) + + suite.mock.ExpectExec("UPDATE opentdf.resources"). + WithArgs(definition.Definition.Descriptor_.Name, + definition.Definition.Descriptor_.Namespace, + definition.Definition.Descriptor_.Version, + definition.Definition.Descriptor_.Description, + definition.Definition.Descriptor_.Fqn, + definition.Definition.Descriptor_.Labels, + common.PolicyResourceType_POLICY_RESOURCE_TYPE_ATTRIBUTE_DEFINITION.String(), + bDefinition, + int32(1), + ). + WillReturnResult(pgxmock.NewResult("UPDATE", 1)) + + _, err = suite.attrServer.UpdateAttribute(context.Background(), &attributes.UpdateAttributeRequest{ + Definition: definition.Definition, + Id: 1, + }) + + assert.NoError(suite.T(), err) + + if err := suite.mock.ExpectationsWereMet(); err != nil { + suite.T().Errorf("there were unfulfilled expectations: %s", err) + } +} + +func (suite *AttributesSuite) Test_UpdateAttributeGroup_Returns_InternalError_When_Database_Error() { + // Copy Global Test Data to Local + group := attributeGroup + + bGroup, err := protojson.Marshal(group.Group) + + assert.NoError(suite.T(), err) + + suite.mock.ExpectExec("UPDATE opentdf.resources"). + WithArgs(group.Group.Descriptor_.Name, + group.Group.Descriptor_.Namespace, + group.Group.Descriptor_.Version, + group.Group.Descriptor_.Description, + group.Group.Descriptor_.Fqn, + group.Group.Descriptor_.Labels, + common.PolicyResourceType_POLICY_RESOURCE_TYPE_ATTRIBUTE_GROUP.String(), + bGroup, + int32(1), + ). + WillReturnError(errors.New("error updating attribute group")) + + _, err = suite.attrServer.UpdateAttributeGroup(context.Background(), &attributes.UpdateAttributeGroupRequest{ + Group: group.Group, + Id: 1, + }) + if assert.Error(suite.T(), err) { + grpcStatus, _ := status.FromError(err) + + assert.Equal(suite.T(), codes.Internal, grpcStatus.Code()) + + assert.Contains(suite.T(), grpcStatus.Message(), services.ErrUpdatingResource) + } + + if err := suite.mock.ExpectationsWereMet(); err != nil { + suite.T().Errorf("there were unfulfilled expectations: %s", err) + } +} + +func (suite *AttributesSuite) Test_UpdateAttributeGroup_Returns_OK_When_Successful() { + // Copy Global Test Data to Local + group := attributeGroup + + bGroup, err := protojson.Marshal(group.Group) + + assert.NoError(suite.T(), err) + + suite.mock.ExpectExec("UPDATE opentdf.resources"). + WithArgs(group.Group.Descriptor_.Name, + group.Group.Descriptor_.Namespace, + group.Group.Descriptor_.Version, + group.Group.Descriptor_.Description, + group.Group.Descriptor_.Fqn, + group.Group.Descriptor_.Labels, + common.PolicyResourceType_POLICY_RESOURCE_TYPE_ATTRIBUTE_GROUP.String(), + bGroup, + int32(1), + ). + WillReturnResult(pgxmock.NewResult("UPDATE", 1)) + + _, err = suite.attrServer.UpdateAttributeGroup(context.Background(), &attributes.UpdateAttributeGroupRequest{ + Group: group.Group, + Id: 1, + }) + + assert.NoError(suite.T(), err) + + if err := suite.mock.ExpectationsWereMet(); err != nil { + suite.T().Errorf("there were unfulfilled expectations: %s", err) + } +} + +func (suite *AttributesSuite) Test_DeleteAttribute_Returns_InternalError_When_Database_Error() { + suite.mock.ExpectExec("DELETE FROM opentdf.resources"). + WithArgs(int32(1), common.PolicyResourceType_POLICY_RESOURCE_TYPE_ATTRIBUTE_DEFINITION.String()). + WillReturnError(errors.New("error deleting attribute definition")) + + _, err := suite.attrServer.DeleteAttribute(context.Background(), &attributes.DeleteAttributeRequest{ + Id: 1, + }) + if assert.Error(suite.T(), err) { + grpcStatus, _ := status.FromError(err) + + assert.Equal(suite.T(), codes.Internal, grpcStatus.Code()) + + assert.Contains(suite.T(), grpcStatus.Message(), services.ErrDeletingResource) + } + + if err := suite.mock.ExpectationsWereMet(); err != nil { + suite.T().Errorf("there were unfulfilled expectations: %s", err) + } +} + +func (suite *AttributesSuite) Test_DeleteAttribute_Returns_OK_When_Successful() { + suite.mock.ExpectExec("DELETE FROM opentdf.resources"). + WithArgs(int32(1), common.PolicyResourceType_POLICY_RESOURCE_TYPE_ATTRIBUTE_DEFINITION.String()). + WillReturnResult(pgxmock.NewResult("DELETE", 1)) + + _, err := suite.attrServer.DeleteAttribute(context.Background(), &attributes.DeleteAttributeRequest{ + Id: 1, + }) + + assert.NoError(suite.T(), err) + + if err := suite.mock.ExpectationsWereMet(); err != nil { + suite.T().Errorf("there were unfulfilled expectations: %s", err) + } +} + +func (suite *AttributesSuite) Test_DeleteAttributeGroup_Returns_InternalError_When_Database_Error() { + suite.mock.ExpectExec("DELETE FROM opentdf.resources"). + WithArgs(int32(1), common.PolicyResourceType_POLICY_RESOURCE_TYPE_ATTRIBUTE_GROUP.String()). + WillReturnError(errors.New("error deleting attribute group")) + + _, err := suite.attrServer.DeleteAttributeGroup(context.Background(), &attributes.DeleteAttributeGroupRequest{ + Id: 1, + }) + if assert.Error(suite.T(), err) { + grpcStatus, _ := status.FromError(err) + + assert.Equal(suite.T(), codes.Internal, grpcStatus.Code()) + + assert.Contains(suite.T(), grpcStatus.Message(), services.ErrDeletingResource) + } + + if err := suite.mock.ExpectationsWereMet(); err != nil { + suite.T().Errorf("there were unfulfilled expectations: %s", err) + } +} + +func (suite *AttributesSuite) Test_DeleteAttributeGroup_Returns_OK_When_Successful() { + suite.mock.ExpectExec("DELETE FROM opentdf.resources"). + WithArgs(int32(1), common.PolicyResourceType_POLICY_RESOURCE_TYPE_ATTRIBUTE_GROUP.String()). + WillReturnResult(pgxmock.NewResult("DELETE", 1)) + + _, err := suite.attrServer.DeleteAttributeGroup(context.Background(), &attributes.DeleteAttributeGroupRequest{ + Id: 1, + }) + + assert.NoError(suite.T(), err) + + if err := suite.mock.ExpectationsWereMet(); err != nil { + suite.T().Errorf("there were unfulfilled expectations: %s", err) + } +} From 8f3acc32cd25d4ecc5377ee293614193a1732e17 Mon Sep 17 00:00:00 2001 From: Ryan Schumacher Date: Mon, 22 Jan 2024 16:05:49 -0600 Subject: [PATCH 7/8] Remove dead code --- internal/db/db.go | 1 - internal/db/metadata.go | 10 ---------- 2 files changed, 11 deletions(-) diff --git a/internal/db/db.go b/internal/db/db.go index df255ef98b..f92904df9c 100644 --- a/internal/db/db.go +++ b/internal/db/db.go @@ -76,7 +76,6 @@ func (c Config) buildURL() string { func (c Client) queryRow(ctx context.Context, sql string, args []interface{}, err error) (pgx.Row, error) { slog.Debug("sql", slog.String("sql", sql), slog.Any("args", args)) if err != nil { - slog.Error("sql.error", "failed to query get resource sql", slog.String("error", err.Error())) return nil, err } return c.QueryRow(ctx, sql, args...), nil diff --git a/internal/db/metadata.go b/internal/db/metadata.go index 749762cf08..10fa1e8eb1 100644 --- a/internal/db/metadata.go +++ b/internal/db/metadata.go @@ -6,16 +6,6 @@ import ( "google.golang.org/protobuf/types/known/timestamppb" ) -type ImmutableMetadata struct { - CreatedAt *timestamppb.Timestamp - UpdatedAt *timestamppb.Timestamp -} - -type MutableMetadata struct { - Labels map[string]string - Description string -} - // Marshal policy metadata is used by the marshalCreateMetadata and marshalUpdateMetadata functions to enable // the creation and update of policy metadata without exposing it to developers. Take note of the immutableMetadata and // mutableMetadata parameters. The mutableMetadata is the metadata that is passed in by the developer. The immutableMetadata From 99876befced881793f6a48c20bbc4c0f09855e23 Mon Sep 17 00:00:00 2001 From: Ryan Schumacher Date: Mon, 22 Jan 2024 16:07:02 -0600 Subject: [PATCH 8/8] Disable broken code (will undo as we work) --- cmd/start.go | 39 +- services/acre/{acre.go => acre.gox} | 0 services/acre/{acre_test.go => acre_test.gox} | 0 services/acse/{acse.go => acse.gox} | 0 services/acse/{acse_test.go => acse_test.gox} | 0 services/attributes/attributes_test.go | 679 ------------------ ...access_grants.go => key_access_grants.gox} | 0 ...nts_test.go => key_access_grants_test.gox} | 0 8 files changed, 20 insertions(+), 698 deletions(-) rename services/acre/{acre.go => acre.gox} (100%) rename services/acre/{acre_test.go => acre_test.gox} (100%) rename services/acse/{acse.go => acse.gox} (100%) rename services/acse/{acse_test.go => acse_test.gox} (100%) delete mode 100644 services/attributes/attributes_test.go rename services/keyaccessgrants/{key_access_grants.go => key_access_grants.gox} (100%) rename services/keyaccessgrants/{key_access_grants_test.go => key_access_grants_test.gox} (100%) diff --git a/cmd/start.go b/cmd/start.go index d014c7070f..06d6db0fbe 100644 --- a/cmd/start.go +++ b/cmd/start.go @@ -16,10 +16,11 @@ import ( "github.com/opentdf/opentdf-v2-poc/internal/logger" "github.com/opentdf/opentdf-v2-poc/internal/opa" "github.com/opentdf/opentdf-v2-poc/internal/server" - "github.com/opentdf/opentdf-v2-poc/services/acre" - "github.com/opentdf/opentdf-v2-poc/services/acse" + + // "github.com/opentdf/opentdf-v2-poc/services/acre" + // "github.com/opentdf/opentdf-v2-poc/services/acse" "github.com/opentdf/opentdf-v2-poc/services/attributes" - "github.com/opentdf/opentdf-v2-poc/services/keyaccessgrants" + // "github.com/opentdf/opentdf-v2-poc/services/keyaccessgrants" "github.com/spf13/cobra" ) @@ -129,11 +130,11 @@ func RegisterServices(_ config.Config, otdf *server.OpenTDFServer, dbClient *db. var ( err error ) - slog.Info("registering acre server") - err = acre.NewResourceEncoding(dbClient, otdf.GrpcServer, otdf.Mux) - if err != nil { - return fmt.Errorf("could not register acre service: %w", err) - } + // slog.Info("registering acre server") + // err = acre.NewResourceEncoding(dbClient, otdf.GrpcServer, otdf.Mux) + // if err != nil { + // return fmt.Errorf("could not register acre service: %w", err) + // } slog.Info("registering attributes server") err = attributes.NewAttributesServer(dbClient, otdf.GrpcServer, otdf.Mux) @@ -141,17 +142,17 @@ func RegisterServices(_ config.Config, otdf *server.OpenTDFServer, dbClient *db. return fmt.Errorf("could not register attributes service: %w", err) } - slog.Info("registering acse server") - err = acse.NewSubjectEncodingServer(dbClient, otdf.GrpcServer, otdf.GrpcInProcess.GetGrpcServer(), otdf.Mux) - if err != nil { - return fmt.Errorf("could not register acse service: %w", err) - } - - slog.Info("registering key access grants service") - err = keyaccessgrants.NewKeyAccessGrantsServer(dbClient, otdf.GrpcServer, otdf.Mux) - if err != nil { - return fmt.Errorf("could not register key access grants service: %w", err) - } + // slog.Info("registering acse server") + // err = acse.NewSubjectEncodingServer(dbClient, otdf.GrpcServer, otdf.GrpcInProcess.GetGrpcServer(), otdf.Mux) + // if err != nil { + // return fmt.Errorf("could not register acse service: %w", err) + // } + + // slog.Info("registering key access grants service") + // err = keyaccessgrants.NewKeyAccessGrantsServer(dbClient, otdf.GrpcServer, otdf.Mux) + // if err != nil { + // return fmt.Errorf("could not register key access grants service: %w", err) + // } return nil } diff --git a/services/acre/acre.go b/services/acre/acre.gox similarity index 100% rename from services/acre/acre.go rename to services/acre/acre.gox diff --git a/services/acre/acre_test.go b/services/acre/acre_test.gox similarity index 100% rename from services/acre/acre_test.go rename to services/acre/acre_test.gox diff --git a/services/acse/acse.go b/services/acse/acse.gox similarity index 100% rename from services/acse/acse.go rename to services/acse/acse.gox diff --git a/services/acse/acse_test.go b/services/acse/acse_test.gox similarity index 100% rename from services/acse/acse_test.go rename to services/acse/acse_test.gox diff --git a/services/attributes/attributes_test.go b/services/attributes/attributes_test.go deleted file mode 100644 index 6fc5c67fcd..0000000000 --- a/services/attributes/attributes_test.go +++ /dev/null @@ -1,679 +0,0 @@ -package attributes - -import ( - "context" - "errors" - "log/slog" - "testing" - - "github.com/opentdf/opentdf-v2-poc/internal/db" - "github.com/opentdf/opentdf-v2-poc/sdk/attributes" - "github.com/opentdf/opentdf-v2-poc/sdk/common" - "github.com/opentdf/opentdf-v2-poc/services" - "github.com/pashagolub/pgxmock/v3" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/suite" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" - "google.golang.org/protobuf/encoding/protojson" -) - -type AttributesSuite struct { - suite.Suite - mock pgxmock.PgxPoolIface - attrServer *AttributesService -} - -func (suite *AttributesSuite) SetupSuite() { - mock, err := pgxmock.NewPool() - if err != nil { - slog.Error("could not create pgxpool mock", slog.String("error", err.Error())) - } - suite.mock = mock - - suite.attrServer = &AttributesService{ - dbClient: &db.Client{ - PgxIface: mock, - }, - } -} - -func (suite *AttributesSuite) TearDownSuite() { - suite.mock.Close() -} - -func TestAttributesSuite(t *testing.T) { - suite.Run(t, new(AttributesSuite)) -} - -//nolint:gochecknoglobals // This is test data and should be reinitialized for each test -var attributeDefinition = &attributes.CreateAttributeRequest{ - Definition: &attributes.AttributeDefinition{ - Name: "relto", - Rule: attributes.AttributeDefinition_ATTRIBUTE_RULE_TYPE_ANY_OF, - Values: []*attributes.AttributeDefinitionValue{ - { - Value: "USA", - }, - }, - Descriptor_: &common.ResourceDescriptor{ - Version: 1, - Name: "example attribute", - Namespace: "demo.com", - Fqn: "http://demo.com/attr/relto", - Labels: map[string]string{ - "origin": "Country of Origin", - }, - Description: "The relto attribute is used to describe the relationship of the resource to the country of origin.", - Type: common.PolicyResourceType_POLICY_RESOURCE_TYPE_ATTRIBUTE_DEFINITION, - Id: 1, - }, - }, -} - -//nolint:gochecknoglobals // This is test data and should be reinitialized for each test -var attributeGroup = &attributes.CreateAttributeGroupRequest{ - Group: &attributes.AttributeGroup{ - Descriptor_: &common.ResourceDescriptor{ - Version: 1, - Name: "example attribute group", - Namespace: "demo.com", - Fqn: "http://demo.com/attr/group", - Labels: map[string]string{ - "origin": "Country of Origin", - }, - Type: common.PolicyResourceType_POLICY_RESOURCE_TYPE_ATTRIBUTE_GROUP, - Id: 1, - }, - MemberValues: []*attributes.AttributeValueReference{ - { - Ref: &attributes.AttributeValueReference_AttributeValue{ - AttributeValue: &attributes.AttributeDefinitionValue{ - Value: "USA", - }, - }, - }, - }, - GroupValue: &attributes.AttributeValueReference{}, - }, -} - -func (suite *AttributesSuite) Test_CreateAttribute_Returns_InternalError_When_Database_Error() { - // Copy Global Test Data to Local - definition := attributeDefinition - - bDefinition, err := protojson.Marshal(definition.Definition) - - assert.NoError(suite.T(), err) - - suite.mock.ExpectExec("INSERT INTO opentdf.resources"). - WithArgs(definition.Definition.Descriptor_.Name, - definition.Definition.Descriptor_.Namespace, - definition.Definition.Descriptor_.Version, - definition.Definition.Descriptor_.Fqn, - definition.Definition.Descriptor_.Labels, - definition.Definition.Descriptor_.Description, - common.PolicyResourceType_POLICY_RESOURCE_TYPE_ATTRIBUTE_DEFINITION.String(), - bDefinition, - ). - WillReturnError(errors.New("error inserting resource")) - - _, err = suite.attrServer.CreateAttribute(context.Background(), definition) - if assert.Error(suite.T(), err) { - grpcStatus, _ := status.FromError(err) - - assert.Equal(suite.T(), codes.Internal, grpcStatus.Code()) - - assert.Contains(suite.T(), grpcStatus.Message(), services.ErrCreatingResource) - } - - if err := suite.mock.ExpectationsWereMet(); err != nil { - suite.T().Errorf("there were unfulfilled expectations: %s", err) - } -} - -func (suite *AttributesSuite) Test_CreateAttribute_Returns_OK_When_Successful() { - // Copy Global Test Data to Local - definition := attributeDefinition - - bDefinition, err := protojson.Marshal(definition.Definition) - - assert.NoError(suite.T(), err) - - suite.mock.ExpectExec("INSERT INTO opentdf.resources"). - WithArgs(definition.Definition.Descriptor_.Name, - definition.Definition.Descriptor_.Namespace, - definition.Definition.Descriptor_.Version, - definition.Definition.Descriptor_.Fqn, - definition.Definition.Descriptor_.Labels, - definition.Definition.Descriptor_.Description, - common.PolicyResourceType_POLICY_RESOURCE_TYPE_ATTRIBUTE_DEFINITION.String(), - bDefinition, - ). - WillReturnResult(pgxmock.NewResult("INSERT", 1)) - - _, err = suite.attrServer.CreateAttribute(context.Background(), definition) - - assert.NoError(suite.T(), err) - - if err := suite.mock.ExpectationsWereMet(); err != nil { - suite.T().Errorf("there were unfulfilled expectations: %s", err) - } -} - -func (suite *AttributesSuite) Test_CreateAttributeGroup_Returns_InternalError_When_Database_Error() { - // Copy Global Test Data to Local - group := attributeGroup - - bGroup, err := protojson.Marshal(group.Group) - - assert.NoError(suite.T(), err) - - suite.mock.ExpectExec("INSERT INTO opentdf.resources"). - WithArgs(group.Group.Descriptor_.Name, - group.Group.Descriptor_.Namespace, - group.Group.Descriptor_.Version, - group.Group.Descriptor_.Fqn, - group.Group.Descriptor_.Labels, - group.Group.Descriptor_.Description, - common.PolicyResourceType_POLICY_RESOURCE_TYPE_ATTRIBUTE_GROUP.String(), - bGroup, - ). - WillReturnError(errors.New("error inserting resource")) - - _, err = suite.attrServer.CreateAttributeGroup(context.Background(), group) - if assert.Error(suite.T(), err) { - grpcStatus, _ := status.FromError(err) - - assert.Equal(suite.T(), codes.Internal, grpcStatus.Code()) - - assert.Contains(suite.T(), grpcStatus.Message(), services.ErrCreatingResource) - } - - if err := suite.mock.ExpectationsWereMet(); err != nil { - suite.T().Errorf("there were unfulfilled expectations: %s", err) - } -} - -func (suite *AttributesSuite) Test_CreateAttributeGroup_Returns_OK_When_Successful() { - // Copy Global Test Data to Local - group := attributeGroup - - bGroup, err := protojson.Marshal(group.Group) - - assert.NoError(suite.T(), err) - - suite.mock.ExpectExec("INSERT INTO opentdf.resources"). - WithArgs(group.Group.Descriptor_.Name, - group.Group.Descriptor_.Namespace, - group.Group.Descriptor_.Version, - group.Group.Descriptor_.Fqn, - group.Group.Descriptor_.Labels, - group.Group.Descriptor_.Description, - common.PolicyResourceType_POLICY_RESOURCE_TYPE_ATTRIBUTE_GROUP.String(), - bGroup, - ). - WillReturnResult(pgxmock.NewResult("INSERT", 1)) - - _, err = suite.attrServer.CreateAttributeGroup(context.Background(), group) - - assert.NoError(suite.T(), err) - - if err := suite.mock.ExpectationsWereMet(); err != nil { - suite.T().Errorf("there were unfulfilled expectations: %s", err) - } -} - -func (suite *AttributesSuite) Test_ListAttributes_Returns_InternalError_When_Database_Error() { - suite.mock.ExpectQuery("SELECT id, resource FROM opentdf.resources"). - WithArgs(common.PolicyResourceType_POLICY_RESOURCE_TYPE_ATTRIBUTE_DEFINITION.String(), "opentdf", int32(1)). - WillReturnError(errors.New("error listing attribute defintions")) - - _, err := suite.attrServer.ListAttributes(context.Background(), &attributes.ListAttributesRequest{ - Selector: &common.ResourceSelector{ - Namespace: "opentdf", - Version: 1, - }, - }) - if assert.Error(suite.T(), err) { - grpcStatus, _ := status.FromError(err) - - assert.Equal(suite.T(), codes.Internal, grpcStatus.Code()) - - assert.Contains(suite.T(), grpcStatus.Message(), services.ErrListingResource) - } - - if err := suite.mock.ExpectationsWereMet(); err != nil { - suite.T().Errorf("there were unfulfilled expectations: %s", err) - } -} - -func (suite *AttributesSuite) Test_ListAttributes_Returns_OK_When_Successful() { - // Copy Global Test Data to Local - definition := attributeDefinition - - bDefinition, err := protojson.Marshal(definition.Definition) - - assert.NoError(suite.T(), err) - - suite.mock.ExpectQuery("SELECT id, resource FROM opentdf.resources"). - WithArgs(common.PolicyResourceType_POLICY_RESOURCE_TYPE_ATTRIBUTE_DEFINITION.String(), "opentdf", int32(1)). - WillReturnRows(pgxmock.NewRows([]string{"id", "resource"}). - AddRow(int32(1), bDefinition)) - - definitions, err := suite.attrServer.ListAttributes(context.Background(), &attributes.ListAttributesRequest{ - Selector: &common.ResourceSelector{ - Namespace: "opentdf", - Version: 1, - }, - }) - - assert.NoError(suite.T(), err) - assert.Equal(suite.T(), []*attributes.AttributeDefinition{definition.Definition}, definitions.Definitions) - - if err := suite.mock.ExpectationsWereMet(); err != nil { - suite.T().Errorf("there were unfulfilled expectations: %s", err) - } -} - -func (suite *AttributesSuite) Test_ListAttributeGroups_Returns_InternalError_When_Database_Error() { - suite.mock.ExpectQuery("SELECT id, resource FROM opentdf.resources"). - WithArgs(common.PolicyResourceType_POLICY_RESOURCE_TYPE_ATTRIBUTE_GROUP.String(), "opentdf", int32(1)). - WillReturnError(errors.New("error listing attribute groups")) - - _, err := suite.attrServer.ListAttributeGroups(context.Background(), &attributes.ListAttributeGroupsRequest{ - Selector: &common.ResourceSelector{ - Namespace: "opentdf", - Version: 1, - }, - }) - if assert.Error(suite.T(), err) { - grpcStatus, _ := status.FromError(err) - - assert.Equal(suite.T(), codes.Internal, grpcStatus.Code()) - - assert.Contains(suite.T(), grpcStatus.Message(), services.ErrListingResource) - } - - if err := suite.mock.ExpectationsWereMet(); err != nil { - suite.T().Errorf("there were unfulfilled expectations: %s", err) - } -} - -func (suite *AttributesSuite) Test_ListAttributeGroups_Returns_OK_When_Successful() { - // Copy Global Test Data to Local - group := attributeGroup - - bGroup, err := protojson.Marshal(group.Group) - - assert.NoError(suite.T(), err) - - suite.mock.ExpectQuery("SELECT id, resource FROM opentdf.resources"). - WithArgs(common.PolicyResourceType_POLICY_RESOURCE_TYPE_ATTRIBUTE_GROUP.String(), "opentdf", int32(1)). - WillReturnRows(pgxmock.NewRows([]string{"id", "resource"}). - AddRow(int32(1), bGroup)) - - groups, err := suite.attrServer.ListAttributeGroups(context.Background(), &attributes.ListAttributeGroupsRequest{ - Selector: &common.ResourceSelector{ - Namespace: "opentdf", - Version: 1, - }, - }) - - assert.NoError(suite.T(), err) - assert.Equal(suite.T(), []*attributes.AttributeGroup{group.Group}, groups.Groups) - - if err := suite.mock.ExpectationsWereMet(); err != nil { - suite.T().Errorf("there were unfulfilled expectations: %s", err) - } -} - -func (suite *AttributesSuite) Test_GetAttribute_Returns_InternalError_When_Database_Error() { - suite.mock.ExpectQuery("SELECT id, resource FROM opentdf.resources"). - WithArgs(int32(1), common.PolicyResourceType_POLICY_RESOURCE_TYPE_ATTRIBUTE_DEFINITION.String()). - WillReturnError(errors.New("error getting attribute definition")) - - _, err := suite.attrServer.GetAttribute(context.Background(), &attributes.GetAttributeRequest{ - Id: 1, - }) - if assert.Error(suite.T(), err) { - grpcStatus, _ := status.FromError(err) - - assert.Equal(suite.T(), codes.Internal, grpcStatus.Code()) - - assert.Contains(suite.T(), grpcStatus.Message(), services.ErrGettingResource) - } - - if err := suite.mock.ExpectationsWereMet(); err != nil { - suite.T().Errorf("there were unfulfilled expectations: %s", err) - } -} - -func (suite *AttributesSuite) Test_GetAttribute_Returns_NotFound_When_No_Resource_Found() { - suite.mock.ExpectQuery("SELECT id, resource FROM opentdf.resources"). - WithArgs(int32(1), common.PolicyResourceType_POLICY_RESOURCE_TYPE_ATTRIBUTE_DEFINITION.String()). - WillReturnRows(pgxmock.NewRows([]string{"id", "resource"})) - - _, err := suite.attrServer.GetAttribute(context.Background(), &attributes.GetAttributeRequest{ - Id: 1, - }) - if assert.Error(suite.T(), err) { - grpcStatus, _ := status.FromError(err) - - assert.Equal(suite.T(), codes.NotFound, grpcStatus.Code()) - - assert.Contains(suite.T(), grpcStatus.Message(), services.ErrNotFound) - } - - if err := suite.mock.ExpectationsWereMet(); err != nil { - suite.T().Errorf("there were unfulfilled expectations: %s", err) - } -} - -func (suite *AttributesSuite) Test_GetAttribute_Returns_OK_When_Successful() { - // Copy Global Test Data to Local - definition := attributeDefinition - - bDefinition, err := protojson.Marshal(definition.Definition) - - assert.NoError(suite.T(), err) - - suite.mock.ExpectQuery("SELECT id, resource FROM opentdf.resources"). - WithArgs(int32(1), common.PolicyResourceType_POLICY_RESOURCE_TYPE_ATTRIBUTE_DEFINITION.String()). - WillReturnRows(pgxmock.NewRows([]string{"id", "resource"}). - AddRow(int32(1), bDefinition)) - - resp, err := suite.attrServer.GetAttribute(context.Background(), &attributes.GetAttributeRequest{ - Id: 1, - }) - - assert.NoError(suite.T(), err) - assert.Equal(suite.T(), definition.Definition, resp.Definition) - - if err := suite.mock.ExpectationsWereMet(); err != nil { - suite.T().Errorf("there were unfulfilled expectations: %s", err) - } -} - -func (suite *AttributesSuite) Test_GetAttributeGroup_Returns_InternalError_When_Database_Error() { - suite.mock.ExpectQuery("SELECT id, resource FROM opentdf.resources"). - WithArgs(int32(1), common.PolicyResourceType_POLICY_RESOURCE_TYPE_ATTRIBUTE_GROUP.String()). - WillReturnError(errors.New("error getting attribute group")) - - _, err := suite.attrServer.GetAttributeGroup(context.Background(), &attributes.GetAttributeGroupRequest{ - Id: 1, - }) - if assert.Error(suite.T(), err) { - grpcStatus, _ := status.FromError(err) - - assert.Equal(suite.T(), codes.Internal, grpcStatus.Code()) - - assert.Contains(suite.T(), grpcStatus.Message(), services.ErrGettingResource) - } - - if err := suite.mock.ExpectationsWereMet(); err != nil { - suite.T().Errorf("there were unfulfilled expectations: %s", err) - } -} - -func (suite *AttributesSuite) Test_GetAttributeGroup_Returns_NotFound_When_No_Resource_Found() { - suite.mock.ExpectQuery("SELECT id, resource FROM opentdf.resources"). - WithArgs(int32(1), common.PolicyResourceType_POLICY_RESOURCE_TYPE_ATTRIBUTE_GROUP.String()). - WillReturnRows(pgxmock.NewRows([]string{"id", "resource"})) - - _, err := suite.attrServer.GetAttributeGroup(context.Background(), &attributes.GetAttributeGroupRequest{ - Id: 1, - }) - if assert.Error(suite.T(), err) { - grpcStatus, _ := status.FromError(err) - - assert.Equal(suite.T(), codes.NotFound, grpcStatus.Code()) - - assert.Contains(suite.T(), grpcStatus.Message(), services.ErrNotFound) - } - - if err := suite.mock.ExpectationsWereMet(); err != nil { - suite.T().Errorf("there were unfulfilled expectations: %s", err) - } -} - -func (suite *AttributesSuite) Test_GetAttributeGroup_Returns_OK_When_Successful() { - // Copy Global Test Data to Local - group := attributeGroup - - bGroup, err := protojson.Marshal(group.Group) - - assert.NoError(suite.T(), err) - - suite.mock.ExpectQuery("SELECT id, resource FROM opentdf.resources"). - WithArgs(int32(1), common.PolicyResourceType_POLICY_RESOURCE_TYPE_ATTRIBUTE_GROUP.String()). - WillReturnRows(pgxmock.NewRows([]string{"id", "resource"}). - AddRow(int32(1), bGroup)) - - resp, err := suite.attrServer.GetAttributeGroup(context.Background(), &attributes.GetAttributeGroupRequest{ - Id: 1, - }) - - assert.NoError(suite.T(), err) - assert.Equal(suite.T(), group.Group, resp.Group) - - if err := suite.mock.ExpectationsWereMet(); err != nil { - suite.T().Errorf("there were unfulfilled expectations: %s", err) - } -} - -func (suite *AttributesSuite) Test_UpdateAttribute_Returns_InternalError_When_Database_Error() { - // Copy Global Test Data to Local - definition := attributeDefinition - - bDefinition, err := protojson.Marshal(definition.Definition) - - assert.NoError(suite.T(), err) - - suite.mock.ExpectExec("UPDATE opentdf.resources"). - WithArgs(definition.Definition.Descriptor_.Name, - definition.Definition.Descriptor_.Namespace, - definition.Definition.Descriptor_.Version, - definition.Definition.Descriptor_.Description, - definition.Definition.Descriptor_.Fqn, - definition.Definition.Descriptor_.Labels, - common.PolicyResourceType_POLICY_RESOURCE_TYPE_ATTRIBUTE_DEFINITION.String(), - bDefinition, - int32(1), - ). - WillReturnError(errors.New("error updating attribute definition")) - - _, err = suite.attrServer.UpdateAttribute(context.Background(), &attributes.UpdateAttributeRequest{ - Definition: definition.Definition, - Id: 1, - }) - if assert.Error(suite.T(), err) { - grpcStatus, _ := status.FromError(err) - - assert.Equal(suite.T(), codes.Internal, grpcStatus.Code()) - - assert.Contains(suite.T(), grpcStatus.Message(), services.ErrUpdatingResource) - } - - if err := suite.mock.ExpectationsWereMet(); err != nil { - suite.T().Errorf("there were unfulfilled expectations: %s", err) - } -} - -func (suite *AttributesSuite) Test_UpdateAttribute_Returns_OK_When_Successful() { - // Copy Global Test Data to Local - definition := attributeDefinition - - bDefinition, err := protojson.Marshal(definition.Definition) - - assert.NoError(suite.T(), err) - - suite.mock.ExpectExec("UPDATE opentdf.resources"). - WithArgs(definition.Definition.Descriptor_.Name, - definition.Definition.Descriptor_.Namespace, - definition.Definition.Descriptor_.Version, - definition.Definition.Descriptor_.Description, - definition.Definition.Descriptor_.Fqn, - definition.Definition.Descriptor_.Labels, - common.PolicyResourceType_POLICY_RESOURCE_TYPE_ATTRIBUTE_DEFINITION.String(), - bDefinition, - int32(1), - ). - WillReturnResult(pgxmock.NewResult("UPDATE", 1)) - - _, err = suite.attrServer.UpdateAttribute(context.Background(), &attributes.UpdateAttributeRequest{ - Definition: definition.Definition, - Id: 1, - }) - - assert.NoError(suite.T(), err) - - if err := suite.mock.ExpectationsWereMet(); err != nil { - suite.T().Errorf("there were unfulfilled expectations: %s", err) - } -} - -func (suite *AttributesSuite) Test_UpdateAttributeGroup_Returns_InternalError_When_Database_Error() { - // Copy Global Test Data to Local - group := attributeGroup - - bGroup, err := protojson.Marshal(group.Group) - - assert.NoError(suite.T(), err) - - suite.mock.ExpectExec("UPDATE opentdf.resources"). - WithArgs(group.Group.Descriptor_.Name, - group.Group.Descriptor_.Namespace, - group.Group.Descriptor_.Version, - group.Group.Descriptor_.Description, - group.Group.Descriptor_.Fqn, - group.Group.Descriptor_.Labels, - common.PolicyResourceType_POLICY_RESOURCE_TYPE_ATTRIBUTE_GROUP.String(), - bGroup, - int32(1), - ). - WillReturnError(errors.New("error updating attribute group")) - - _, err = suite.attrServer.UpdateAttributeGroup(context.Background(), &attributes.UpdateAttributeGroupRequest{ - Group: group.Group, - Id: 1, - }) - if assert.Error(suite.T(), err) { - grpcStatus, _ := status.FromError(err) - - assert.Equal(suite.T(), codes.Internal, grpcStatus.Code()) - - assert.Contains(suite.T(), grpcStatus.Message(), services.ErrUpdatingResource) - } - - if err := suite.mock.ExpectationsWereMet(); err != nil { - suite.T().Errorf("there were unfulfilled expectations: %s", err) - } -} - -func (suite *AttributesSuite) Test_UpdateAttributeGroup_Returns_OK_When_Successful() { - // Copy Global Test Data to Local - group := attributeGroup - - bGroup, err := protojson.Marshal(group.Group) - - assert.NoError(suite.T(), err) - - suite.mock.ExpectExec("UPDATE opentdf.resources"). - WithArgs(group.Group.Descriptor_.Name, - group.Group.Descriptor_.Namespace, - group.Group.Descriptor_.Version, - group.Group.Descriptor_.Description, - group.Group.Descriptor_.Fqn, - group.Group.Descriptor_.Labels, - common.PolicyResourceType_POLICY_RESOURCE_TYPE_ATTRIBUTE_GROUP.String(), - bGroup, - int32(1), - ). - WillReturnResult(pgxmock.NewResult("UPDATE", 1)) - - _, err = suite.attrServer.UpdateAttributeGroup(context.Background(), &attributes.UpdateAttributeGroupRequest{ - Group: group.Group, - Id: 1, - }) - - assert.NoError(suite.T(), err) - - if err := suite.mock.ExpectationsWereMet(); err != nil { - suite.T().Errorf("there were unfulfilled expectations: %s", err) - } -} - -func (suite *AttributesSuite) Test_DeleteAttribute_Returns_InternalError_When_Database_Error() { - suite.mock.ExpectExec("DELETE FROM opentdf.resources"). - WithArgs(int32(1), common.PolicyResourceType_POLICY_RESOURCE_TYPE_ATTRIBUTE_DEFINITION.String()). - WillReturnError(errors.New("error deleting attribute definition")) - - _, err := suite.attrServer.DeleteAttribute(context.Background(), &attributes.DeleteAttributeRequest{ - Id: 1, - }) - if assert.Error(suite.T(), err) { - grpcStatus, _ := status.FromError(err) - - assert.Equal(suite.T(), codes.Internal, grpcStatus.Code()) - - assert.Contains(suite.T(), grpcStatus.Message(), services.ErrDeletingResource) - } - - if err := suite.mock.ExpectationsWereMet(); err != nil { - suite.T().Errorf("there were unfulfilled expectations: %s", err) - } -} - -func (suite *AttributesSuite) Test_DeleteAttribute_Returns_OK_When_Successful() { - suite.mock.ExpectExec("DELETE FROM opentdf.resources"). - WithArgs(int32(1), common.PolicyResourceType_POLICY_RESOURCE_TYPE_ATTRIBUTE_DEFINITION.String()). - WillReturnResult(pgxmock.NewResult("DELETE", 1)) - - _, err := suite.attrServer.DeleteAttribute(context.Background(), &attributes.DeleteAttributeRequest{ - Id: 1, - }) - - assert.NoError(suite.T(), err) - - if err := suite.mock.ExpectationsWereMet(); err != nil { - suite.T().Errorf("there were unfulfilled expectations: %s", err) - } -} - -func (suite *AttributesSuite) Test_DeleteAttributeGroup_Returns_InternalError_When_Database_Error() { - suite.mock.ExpectExec("DELETE FROM opentdf.resources"). - WithArgs(int32(1), common.PolicyResourceType_POLICY_RESOURCE_TYPE_ATTRIBUTE_GROUP.String()). - WillReturnError(errors.New("error deleting attribute group")) - - _, err := suite.attrServer.DeleteAttributeGroup(context.Background(), &attributes.DeleteAttributeGroupRequest{ - Id: 1, - }) - if assert.Error(suite.T(), err) { - grpcStatus, _ := status.FromError(err) - - assert.Equal(suite.T(), codes.Internal, grpcStatus.Code()) - - assert.Contains(suite.T(), grpcStatus.Message(), services.ErrDeletingResource) - } - - if err := suite.mock.ExpectationsWereMet(); err != nil { - suite.T().Errorf("there were unfulfilled expectations: %s", err) - } -} - -func (suite *AttributesSuite) Test_DeleteAttributeGroup_Returns_OK_When_Successful() { - suite.mock.ExpectExec("DELETE FROM opentdf.resources"). - WithArgs(int32(1), common.PolicyResourceType_POLICY_RESOURCE_TYPE_ATTRIBUTE_GROUP.String()). - WillReturnResult(pgxmock.NewResult("DELETE", 1)) - - _, err := suite.attrServer.DeleteAttributeGroup(context.Background(), &attributes.DeleteAttributeGroupRequest{ - Id: 1, - }) - - assert.NoError(suite.T(), err) - - if err := suite.mock.ExpectationsWereMet(); err != nil { - suite.T().Errorf("there were unfulfilled expectations: %s", err) - } -} diff --git a/services/keyaccessgrants/key_access_grants.go b/services/keyaccessgrants/key_access_grants.gox similarity index 100% rename from services/keyaccessgrants/key_access_grants.go rename to services/keyaccessgrants/key_access_grants.gox diff --git a/services/keyaccessgrants/key_access_grants_test.go b/services/keyaccessgrants/key_access_grants_test.gox similarity index 100% rename from services/keyaccessgrants/key_access_grants_test.go rename to services/keyaccessgrants/key_access_grants_test.gox