From 375aef7000365bb8e083a93df33aa584439b6995 Mon Sep 17 00:00:00 2001 From: Dillon Nys Date: Fri, 5 Jul 2024 21:03:15 -0700 Subject: [PATCH] feat(corks): Add Go library --- .github/workflows/dart.yaml | 14 +- .github/workflows/go.yaml | 29 + buf.gen.yaml | 24 + buf.yaml | 13 + dart/CHANGELOG.md | 2 + dart/lib/src/cork.dart | 26 +- dart/lib/src/proto/corks/v1/cork.pb.dart | 36 +- dart/lib/src/proto/corks/v1/cork.pbjson.dart | 9 +- .../src/proto/google/protobuf/plugin.pb.dart | 18 +- dart/lib/src/signer.dart | 25 +- dart/pubspec.yaml | 2 +- go/cedar/caveat.go | 15 + go/cedar/cedar_test.go | 105 + go/cedar/entity.go | 47 + go/cedar/value.go | 110 + go/cork.go | 163 + go/go.mod | 14 + go/go.sum | 16 + go/proto.go | 44 + go/proto/cedar/v3/context.pb.go | 164 + go/proto/cedar/v3/entity.pb.go | 191 ++ go/proto/cedar/v3/entity_id.pb.go | 160 + go/proto/cedar/v3/expr.pb.go | 2969 +++++++++++++++++ go/proto/cedar/v3/policy.pb.go | 764 +++++ go/proto/cedar/v3/value.pb.go | 561 ++++ go/proto/corks/v1/cork.pb.go | 273 ++ go/proto/dart/dart_options.pb.go | 427 +++ go/signer.go | 70 + proto/buf.gen.yaml | 6 - proto/buf.yaml | 10 - proto/cedar/v3/context.proto | 2 + proto/cedar/v3/entity.proto | 2 + proto/cedar/v3/entity_id.proto | 2 + proto/cedar/v3/expr.proto | 2 + proto/cedar/v3/policy.proto | 2 + proto/cedar/v3/value.proto | 2 + proto/corks/v1/cork.proto | 9 +- .../dart/dart_options.proto | 0 .../google/protobuf/README.md | 0 .../google/protobuf/any.proto | 0 .../google/protobuf/descriptor.proto | 0 .../google/protobuf/duration.proto | 0 .../google/protobuf/plugin.proto | 0 .../google/protobuf/timestamp.proto | 0 44 files changed, 6226 insertions(+), 102 deletions(-) create mode 100644 .github/workflows/go.yaml create mode 100644 buf.gen.yaml create mode 100644 buf.yaml create mode 100644 go/cedar/caveat.go create mode 100644 go/cedar/cedar_test.go create mode 100644 go/cedar/entity.go create mode 100644 go/cedar/value.go create mode 100644 go/cork.go create mode 100644 go/go.mod create mode 100644 go/go.sum create mode 100644 go/proto.go create mode 100644 go/proto/cedar/v3/context.pb.go create mode 100644 go/proto/cedar/v3/entity.pb.go create mode 100644 go/proto/cedar/v3/entity_id.pb.go create mode 100644 go/proto/cedar/v3/expr.pb.go create mode 100644 go/proto/cedar/v3/policy.pb.go create mode 100644 go/proto/cedar/v3/value.pb.go create mode 100644 go/proto/corks/v1/cork.pb.go create mode 100644 go/proto/dart/dart_options.pb.go create mode 100644 go/signer.go delete mode 100644 proto/buf.gen.yaml delete mode 100644 proto/buf.yaml rename {proto => third_party}/dart/dart_options.proto (100%) rename {proto => third_party}/google/protobuf/README.md (100%) rename {proto => third_party}/google/protobuf/any.proto (100%) rename {proto => third_party}/google/protobuf/descriptor.proto (100%) rename {proto => third_party}/google/protobuf/duration.proto (100%) rename {proto => third_party}/google/protobuf/plugin.proto (100%) rename {proto => third_party}/google/protobuf/timestamp.proto (100%) diff --git a/.github/workflows/dart.yaml b/.github/workflows/dart.yaml index ca23a4a..7e609e5 100644 --- a/.github/workflows/dart.yaml +++ b/.github/workflows/dart.yaml @@ -13,16 +13,8 @@ concurrency: jobs: test: - strategy: - fail-fast: false - matrix: - os: - - ubuntu-latest - - macos-14 - - windows-latest - runs-on: ${{ matrix.os }} - # TODO(dnys1): Speed up Rust builds - timeout-minutes: 15 + runs-on: ubuntu-latest + timeout-minutes: 5 steps: - name: Git Checkout uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # 4.1.7 @@ -35,4 +27,4 @@ jobs: run: dart pub get - name: Test working-directory: dart - run: dart --enable-experiment=native-assets test --fail-fast + run: dart test --fail-fast diff --git a/.github/workflows/go.yaml b/.github/workflows/go.yaml new file mode 100644 index 0000000..88967db --- /dev/null +++ b/.github/workflows/go.yaml @@ -0,0 +1,29 @@ +name: Go +on: + pull_request: + paths: + - ".github/workflows/go.yaml" + - "go/**" + +# Prevent duplicate runs due to Graphite +# https://graphite.dev/docs/troubleshooting#why-are-my-actions-running-twice +concurrency: + group: ${{ github.repository }}-${{ github.workflow }}-${{ github.ref }}-${{ github.ref == 'refs/heads/main' && github.sha || ''}} + cancel-in-progress: true + +jobs: + test: + runs-on: ubuntu-latest + timeout-minutes: 5 + steps: + - name: Git Checkout + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # 4.1.7 + with: + submodules: true + - name: Setup Go + uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # 5.0.1 + with: + go-version-file: go/go.mod + - name: Test + working-directory: go + run: go test ./... diff --git a/buf.gen.yaml b/buf.gen.yaml new file mode 100644 index 0000000..49e8772 --- /dev/null +++ b/buf.gen.yaml @@ -0,0 +1,24 @@ +version: v2 +managed: + enabled: true + override: + - file_option: go_package + value: github.com/celest-dev/corks/go/proto/dart;dartoptionspb + path: dart/dart_options.proto +inputs: + - directory: proto + - directory: third_party + paths: + - third_party/dart/dart_options.proto +plugins: + - remote: buf.build/protocolbuffers/dart:v21.1.2 + include_imports: true + include_wkt: true + out: dart/lib/src/proto + opt: grpc + - remote: buf.build/protocolbuffers/go:v1.34.2 + include_imports: false + include_wkt: false + out: go/proto + opt: + - paths=source_relative diff --git a/buf.yaml b/buf.yaml new file mode 100644 index 0000000..b933446 --- /dev/null +++ b/buf.yaml @@ -0,0 +1,13 @@ +version: v2 +modules: + - path: proto + - path: third_party +breaking: + use: + - PACKAGE +lint: + use: + - MINIMAL + ignore: + - third_party + disallow_comment_ignores: true diff --git a/dart/CHANGELOG.md b/dart/CHANGELOG.md index 4429aec..94f528e 100644 --- a/dart/CHANGELOG.md +++ b/dart/CHANGELOG.md @@ -1,3 +1,5 @@ +## 0.2.0-wip + ## 0.1.2 - chore: Update repository diff --git a/dart/lib/src/cork.dart b/dart/lib/src/cork.dart index de2969b..f959f08 100644 --- a/dart/lib/src/cork.dart +++ b/dart/lib/src/cork.dart @@ -7,7 +7,6 @@ import 'dart:typed_data'; import 'package:cedar/cedar.dart' as cedar; import 'package:corks_cedar/corks_proto.dart' as proto; import 'package:corks_cedar/src/interop/proto_interop.dart'; -import 'package:corks_cedar/src/proto/google/protobuf/any.pb.dart' as proto; import 'package:corks_cedar/src/signer.dart'; import 'package:crypto/crypto.dart'; import 'package:meta/meta.dart'; @@ -66,10 +65,8 @@ final class Cork { Uint8List encode() => toProto().writeToBuffer(); Future verify(Signer signer) async { - if (Digest(signer.keyId) != Digest(keyId)) { - return false; - } await signer.sign(id); + await signer.sign(keyId); if (bearer != null) { // TODO(dnys1): https://github.com/dart-lang/sdk/issues/54664 if (!await bearer!.verify(signer)) { @@ -123,6 +120,7 @@ final class CorkBuilder { Future build(Signer signer) async { await signer.sign(_id); + await signer.sign(signer.keyId); SignedBearer? signedBearer; if (_bearer case final bearer?) { @@ -173,15 +171,11 @@ extension type SignedBearer(SignedBlock _block) implements SignedBlock { : _block = SignedBlock.fromProto(proto); Bearer get bearer { - final any = proto.Any( - typeUrl: typeUrl, - value: block, - ); final entity = proto.Entity(); - if (!any.canUnpackInto(entity)) { - throw ArgumentError('Invalid bearer type: $typeUrl'); + if (!block.canUnpackInto(entity)) { + throw ArgumentError('Invalid bearer type: ${block.typeUrl}'); } - any.unpackInto(entity); + block.unpackInto(entity); return Bearer.entity( entity: entity.fromProto(), ); @@ -214,15 +208,11 @@ extension type SignedCaveat(SignedBlock _block) implements SignedBlock { : _block = SignedBlock.fromProto(proto); Caveat get caveat { - final any = proto.Any( - typeUrl: typeUrl, - value: block, - ); final policy = proto.Policy(); - if (!any.canUnpackInto(policy)) { - throw ArgumentError('Invalid caveat type: $typeUrl'); + if (!block.canUnpackInto(policy)) { + throw ArgumentError('Invalid caveat type: ${block.typeUrl}'); } - any.unpackInto(policy); + block.unpackInto(policy); return PolicyCaveat(policy: policy.fromProto()); } } diff --git a/dart/lib/src/proto/corks/v1/cork.pb.dart b/dart/lib/src/proto/corks/v1/cork.pb.dart index b4c15a5..2170d39 100644 --- a/dart/lib/src/proto/corks/v1/cork.pb.dart +++ b/dart/lib/src/proto/corks/v1/cork.pb.dart @@ -13,6 +13,8 @@ import 'dart:core' as $core; import 'package:protobuf/protobuf.dart' as $pb; +import '../../google/protobuf/any.pb.dart' as $4; + class Cork extends $pb.GeneratedMessage { factory Cork({ $core.List<$core.int>? id, @@ -117,17 +119,13 @@ class Cork extends $pb.GeneratedMessage { class SignedBlock extends $pb.GeneratedMessage { factory SignedBlock({ - $core.List<$core.int>? block, - $core.List<$core.int>? typeUrl, + $4.Any? block, $core.List<$core.int>? signature, }) { final $result = create(); if (block != null) { $result.block = block; } - if (typeUrl != null) { - $result.typeUrl = typeUrl; - } if (signature != null) { $result.signature = signature; } @@ -138,9 +136,8 @@ class SignedBlock extends $pb.GeneratedMessage { factory SignedBlock.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'SignedBlock', package: const $pb.PackageName(_omitMessageNames ? '' : 'corks.v1'), createEmptyInstance: create) - ..a<$core.List<$core.int>>(1, _omitFieldNames ? '' : 'block', $pb.PbFieldType.OY) - ..a<$core.List<$core.int>>(2, _omitFieldNames ? '' : 'typeUrl', $pb.PbFieldType.OY) - ..a<$core.List<$core.int>>(3, _omitFieldNames ? '' : 'signature', $pb.PbFieldType.OY) + ..aOM<$4.Any>(1, _omitFieldNames ? '' : 'block', subBuilder: $4.Any.create) + ..a<$core.List<$core.int>>(2, _omitFieldNames ? '' : 'signature', $pb.PbFieldType.OY) ..hasRequiredFields = false ; @@ -166,31 +163,24 @@ class SignedBlock extends $pb.GeneratedMessage { static SignedBlock? _defaultInstance; @$pb.TagNumber(1) - $core.List<$core.int> get block => $_getN(0); + $4.Any get block => $_getN(0); @$pb.TagNumber(1) - set block($core.List<$core.int> v) { $_setBytes(0, v); } + set block($4.Any v) { setField(1, v); } @$pb.TagNumber(1) $core.bool hasBlock() => $_has(0); @$pb.TagNumber(1) void clearBlock() => clearField(1); + @$pb.TagNumber(1) + $4.Any ensureBlock() => $_ensure(0); @$pb.TagNumber(2) - $core.List<$core.int> get typeUrl => $_getN(1); + $core.List<$core.int> get signature => $_getN(1); @$pb.TagNumber(2) - set typeUrl($core.List<$core.int> v) { $_setBytes(1, v); } + set signature($core.List<$core.int> v) { $_setBytes(1, v); } @$pb.TagNumber(2) - $core.bool hasTypeUrl() => $_has(1); + $core.bool hasSignature() => $_has(1); @$pb.TagNumber(2) - void clearTypeUrl() => clearField(2); - - @$pb.TagNumber(3) - $core.List<$core.int> get signature => $_getN(2); - @$pb.TagNumber(3) - set signature($core.List<$core.int> v) { $_setBytes(2, v); } - @$pb.TagNumber(3) - $core.bool hasSignature() => $_has(2); - @$pb.TagNumber(3) - void clearSignature() => clearField(3); + void clearSignature() => clearField(2); } diff --git a/dart/lib/src/proto/corks/v1/cork.pbjson.dart b/dart/lib/src/proto/corks/v1/cork.pbjson.dart index edcbef9..d69850d 100644 --- a/dart/lib/src/proto/corks/v1/cork.pbjson.dart +++ b/dart/lib/src/proto/corks/v1/cork.pbjson.dart @@ -39,14 +39,13 @@ final $typed_data.Uint8List corkDescriptor = $convert.base64Decode( const SignedBlock$json = { '1': 'SignedBlock', '2': [ - {'1': 'block', '3': 1, '4': 1, '5': 12, '10': 'block'}, - {'1': 'type_url', '3': 2, '4': 1, '5': 12, '10': 'typeUrl'}, - {'1': 'signature', '3': 3, '4': 1, '5': 12, '10': 'signature'}, + {'1': 'block', '3': 1, '4': 1, '5': 11, '6': '.google.protobuf.Any', '10': 'block'}, + {'1': 'signature', '3': 2, '4': 1, '5': 12, '10': 'signature'}, ], }; /// Descriptor for `SignedBlock`. Decode as a `google.protobuf.DescriptorProto`. final $typed_data.Uint8List signedBlockDescriptor = $convert.base64Decode( - 'CgtTaWduZWRCbG9jaxIUCgVibG9jaxgBIAEoDFIFYmxvY2sSGQoIdHlwZV91cmwYAiABKAxSB3' - 'R5cGVVcmwSHAoJc2lnbmF0dXJlGAMgASgMUglzaWduYXR1cmU='); + 'CgtTaWduZWRCbG9jaxIqCgVibG9jaxgBIAEoCzIULmdvb2dsZS5wcm90b2J1Zi5BbnlSBWJsb2' + 'NrEhwKCXNpZ25hdHVyZRgCIAEoDFIJc2lnbmF0dXJl'); diff --git a/dart/lib/src/proto/google/protobuf/plugin.pb.dart b/dart/lib/src/proto/google/protobuf/plugin.pb.dart index 7734e74..2c4d594 100644 --- a/dart/lib/src/proto/google/protobuf/plugin.pb.dart +++ b/dart/lib/src/proto/google/protobuf/plugin.pb.dart @@ -14,7 +14,7 @@ import 'dart:core' as $core; import 'package:fixnum/fixnum.dart' as $fixnum; import 'package:protobuf/protobuf.dart' as $pb; -import 'descriptor.pb.dart' as $2; +import 'descriptor.pb.dart' as $0; export 'plugin.pbenum.dart'; @@ -119,7 +119,7 @@ class CodeGeneratorRequest extends $pb.GeneratedMessage { $core.Iterable<$core.String>? fileToGenerate, $core.String? parameter, Version? compilerVersion, - $core.Iterable<$2.FileDescriptorProto>? protoFile, + $core.Iterable<$0.FileDescriptorProto>? protoFile, }) { final $result = create(); if (fileToGenerate != null) { @@ -144,7 +144,7 @@ class CodeGeneratorRequest extends $pb.GeneratedMessage { ..pPS(1, _omitFieldNames ? '' : 'fileToGenerate') ..aOS(2, _omitFieldNames ? '' : 'parameter') ..aOM(3, _omitFieldNames ? '' : 'compilerVersion', subBuilder: Version.create) - ..pc<$2.FileDescriptorProto>(15, _omitFieldNames ? '' : 'protoFile', $pb.PbFieldType.PM, subBuilder: $2.FileDescriptorProto.create) + ..pc<$0.FileDescriptorProto>(15, _omitFieldNames ? '' : 'protoFile', $pb.PbFieldType.PM, subBuilder: $0.FileDescriptorProto.create) ; @$core.Deprecated( @@ -211,7 +211,7 @@ class CodeGeneratorRequest extends $pb.GeneratedMessage { /// Type names of fields and extensions in the FileDescriptorProto are always /// fully qualified. @$pb.TagNumber(15) - $core.List<$2.FileDescriptorProto> get protoFile => $_getList(3); + $core.List<$0.FileDescriptorProto> get protoFile => $_getList(3); } /// Represents a single generated file. @@ -220,7 +220,7 @@ class CodeGeneratorResponse_File extends $pb.GeneratedMessage { $core.String? name, $core.String? insertionPoint, $core.String? content, - $2.GeneratedCodeInfo? generatedCodeInfo, + $0.GeneratedCodeInfo? generatedCodeInfo, }) { final $result = create(); if (name != null) { @@ -245,7 +245,7 @@ class CodeGeneratorResponse_File extends $pb.GeneratedMessage { ..aOS(1, _omitFieldNames ? '' : 'name') ..aOS(2, _omitFieldNames ? '' : 'insertionPoint') ..aOS(15, _omitFieldNames ? '' : 'content') - ..aOM<$2.GeneratedCodeInfo>(16, _omitFieldNames ? '' : 'generatedCodeInfo', subBuilder: $2.GeneratedCodeInfo.create) + ..aOM<$0.GeneratedCodeInfo>(16, _omitFieldNames ? '' : 'generatedCodeInfo', subBuilder: $0.GeneratedCodeInfo.create) ..hasRequiredFields = false ; @@ -350,15 +350,15 @@ class CodeGeneratorResponse_File extends $pb.GeneratedMessage { /// point is used, this information will be appropriately offset and inserted /// into the code generation metadata for the generated files. @$pb.TagNumber(16) - $2.GeneratedCodeInfo get generatedCodeInfo => $_getN(3); + $0.GeneratedCodeInfo get generatedCodeInfo => $_getN(3); @$pb.TagNumber(16) - set generatedCodeInfo($2.GeneratedCodeInfo v) { setField(16, v); } + set generatedCodeInfo($0.GeneratedCodeInfo v) { setField(16, v); } @$pb.TagNumber(16) $core.bool hasGeneratedCodeInfo() => $_has(3); @$pb.TagNumber(16) void clearGeneratedCodeInfo() => clearField(16); @$pb.TagNumber(16) - $2.GeneratedCodeInfo ensureGeneratedCodeInfo() => $_ensure(3); + $0.GeneratedCodeInfo ensureGeneratedCodeInfo() => $_ensure(3); } /// The plugin writes an encoded CodeGeneratorResponse to stdout. diff --git a/dart/lib/src/signer.dart b/dart/lib/src/signer.dart index e42391b..c9a1277 100644 --- a/dart/lib/src/signer.dart +++ b/dart/lib/src/signer.dart @@ -1,22 +1,20 @@ import 'dart:async'; -import 'dart:convert'; import 'dart:typed_data'; import 'package:corks_cedar/corks_proto.dart' as proto; import 'package:corks_cedar/src/interop/to_proto.dart'; +import 'package:corks_cedar/src/proto/google/protobuf/any.pb.dart'; import 'package:crypto/crypto.dart'; import 'package:meta/meta.dart'; +import 'package:protobuf/src/protobuf/mixins/well_known.dart'; mixin Signable implements ToProto { Future sign(Signer signer) async { - final proto = toProto(); - final typeUrl = 'dev.celest/${proto.info_.qualifiedMessageName}'; - await signer.sign(utf8.encode(typeUrl)); - final bytes = proto.writeToBuffer(); - final signature = await signer.sign(bytes); + final block = Any(); + AnyMixin.packIntoAny(block, toProto()); + final signature = await signer.sign(block.writeToBuffer()); return SignedBlock( - block: bytes, - typeUrl: typeUrl, + block: block, signature: signature, ); } @@ -26,30 +24,25 @@ mixin Signable implements ToProto { final class SignedBlock implements ToProto { const SignedBlock({ required this.block, - required this.typeUrl, required this.signature, }); factory SignedBlock.fromProto(proto.SignedBlock proto) => SignedBlock( - block: Uint8List.fromList(proto.block), - typeUrl: utf8.decode(proto.typeUrl), + block: proto.block, signature: Uint8List.fromList(proto.signature), ); Future verify(Signer signer) async { - await signer.sign(utf8.encode(typeUrl)); - final signature = await signer.sign(block); + final signature = await signer.sign(block.writeToBuffer()); return Digest(signature) == Digest(signature); } - final Uint8List block; - final String typeUrl; + final Any block; final Uint8List signature; @override proto.SignedBlock toProto() => proto.SignedBlock( block: block, - typeUrl: utf8.encode(typeUrl), signature: signature, ); } diff --git a/dart/pubspec.yaml b/dart/pubspec.yaml index eaac5d7..d7770e5 100644 --- a/dart/pubspec.yaml +++ b/dart/pubspec.yaml @@ -1,6 +1,6 @@ name: corks_cedar description: An embedded authorization token format, based off Google's macaroons. -version: 0.1.2 +version: 0.2.0-wip repository: https://github.com/celest-dev/corks/tree/main/dart environment: diff --git a/go/cedar/caveat.go b/go/cedar/caveat.go new file mode 100644 index 0000000..0a8a4a3 --- /dev/null +++ b/go/cedar/caveat.go @@ -0,0 +1,15 @@ +package cedar + +import ( + "errors" + + corks "github.com/celest-dev/corks/go" + cedarpb "github.com/celest-dev/corks/go/proto/cedar/v3" +) + +func NewPolicyCaveat(policy *cedarpb.Policy) (corks.Signable, error) { + if policy.Effect != cedarpb.PolicyEffect_POLICY_EFFECT_FORBID { + return nil, errors.New("only forbid policies are allowed") + } + return &corks.SignableProto{Message: policy}, nil +} diff --git a/go/cedar/cedar_test.go b/go/cedar/cedar_test.go new file mode 100644 index 0000000..7faaa65 --- /dev/null +++ b/go/cedar/cedar_test.go @@ -0,0 +1,105 @@ +package cedar_test + +import ( + "crypto/rand" + "testing" + + corks "github.com/celest-dev/corks/go" + "github.com/celest-dev/corks/go/cedar" + "github.com/stretchr/testify/require" + "google.golang.org/protobuf/encoding/protojson" +) + +func newSecretKey() []byte { + key := make([]byte, 32) + _, err := rand.Read(key) + if err != nil { + panic(err) + } + return key +} + +func TestBuildAndVerify(t *testing.T) { + t.Parallel() + aId := []byte("a") + aKey := newSecretKey() + + bId := []byte("b") + bKey := newSecretKey() + + tt := []struct { + name string + build func() (*corks.Cork, error) + }{ + { + name: "no bearer/id", + build: func() (*corks.Cork, error) { + b := corks.NewBuilder() + return b.Build(corks.NewLocalSigner(aId, aKey)) + }, + }, + { + name: "with id", + build: func() (*corks.Cork, error) { + id := &cedar.EntityId{ + Type: "User", + Id: "alice", + } + json, err := protojson.Marshal(id) + if err != nil { + return nil, err + } + b := corks.NewBuilder(corks.WithID([]byte(json))) + return b.Build(corks.NewLocalSigner(aId, aKey)) + }, + }, + { + name: "with bearer", + build: func() (*corks.Cork, error) { + b := corks.NewBuilder(corks.WithBearer( + &cedar.Entity{ + Uid: &cedar.EntityId{ + Type: "User", + Id: "alice", + }, + }, + )) + return b.Build(corks.NewLocalSigner(aId, aKey)) + }, + }, + { + name: "with bearer and id", + build: func() (*corks.Cork, error) { + id := &cedar.EntityId{ + Type: "User", + Id: "alice", + } + json, err := protojson.Marshal(id) + if err != nil { + return nil, err + } + b := corks.NewBuilder( + corks.WithID([]byte(json)), + corks.WithBearer( + &cedar.Entity{ + Uid: &cedar.EntityId{ + Type: "User", + Id: "alice", + }, + }, + ), + ) + return b.Build(corks.NewLocalSigner(aId, aKey)) + }, + }, + } + + for _, tc := range tt { + t.Run(tc.name, func(t *testing.T) { + cork, err := tc.build() + require.NoError(t, err) + require.NoError(t, cork.Verify(corks.NewLocalSigner(aId, aKey))) + require.Error(t, cork.Verify(corks.NewLocalSigner(bId, bKey))) + }) + } +} diff --git a/go/cedar/entity.go b/go/cedar/entity.go new file mode 100644 index 0000000..9bdb430 --- /dev/null +++ b/go/cedar/entity.go @@ -0,0 +1,47 @@ +package cedar + +import ( + corks "github.com/celest-dev/corks/go" + cedarpb "github.com/celest-dev/corks/go/proto/cedar/v3" + "google.golang.org/protobuf/reflect/protoreflect" +) + +type EntityId cedarpb.EntityId + +func (e *EntityId) ProtoReflect() protoreflect.Message { + return (*cedarpb.EntityId)(e).ProtoReflect() +} + +var _ corks.Signable = (*EntityId)(nil) + +func (e *EntityId) Sign(signer corks.Signer) (*corks.SignedBlock, error) { + signable := &corks.SignableProto{Message: (*cedarpb.EntityId)(e)} + return signable.Sign(signer) +} + +type Entity struct { + Uid *EntityId `json:"uid"` + Parents []*EntityId `json:"parents"` + Attrs map[string]Value `json:"attributes"` +} + +var _ corks.Signable = (*Entity)(nil) + +func (e *Entity) Sign(signer corks.Signer) (*corks.SignedBlock, error) { + parents := make([]*cedarpb.EntityId, len(e.Parents)) + for i, p := range e.Parents { + parents[i] = (*cedarpb.EntityId)(p) + } + attrs := make(map[string]*cedarpb.Value) + for k, v := range e.Attrs { + attrs[k] = v.toValue() + } + signable := &corks.SignableProto{ + Message: &cedarpb.Entity{ + Uid: (*cedarpb.EntityId)(e.Uid), + Parents: parents, + Attributes: attrs, + }, + } + return signable.Sign(signer) +} diff --git a/go/cedar/value.go b/go/cedar/value.go new file mode 100644 index 0000000..a3aae53 --- /dev/null +++ b/go/cedar/value.go @@ -0,0 +1,110 @@ +package cedar + +import ( + cedarpb "github.com/celest-dev/corks/go/proto/cedar/v3" +) + +type Value interface { + toValue() *cedarpb.Value +} + +type String string + +func (s String) toValue() *cedarpb.Value { + return &cedarpb.Value{ + Value: &cedarpb.Value_String_{ + String_: string(s), + }, + } +} + +type Long int64 + +func (l Long) toValue() *cedarpb.Value { + return &cedarpb.Value{ + Value: &cedarpb.Value_Long{ + Long: int64(l), + }, + } +} + +type Bool bool + +func (b Bool) toValue() *cedarpb.Value { + return &cedarpb.Value{ + Value: &cedarpb.Value_Bool{ + Bool: bool(b), + }, + } +} + +func Set[T setValue](values []T) set[T] { + s := make(set[T]) + for _, v := range values { + s[v] = struct{}{} + } + return s +} + +type setValue interface { + Value + comparable +} + +type set[T setValue] map[T]struct{} + +func (s set[T]) toValue() *cedarpb.Value { + var values []*cedarpb.Value + for v := range s { + values = append(values, v.toValue()) + } + return &cedarpb.Value{ + Value: &cedarpb.Value_Set{ + Set: &cedarpb.SetValue{ + Values: values, + }, + }, + } +} + +type Record map[string]Value + +func (r Record) toValue() *cedarpb.Value { + fields := make(map[string]*cedarpb.Value) + for k, v := range r { + fields[k] = v.toValue() + } + return &cedarpb.Value{ + Value: &cedarpb.Value_Record{ + Record: &cedarpb.RecordValue{ + Values: fields, + }, + }, + } +} + +type Extension struct { + Function string `json:"fn"` + Arg Value `json:"arg"` +} + +func (e Extension) toValue() *cedarpb.Value { + return &cedarpb.Value{ + Value: &cedarpb.Value_Extension{ + Extension: &cedarpb.ExtensionValue{ + Fn: e.Function, + Arg: e.Arg.toValue(), + }, + }, + } +} + +func (e *EntityId) toValue() *cedarpb.Value { + return &cedarpb.Value{ + Value: &cedarpb.Value_Entity{ + Entity: &cedarpb.EntityValue{ + Uid: (*cedarpb.EntityId)(e), + }, + }, + } +} diff --git a/go/cork.go b/go/cork.go new file mode 100644 index 0000000..b90982a --- /dev/null +++ b/go/cork.go @@ -0,0 +1,163 @@ +package corks + +import ( + "crypto/rand" + "crypto/subtle" + "errors" + "reflect" + + corkspb "github.com/celest-dev/corks/go/proto/corks/v1" +) + +type ( + SignedBlock = corkspb.SignedBlock +) + +const ( + nonceSize = 32 +) + +var ( + ErrInvalidCork = errors.New("invalid cork") +) + +type Cork corkspb.Cork + +func (c *Cork) Verify(signer Signer) error { + _, err := signer.Sign(c.Id) + if err != nil { + return err + } + _, err = signer.Sign(c.KeyId) + if err != nil { + return err + } + + addBlock := func(signedBlock *SignedBlock) error { + block := signedBlock.GetBlock() + _, err = signer.Sign([]byte(block.TypeUrl)) + if err != nil { + return err + } + expected, err := signer.Sign(block.Value) + if err != nil { + return err + } + if subtle.ConstantTimeCompare(expected, signedBlock.Signature) == 0 { + return ErrInvalidSignature + } + return nil + } + + if c.Bearer != nil { + err := addBlock(c.Bearer) + if err != nil { + return err + } + } + for _, caveat := range c.Caveats { + err := addBlock(caveat) + if err != nil { + return err + } + } + + expected, err := signer.Close() + if err != nil { + return err + } + if subtle.ConstantTimeCompare(expected, c.Signature) == 0 { + return ErrInvalidSignature + } + return nil +} + +type Builder struct { + // The unique ID of the Cork. + // + // If not set, a random ID will be generated. + id []byte + + // The bearer of the Cork. + // + // May be `nil`. + bearer Signable + + // The caveats of the Cork. + caveats []Signable +} + +type BuilderOption func(*Builder) + +func NewBuilder(opts ...BuilderOption) *Builder { + builder := &Builder{} + for _, opt := range opts { + opt(builder) + } + if len(builder.id) == 0 { + id := [nonceSize]byte{} + n, err := rand.Read(id[:]) + if err != nil || n != nonceSize { + panic("failed to generate random ID") + } + builder.id = id[:] + } + return builder +} + +func WithID(id []byte) BuilderOption { + return func(b *Builder) { + b.id = id + } +} + +func WithBearer(bearer Signable) BuilderOption { + return func(b *Builder) { + b.bearer = bearer + } +} + +func (b *Builder) hasBearer() bool { + val := reflect.ValueOf(b.bearer) + return val.IsValid() && !val.IsNil() +} + +func (b *Builder) AddCaveat(caveat Signable) { + b.caveats = append(b.caveats, caveat) +} + +func (b *Builder) Build(signer Signer) (*Cork, error) { + _, err := signer.Sign(b.id[:]) + if err != nil { + return nil, err + } + + var signedBearer *corkspb.SignedBlock + if b.hasBearer() { + signedBearer, err = b.bearer.Sign(signer) + if err != nil { + return nil, err + } + } + + signedCaveats := make([]*corkspb.SignedBlock, len(b.caveats)) + for i, caveat := range b.caveats { + signedCaveats[i], err = caveat.Sign(signer) + if err != nil { + return nil, err + } + } + + signature, err := signer.Close() + if err != nil { + return nil, err + } + + cork := &corkspb.Cork{ + Id: b.id[:], + Bearer: signedBearer, + Caveats: signedCaveats, + Signature: signature, + } + return (*Cork)(cork), nil +} diff --git a/go/go.mod b/go/go.mod new file mode 100644 index 0000000..738ef26 --- /dev/null +++ b/go/go.mod @@ -0,0 +1,14 @@ +module github.com/celest-dev/corks/go + +go 1.22.4 + +require ( + github.com/stretchr/testify v1.9.0 + google.golang.org/protobuf v1.34.2 +) + +require ( + github.com/davecgh/go-spew v1.1.1 // indirect + github.com/pmezard/go-difflib v1.0.0 // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect +) diff --git a/go/go.sum b/go/go.sum new file mode 100644 index 0000000..4cda4a4 --- /dev/null +++ b/go/go.sum @@ -0,0 +1,16 @@ +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU= +github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= +github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= +google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/go/proto.go b/go/proto.go new file mode 100644 index 0000000..e5e5bf6 --- /dev/null +++ b/go/proto.go @@ -0,0 +1,44 @@ +package corks + +import ( + "google.golang.org/protobuf/proto" + "google.golang.org/protobuf/types/known/anypb" +) + +type SignableProto struct { + proto.Message +} + +var _ Signable = (*SignableProto)(nil) + +func (b *SignableProto) Sign(signer Signer) (*SignedBlock, error) { + block, err := b.ToAny() + if err != nil { + return nil, err + } + _, err = signer.Sign([]byte(block.TypeUrl)) + if err != nil { + return nil, err + } + signature, err := signer.Sign(block.Value) + if err != nil { + return nil, err + } + return &SignedBlock{ + Block: block, + Signature: signature, + }, nil +} + +// AsAny returns the block as an Any message. +func (m *SignableProto) ToAny() (*anypb.Any, error) { + if any, ok := m.Message.(*anypb.Any); ok { + return any, nil + } + any := new(anypb.Any) + err := anypb.MarshalFrom(any, m, proto.MarshalOptions{Deterministic: true}) + if err != nil { + return nil, err + } + return any, nil +} diff --git a/go/proto/cedar/v3/context.pb.go b/go/proto/cedar/v3/context.pb.go new file mode 100644 index 0000000..335e393 --- /dev/null +++ b/go/proto/cedar/v3/context.pb.go @@ -0,0 +1,164 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.34.2 +// protoc (unknown) +// source: cedar/v3/context.proto + +package cedarpb + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type Context struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Values map[string]*Value `protobuf:"bytes,1,rep,name=values,proto3" json:"values,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` +} + +func (x *Context) Reset() { + *x = Context{} + if protoimpl.UnsafeEnabled { + mi := &file_cedar_v3_context_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Context) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Context) ProtoMessage() {} + +func (x *Context) ProtoReflect() protoreflect.Message { + mi := &file_cedar_v3_context_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Context.ProtoReflect.Descriptor instead. +func (*Context) Descriptor() ([]byte, []int) { + return file_cedar_v3_context_proto_rawDescGZIP(), []int{0} +} + +func (x *Context) GetValues() map[string]*Value { + if x != nil { + return x.Values + } + return nil +} + +var File_cedar_v3_context_proto protoreflect.FileDescriptor + +var file_cedar_v3_context_proto_rawDesc = []byte{ + 0x0a, 0x16, 0x63, 0x65, 0x64, 0x61, 0x72, 0x2f, 0x76, 0x33, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x65, + 0x78, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x08, 0x63, 0x65, 0x64, 0x61, 0x72, 0x2e, + 0x76, 0x33, 0x1a, 0x14, 0x63, 0x65, 0x64, 0x61, 0x72, 0x2f, 0x76, 0x33, 0x2f, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x8c, 0x01, 0x0a, 0x07, 0x43, 0x6f, 0x6e, + 0x74, 0x65, 0x78, 0x74, 0x12, 0x35, 0x0a, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x01, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x63, 0x65, 0x64, 0x61, 0x72, 0x2e, 0x76, 0x33, 0x2e, + 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x2e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x45, 0x6e, + 0x74, 0x72, 0x79, 0x52, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x1a, 0x4a, 0x0a, 0x0b, 0x56, + 0x61, 0x6c, 0x75, 0x65, 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, 0x25, 0x0a, 0x05, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x63, 0x65, + 0x64, 0x61, 0x72, 0x2e, 0x76, 0x33, 0x2e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x05, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x42, 0x94, 0x01, 0x0a, 0x0c, 0x63, 0x6f, 0x6d, 0x2e, + 0x63, 0x65, 0x64, 0x61, 0x72, 0x2e, 0x76, 0x33, 0x42, 0x0c, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, + 0x74, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x35, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, + 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x65, 0x6c, 0x65, 0x73, 0x74, 0x2d, 0x64, 0x65, 0x76, 0x2f, + 0x63, 0x6f, 0x72, 0x6b, 0x73, 0x2f, 0x67, 0x6f, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x63, + 0x65, 0x64, 0x61, 0x72, 0x2f, 0x76, 0x33, 0x3b, 0x63, 0x65, 0x64, 0x61, 0x72, 0x70, 0x62, 0xa2, + 0x02, 0x03, 0x43, 0x58, 0x58, 0xaa, 0x02, 0x08, 0x43, 0x65, 0x64, 0x61, 0x72, 0x2e, 0x56, 0x33, + 0xca, 0x02, 0x08, 0x43, 0x65, 0x64, 0x61, 0x72, 0x5c, 0x56, 0x33, 0xe2, 0x02, 0x14, 0x43, 0x65, + 0x64, 0x61, 0x72, 0x5c, 0x56, 0x33, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, + 0x74, 0x61, 0xea, 0x02, 0x09, 0x43, 0x65, 0x64, 0x61, 0x72, 0x3a, 0x3a, 0x56, 0x33, 0x62, 0x06, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_cedar_v3_context_proto_rawDescOnce sync.Once + file_cedar_v3_context_proto_rawDescData = file_cedar_v3_context_proto_rawDesc +) + +func file_cedar_v3_context_proto_rawDescGZIP() []byte { + file_cedar_v3_context_proto_rawDescOnce.Do(func() { + file_cedar_v3_context_proto_rawDescData = protoimpl.X.CompressGZIP(file_cedar_v3_context_proto_rawDescData) + }) + return file_cedar_v3_context_proto_rawDescData +} + +var file_cedar_v3_context_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_cedar_v3_context_proto_goTypes = []any{ + (*Context)(nil), // 0: cedar.v3.Context + nil, // 1: cedar.v3.Context.ValuesEntry + (*Value)(nil), // 2: cedar.v3.Value +} +var file_cedar_v3_context_proto_depIdxs = []int32{ + 1, // 0: cedar.v3.Context.values:type_name -> cedar.v3.Context.ValuesEntry + 2, // 1: cedar.v3.Context.ValuesEntry.value:type_name -> cedar.v3.Value + 2, // [2:2] is the sub-list for method output_type + 2, // [2:2] is the sub-list for method input_type + 2, // [2:2] is the sub-list for extension type_name + 2, // [2:2] is the sub-list for extension extendee + 0, // [0:2] is the sub-list for field type_name +} + +func init() { file_cedar_v3_context_proto_init() } +func file_cedar_v3_context_proto_init() { + if File_cedar_v3_context_proto != nil { + return + } + file_cedar_v3_value_proto_init() + if !protoimpl.UnsafeEnabled { + file_cedar_v3_context_proto_msgTypes[0].Exporter = func(v any, i int) any { + switch v := v.(*Context); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_cedar_v3_context_proto_rawDesc, + NumEnums: 0, + NumMessages: 2, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_cedar_v3_context_proto_goTypes, + DependencyIndexes: file_cedar_v3_context_proto_depIdxs, + MessageInfos: file_cedar_v3_context_proto_msgTypes, + }.Build() + File_cedar_v3_context_proto = out.File + file_cedar_v3_context_proto_rawDesc = nil + file_cedar_v3_context_proto_goTypes = nil + file_cedar_v3_context_proto_depIdxs = nil +} diff --git a/go/proto/cedar/v3/entity.pb.go b/go/proto/cedar/v3/entity.pb.go new file mode 100644 index 0000000..8570503 --- /dev/null +++ b/go/proto/cedar/v3/entity.pb.go @@ -0,0 +1,191 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.34.2 +// protoc (unknown) +// source: cedar/v3/entity.proto + +package cedarpb + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type Entity struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Uid *EntityId `protobuf:"bytes,1,opt,name=uid,proto3" json:"uid,omitempty"` + Parents []*EntityId `protobuf:"bytes,2,rep,name=parents,proto3" json:"parents,omitempty"` + Attributes map[string]*Value `protobuf:"bytes,3,rep,name=attributes,proto3" json:"attributes,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` +} + +func (x *Entity) Reset() { + *x = Entity{} + if protoimpl.UnsafeEnabled { + mi := &file_cedar_v3_entity_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Entity) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Entity) ProtoMessage() {} + +func (x *Entity) ProtoReflect() protoreflect.Message { + mi := &file_cedar_v3_entity_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Entity.ProtoReflect.Descriptor instead. +func (*Entity) Descriptor() ([]byte, []int) { + return file_cedar_v3_entity_proto_rawDescGZIP(), []int{0} +} + +func (x *Entity) GetUid() *EntityId { + if x != nil { + return x.Uid + } + return nil +} + +func (x *Entity) GetParents() []*EntityId { + if x != nil { + return x.Parents + } + return nil +} + +func (x *Entity) GetAttributes() map[string]*Value { + if x != nil { + return x.Attributes + } + return nil +} + +var File_cedar_v3_entity_proto protoreflect.FileDescriptor + +var file_cedar_v3_entity_proto_rawDesc = []byte{ + 0x0a, 0x15, 0x63, 0x65, 0x64, 0x61, 0x72, 0x2f, 0x76, 0x33, 0x2f, 0x65, 0x6e, 0x74, 0x69, 0x74, + 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x08, 0x63, 0x65, 0x64, 0x61, 0x72, 0x2e, 0x76, + 0x33, 0x1a, 0x18, 0x63, 0x65, 0x64, 0x61, 0x72, 0x2f, 0x76, 0x33, 0x2f, 0x65, 0x6e, 0x74, 0x69, + 0x74, 0x79, 0x5f, 0x69, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x14, 0x63, 0x65, 0x64, + 0x61, 0x72, 0x2f, 0x76, 0x33, 0x2f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x22, 0xee, 0x01, 0x0a, 0x06, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x12, 0x24, 0x0a, 0x03, + 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x63, 0x65, 0x64, 0x61, + 0x72, 0x2e, 0x76, 0x33, 0x2e, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x49, 0x64, 0x52, 0x03, 0x75, + 0x69, 0x64, 0x12, 0x2c, 0x0a, 0x07, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x02, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x63, 0x65, 0x64, 0x61, 0x72, 0x2e, 0x76, 0x33, 0x2e, 0x45, + 0x6e, 0x74, 0x69, 0x74, 0x79, 0x49, 0x64, 0x52, 0x07, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x73, + 0x12, 0x40, 0x0a, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x18, 0x03, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x63, 0x65, 0x64, 0x61, 0x72, 0x2e, 0x76, 0x33, 0x2e, + 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x2e, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, + 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, + 0x65, 0x73, 0x1a, 0x4e, 0x0a, 0x0f, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 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, 0x25, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x63, 0x65, 0x64, 0x61, 0x72, 0x2e, 0x76, + 0x33, 0x2e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, + 0x38, 0x01, 0x42, 0x93, 0x01, 0x0a, 0x0c, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x65, 0x64, 0x61, 0x72, + 0x2e, 0x76, 0x33, 0x42, 0x0b, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f, + 0x50, 0x01, 0x5a, 0x35, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, + 0x65, 0x6c, 0x65, 0x73, 0x74, 0x2d, 0x64, 0x65, 0x76, 0x2f, 0x63, 0x6f, 0x72, 0x6b, 0x73, 0x2f, + 0x67, 0x6f, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x63, 0x65, 0x64, 0x61, 0x72, 0x2f, 0x76, + 0x33, 0x3b, 0x63, 0x65, 0x64, 0x61, 0x72, 0x70, 0x62, 0xa2, 0x02, 0x03, 0x43, 0x58, 0x58, 0xaa, + 0x02, 0x08, 0x43, 0x65, 0x64, 0x61, 0x72, 0x2e, 0x56, 0x33, 0xca, 0x02, 0x08, 0x43, 0x65, 0x64, + 0x61, 0x72, 0x5c, 0x56, 0x33, 0xe2, 0x02, 0x14, 0x43, 0x65, 0x64, 0x61, 0x72, 0x5c, 0x56, 0x33, + 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x09, 0x43, + 0x65, 0x64, 0x61, 0x72, 0x3a, 0x3a, 0x56, 0x33, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_cedar_v3_entity_proto_rawDescOnce sync.Once + file_cedar_v3_entity_proto_rawDescData = file_cedar_v3_entity_proto_rawDesc +) + +func file_cedar_v3_entity_proto_rawDescGZIP() []byte { + file_cedar_v3_entity_proto_rawDescOnce.Do(func() { + file_cedar_v3_entity_proto_rawDescData = protoimpl.X.CompressGZIP(file_cedar_v3_entity_proto_rawDescData) + }) + return file_cedar_v3_entity_proto_rawDescData +} + +var file_cedar_v3_entity_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_cedar_v3_entity_proto_goTypes = []any{ + (*Entity)(nil), // 0: cedar.v3.Entity + nil, // 1: cedar.v3.Entity.AttributesEntry + (*EntityId)(nil), // 2: cedar.v3.EntityId + (*Value)(nil), // 3: cedar.v3.Value +} +var file_cedar_v3_entity_proto_depIdxs = []int32{ + 2, // 0: cedar.v3.Entity.uid:type_name -> cedar.v3.EntityId + 2, // 1: cedar.v3.Entity.parents:type_name -> cedar.v3.EntityId + 1, // 2: cedar.v3.Entity.attributes:type_name -> cedar.v3.Entity.AttributesEntry + 3, // 3: cedar.v3.Entity.AttributesEntry.value:type_name -> cedar.v3.Value + 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 + 4, // [4:4] is the sub-list for extension extendee + 0, // [0:4] is the sub-list for field type_name +} + +func init() { file_cedar_v3_entity_proto_init() } +func file_cedar_v3_entity_proto_init() { + if File_cedar_v3_entity_proto != nil { + return + } + file_cedar_v3_entity_id_proto_init() + file_cedar_v3_value_proto_init() + if !protoimpl.UnsafeEnabled { + file_cedar_v3_entity_proto_msgTypes[0].Exporter = func(v any, i int) any { + switch v := v.(*Entity); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_cedar_v3_entity_proto_rawDesc, + NumEnums: 0, + NumMessages: 2, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_cedar_v3_entity_proto_goTypes, + DependencyIndexes: file_cedar_v3_entity_proto_depIdxs, + MessageInfos: file_cedar_v3_entity_proto_msgTypes, + }.Build() + File_cedar_v3_entity_proto = out.File + file_cedar_v3_entity_proto_rawDesc = nil + file_cedar_v3_entity_proto_goTypes = nil + file_cedar_v3_entity_proto_depIdxs = nil +} diff --git a/go/proto/cedar/v3/entity_id.pb.go b/go/proto/cedar/v3/entity_id.pb.go new file mode 100644 index 0000000..f392d14 --- /dev/null +++ b/go/proto/cedar/v3/entity_id.pb.go @@ -0,0 +1,160 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.34.2 +// protoc (unknown) +// source: cedar/v3/entity_id.proto + +package cedarpb + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type EntityId struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` + Id string `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"` +} + +func (x *EntityId) Reset() { + *x = EntityId{} + if protoimpl.UnsafeEnabled { + mi := &file_cedar_v3_entity_id_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EntityId) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EntityId) ProtoMessage() {} + +func (x *EntityId) ProtoReflect() protoreflect.Message { + mi := &file_cedar_v3_entity_id_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use EntityId.ProtoReflect.Descriptor instead. +func (*EntityId) Descriptor() ([]byte, []int) { + return file_cedar_v3_entity_id_proto_rawDescGZIP(), []int{0} +} + +func (x *EntityId) GetType() string { + if x != nil { + return x.Type + } + return "" +} + +func (x *EntityId) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +var File_cedar_v3_entity_id_proto protoreflect.FileDescriptor + +var file_cedar_v3_entity_id_proto_rawDesc = []byte{ + 0x0a, 0x18, 0x63, 0x65, 0x64, 0x61, 0x72, 0x2f, 0x76, 0x33, 0x2f, 0x65, 0x6e, 0x74, 0x69, 0x74, + 0x79, 0x5f, 0x69, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x08, 0x63, 0x65, 0x64, 0x61, + 0x72, 0x2e, 0x76, 0x33, 0x22, 0x2e, 0x0a, 0x08, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x49, 0x64, + 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, + 0x74, 0x79, 0x70, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x02, 0x69, 0x64, 0x42, 0x95, 0x01, 0x0a, 0x0c, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x65, 0x64, + 0x61, 0x72, 0x2e, 0x76, 0x33, 0x42, 0x0d, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x49, 0x64, 0x50, + 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x35, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, + 0x6f, 0x6d, 0x2f, 0x63, 0x65, 0x6c, 0x65, 0x73, 0x74, 0x2d, 0x64, 0x65, 0x76, 0x2f, 0x63, 0x6f, + 0x72, 0x6b, 0x73, 0x2f, 0x67, 0x6f, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x63, 0x65, 0x64, + 0x61, 0x72, 0x2f, 0x76, 0x33, 0x3b, 0x63, 0x65, 0x64, 0x61, 0x72, 0x70, 0x62, 0xa2, 0x02, 0x03, + 0x43, 0x58, 0x58, 0xaa, 0x02, 0x08, 0x43, 0x65, 0x64, 0x61, 0x72, 0x2e, 0x56, 0x33, 0xca, 0x02, + 0x08, 0x43, 0x65, 0x64, 0x61, 0x72, 0x5c, 0x56, 0x33, 0xe2, 0x02, 0x14, 0x43, 0x65, 0x64, 0x61, + 0x72, 0x5c, 0x56, 0x33, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, + 0xea, 0x02, 0x09, 0x43, 0x65, 0x64, 0x61, 0x72, 0x3a, 0x3a, 0x56, 0x33, 0x62, 0x06, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_cedar_v3_entity_id_proto_rawDescOnce sync.Once + file_cedar_v3_entity_id_proto_rawDescData = file_cedar_v3_entity_id_proto_rawDesc +) + +func file_cedar_v3_entity_id_proto_rawDescGZIP() []byte { + file_cedar_v3_entity_id_proto_rawDescOnce.Do(func() { + file_cedar_v3_entity_id_proto_rawDescData = protoimpl.X.CompressGZIP(file_cedar_v3_entity_id_proto_rawDescData) + }) + return file_cedar_v3_entity_id_proto_rawDescData +} + +var file_cedar_v3_entity_id_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_cedar_v3_entity_id_proto_goTypes = []any{ + (*EntityId)(nil), // 0: cedar.v3.EntityId +} +var file_cedar_v3_entity_id_proto_depIdxs = []int32{ + 0, // [0:0] is the sub-list for method output_type + 0, // [0:0] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_cedar_v3_entity_id_proto_init() } +func file_cedar_v3_entity_id_proto_init() { + if File_cedar_v3_entity_id_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_cedar_v3_entity_id_proto_msgTypes[0].Exporter = func(v any, i int) any { + switch v := v.(*EntityId); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_cedar_v3_entity_id_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_cedar_v3_entity_id_proto_goTypes, + DependencyIndexes: file_cedar_v3_entity_id_proto_depIdxs, + MessageInfos: file_cedar_v3_entity_id_proto_msgTypes, + }.Build() + File_cedar_v3_entity_id_proto = out.File + file_cedar_v3_entity_id_proto_rawDesc = nil + file_cedar_v3_entity_id_proto_goTypes = nil + file_cedar_v3_entity_id_proto_depIdxs = nil +} diff --git a/go/proto/cedar/v3/expr.pb.go b/go/proto/cedar/v3/expr.pb.go new file mode 100644 index 0000000..1d7a277 --- /dev/null +++ b/go/proto/cedar/v3/expr.pb.go @@ -0,0 +1,2969 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.34.2 +// protoc (unknown) +// source: cedar/v3/expr.proto + +package cedarpb + +import ( + _ "github.com/celest-dev/corks/go/proto/dart" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type Variable int32 + +const ( + Variable_VARIABLE_UNSPECIFIED Variable = 0 + Variable_VARIABLE_PRINCIPAL Variable = 1 + Variable_VARIABLE_ACTION Variable = 2 + Variable_VARIABLE_RESOURCE Variable = 3 + Variable_VARIABLE_CONTEXT Variable = 4 +) + +// Enum value maps for Variable. +var ( + Variable_name = map[int32]string{ + 0: "VARIABLE_UNSPECIFIED", + 1: "VARIABLE_PRINCIPAL", + 2: "VARIABLE_ACTION", + 3: "VARIABLE_RESOURCE", + 4: "VARIABLE_CONTEXT", + } + Variable_value = map[string]int32{ + "VARIABLE_UNSPECIFIED": 0, + "VARIABLE_PRINCIPAL": 1, + "VARIABLE_ACTION": 2, + "VARIABLE_RESOURCE": 3, + "VARIABLE_CONTEXT": 4, + } +) + +func (x Variable) Enum() *Variable { + p := new(Variable) + *p = x + return p +} + +func (x Variable) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (Variable) Descriptor() protoreflect.EnumDescriptor { + return file_cedar_v3_expr_proto_enumTypes[0].Descriptor() +} + +func (Variable) Type() protoreflect.EnumType { + return &file_cedar_v3_expr_proto_enumTypes[0] +} + +func (x Variable) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use Variable.Descriptor instead. +func (Variable) EnumDescriptor() ([]byte, []int) { + return file_cedar_v3_expr_proto_rawDescGZIP(), []int{0} +} + +type SlotId int32 + +const ( + SlotId_SLOT_ID_UNSPECIFIED SlotId = 0 + SlotId_SLOT_ID_PRINCIPAL SlotId = 1 + SlotId_SLOT_ID_RESOURCE SlotId = 2 +) + +// Enum value maps for SlotId. +var ( + SlotId_name = map[int32]string{ + 0: "SLOT_ID_UNSPECIFIED", + 1: "SLOT_ID_PRINCIPAL", + 2: "SLOT_ID_RESOURCE", + } + SlotId_value = map[string]int32{ + "SLOT_ID_UNSPECIFIED": 0, + "SLOT_ID_PRINCIPAL": 1, + "SLOT_ID_RESOURCE": 2, + } +) + +func (x SlotId) Enum() *SlotId { + p := new(SlotId) + *p = x + return p +} + +func (x SlotId) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (SlotId) Descriptor() protoreflect.EnumDescriptor { + return file_cedar_v3_expr_proto_enumTypes[1].Descriptor() +} + +func (SlotId) Type() protoreflect.EnumType { + return &file_cedar_v3_expr_proto_enumTypes[1] +} + +func (x SlotId) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use SlotId.Descriptor instead. +func (SlotId) EnumDescriptor() ([]byte, []int) { + return file_cedar_v3_expr_proto_rawDescGZIP(), []int{1} +} + +type Expr struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Expr: + // + // *Expr_Value + // *Expr_Var + // *Expr_Slot + // *Expr_Unknown + // *Expr_Not + // *Expr_Neg + // *Expr_Equals + // *Expr_NotEquals + // *Expr_In + // *Expr_LessThan + // *Expr_LessThanOrEquals + // *Expr_GreaterThan + // *Expr_GreaterThanOrEquals + // *Expr_And + // *Expr_Or + // *Expr_Plus + // *Expr_Minus + // *Expr_Times + // *Expr_Contains + // *Expr_ContainsAll + // *Expr_ContainsAny + // *Expr_GetAttribute + // *Expr_HasAttribute + // *Expr_Like + // *Expr_Is + // *Expr_IfThenElse + // *Expr_Set + // *Expr_Record + // *Expr_FuncCall + Expr isExpr_Expr `protobuf_oneof:"expr"` +} + +func (x *Expr) Reset() { + *x = Expr{} + if protoimpl.UnsafeEnabled { + mi := &file_cedar_v3_expr_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Expr) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Expr) ProtoMessage() {} + +func (x *Expr) ProtoReflect() protoreflect.Message { + mi := &file_cedar_v3_expr_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Expr.ProtoReflect.Descriptor instead. +func (*Expr) Descriptor() ([]byte, []int) { + return file_cedar_v3_expr_proto_rawDescGZIP(), []int{0} +} + +func (m *Expr) GetExpr() isExpr_Expr { + if m != nil { + return m.Expr + } + return nil +} + +func (x *Expr) GetValue() *ExprValue { + if x, ok := x.GetExpr().(*Expr_Value); ok { + return x.Value + } + return nil +} + +func (x *Expr) GetVar() *ExprVar { + if x, ok := x.GetExpr().(*Expr_Var); ok { + return x.Var + } + return nil +} + +func (x *Expr) GetSlot() *ExprSlot { + if x, ok := x.GetExpr().(*Expr_Slot); ok { + return x.Slot + } + return nil +} + +func (x *Expr) GetUnknown() *ExprUnknown { + if x, ok := x.GetExpr().(*Expr_Unknown); ok { + return x.Unknown + } + return nil +} + +func (x *Expr) GetNot() *ExprNot { + if x, ok := x.GetExpr().(*Expr_Not); ok { + return x.Not + } + return nil +} + +func (x *Expr) GetNeg() *ExprNeg { + if x, ok := x.GetExpr().(*Expr_Neg); ok { + return x.Neg + } + return nil +} + +func (x *Expr) GetEquals() *ExprEquals { + if x, ok := x.GetExpr().(*Expr_Equals); ok { + return x.Equals + } + return nil +} + +func (x *Expr) GetNotEquals() *ExprNotEquals { + if x, ok := x.GetExpr().(*Expr_NotEquals); ok { + return x.NotEquals + } + return nil +} + +func (x *Expr) GetIn() *ExprIn { + if x, ok := x.GetExpr().(*Expr_In); ok { + return x.In + } + return nil +} + +func (x *Expr) GetLessThan() *ExprLessThan { + if x, ok := x.GetExpr().(*Expr_LessThan); ok { + return x.LessThan + } + return nil +} + +func (x *Expr) GetLessThanOrEquals() *ExprLessThanOrEquals { + if x, ok := x.GetExpr().(*Expr_LessThanOrEquals); ok { + return x.LessThanOrEquals + } + return nil +} + +func (x *Expr) GetGreaterThan() *ExprGreaterThan { + if x, ok := x.GetExpr().(*Expr_GreaterThan); ok { + return x.GreaterThan + } + return nil +} + +func (x *Expr) GetGreaterThanOrEquals() *ExprGreaterThanOrEquals { + if x, ok := x.GetExpr().(*Expr_GreaterThanOrEquals); ok { + return x.GreaterThanOrEquals + } + return nil +} + +func (x *Expr) GetAnd() *ExprAnd { + if x, ok := x.GetExpr().(*Expr_And); ok { + return x.And + } + return nil +} + +func (x *Expr) GetOr() *ExprOr { + if x, ok := x.GetExpr().(*Expr_Or); ok { + return x.Or + } + return nil +} + +func (x *Expr) GetPlus() *ExprPlus { + if x, ok := x.GetExpr().(*Expr_Plus); ok { + return x.Plus + } + return nil +} + +func (x *Expr) GetMinus() *ExprMinus { + if x, ok := x.GetExpr().(*Expr_Minus); ok { + return x.Minus + } + return nil +} + +func (x *Expr) GetTimes() *ExprTimes { + if x, ok := x.GetExpr().(*Expr_Times); ok { + return x.Times + } + return nil +} + +func (x *Expr) GetContains() *ExprContains { + if x, ok := x.GetExpr().(*Expr_Contains); ok { + return x.Contains + } + return nil +} + +func (x *Expr) GetContainsAll() *ExprContainsAll { + if x, ok := x.GetExpr().(*Expr_ContainsAll); ok { + return x.ContainsAll + } + return nil +} + +func (x *Expr) GetContainsAny() *ExprContainsAny { + if x, ok := x.GetExpr().(*Expr_ContainsAny); ok { + return x.ContainsAny + } + return nil +} + +func (x *Expr) GetGetAttribute() *ExprGetAttribute { + if x, ok := x.GetExpr().(*Expr_GetAttribute); ok { + return x.GetAttribute + } + return nil +} + +func (x *Expr) GetHasAttribute() *ExprHasAttribute { + if x, ok := x.GetExpr().(*Expr_HasAttribute); ok { + return x.HasAttribute + } + return nil +} + +func (x *Expr) GetLike() *ExprLike { + if x, ok := x.GetExpr().(*Expr_Like); ok { + return x.Like + } + return nil +} + +func (x *Expr) GetIs() *ExprIs { + if x, ok := x.GetExpr().(*Expr_Is); ok { + return x.Is + } + return nil +} + +func (x *Expr) GetIfThenElse() *ExprIfThenElse { + if x, ok := x.GetExpr().(*Expr_IfThenElse); ok { + return x.IfThenElse + } + return nil +} + +func (x *Expr) GetSet() *ExprSet { + if x, ok := x.GetExpr().(*Expr_Set); ok { + return x.Set + } + return nil +} + +func (x *Expr) GetRecord() *ExprRecord { + if x, ok := x.GetExpr().(*Expr_Record); ok { + return x.Record + } + return nil +} + +func (x *Expr) GetFuncCall() *ExprFuncCall { + if x, ok := x.GetExpr().(*Expr_FuncCall); ok { + return x.FuncCall + } + return nil +} + +type isExpr_Expr interface { + isExpr_Expr() +} + +type Expr_Value struct { + Value *ExprValue `protobuf:"bytes,1,opt,name=value,proto3,oneof"` +} + +type Expr_Var struct { + Var *ExprVar `protobuf:"bytes,2,opt,name=var,proto3,oneof"` +} + +type Expr_Slot struct { + Slot *ExprSlot `protobuf:"bytes,3,opt,name=slot,proto3,oneof"` +} + +type Expr_Unknown struct { + Unknown *ExprUnknown `protobuf:"bytes,4,opt,name=unknown,proto3,oneof"` +} + +type Expr_Not struct { + Not *ExprNot `protobuf:"bytes,5,opt,name=not,proto3,oneof"` +} + +type Expr_Neg struct { + Neg *ExprNeg `protobuf:"bytes,6,opt,name=neg,proto3,oneof"` +} + +type Expr_Equals struct { + Equals *ExprEquals `protobuf:"bytes,7,opt,name=equals,proto3,oneof"` +} + +type Expr_NotEquals struct { + NotEquals *ExprNotEquals `protobuf:"bytes,8,opt,name=not_equals,json=notEquals,proto3,oneof"` +} + +type Expr_In struct { + In *ExprIn `protobuf:"bytes,9,opt,name=in,proto3,oneof"` +} + +type Expr_LessThan struct { + LessThan *ExprLessThan `protobuf:"bytes,10,opt,name=less_than,json=lessThan,proto3,oneof"` +} + +type Expr_LessThanOrEquals struct { + LessThanOrEquals *ExprLessThanOrEquals `protobuf:"bytes,11,opt,name=less_than_or_equals,json=lessThanOrEquals,proto3,oneof"` +} + +type Expr_GreaterThan struct { + GreaterThan *ExprGreaterThan `protobuf:"bytes,12,opt,name=greater_than,json=greaterThan,proto3,oneof"` +} + +type Expr_GreaterThanOrEquals struct { + GreaterThanOrEquals *ExprGreaterThanOrEquals `protobuf:"bytes,13,opt,name=greater_than_or_equals,json=greaterThanOrEquals,proto3,oneof"` +} + +type Expr_And struct { + And *ExprAnd `protobuf:"bytes,14,opt,name=and,proto3,oneof"` +} + +type Expr_Or struct { + Or *ExprOr `protobuf:"bytes,15,opt,name=or,proto3,oneof"` +} + +type Expr_Plus struct { + Plus *ExprPlus `protobuf:"bytes,16,opt,name=plus,proto3,oneof"` +} + +type Expr_Minus struct { + Minus *ExprMinus `protobuf:"bytes,17,opt,name=minus,proto3,oneof"` +} + +type Expr_Times struct { + Times *ExprTimes `protobuf:"bytes,18,opt,name=times,proto3,oneof"` +} + +type Expr_Contains struct { + Contains *ExprContains `protobuf:"bytes,19,opt,name=contains,proto3,oneof"` +} + +type Expr_ContainsAll struct { + ContainsAll *ExprContainsAll `protobuf:"bytes,20,opt,name=contains_all,json=containsAll,proto3,oneof"` +} + +type Expr_ContainsAny struct { + ContainsAny *ExprContainsAny `protobuf:"bytes,21,opt,name=contains_any,json=containsAny,proto3,oneof"` +} + +type Expr_GetAttribute struct { + GetAttribute *ExprGetAttribute `protobuf:"bytes,22,opt,name=get_attribute,json=getAttribute,proto3,oneof"` +} + +type Expr_HasAttribute struct { + HasAttribute *ExprHasAttribute `protobuf:"bytes,23,opt,name=has_attribute,json=hasAttribute,proto3,oneof"` +} + +type Expr_Like struct { + Like *ExprLike `protobuf:"bytes,24,opt,name=like,proto3,oneof"` +} + +type Expr_Is struct { + Is *ExprIs `protobuf:"bytes,25,opt,name=is,proto3,oneof"` +} + +type Expr_IfThenElse struct { + IfThenElse *ExprIfThenElse `protobuf:"bytes,26,opt,name=if_then_else,json=ifThenElse,proto3,oneof"` +} + +type Expr_Set struct { + Set *ExprSet `protobuf:"bytes,27,opt,name=set,proto3,oneof"` +} + +type Expr_Record struct { + Record *ExprRecord `protobuf:"bytes,28,opt,name=record,proto3,oneof"` +} + +type Expr_FuncCall struct { + FuncCall *ExprFuncCall `protobuf:"bytes,29,opt,name=func_call,json=funcCall,proto3,oneof"` +} + +func (*Expr_Value) isExpr_Expr() {} + +func (*Expr_Var) isExpr_Expr() {} + +func (*Expr_Slot) isExpr_Expr() {} + +func (*Expr_Unknown) isExpr_Expr() {} + +func (*Expr_Not) isExpr_Expr() {} + +func (*Expr_Neg) isExpr_Expr() {} + +func (*Expr_Equals) isExpr_Expr() {} + +func (*Expr_NotEquals) isExpr_Expr() {} + +func (*Expr_In) isExpr_Expr() {} + +func (*Expr_LessThan) isExpr_Expr() {} + +func (*Expr_LessThanOrEquals) isExpr_Expr() {} + +func (*Expr_GreaterThan) isExpr_Expr() {} + +func (*Expr_GreaterThanOrEquals) isExpr_Expr() {} + +func (*Expr_And) isExpr_Expr() {} + +func (*Expr_Or) isExpr_Expr() {} + +func (*Expr_Plus) isExpr_Expr() {} + +func (*Expr_Minus) isExpr_Expr() {} + +func (*Expr_Times) isExpr_Expr() {} + +func (*Expr_Contains) isExpr_Expr() {} + +func (*Expr_ContainsAll) isExpr_Expr() {} + +func (*Expr_ContainsAny) isExpr_Expr() {} + +func (*Expr_GetAttribute) isExpr_Expr() {} + +func (*Expr_HasAttribute) isExpr_Expr() {} + +func (*Expr_Like) isExpr_Expr() {} + +func (*Expr_Is) isExpr_Expr() {} + +func (*Expr_IfThenElse) isExpr_Expr() {} + +func (*Expr_Set) isExpr_Expr() {} + +func (*Expr_Record) isExpr_Expr() {} + +func (*Expr_FuncCall) isExpr_Expr() {} + +type ExprValue struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Value *Value `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` +} + +func (x *ExprValue) Reset() { + *x = ExprValue{} + if protoimpl.UnsafeEnabled { + mi := &file_cedar_v3_expr_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ExprValue) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ExprValue) ProtoMessage() {} + +func (x *ExprValue) ProtoReflect() protoreflect.Message { + mi := &file_cedar_v3_expr_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ExprValue.ProtoReflect.Descriptor instead. +func (*ExprValue) Descriptor() ([]byte, []int) { + return file_cedar_v3_expr_proto_rawDescGZIP(), []int{1} +} + +func (x *ExprValue) GetValue() *Value { + if x != nil { + return x.Value + } + return nil +} + +type ExprVar struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Variable Variable `protobuf:"varint,1,opt,name=variable,proto3,enum=cedar.v3.Variable" json:"variable,omitempty"` +} + +func (x *ExprVar) Reset() { + *x = ExprVar{} + if protoimpl.UnsafeEnabled { + mi := &file_cedar_v3_expr_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ExprVar) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ExprVar) ProtoMessage() {} + +func (x *ExprVar) ProtoReflect() protoreflect.Message { + mi := &file_cedar_v3_expr_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ExprVar.ProtoReflect.Descriptor instead. +func (*ExprVar) Descriptor() ([]byte, []int) { + return file_cedar_v3_expr_proto_rawDescGZIP(), []int{2} +} + +func (x *ExprVar) GetVariable() Variable { + if x != nil { + return x.Variable + } + return Variable_VARIABLE_UNSPECIFIED +} + +type ExprSlot struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + SlotId SlotId `protobuf:"varint,1,opt,name=slot_id,json=slotId,proto3,enum=cedar.v3.SlotId" json:"slot_id,omitempty"` +} + +func (x *ExprSlot) Reset() { + *x = ExprSlot{} + if protoimpl.UnsafeEnabled { + mi := &file_cedar_v3_expr_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ExprSlot) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ExprSlot) ProtoMessage() {} + +func (x *ExprSlot) ProtoReflect() protoreflect.Message { + mi := &file_cedar_v3_expr_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ExprSlot.ProtoReflect.Descriptor instead. +func (*ExprSlot) Descriptor() ([]byte, []int) { + return file_cedar_v3_expr_proto_rawDescGZIP(), []int{3} +} + +func (x *ExprSlot) GetSlotId() SlotId { + if x != nil { + return x.SlotId + } + return SlotId_SLOT_ID_UNSPECIFIED +} + +type ExprUnknown struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` +} + +func (x *ExprUnknown) Reset() { + *x = ExprUnknown{} + if protoimpl.UnsafeEnabled { + mi := &file_cedar_v3_expr_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ExprUnknown) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ExprUnknown) ProtoMessage() {} + +func (x *ExprUnknown) ProtoReflect() protoreflect.Message { + mi := &file_cedar_v3_expr_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ExprUnknown.ProtoReflect.Descriptor instead. +func (*ExprUnknown) Descriptor() ([]byte, []int) { + return file_cedar_v3_expr_proto_rawDescGZIP(), []int{4} +} + +func (x *ExprUnknown) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +type ExprNot struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Expr *Expr `protobuf:"bytes,1,opt,name=expr,proto3" json:"expr,omitempty"` +} + +func (x *ExprNot) Reset() { + *x = ExprNot{} + if protoimpl.UnsafeEnabled { + mi := &file_cedar_v3_expr_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ExprNot) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ExprNot) ProtoMessage() {} + +func (x *ExprNot) ProtoReflect() protoreflect.Message { + mi := &file_cedar_v3_expr_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ExprNot.ProtoReflect.Descriptor instead. +func (*ExprNot) Descriptor() ([]byte, []int) { + return file_cedar_v3_expr_proto_rawDescGZIP(), []int{5} +} + +func (x *ExprNot) GetExpr() *Expr { + if x != nil { + return x.Expr + } + return nil +} + +type ExprNeg struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Expr *Expr `protobuf:"bytes,1,opt,name=expr,proto3" json:"expr,omitempty"` +} + +func (x *ExprNeg) Reset() { + *x = ExprNeg{} + if protoimpl.UnsafeEnabled { + mi := &file_cedar_v3_expr_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ExprNeg) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ExprNeg) ProtoMessage() {} + +func (x *ExprNeg) ProtoReflect() protoreflect.Message { + mi := &file_cedar_v3_expr_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ExprNeg.ProtoReflect.Descriptor instead. +func (*ExprNeg) Descriptor() ([]byte, []int) { + return file_cedar_v3_expr_proto_rawDescGZIP(), []int{6} +} + +func (x *ExprNeg) GetExpr() *Expr { + if x != nil { + return x.Expr + } + return nil +} + +type ExprEquals struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Left *Expr `protobuf:"bytes,1,opt,name=left,proto3" json:"left,omitempty"` + Right *Expr `protobuf:"bytes,2,opt,name=right,proto3" json:"right,omitempty"` +} + +func (x *ExprEquals) Reset() { + *x = ExprEquals{} + if protoimpl.UnsafeEnabled { + mi := &file_cedar_v3_expr_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ExprEquals) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ExprEquals) ProtoMessage() {} + +func (x *ExprEquals) ProtoReflect() protoreflect.Message { + mi := &file_cedar_v3_expr_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ExprEquals.ProtoReflect.Descriptor instead. +func (*ExprEquals) Descriptor() ([]byte, []int) { + return file_cedar_v3_expr_proto_rawDescGZIP(), []int{7} +} + +func (x *ExprEquals) GetLeft() *Expr { + if x != nil { + return x.Left + } + return nil +} + +func (x *ExprEquals) GetRight() *Expr { + if x != nil { + return x.Right + } + return nil +} + +type ExprNotEquals struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Left *Expr `protobuf:"bytes,1,opt,name=left,proto3" json:"left,omitempty"` + Right *Expr `protobuf:"bytes,2,opt,name=right,proto3" json:"right,omitempty"` +} + +func (x *ExprNotEquals) Reset() { + *x = ExprNotEquals{} + if protoimpl.UnsafeEnabled { + mi := &file_cedar_v3_expr_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ExprNotEquals) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ExprNotEquals) ProtoMessage() {} + +func (x *ExprNotEquals) ProtoReflect() protoreflect.Message { + mi := &file_cedar_v3_expr_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ExprNotEquals.ProtoReflect.Descriptor instead. +func (*ExprNotEquals) Descriptor() ([]byte, []int) { + return file_cedar_v3_expr_proto_rawDescGZIP(), []int{8} +} + +func (x *ExprNotEquals) GetLeft() *Expr { + if x != nil { + return x.Left + } + return nil +} + +func (x *ExprNotEquals) GetRight() *Expr { + if x != nil { + return x.Right + } + return nil +} + +type ExprIn struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Left *Expr `protobuf:"bytes,1,opt,name=left,proto3" json:"left,omitempty"` + Right *Expr `protobuf:"bytes,2,opt,name=right,proto3" json:"right,omitempty"` +} + +func (x *ExprIn) Reset() { + *x = ExprIn{} + if protoimpl.UnsafeEnabled { + mi := &file_cedar_v3_expr_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ExprIn) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ExprIn) ProtoMessage() {} + +func (x *ExprIn) ProtoReflect() protoreflect.Message { + mi := &file_cedar_v3_expr_proto_msgTypes[9] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ExprIn.ProtoReflect.Descriptor instead. +func (*ExprIn) Descriptor() ([]byte, []int) { + return file_cedar_v3_expr_proto_rawDescGZIP(), []int{9} +} + +func (x *ExprIn) GetLeft() *Expr { + if x != nil { + return x.Left + } + return nil +} + +func (x *ExprIn) GetRight() *Expr { + if x != nil { + return x.Right + } + return nil +} + +type ExprLessThan struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Left *Expr `protobuf:"bytes,1,opt,name=left,proto3" json:"left,omitempty"` + Right *Expr `protobuf:"bytes,2,opt,name=right,proto3" json:"right,omitempty"` +} + +func (x *ExprLessThan) Reset() { + *x = ExprLessThan{} + if protoimpl.UnsafeEnabled { + mi := &file_cedar_v3_expr_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ExprLessThan) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ExprLessThan) ProtoMessage() {} + +func (x *ExprLessThan) ProtoReflect() protoreflect.Message { + mi := &file_cedar_v3_expr_proto_msgTypes[10] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ExprLessThan.ProtoReflect.Descriptor instead. +func (*ExprLessThan) Descriptor() ([]byte, []int) { + return file_cedar_v3_expr_proto_rawDescGZIP(), []int{10} +} + +func (x *ExprLessThan) GetLeft() *Expr { + if x != nil { + return x.Left + } + return nil +} + +func (x *ExprLessThan) GetRight() *Expr { + if x != nil { + return x.Right + } + return nil +} + +type ExprLessThanOrEquals struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Left *Expr `protobuf:"bytes,1,opt,name=left,proto3" json:"left,omitempty"` + Right *Expr `protobuf:"bytes,2,opt,name=right,proto3" json:"right,omitempty"` +} + +func (x *ExprLessThanOrEquals) Reset() { + *x = ExprLessThanOrEquals{} + if protoimpl.UnsafeEnabled { + mi := &file_cedar_v3_expr_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ExprLessThanOrEquals) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ExprLessThanOrEquals) ProtoMessage() {} + +func (x *ExprLessThanOrEquals) ProtoReflect() protoreflect.Message { + mi := &file_cedar_v3_expr_proto_msgTypes[11] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ExprLessThanOrEquals.ProtoReflect.Descriptor instead. +func (*ExprLessThanOrEquals) Descriptor() ([]byte, []int) { + return file_cedar_v3_expr_proto_rawDescGZIP(), []int{11} +} + +func (x *ExprLessThanOrEquals) GetLeft() *Expr { + if x != nil { + return x.Left + } + return nil +} + +func (x *ExprLessThanOrEquals) GetRight() *Expr { + if x != nil { + return x.Right + } + return nil +} + +type ExprGreaterThan struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Left *Expr `protobuf:"bytes,1,opt,name=left,proto3" json:"left,omitempty"` + Right *Expr `protobuf:"bytes,2,opt,name=right,proto3" json:"right,omitempty"` +} + +func (x *ExprGreaterThan) Reset() { + *x = ExprGreaterThan{} + if protoimpl.UnsafeEnabled { + mi := &file_cedar_v3_expr_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ExprGreaterThan) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ExprGreaterThan) ProtoMessage() {} + +func (x *ExprGreaterThan) ProtoReflect() protoreflect.Message { + mi := &file_cedar_v3_expr_proto_msgTypes[12] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ExprGreaterThan.ProtoReflect.Descriptor instead. +func (*ExprGreaterThan) Descriptor() ([]byte, []int) { + return file_cedar_v3_expr_proto_rawDescGZIP(), []int{12} +} + +func (x *ExprGreaterThan) GetLeft() *Expr { + if x != nil { + return x.Left + } + return nil +} + +func (x *ExprGreaterThan) GetRight() *Expr { + if x != nil { + return x.Right + } + return nil +} + +type ExprGreaterThanOrEquals struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Left *Expr `protobuf:"bytes,1,opt,name=left,proto3" json:"left,omitempty"` + Right *Expr `protobuf:"bytes,2,opt,name=right,proto3" json:"right,omitempty"` +} + +func (x *ExprGreaterThanOrEquals) Reset() { + *x = ExprGreaterThanOrEquals{} + if protoimpl.UnsafeEnabled { + mi := &file_cedar_v3_expr_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ExprGreaterThanOrEquals) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ExprGreaterThanOrEquals) ProtoMessage() {} + +func (x *ExprGreaterThanOrEquals) ProtoReflect() protoreflect.Message { + mi := &file_cedar_v3_expr_proto_msgTypes[13] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ExprGreaterThanOrEquals.ProtoReflect.Descriptor instead. +func (*ExprGreaterThanOrEquals) Descriptor() ([]byte, []int) { + return file_cedar_v3_expr_proto_rawDescGZIP(), []int{13} +} + +func (x *ExprGreaterThanOrEquals) GetLeft() *Expr { + if x != nil { + return x.Left + } + return nil +} + +func (x *ExprGreaterThanOrEquals) GetRight() *Expr { + if x != nil { + return x.Right + } + return nil +} + +type ExprAnd struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Left *Expr `protobuf:"bytes,1,opt,name=left,proto3" json:"left,omitempty"` + Right *Expr `protobuf:"bytes,2,opt,name=right,proto3" json:"right,omitempty"` +} + +func (x *ExprAnd) Reset() { + *x = ExprAnd{} + if protoimpl.UnsafeEnabled { + mi := &file_cedar_v3_expr_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ExprAnd) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ExprAnd) ProtoMessage() {} + +func (x *ExprAnd) ProtoReflect() protoreflect.Message { + mi := &file_cedar_v3_expr_proto_msgTypes[14] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ExprAnd.ProtoReflect.Descriptor instead. +func (*ExprAnd) Descriptor() ([]byte, []int) { + return file_cedar_v3_expr_proto_rawDescGZIP(), []int{14} +} + +func (x *ExprAnd) GetLeft() *Expr { + if x != nil { + return x.Left + } + return nil +} + +func (x *ExprAnd) GetRight() *Expr { + if x != nil { + return x.Right + } + return nil +} + +type ExprOr struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Left *Expr `protobuf:"bytes,1,opt,name=left,proto3" json:"left,omitempty"` + Right *Expr `protobuf:"bytes,2,opt,name=right,proto3" json:"right,omitempty"` +} + +func (x *ExprOr) Reset() { + *x = ExprOr{} + if protoimpl.UnsafeEnabled { + mi := &file_cedar_v3_expr_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ExprOr) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ExprOr) ProtoMessage() {} + +func (x *ExprOr) ProtoReflect() protoreflect.Message { + mi := &file_cedar_v3_expr_proto_msgTypes[15] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ExprOr.ProtoReflect.Descriptor instead. +func (*ExprOr) Descriptor() ([]byte, []int) { + return file_cedar_v3_expr_proto_rawDescGZIP(), []int{15} +} + +func (x *ExprOr) GetLeft() *Expr { + if x != nil { + return x.Left + } + return nil +} + +func (x *ExprOr) GetRight() *Expr { + if x != nil { + return x.Right + } + return nil +} + +type ExprPlus struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Left *Expr `protobuf:"bytes,1,opt,name=left,proto3" json:"left,omitempty"` + Right *Expr `protobuf:"bytes,2,opt,name=right,proto3" json:"right,omitempty"` +} + +func (x *ExprPlus) Reset() { + *x = ExprPlus{} + if protoimpl.UnsafeEnabled { + mi := &file_cedar_v3_expr_proto_msgTypes[16] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ExprPlus) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ExprPlus) ProtoMessage() {} + +func (x *ExprPlus) ProtoReflect() protoreflect.Message { + mi := &file_cedar_v3_expr_proto_msgTypes[16] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ExprPlus.ProtoReflect.Descriptor instead. +func (*ExprPlus) Descriptor() ([]byte, []int) { + return file_cedar_v3_expr_proto_rawDescGZIP(), []int{16} +} + +func (x *ExprPlus) GetLeft() *Expr { + if x != nil { + return x.Left + } + return nil +} + +func (x *ExprPlus) GetRight() *Expr { + if x != nil { + return x.Right + } + return nil +} + +type ExprMinus struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Left *Expr `protobuf:"bytes,1,opt,name=left,proto3" json:"left,omitempty"` + Right *Expr `protobuf:"bytes,2,opt,name=right,proto3" json:"right,omitempty"` +} + +func (x *ExprMinus) Reset() { + *x = ExprMinus{} + if protoimpl.UnsafeEnabled { + mi := &file_cedar_v3_expr_proto_msgTypes[17] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ExprMinus) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ExprMinus) ProtoMessage() {} + +func (x *ExprMinus) ProtoReflect() protoreflect.Message { + mi := &file_cedar_v3_expr_proto_msgTypes[17] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ExprMinus.ProtoReflect.Descriptor instead. +func (*ExprMinus) Descriptor() ([]byte, []int) { + return file_cedar_v3_expr_proto_rawDescGZIP(), []int{17} +} + +func (x *ExprMinus) GetLeft() *Expr { + if x != nil { + return x.Left + } + return nil +} + +func (x *ExprMinus) GetRight() *Expr { + if x != nil { + return x.Right + } + return nil +} + +type ExprTimes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Left *Expr `protobuf:"bytes,1,opt,name=left,proto3" json:"left,omitempty"` + Right *Expr `protobuf:"bytes,2,opt,name=right,proto3" json:"right,omitempty"` +} + +func (x *ExprTimes) Reset() { + *x = ExprTimes{} + if protoimpl.UnsafeEnabled { + mi := &file_cedar_v3_expr_proto_msgTypes[18] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ExprTimes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ExprTimes) ProtoMessage() {} + +func (x *ExprTimes) ProtoReflect() protoreflect.Message { + mi := &file_cedar_v3_expr_proto_msgTypes[18] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ExprTimes.ProtoReflect.Descriptor instead. +func (*ExprTimes) Descriptor() ([]byte, []int) { + return file_cedar_v3_expr_proto_rawDescGZIP(), []int{18} +} + +func (x *ExprTimes) GetLeft() *Expr { + if x != nil { + return x.Left + } + return nil +} + +func (x *ExprTimes) GetRight() *Expr { + if x != nil { + return x.Right + } + return nil +} + +type ExprContains struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Left *Expr `protobuf:"bytes,1,opt,name=left,proto3" json:"left,omitempty"` + Right *Expr `protobuf:"bytes,2,opt,name=right,proto3" json:"right,omitempty"` +} + +func (x *ExprContains) Reset() { + *x = ExprContains{} + if protoimpl.UnsafeEnabled { + mi := &file_cedar_v3_expr_proto_msgTypes[19] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ExprContains) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ExprContains) ProtoMessage() {} + +func (x *ExprContains) ProtoReflect() protoreflect.Message { + mi := &file_cedar_v3_expr_proto_msgTypes[19] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ExprContains.ProtoReflect.Descriptor instead. +func (*ExprContains) Descriptor() ([]byte, []int) { + return file_cedar_v3_expr_proto_rawDescGZIP(), []int{19} +} + +func (x *ExprContains) GetLeft() *Expr { + if x != nil { + return x.Left + } + return nil +} + +func (x *ExprContains) GetRight() *Expr { + if x != nil { + return x.Right + } + return nil +} + +type ExprContainsAll struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Left *Expr `protobuf:"bytes,1,opt,name=left,proto3" json:"left,omitempty"` + Right *Expr `protobuf:"bytes,2,opt,name=right,proto3" json:"right,omitempty"` +} + +func (x *ExprContainsAll) Reset() { + *x = ExprContainsAll{} + if protoimpl.UnsafeEnabled { + mi := &file_cedar_v3_expr_proto_msgTypes[20] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ExprContainsAll) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ExprContainsAll) ProtoMessage() {} + +func (x *ExprContainsAll) ProtoReflect() protoreflect.Message { + mi := &file_cedar_v3_expr_proto_msgTypes[20] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ExprContainsAll.ProtoReflect.Descriptor instead. +func (*ExprContainsAll) Descriptor() ([]byte, []int) { + return file_cedar_v3_expr_proto_rawDescGZIP(), []int{20} +} + +func (x *ExprContainsAll) GetLeft() *Expr { + if x != nil { + return x.Left + } + return nil +} + +func (x *ExprContainsAll) GetRight() *Expr { + if x != nil { + return x.Right + } + return nil +} + +type ExprContainsAny struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Left *Expr `protobuf:"bytes,1,opt,name=left,proto3" json:"left,omitempty"` + Right *Expr `protobuf:"bytes,2,opt,name=right,proto3" json:"right,omitempty"` +} + +func (x *ExprContainsAny) Reset() { + *x = ExprContainsAny{} + if protoimpl.UnsafeEnabled { + mi := &file_cedar_v3_expr_proto_msgTypes[21] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ExprContainsAny) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ExprContainsAny) ProtoMessage() {} + +func (x *ExprContainsAny) ProtoReflect() protoreflect.Message { + mi := &file_cedar_v3_expr_proto_msgTypes[21] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ExprContainsAny.ProtoReflect.Descriptor instead. +func (*ExprContainsAny) Descriptor() ([]byte, []int) { + return file_cedar_v3_expr_proto_rawDescGZIP(), []int{21} +} + +func (x *ExprContainsAny) GetLeft() *Expr { + if x != nil { + return x.Left + } + return nil +} + +func (x *ExprContainsAny) GetRight() *Expr { + if x != nil { + return x.Right + } + return nil +} + +type ExprGetAttribute struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Left *Expr `protobuf:"bytes,1,opt,name=left,proto3" json:"left,omitempty"` + Attr string `protobuf:"bytes,2,opt,name=attr,proto3" json:"attr,omitempty"` +} + +func (x *ExprGetAttribute) Reset() { + *x = ExprGetAttribute{} + if protoimpl.UnsafeEnabled { + mi := &file_cedar_v3_expr_proto_msgTypes[22] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ExprGetAttribute) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ExprGetAttribute) ProtoMessage() {} + +func (x *ExprGetAttribute) ProtoReflect() protoreflect.Message { + mi := &file_cedar_v3_expr_proto_msgTypes[22] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ExprGetAttribute.ProtoReflect.Descriptor instead. +func (*ExprGetAttribute) Descriptor() ([]byte, []int) { + return file_cedar_v3_expr_proto_rawDescGZIP(), []int{22} +} + +func (x *ExprGetAttribute) GetLeft() *Expr { + if x != nil { + return x.Left + } + return nil +} + +func (x *ExprGetAttribute) GetAttr() string { + if x != nil { + return x.Attr + } + return "" +} + +type ExprHasAttribute struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Left *Expr `protobuf:"bytes,1,opt,name=left,proto3" json:"left,omitempty"` + Attr string `protobuf:"bytes,2,opt,name=attr,proto3" json:"attr,omitempty"` +} + +func (x *ExprHasAttribute) Reset() { + *x = ExprHasAttribute{} + if protoimpl.UnsafeEnabled { + mi := &file_cedar_v3_expr_proto_msgTypes[23] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ExprHasAttribute) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ExprHasAttribute) ProtoMessage() {} + +func (x *ExprHasAttribute) ProtoReflect() protoreflect.Message { + mi := &file_cedar_v3_expr_proto_msgTypes[23] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ExprHasAttribute.ProtoReflect.Descriptor instead. +func (*ExprHasAttribute) Descriptor() ([]byte, []int) { + return file_cedar_v3_expr_proto_rawDescGZIP(), []int{23} +} + +func (x *ExprHasAttribute) GetLeft() *Expr { + if x != nil { + return x.Left + } + return nil +} + +func (x *ExprHasAttribute) GetAttr() string { + if x != nil { + return x.Attr + } + return "" +} + +type ExprLike struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Left *Expr `protobuf:"bytes,1,opt,name=left,proto3" json:"left,omitempty"` + Pattern string `protobuf:"bytes,2,opt,name=pattern,proto3" json:"pattern,omitempty"` +} + +func (x *ExprLike) Reset() { + *x = ExprLike{} + if protoimpl.UnsafeEnabled { + mi := &file_cedar_v3_expr_proto_msgTypes[24] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ExprLike) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ExprLike) ProtoMessage() {} + +func (x *ExprLike) ProtoReflect() protoreflect.Message { + mi := &file_cedar_v3_expr_proto_msgTypes[24] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ExprLike.ProtoReflect.Descriptor instead. +func (*ExprLike) Descriptor() ([]byte, []int) { + return file_cedar_v3_expr_proto_rawDescGZIP(), []int{24} +} + +func (x *ExprLike) GetLeft() *Expr { + if x != nil { + return x.Left + } + return nil +} + +func (x *ExprLike) GetPattern() string { + if x != nil { + return x.Pattern + } + return "" +} + +type ExprIs struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Left *Expr `protobuf:"bytes,1,opt,name=left,proto3" json:"left,omitempty"` + EntityType string `protobuf:"bytes,2,opt,name=entity_type,json=entityType,proto3" json:"entity_type,omitempty"` + In *Expr `protobuf:"bytes,3,opt,name=in,proto3,oneof" json:"in,omitempty"` +} + +func (x *ExprIs) Reset() { + *x = ExprIs{} + if protoimpl.UnsafeEnabled { + mi := &file_cedar_v3_expr_proto_msgTypes[25] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ExprIs) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ExprIs) ProtoMessage() {} + +func (x *ExprIs) ProtoReflect() protoreflect.Message { + mi := &file_cedar_v3_expr_proto_msgTypes[25] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ExprIs.ProtoReflect.Descriptor instead. +func (*ExprIs) Descriptor() ([]byte, []int) { + return file_cedar_v3_expr_proto_rawDescGZIP(), []int{25} +} + +func (x *ExprIs) GetLeft() *Expr { + if x != nil { + return x.Left + } + return nil +} + +func (x *ExprIs) GetEntityType() string { + if x != nil { + return x.EntityType + } + return "" +} + +func (x *ExprIs) GetIn() *Expr { + if x != nil { + return x.In + } + return nil +} + +type ExprIfThenElse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + If *Expr `protobuf:"bytes,1,opt,name=if,proto3" json:"if,omitempty"` + Then *Expr `protobuf:"bytes,2,opt,name=then,proto3" json:"then,omitempty"` + Else *Expr `protobuf:"bytes,3,opt,name=else,proto3" json:"else,omitempty"` +} + +func (x *ExprIfThenElse) Reset() { + *x = ExprIfThenElse{} + if protoimpl.UnsafeEnabled { + mi := &file_cedar_v3_expr_proto_msgTypes[26] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ExprIfThenElse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ExprIfThenElse) ProtoMessage() {} + +func (x *ExprIfThenElse) ProtoReflect() protoreflect.Message { + mi := &file_cedar_v3_expr_proto_msgTypes[26] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ExprIfThenElse.ProtoReflect.Descriptor instead. +func (*ExprIfThenElse) Descriptor() ([]byte, []int) { + return file_cedar_v3_expr_proto_rawDescGZIP(), []int{26} +} + +func (x *ExprIfThenElse) GetIf() *Expr { + if x != nil { + return x.If + } + return nil +} + +func (x *ExprIfThenElse) GetThen() *Expr { + if x != nil { + return x.Then + } + return nil +} + +func (x *ExprIfThenElse) GetElse() *Expr { + if x != nil { + return x.Else + } + return nil +} + +type ExprSet struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Expressions []*Expr `protobuf:"bytes,1,rep,name=expressions,proto3" json:"expressions,omitempty"` +} + +func (x *ExprSet) Reset() { + *x = ExprSet{} + if protoimpl.UnsafeEnabled { + mi := &file_cedar_v3_expr_proto_msgTypes[27] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ExprSet) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ExprSet) ProtoMessage() {} + +func (x *ExprSet) ProtoReflect() protoreflect.Message { + mi := &file_cedar_v3_expr_proto_msgTypes[27] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ExprSet.ProtoReflect.Descriptor instead. +func (*ExprSet) Descriptor() ([]byte, []int) { + return file_cedar_v3_expr_proto_rawDescGZIP(), []int{27} +} + +func (x *ExprSet) GetExpressions() []*Expr { + if x != nil { + return x.Expressions + } + return nil +} + +type ExprRecord struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Attributes map[string]*Expr `protobuf:"bytes,1,rep,name=attributes,proto3" json:"attributes,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` +} + +func (x *ExprRecord) Reset() { + *x = ExprRecord{} + if protoimpl.UnsafeEnabled { + mi := &file_cedar_v3_expr_proto_msgTypes[28] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ExprRecord) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ExprRecord) ProtoMessage() {} + +func (x *ExprRecord) ProtoReflect() protoreflect.Message { + mi := &file_cedar_v3_expr_proto_msgTypes[28] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ExprRecord.ProtoReflect.Descriptor instead. +func (*ExprRecord) Descriptor() ([]byte, []int) { + return file_cedar_v3_expr_proto_rawDescGZIP(), []int{28} +} + +func (x *ExprRecord) GetAttributes() map[string]*Expr { + if x != nil { + return x.Attributes + } + return nil +} + +type ExprFuncCall struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Fn string `protobuf:"bytes,1,opt,name=fn,proto3" json:"fn,omitempty"` + Args []*Expr `protobuf:"bytes,2,rep,name=args,proto3" json:"args,omitempty"` +} + +func (x *ExprFuncCall) Reset() { + *x = ExprFuncCall{} + if protoimpl.UnsafeEnabled { + mi := &file_cedar_v3_expr_proto_msgTypes[29] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ExprFuncCall) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ExprFuncCall) ProtoMessage() {} + +func (x *ExprFuncCall) ProtoReflect() protoreflect.Message { + mi := &file_cedar_v3_expr_proto_msgTypes[29] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ExprFuncCall.ProtoReflect.Descriptor instead. +func (*ExprFuncCall) Descriptor() ([]byte, []int) { + return file_cedar_v3_expr_proto_rawDescGZIP(), []int{29} +} + +func (x *ExprFuncCall) GetFn() string { + if x != nil { + return x.Fn + } + return "" +} + +func (x *ExprFuncCall) GetArgs() []*Expr { + if x != nil { + return x.Args + } + return nil +} + +var File_cedar_v3_expr_proto protoreflect.FileDescriptor + +var file_cedar_v3_expr_proto_rawDesc = []byte{ + 0x0a, 0x13, 0x63, 0x65, 0x64, 0x61, 0x72, 0x2f, 0x76, 0x33, 0x2f, 0x65, 0x78, 0x70, 0x72, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x08, 0x63, 0x65, 0x64, 0x61, 0x72, 0x2e, 0x76, 0x33, 0x1a, + 0x14, 0x63, 0x65, 0x64, 0x61, 0x72, 0x2f, 0x76, 0x33, 0x2f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x64, 0x61, 0x72, 0x74, 0x2f, 0x64, 0x61, 0x72, 0x74, + 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x81, + 0x0c, 0x0a, 0x04, 0x45, 0x78, 0x70, 0x72, 0x12, 0x2b, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x63, 0x65, 0x64, 0x61, 0x72, 0x2e, 0x76, + 0x33, 0x2e, 0x45, 0x78, 0x70, 0x72, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x48, 0x00, 0x52, 0x05, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x12, 0x30, 0x0a, 0x03, 0x76, 0x61, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x11, 0x2e, 0x63, 0x65, 0x64, 0x61, 0x72, 0x2e, 0x76, 0x33, 0x2e, 0x45, 0x78, 0x70, + 0x72, 0x56, 0x61, 0x72, 0x42, 0x09, 0xba, 0x8f, 0xbe, 0x6d, 0x04, 0x76, 0x61, 0x72, 0x5f, 0x48, + 0x00, 0x52, 0x03, 0x76, 0x61, 0x72, 0x12, 0x28, 0x0a, 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x63, 0x65, 0x64, 0x61, 0x72, 0x2e, 0x76, 0x33, 0x2e, + 0x45, 0x78, 0x70, 0x72, 0x53, 0x6c, 0x6f, 0x74, 0x48, 0x00, 0x52, 0x04, 0x73, 0x6c, 0x6f, 0x74, + 0x12, 0x31, 0x0a, 0x07, 0x75, 0x6e, 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x15, 0x2e, 0x63, 0x65, 0x64, 0x61, 0x72, 0x2e, 0x76, 0x33, 0x2e, 0x45, 0x78, 0x70, + 0x72, 0x55, 0x6e, 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x48, 0x00, 0x52, 0x07, 0x75, 0x6e, 0x6b, 0x6e, + 0x6f, 0x77, 0x6e, 0x12, 0x25, 0x0a, 0x03, 0x6e, 0x6f, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x11, 0x2e, 0x63, 0x65, 0x64, 0x61, 0x72, 0x2e, 0x76, 0x33, 0x2e, 0x45, 0x78, 0x70, 0x72, + 0x4e, 0x6f, 0x74, 0x48, 0x00, 0x52, 0x03, 0x6e, 0x6f, 0x74, 0x12, 0x25, 0x0a, 0x03, 0x6e, 0x65, + 0x67, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x63, 0x65, 0x64, 0x61, 0x72, 0x2e, + 0x76, 0x33, 0x2e, 0x45, 0x78, 0x70, 0x72, 0x4e, 0x65, 0x67, 0x48, 0x00, 0x52, 0x03, 0x6e, 0x65, + 0x67, 0x12, 0x2e, 0x0a, 0x06, 0x65, 0x71, 0x75, 0x61, 0x6c, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x14, 0x2e, 0x63, 0x65, 0x64, 0x61, 0x72, 0x2e, 0x76, 0x33, 0x2e, 0x45, 0x78, 0x70, + 0x72, 0x45, 0x71, 0x75, 0x61, 0x6c, 0x73, 0x48, 0x00, 0x52, 0x06, 0x65, 0x71, 0x75, 0x61, 0x6c, + 0x73, 0x12, 0x38, 0x0a, 0x0a, 0x6e, 0x6f, 0x74, 0x5f, 0x65, 0x71, 0x75, 0x61, 0x6c, 0x73, 0x18, + 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x63, 0x65, 0x64, 0x61, 0x72, 0x2e, 0x76, 0x33, + 0x2e, 0x45, 0x78, 0x70, 0x72, 0x4e, 0x6f, 0x74, 0x45, 0x71, 0x75, 0x61, 0x6c, 0x73, 0x48, 0x00, + 0x52, 0x09, 0x6e, 0x6f, 0x74, 0x45, 0x71, 0x75, 0x61, 0x6c, 0x73, 0x12, 0x2c, 0x0a, 0x02, 0x69, + 0x6e, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x63, 0x65, 0x64, 0x61, 0x72, 0x2e, + 0x76, 0x33, 0x2e, 0x45, 0x78, 0x70, 0x72, 0x49, 0x6e, 0x42, 0x08, 0xba, 0x8f, 0xbe, 0x6d, 0x03, + 0x69, 0x6e, 0x5f, 0x48, 0x00, 0x52, 0x02, 0x69, 0x6e, 0x12, 0x35, 0x0a, 0x09, 0x6c, 0x65, 0x73, + 0x73, 0x5f, 0x74, 0x68, 0x61, 0x6e, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x63, + 0x65, 0x64, 0x61, 0x72, 0x2e, 0x76, 0x33, 0x2e, 0x45, 0x78, 0x70, 0x72, 0x4c, 0x65, 0x73, 0x73, + 0x54, 0x68, 0x61, 0x6e, 0x48, 0x00, 0x52, 0x08, 0x6c, 0x65, 0x73, 0x73, 0x54, 0x68, 0x61, 0x6e, + 0x12, 0x4f, 0x0a, 0x13, 0x6c, 0x65, 0x73, 0x73, 0x5f, 0x74, 0x68, 0x61, 0x6e, 0x5f, 0x6f, 0x72, + 0x5f, 0x65, 0x71, 0x75, 0x61, 0x6c, 0x73, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, + 0x63, 0x65, 0x64, 0x61, 0x72, 0x2e, 0x76, 0x33, 0x2e, 0x45, 0x78, 0x70, 0x72, 0x4c, 0x65, 0x73, + 0x73, 0x54, 0x68, 0x61, 0x6e, 0x4f, 0x72, 0x45, 0x71, 0x75, 0x61, 0x6c, 0x73, 0x48, 0x00, 0x52, + 0x10, 0x6c, 0x65, 0x73, 0x73, 0x54, 0x68, 0x61, 0x6e, 0x4f, 0x72, 0x45, 0x71, 0x75, 0x61, 0x6c, + 0x73, 0x12, 0x3e, 0x0a, 0x0c, 0x67, 0x72, 0x65, 0x61, 0x74, 0x65, 0x72, 0x5f, 0x74, 0x68, 0x61, + 0x6e, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x65, 0x64, 0x61, 0x72, 0x2e, + 0x76, 0x33, 0x2e, 0x45, 0x78, 0x70, 0x72, 0x47, 0x72, 0x65, 0x61, 0x74, 0x65, 0x72, 0x54, 0x68, + 0x61, 0x6e, 0x48, 0x00, 0x52, 0x0b, 0x67, 0x72, 0x65, 0x61, 0x74, 0x65, 0x72, 0x54, 0x68, 0x61, + 0x6e, 0x12, 0x58, 0x0a, 0x16, 0x67, 0x72, 0x65, 0x61, 0x74, 0x65, 0x72, 0x5f, 0x74, 0x68, 0x61, + 0x6e, 0x5f, 0x6f, 0x72, 0x5f, 0x65, 0x71, 0x75, 0x61, 0x6c, 0x73, 0x18, 0x0d, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x21, 0x2e, 0x63, 0x65, 0x64, 0x61, 0x72, 0x2e, 0x76, 0x33, 0x2e, 0x45, 0x78, 0x70, + 0x72, 0x47, 0x72, 0x65, 0x61, 0x74, 0x65, 0x72, 0x54, 0x68, 0x61, 0x6e, 0x4f, 0x72, 0x45, 0x71, + 0x75, 0x61, 0x6c, 0x73, 0x48, 0x00, 0x52, 0x13, 0x67, 0x72, 0x65, 0x61, 0x74, 0x65, 0x72, 0x54, + 0x68, 0x61, 0x6e, 0x4f, 0x72, 0x45, 0x71, 0x75, 0x61, 0x6c, 0x73, 0x12, 0x25, 0x0a, 0x03, 0x61, + 0x6e, 0x64, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x63, 0x65, 0x64, 0x61, 0x72, + 0x2e, 0x76, 0x33, 0x2e, 0x45, 0x78, 0x70, 0x72, 0x41, 0x6e, 0x64, 0x48, 0x00, 0x52, 0x03, 0x61, + 0x6e, 0x64, 0x12, 0x22, 0x0a, 0x02, 0x6f, 0x72, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, + 0x2e, 0x63, 0x65, 0x64, 0x61, 0x72, 0x2e, 0x76, 0x33, 0x2e, 0x45, 0x78, 0x70, 0x72, 0x4f, 0x72, + 0x48, 0x00, 0x52, 0x02, 0x6f, 0x72, 0x12, 0x28, 0x0a, 0x04, 0x70, 0x6c, 0x75, 0x73, 0x18, 0x10, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x63, 0x65, 0x64, 0x61, 0x72, 0x2e, 0x76, 0x33, 0x2e, + 0x45, 0x78, 0x70, 0x72, 0x50, 0x6c, 0x75, 0x73, 0x48, 0x00, 0x52, 0x04, 0x70, 0x6c, 0x75, 0x73, + 0x12, 0x2b, 0x0a, 0x05, 0x6d, 0x69, 0x6e, 0x75, 0x73, 0x18, 0x11, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x13, 0x2e, 0x63, 0x65, 0x64, 0x61, 0x72, 0x2e, 0x76, 0x33, 0x2e, 0x45, 0x78, 0x70, 0x72, 0x4d, + 0x69, 0x6e, 0x75, 0x73, 0x48, 0x00, 0x52, 0x05, 0x6d, 0x69, 0x6e, 0x75, 0x73, 0x12, 0x2b, 0x0a, + 0x05, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x18, 0x12, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x63, + 0x65, 0x64, 0x61, 0x72, 0x2e, 0x76, 0x33, 0x2e, 0x45, 0x78, 0x70, 0x72, 0x54, 0x69, 0x6d, 0x65, + 0x73, 0x48, 0x00, 0x52, 0x05, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x12, 0x34, 0x0a, 0x08, 0x63, 0x6f, + 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x73, 0x18, 0x13, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x63, + 0x65, 0x64, 0x61, 0x72, 0x2e, 0x76, 0x33, 0x2e, 0x45, 0x78, 0x70, 0x72, 0x43, 0x6f, 0x6e, 0x74, + 0x61, 0x69, 0x6e, 0x73, 0x48, 0x00, 0x52, 0x08, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x73, + 0x12, 0x3e, 0x0a, 0x0c, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x73, 0x5f, 0x61, 0x6c, 0x6c, + 0x18, 0x14, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x65, 0x64, 0x61, 0x72, 0x2e, 0x76, + 0x33, 0x2e, 0x45, 0x78, 0x70, 0x72, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x73, 0x41, 0x6c, + 0x6c, 0x48, 0x00, 0x52, 0x0b, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x73, 0x41, 0x6c, 0x6c, + 0x12, 0x3e, 0x0a, 0x0c, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x73, 0x5f, 0x61, 0x6e, 0x79, + 0x18, 0x15, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x65, 0x64, 0x61, 0x72, 0x2e, 0x76, + 0x33, 0x2e, 0x45, 0x78, 0x70, 0x72, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x73, 0x41, 0x6e, + 0x79, 0x48, 0x00, 0x52, 0x0b, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x73, 0x41, 0x6e, 0x79, + 0x12, 0x41, 0x0a, 0x0d, 0x67, 0x65, 0x74, 0x5f, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, + 0x65, 0x18, 0x16, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x63, 0x65, 0x64, 0x61, 0x72, 0x2e, + 0x76, 0x33, 0x2e, 0x45, 0x78, 0x70, 0x72, 0x47, 0x65, 0x74, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, + 0x75, 0x74, 0x65, 0x48, 0x00, 0x52, 0x0c, 0x67, 0x65, 0x74, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, + 0x75, 0x74, 0x65, 0x12, 0x41, 0x0a, 0x0d, 0x68, 0x61, 0x73, 0x5f, 0x61, 0x74, 0x74, 0x72, 0x69, + 0x62, 0x75, 0x74, 0x65, 0x18, 0x17, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x63, 0x65, 0x64, + 0x61, 0x72, 0x2e, 0x76, 0x33, 0x2e, 0x45, 0x78, 0x70, 0x72, 0x48, 0x61, 0x73, 0x41, 0x74, 0x74, + 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x48, 0x00, 0x52, 0x0c, 0x68, 0x61, 0x73, 0x41, 0x74, 0x74, + 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x12, 0x28, 0x0a, 0x04, 0x6c, 0x69, 0x6b, 0x65, 0x18, 0x18, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x63, 0x65, 0x64, 0x61, 0x72, 0x2e, 0x76, 0x33, 0x2e, + 0x45, 0x78, 0x70, 0x72, 0x4c, 0x69, 0x6b, 0x65, 0x48, 0x00, 0x52, 0x04, 0x6c, 0x69, 0x6b, 0x65, + 0x12, 0x2c, 0x0a, 0x02, 0x69, 0x73, 0x18, 0x19, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x63, + 0x65, 0x64, 0x61, 0x72, 0x2e, 0x76, 0x33, 0x2e, 0x45, 0x78, 0x70, 0x72, 0x49, 0x73, 0x42, 0x08, + 0xba, 0x8f, 0xbe, 0x6d, 0x03, 0x69, 0x73, 0x5f, 0x48, 0x00, 0x52, 0x02, 0x69, 0x73, 0x12, 0x3c, + 0x0a, 0x0c, 0x69, 0x66, 0x5f, 0x74, 0x68, 0x65, 0x6e, 0x5f, 0x65, 0x6c, 0x73, 0x65, 0x18, 0x1a, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x63, 0x65, 0x64, 0x61, 0x72, 0x2e, 0x76, 0x33, 0x2e, + 0x45, 0x78, 0x70, 0x72, 0x49, 0x66, 0x54, 0x68, 0x65, 0x6e, 0x45, 0x6c, 0x73, 0x65, 0x48, 0x00, + 0x52, 0x0a, 0x69, 0x66, 0x54, 0x68, 0x65, 0x6e, 0x45, 0x6c, 0x73, 0x65, 0x12, 0x25, 0x0a, 0x03, + 0x73, 0x65, 0x74, 0x18, 0x1b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x63, 0x65, 0x64, 0x61, + 0x72, 0x2e, 0x76, 0x33, 0x2e, 0x45, 0x78, 0x70, 0x72, 0x53, 0x65, 0x74, 0x48, 0x00, 0x52, 0x03, + 0x73, 0x65, 0x74, 0x12, 0x2e, 0x0a, 0x06, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x18, 0x1c, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x63, 0x65, 0x64, 0x61, 0x72, 0x2e, 0x76, 0x33, 0x2e, 0x45, + 0x78, 0x70, 0x72, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x48, 0x00, 0x52, 0x06, 0x72, 0x65, 0x63, + 0x6f, 0x72, 0x64, 0x12, 0x35, 0x0a, 0x09, 0x66, 0x75, 0x6e, 0x63, 0x5f, 0x63, 0x61, 0x6c, 0x6c, + 0x18, 0x1d, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x63, 0x65, 0x64, 0x61, 0x72, 0x2e, 0x76, + 0x33, 0x2e, 0x45, 0x78, 0x70, 0x72, 0x46, 0x75, 0x6e, 0x63, 0x43, 0x61, 0x6c, 0x6c, 0x48, 0x00, + 0x52, 0x08, 0x66, 0x75, 0x6e, 0x63, 0x43, 0x61, 0x6c, 0x6c, 0x42, 0x06, 0x0a, 0x04, 0x65, 0x78, + 0x70, 0x72, 0x22, 0x32, 0x0a, 0x09, 0x45, 0x78, 0x70, 0x72, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, + 0x25, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, + 0x2e, 0x63, 0x65, 0x64, 0x61, 0x72, 0x2e, 0x76, 0x33, 0x2e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, + 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x39, 0x0a, 0x07, 0x45, 0x78, 0x70, 0x72, 0x56, 0x61, + 0x72, 0x12, 0x2e, 0x0a, 0x08, 0x76, 0x61, 0x72, 0x69, 0x61, 0x62, 0x6c, 0x65, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0e, 0x32, 0x12, 0x2e, 0x63, 0x65, 0x64, 0x61, 0x72, 0x2e, 0x76, 0x33, 0x2e, 0x56, + 0x61, 0x72, 0x69, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x08, 0x76, 0x61, 0x72, 0x69, 0x61, 0x62, 0x6c, + 0x65, 0x22, 0x35, 0x0a, 0x08, 0x45, 0x78, 0x70, 0x72, 0x53, 0x6c, 0x6f, 0x74, 0x12, 0x29, 0x0a, + 0x07, 0x73, 0x6c, 0x6f, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x10, + 0x2e, 0x63, 0x65, 0x64, 0x61, 0x72, 0x2e, 0x76, 0x33, 0x2e, 0x53, 0x6c, 0x6f, 0x74, 0x49, 0x64, + 0x52, 0x06, 0x73, 0x6c, 0x6f, 0x74, 0x49, 0x64, 0x22, 0x21, 0x0a, 0x0b, 0x45, 0x78, 0x70, 0x72, + 0x55, 0x6e, 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x2d, 0x0a, 0x07, 0x45, + 0x78, 0x70, 0x72, 0x4e, 0x6f, 0x74, 0x12, 0x22, 0x0a, 0x04, 0x65, 0x78, 0x70, 0x72, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x63, 0x65, 0x64, 0x61, 0x72, 0x2e, 0x76, 0x33, 0x2e, + 0x45, 0x78, 0x70, 0x72, 0x52, 0x04, 0x65, 0x78, 0x70, 0x72, 0x22, 0x2d, 0x0a, 0x07, 0x45, 0x78, + 0x70, 0x72, 0x4e, 0x65, 0x67, 0x12, 0x22, 0x0a, 0x04, 0x65, 0x78, 0x70, 0x72, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x63, 0x65, 0x64, 0x61, 0x72, 0x2e, 0x76, 0x33, 0x2e, 0x45, + 0x78, 0x70, 0x72, 0x52, 0x04, 0x65, 0x78, 0x70, 0x72, 0x22, 0x56, 0x0a, 0x0a, 0x45, 0x78, 0x70, + 0x72, 0x45, 0x71, 0x75, 0x61, 0x6c, 0x73, 0x12, 0x22, 0x0a, 0x04, 0x6c, 0x65, 0x66, 0x74, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x63, 0x65, 0x64, 0x61, 0x72, 0x2e, 0x76, 0x33, + 0x2e, 0x45, 0x78, 0x70, 0x72, 0x52, 0x04, 0x6c, 0x65, 0x66, 0x74, 0x12, 0x24, 0x0a, 0x05, 0x72, + 0x69, 0x67, 0x68, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x63, 0x65, 0x64, + 0x61, 0x72, 0x2e, 0x76, 0x33, 0x2e, 0x45, 0x78, 0x70, 0x72, 0x52, 0x05, 0x72, 0x69, 0x67, 0x68, + 0x74, 0x22, 0x59, 0x0a, 0x0d, 0x45, 0x78, 0x70, 0x72, 0x4e, 0x6f, 0x74, 0x45, 0x71, 0x75, 0x61, + 0x6c, 0x73, 0x12, 0x22, 0x0a, 0x04, 0x6c, 0x65, 0x66, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x0e, 0x2e, 0x63, 0x65, 0x64, 0x61, 0x72, 0x2e, 0x76, 0x33, 0x2e, 0x45, 0x78, 0x70, 0x72, + 0x52, 0x04, 0x6c, 0x65, 0x66, 0x74, 0x12, 0x24, 0x0a, 0x05, 0x72, 0x69, 0x67, 0x68, 0x74, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x63, 0x65, 0x64, 0x61, 0x72, 0x2e, 0x76, 0x33, + 0x2e, 0x45, 0x78, 0x70, 0x72, 0x52, 0x05, 0x72, 0x69, 0x67, 0x68, 0x74, 0x22, 0x52, 0x0a, 0x06, + 0x45, 0x78, 0x70, 0x72, 0x49, 0x6e, 0x12, 0x22, 0x0a, 0x04, 0x6c, 0x65, 0x66, 0x74, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x63, 0x65, 0x64, 0x61, 0x72, 0x2e, 0x76, 0x33, 0x2e, + 0x45, 0x78, 0x70, 0x72, 0x52, 0x04, 0x6c, 0x65, 0x66, 0x74, 0x12, 0x24, 0x0a, 0x05, 0x72, 0x69, + 0x67, 0x68, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x63, 0x65, 0x64, 0x61, + 0x72, 0x2e, 0x76, 0x33, 0x2e, 0x45, 0x78, 0x70, 0x72, 0x52, 0x05, 0x72, 0x69, 0x67, 0x68, 0x74, + 0x22, 0x58, 0x0a, 0x0c, 0x45, 0x78, 0x70, 0x72, 0x4c, 0x65, 0x73, 0x73, 0x54, 0x68, 0x61, 0x6e, + 0x12, 0x22, 0x0a, 0x04, 0x6c, 0x65, 0x66, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, + 0x2e, 0x63, 0x65, 0x64, 0x61, 0x72, 0x2e, 0x76, 0x33, 0x2e, 0x45, 0x78, 0x70, 0x72, 0x52, 0x04, + 0x6c, 0x65, 0x66, 0x74, 0x12, 0x24, 0x0a, 0x05, 0x72, 0x69, 0x67, 0x68, 0x74, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x63, 0x65, 0x64, 0x61, 0x72, 0x2e, 0x76, 0x33, 0x2e, 0x45, + 0x78, 0x70, 0x72, 0x52, 0x05, 0x72, 0x69, 0x67, 0x68, 0x74, 0x22, 0x60, 0x0a, 0x14, 0x45, 0x78, + 0x70, 0x72, 0x4c, 0x65, 0x73, 0x73, 0x54, 0x68, 0x61, 0x6e, 0x4f, 0x72, 0x45, 0x71, 0x75, 0x61, + 0x6c, 0x73, 0x12, 0x22, 0x0a, 0x04, 0x6c, 0x65, 0x66, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x0e, 0x2e, 0x63, 0x65, 0x64, 0x61, 0x72, 0x2e, 0x76, 0x33, 0x2e, 0x45, 0x78, 0x70, 0x72, + 0x52, 0x04, 0x6c, 0x65, 0x66, 0x74, 0x12, 0x24, 0x0a, 0x05, 0x72, 0x69, 0x67, 0x68, 0x74, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x63, 0x65, 0x64, 0x61, 0x72, 0x2e, 0x76, 0x33, + 0x2e, 0x45, 0x78, 0x70, 0x72, 0x52, 0x05, 0x72, 0x69, 0x67, 0x68, 0x74, 0x22, 0x5b, 0x0a, 0x0f, + 0x45, 0x78, 0x70, 0x72, 0x47, 0x72, 0x65, 0x61, 0x74, 0x65, 0x72, 0x54, 0x68, 0x61, 0x6e, 0x12, + 0x22, 0x0a, 0x04, 0x6c, 0x65, 0x66, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, + 0x63, 0x65, 0x64, 0x61, 0x72, 0x2e, 0x76, 0x33, 0x2e, 0x45, 0x78, 0x70, 0x72, 0x52, 0x04, 0x6c, + 0x65, 0x66, 0x74, 0x12, 0x24, 0x0a, 0x05, 0x72, 0x69, 0x67, 0x68, 0x74, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x63, 0x65, 0x64, 0x61, 0x72, 0x2e, 0x76, 0x33, 0x2e, 0x45, 0x78, + 0x70, 0x72, 0x52, 0x05, 0x72, 0x69, 0x67, 0x68, 0x74, 0x22, 0x63, 0x0a, 0x17, 0x45, 0x78, 0x70, + 0x72, 0x47, 0x72, 0x65, 0x61, 0x74, 0x65, 0x72, 0x54, 0x68, 0x61, 0x6e, 0x4f, 0x72, 0x45, 0x71, + 0x75, 0x61, 0x6c, 0x73, 0x12, 0x22, 0x0a, 0x04, 0x6c, 0x65, 0x66, 0x74, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x63, 0x65, 0x64, 0x61, 0x72, 0x2e, 0x76, 0x33, 0x2e, 0x45, 0x78, + 0x70, 0x72, 0x52, 0x04, 0x6c, 0x65, 0x66, 0x74, 0x12, 0x24, 0x0a, 0x05, 0x72, 0x69, 0x67, 0x68, + 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x63, 0x65, 0x64, 0x61, 0x72, 0x2e, + 0x76, 0x33, 0x2e, 0x45, 0x78, 0x70, 0x72, 0x52, 0x05, 0x72, 0x69, 0x67, 0x68, 0x74, 0x22, 0x53, + 0x0a, 0x07, 0x45, 0x78, 0x70, 0x72, 0x41, 0x6e, 0x64, 0x12, 0x22, 0x0a, 0x04, 0x6c, 0x65, 0x66, + 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x63, 0x65, 0x64, 0x61, 0x72, 0x2e, + 0x76, 0x33, 0x2e, 0x45, 0x78, 0x70, 0x72, 0x52, 0x04, 0x6c, 0x65, 0x66, 0x74, 0x12, 0x24, 0x0a, + 0x05, 0x72, 0x69, 0x67, 0x68, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x63, + 0x65, 0x64, 0x61, 0x72, 0x2e, 0x76, 0x33, 0x2e, 0x45, 0x78, 0x70, 0x72, 0x52, 0x05, 0x72, 0x69, + 0x67, 0x68, 0x74, 0x22, 0x52, 0x0a, 0x06, 0x45, 0x78, 0x70, 0x72, 0x4f, 0x72, 0x12, 0x22, 0x0a, + 0x04, 0x6c, 0x65, 0x66, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x63, 0x65, + 0x64, 0x61, 0x72, 0x2e, 0x76, 0x33, 0x2e, 0x45, 0x78, 0x70, 0x72, 0x52, 0x04, 0x6c, 0x65, 0x66, + 0x74, 0x12, 0x24, 0x0a, 0x05, 0x72, 0x69, 0x67, 0x68, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x0e, 0x2e, 0x63, 0x65, 0x64, 0x61, 0x72, 0x2e, 0x76, 0x33, 0x2e, 0x45, 0x78, 0x70, 0x72, + 0x52, 0x05, 0x72, 0x69, 0x67, 0x68, 0x74, 0x22, 0x54, 0x0a, 0x08, 0x45, 0x78, 0x70, 0x72, 0x50, + 0x6c, 0x75, 0x73, 0x12, 0x22, 0x0a, 0x04, 0x6c, 0x65, 0x66, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x0e, 0x2e, 0x63, 0x65, 0x64, 0x61, 0x72, 0x2e, 0x76, 0x33, 0x2e, 0x45, 0x78, 0x70, + 0x72, 0x52, 0x04, 0x6c, 0x65, 0x66, 0x74, 0x12, 0x24, 0x0a, 0x05, 0x72, 0x69, 0x67, 0x68, 0x74, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x63, 0x65, 0x64, 0x61, 0x72, 0x2e, 0x76, + 0x33, 0x2e, 0x45, 0x78, 0x70, 0x72, 0x52, 0x05, 0x72, 0x69, 0x67, 0x68, 0x74, 0x22, 0x55, 0x0a, + 0x09, 0x45, 0x78, 0x70, 0x72, 0x4d, 0x69, 0x6e, 0x75, 0x73, 0x12, 0x22, 0x0a, 0x04, 0x6c, 0x65, + 0x66, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x63, 0x65, 0x64, 0x61, 0x72, + 0x2e, 0x76, 0x33, 0x2e, 0x45, 0x78, 0x70, 0x72, 0x52, 0x04, 0x6c, 0x65, 0x66, 0x74, 0x12, 0x24, + 0x0a, 0x05, 0x72, 0x69, 0x67, 0x68, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, + 0x63, 0x65, 0x64, 0x61, 0x72, 0x2e, 0x76, 0x33, 0x2e, 0x45, 0x78, 0x70, 0x72, 0x52, 0x05, 0x72, + 0x69, 0x67, 0x68, 0x74, 0x22, 0x55, 0x0a, 0x09, 0x45, 0x78, 0x70, 0x72, 0x54, 0x69, 0x6d, 0x65, + 0x73, 0x12, 0x22, 0x0a, 0x04, 0x6c, 0x65, 0x66, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x0e, 0x2e, 0x63, 0x65, 0x64, 0x61, 0x72, 0x2e, 0x76, 0x33, 0x2e, 0x45, 0x78, 0x70, 0x72, 0x52, + 0x04, 0x6c, 0x65, 0x66, 0x74, 0x12, 0x24, 0x0a, 0x05, 0x72, 0x69, 0x67, 0x68, 0x74, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x63, 0x65, 0x64, 0x61, 0x72, 0x2e, 0x76, 0x33, 0x2e, + 0x45, 0x78, 0x70, 0x72, 0x52, 0x05, 0x72, 0x69, 0x67, 0x68, 0x74, 0x22, 0x58, 0x0a, 0x0c, 0x45, + 0x78, 0x70, 0x72, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x73, 0x12, 0x22, 0x0a, 0x04, 0x6c, + 0x65, 0x66, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x63, 0x65, 0x64, 0x61, + 0x72, 0x2e, 0x76, 0x33, 0x2e, 0x45, 0x78, 0x70, 0x72, 0x52, 0x04, 0x6c, 0x65, 0x66, 0x74, 0x12, + 0x24, 0x0a, 0x05, 0x72, 0x69, 0x67, 0x68, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, + 0x2e, 0x63, 0x65, 0x64, 0x61, 0x72, 0x2e, 0x76, 0x33, 0x2e, 0x45, 0x78, 0x70, 0x72, 0x52, 0x05, + 0x72, 0x69, 0x67, 0x68, 0x74, 0x22, 0x5b, 0x0a, 0x0f, 0x45, 0x78, 0x70, 0x72, 0x43, 0x6f, 0x6e, + 0x74, 0x61, 0x69, 0x6e, 0x73, 0x41, 0x6c, 0x6c, 0x12, 0x22, 0x0a, 0x04, 0x6c, 0x65, 0x66, 0x74, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x63, 0x65, 0x64, 0x61, 0x72, 0x2e, 0x76, + 0x33, 0x2e, 0x45, 0x78, 0x70, 0x72, 0x52, 0x04, 0x6c, 0x65, 0x66, 0x74, 0x12, 0x24, 0x0a, 0x05, + 0x72, 0x69, 0x67, 0x68, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x63, 0x65, + 0x64, 0x61, 0x72, 0x2e, 0x76, 0x33, 0x2e, 0x45, 0x78, 0x70, 0x72, 0x52, 0x05, 0x72, 0x69, 0x67, + 0x68, 0x74, 0x22, 0x5b, 0x0a, 0x0f, 0x45, 0x78, 0x70, 0x72, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, + 0x6e, 0x73, 0x41, 0x6e, 0x79, 0x12, 0x22, 0x0a, 0x04, 0x6c, 0x65, 0x66, 0x74, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x63, 0x65, 0x64, 0x61, 0x72, 0x2e, 0x76, 0x33, 0x2e, 0x45, + 0x78, 0x70, 0x72, 0x52, 0x04, 0x6c, 0x65, 0x66, 0x74, 0x12, 0x24, 0x0a, 0x05, 0x72, 0x69, 0x67, + 0x68, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x63, 0x65, 0x64, 0x61, 0x72, + 0x2e, 0x76, 0x33, 0x2e, 0x45, 0x78, 0x70, 0x72, 0x52, 0x05, 0x72, 0x69, 0x67, 0x68, 0x74, 0x22, + 0x4a, 0x0a, 0x10, 0x45, 0x78, 0x70, 0x72, 0x47, 0x65, 0x74, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, + 0x75, 0x74, 0x65, 0x12, 0x22, 0x0a, 0x04, 0x6c, 0x65, 0x66, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x0e, 0x2e, 0x63, 0x65, 0x64, 0x61, 0x72, 0x2e, 0x76, 0x33, 0x2e, 0x45, 0x78, 0x70, + 0x72, 0x52, 0x04, 0x6c, 0x65, 0x66, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x61, 0x74, 0x74, 0x72, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x61, 0x74, 0x74, 0x72, 0x22, 0x4a, 0x0a, 0x10, 0x45, + 0x78, 0x70, 0x72, 0x48, 0x61, 0x73, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x12, + 0x22, 0x0a, 0x04, 0x6c, 0x65, 0x66, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, + 0x63, 0x65, 0x64, 0x61, 0x72, 0x2e, 0x76, 0x33, 0x2e, 0x45, 0x78, 0x70, 0x72, 0x52, 0x04, 0x6c, + 0x65, 0x66, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x61, 0x74, 0x74, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x04, 0x61, 0x74, 0x74, 0x72, 0x22, 0x48, 0x0a, 0x08, 0x45, 0x78, 0x70, 0x72, 0x4c, + 0x69, 0x6b, 0x65, 0x12, 0x22, 0x0a, 0x04, 0x6c, 0x65, 0x66, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x0e, 0x2e, 0x63, 0x65, 0x64, 0x61, 0x72, 0x2e, 0x76, 0x33, 0x2e, 0x45, 0x78, 0x70, + 0x72, 0x52, 0x04, 0x6c, 0x65, 0x66, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x61, 0x74, 0x74, 0x65, + 0x72, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x70, 0x61, 0x74, 0x74, 0x65, 0x72, + 0x6e, 0x22, 0x83, 0x01, 0x0a, 0x06, 0x45, 0x78, 0x70, 0x72, 0x49, 0x73, 0x12, 0x22, 0x0a, 0x04, + 0x6c, 0x65, 0x66, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x63, 0x65, 0x64, + 0x61, 0x72, 0x2e, 0x76, 0x33, 0x2e, 0x45, 0x78, 0x70, 0x72, 0x52, 0x04, 0x6c, 0x65, 0x66, 0x74, + 0x12, 0x1f, 0x0a, 0x0b, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x54, 0x79, 0x70, + 0x65, 0x12, 0x2d, 0x0a, 0x02, 0x69, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, + 0x63, 0x65, 0x64, 0x61, 0x72, 0x2e, 0x76, 0x33, 0x2e, 0x45, 0x78, 0x70, 0x72, 0x42, 0x08, 0xba, + 0x8f, 0xbe, 0x6d, 0x03, 0x69, 0x6e, 0x5f, 0x48, 0x00, 0x52, 0x02, 0x69, 0x6e, 0x88, 0x01, 0x01, + 0x42, 0x05, 0x0a, 0x03, 0x5f, 0x69, 0x6e, 0x22, 0x8e, 0x01, 0x0a, 0x0e, 0x45, 0x78, 0x70, 0x72, + 0x49, 0x66, 0x54, 0x68, 0x65, 0x6e, 0x45, 0x6c, 0x73, 0x65, 0x12, 0x28, 0x0a, 0x02, 0x69, 0x66, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x63, 0x65, 0x64, 0x61, 0x72, 0x2e, 0x76, + 0x33, 0x2e, 0x45, 0x78, 0x70, 0x72, 0x42, 0x08, 0xba, 0x8f, 0xbe, 0x6d, 0x03, 0x69, 0x66, 0x5f, + 0x52, 0x02, 0x69, 0x66, 0x12, 0x22, 0x0a, 0x04, 0x74, 0x68, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x63, 0x65, 0x64, 0x61, 0x72, 0x2e, 0x76, 0x33, 0x2e, 0x45, 0x78, + 0x70, 0x72, 0x52, 0x04, 0x74, 0x68, 0x65, 0x6e, 0x12, 0x2e, 0x0a, 0x04, 0x65, 0x6c, 0x73, 0x65, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x63, 0x65, 0x64, 0x61, 0x72, 0x2e, 0x76, + 0x33, 0x2e, 0x45, 0x78, 0x70, 0x72, 0x42, 0x0a, 0xba, 0x8f, 0xbe, 0x6d, 0x05, 0x65, 0x6c, 0x73, + 0x65, 0x5f, 0x52, 0x04, 0x65, 0x6c, 0x73, 0x65, 0x22, 0x3b, 0x0a, 0x07, 0x45, 0x78, 0x70, 0x72, + 0x53, 0x65, 0x74, 0x12, 0x30, 0x0a, 0x0b, 0x65, 0x78, 0x70, 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, + 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x63, 0x65, 0x64, 0x61, 0x72, + 0x2e, 0x76, 0x33, 0x2e, 0x45, 0x78, 0x70, 0x72, 0x52, 0x0b, 0x65, 0x78, 0x70, 0x72, 0x65, 0x73, + 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0xa1, 0x01, 0x0a, 0x0a, 0x45, 0x78, 0x70, 0x72, 0x52, 0x65, + 0x63, 0x6f, 0x72, 0x64, 0x12, 0x44, 0x0a, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, + 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x63, 0x65, 0x64, 0x61, 0x72, + 0x2e, 0x76, 0x33, 0x2e, 0x45, 0x78, 0x70, 0x72, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x2e, 0x41, + 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0a, + 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x1a, 0x4d, 0x0a, 0x0f, 0x41, 0x74, + 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 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, + 0x24, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, + 0x2e, 0x63, 0x65, 0x64, 0x61, 0x72, 0x2e, 0x76, 0x33, 0x2e, 0x45, 0x78, 0x70, 0x72, 0x52, 0x05, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x42, 0x0a, 0x0c, 0x45, 0x78, 0x70, + 0x72, 0x46, 0x75, 0x6e, 0x63, 0x43, 0x61, 0x6c, 0x6c, 0x12, 0x0e, 0x0a, 0x02, 0x66, 0x6e, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x66, 0x6e, 0x12, 0x22, 0x0a, 0x04, 0x61, 0x72, 0x67, + 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x63, 0x65, 0x64, 0x61, 0x72, 0x2e, + 0x76, 0x33, 0x2e, 0x45, 0x78, 0x70, 0x72, 0x52, 0x04, 0x61, 0x72, 0x67, 0x73, 0x2a, 0x7e, 0x0a, + 0x08, 0x56, 0x61, 0x72, 0x69, 0x61, 0x62, 0x6c, 0x65, 0x12, 0x18, 0x0a, 0x14, 0x56, 0x41, 0x52, + 0x49, 0x41, 0x42, 0x4c, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, + 0x44, 0x10, 0x00, 0x12, 0x16, 0x0a, 0x12, 0x56, 0x41, 0x52, 0x49, 0x41, 0x42, 0x4c, 0x45, 0x5f, + 0x50, 0x52, 0x49, 0x4e, 0x43, 0x49, 0x50, 0x41, 0x4c, 0x10, 0x01, 0x12, 0x13, 0x0a, 0x0f, 0x56, + 0x41, 0x52, 0x49, 0x41, 0x42, 0x4c, 0x45, 0x5f, 0x41, 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x10, 0x02, + 0x12, 0x15, 0x0a, 0x11, 0x56, 0x41, 0x52, 0x49, 0x41, 0x42, 0x4c, 0x45, 0x5f, 0x52, 0x45, 0x53, + 0x4f, 0x55, 0x52, 0x43, 0x45, 0x10, 0x03, 0x12, 0x14, 0x0a, 0x10, 0x56, 0x41, 0x52, 0x49, 0x41, + 0x42, 0x4c, 0x45, 0x5f, 0x43, 0x4f, 0x4e, 0x54, 0x45, 0x58, 0x54, 0x10, 0x04, 0x2a, 0x4e, 0x0a, + 0x06, 0x53, 0x6c, 0x6f, 0x74, 0x49, 0x64, 0x12, 0x17, 0x0a, 0x13, 0x53, 0x4c, 0x4f, 0x54, 0x5f, + 0x49, 0x44, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, + 0x12, 0x15, 0x0a, 0x11, 0x53, 0x4c, 0x4f, 0x54, 0x5f, 0x49, 0x44, 0x5f, 0x50, 0x52, 0x49, 0x4e, + 0x43, 0x49, 0x50, 0x41, 0x4c, 0x10, 0x01, 0x12, 0x14, 0x0a, 0x10, 0x53, 0x4c, 0x4f, 0x54, 0x5f, + 0x49, 0x44, 0x5f, 0x52, 0x45, 0x53, 0x4f, 0x55, 0x52, 0x43, 0x45, 0x10, 0x02, 0x42, 0x91, 0x01, + 0x0a, 0x0c, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x65, 0x64, 0x61, 0x72, 0x2e, 0x76, 0x33, 0x42, 0x09, + 0x45, 0x78, 0x70, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x35, 0x67, 0x69, 0x74, + 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x65, 0x6c, 0x65, 0x73, 0x74, 0x2d, 0x64, + 0x65, 0x76, 0x2f, 0x63, 0x6f, 0x72, 0x6b, 0x73, 0x2f, 0x67, 0x6f, 0x2f, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x2f, 0x63, 0x65, 0x64, 0x61, 0x72, 0x2f, 0x76, 0x33, 0x3b, 0x63, 0x65, 0x64, 0x61, 0x72, + 0x70, 0x62, 0xa2, 0x02, 0x03, 0x43, 0x58, 0x58, 0xaa, 0x02, 0x08, 0x43, 0x65, 0x64, 0x61, 0x72, + 0x2e, 0x56, 0x33, 0xca, 0x02, 0x08, 0x43, 0x65, 0x64, 0x61, 0x72, 0x5c, 0x56, 0x33, 0xe2, 0x02, + 0x14, 0x43, 0x65, 0x64, 0x61, 0x72, 0x5c, 0x56, 0x33, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, + 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x09, 0x43, 0x65, 0x64, 0x61, 0x72, 0x3a, 0x3a, 0x56, + 0x33, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_cedar_v3_expr_proto_rawDescOnce sync.Once + file_cedar_v3_expr_proto_rawDescData = file_cedar_v3_expr_proto_rawDesc +) + +func file_cedar_v3_expr_proto_rawDescGZIP() []byte { + file_cedar_v3_expr_proto_rawDescOnce.Do(func() { + file_cedar_v3_expr_proto_rawDescData = protoimpl.X.CompressGZIP(file_cedar_v3_expr_proto_rawDescData) + }) + return file_cedar_v3_expr_proto_rawDescData +} + +var file_cedar_v3_expr_proto_enumTypes = make([]protoimpl.EnumInfo, 2) +var file_cedar_v3_expr_proto_msgTypes = make([]protoimpl.MessageInfo, 31) +var file_cedar_v3_expr_proto_goTypes = []any{ + (Variable)(0), // 0: cedar.v3.Variable + (SlotId)(0), // 1: cedar.v3.SlotId + (*Expr)(nil), // 2: cedar.v3.Expr + (*ExprValue)(nil), // 3: cedar.v3.ExprValue + (*ExprVar)(nil), // 4: cedar.v3.ExprVar + (*ExprSlot)(nil), // 5: cedar.v3.ExprSlot + (*ExprUnknown)(nil), // 6: cedar.v3.ExprUnknown + (*ExprNot)(nil), // 7: cedar.v3.ExprNot + (*ExprNeg)(nil), // 8: cedar.v3.ExprNeg + (*ExprEquals)(nil), // 9: cedar.v3.ExprEquals + (*ExprNotEquals)(nil), // 10: cedar.v3.ExprNotEquals + (*ExprIn)(nil), // 11: cedar.v3.ExprIn + (*ExprLessThan)(nil), // 12: cedar.v3.ExprLessThan + (*ExprLessThanOrEquals)(nil), // 13: cedar.v3.ExprLessThanOrEquals + (*ExprGreaterThan)(nil), // 14: cedar.v3.ExprGreaterThan + (*ExprGreaterThanOrEquals)(nil), // 15: cedar.v3.ExprGreaterThanOrEquals + (*ExprAnd)(nil), // 16: cedar.v3.ExprAnd + (*ExprOr)(nil), // 17: cedar.v3.ExprOr + (*ExprPlus)(nil), // 18: cedar.v3.ExprPlus + (*ExprMinus)(nil), // 19: cedar.v3.ExprMinus + (*ExprTimes)(nil), // 20: cedar.v3.ExprTimes + (*ExprContains)(nil), // 21: cedar.v3.ExprContains + (*ExprContainsAll)(nil), // 22: cedar.v3.ExprContainsAll + (*ExprContainsAny)(nil), // 23: cedar.v3.ExprContainsAny + (*ExprGetAttribute)(nil), // 24: cedar.v3.ExprGetAttribute + (*ExprHasAttribute)(nil), // 25: cedar.v3.ExprHasAttribute + (*ExprLike)(nil), // 26: cedar.v3.ExprLike + (*ExprIs)(nil), // 27: cedar.v3.ExprIs + (*ExprIfThenElse)(nil), // 28: cedar.v3.ExprIfThenElse + (*ExprSet)(nil), // 29: cedar.v3.ExprSet + (*ExprRecord)(nil), // 30: cedar.v3.ExprRecord + (*ExprFuncCall)(nil), // 31: cedar.v3.ExprFuncCall + nil, // 32: cedar.v3.ExprRecord.AttributesEntry + (*Value)(nil), // 33: cedar.v3.Value +} +var file_cedar_v3_expr_proto_depIdxs = []int32{ + 3, // 0: cedar.v3.Expr.value:type_name -> cedar.v3.ExprValue + 4, // 1: cedar.v3.Expr.var:type_name -> cedar.v3.ExprVar + 5, // 2: cedar.v3.Expr.slot:type_name -> cedar.v3.ExprSlot + 6, // 3: cedar.v3.Expr.unknown:type_name -> cedar.v3.ExprUnknown + 7, // 4: cedar.v3.Expr.not:type_name -> cedar.v3.ExprNot + 8, // 5: cedar.v3.Expr.neg:type_name -> cedar.v3.ExprNeg + 9, // 6: cedar.v3.Expr.equals:type_name -> cedar.v3.ExprEquals + 10, // 7: cedar.v3.Expr.not_equals:type_name -> cedar.v3.ExprNotEquals + 11, // 8: cedar.v3.Expr.in:type_name -> cedar.v3.ExprIn + 12, // 9: cedar.v3.Expr.less_than:type_name -> cedar.v3.ExprLessThan + 13, // 10: cedar.v3.Expr.less_than_or_equals:type_name -> cedar.v3.ExprLessThanOrEquals + 14, // 11: cedar.v3.Expr.greater_than:type_name -> cedar.v3.ExprGreaterThan + 15, // 12: cedar.v3.Expr.greater_than_or_equals:type_name -> cedar.v3.ExprGreaterThanOrEquals + 16, // 13: cedar.v3.Expr.and:type_name -> cedar.v3.ExprAnd + 17, // 14: cedar.v3.Expr.or:type_name -> cedar.v3.ExprOr + 18, // 15: cedar.v3.Expr.plus:type_name -> cedar.v3.ExprPlus + 19, // 16: cedar.v3.Expr.minus:type_name -> cedar.v3.ExprMinus + 20, // 17: cedar.v3.Expr.times:type_name -> cedar.v3.ExprTimes + 21, // 18: cedar.v3.Expr.contains:type_name -> cedar.v3.ExprContains + 22, // 19: cedar.v3.Expr.contains_all:type_name -> cedar.v3.ExprContainsAll + 23, // 20: cedar.v3.Expr.contains_any:type_name -> cedar.v3.ExprContainsAny + 24, // 21: cedar.v3.Expr.get_attribute:type_name -> cedar.v3.ExprGetAttribute + 25, // 22: cedar.v3.Expr.has_attribute:type_name -> cedar.v3.ExprHasAttribute + 26, // 23: cedar.v3.Expr.like:type_name -> cedar.v3.ExprLike + 27, // 24: cedar.v3.Expr.is:type_name -> cedar.v3.ExprIs + 28, // 25: cedar.v3.Expr.if_then_else:type_name -> cedar.v3.ExprIfThenElse + 29, // 26: cedar.v3.Expr.set:type_name -> cedar.v3.ExprSet + 30, // 27: cedar.v3.Expr.record:type_name -> cedar.v3.ExprRecord + 31, // 28: cedar.v3.Expr.func_call:type_name -> cedar.v3.ExprFuncCall + 33, // 29: cedar.v3.ExprValue.value:type_name -> cedar.v3.Value + 0, // 30: cedar.v3.ExprVar.variable:type_name -> cedar.v3.Variable + 1, // 31: cedar.v3.ExprSlot.slot_id:type_name -> cedar.v3.SlotId + 2, // 32: cedar.v3.ExprNot.expr:type_name -> cedar.v3.Expr + 2, // 33: cedar.v3.ExprNeg.expr:type_name -> cedar.v3.Expr + 2, // 34: cedar.v3.ExprEquals.left:type_name -> cedar.v3.Expr + 2, // 35: cedar.v3.ExprEquals.right:type_name -> cedar.v3.Expr + 2, // 36: cedar.v3.ExprNotEquals.left:type_name -> cedar.v3.Expr + 2, // 37: cedar.v3.ExprNotEquals.right:type_name -> cedar.v3.Expr + 2, // 38: cedar.v3.ExprIn.left:type_name -> cedar.v3.Expr + 2, // 39: cedar.v3.ExprIn.right:type_name -> cedar.v3.Expr + 2, // 40: cedar.v3.ExprLessThan.left:type_name -> cedar.v3.Expr + 2, // 41: cedar.v3.ExprLessThan.right:type_name -> cedar.v3.Expr + 2, // 42: cedar.v3.ExprLessThanOrEquals.left:type_name -> cedar.v3.Expr + 2, // 43: cedar.v3.ExprLessThanOrEquals.right:type_name -> cedar.v3.Expr + 2, // 44: cedar.v3.ExprGreaterThan.left:type_name -> cedar.v3.Expr + 2, // 45: cedar.v3.ExprGreaterThan.right:type_name -> cedar.v3.Expr + 2, // 46: cedar.v3.ExprGreaterThanOrEquals.left:type_name -> cedar.v3.Expr + 2, // 47: cedar.v3.ExprGreaterThanOrEquals.right:type_name -> cedar.v3.Expr + 2, // 48: cedar.v3.ExprAnd.left:type_name -> cedar.v3.Expr + 2, // 49: cedar.v3.ExprAnd.right:type_name -> cedar.v3.Expr + 2, // 50: cedar.v3.ExprOr.left:type_name -> cedar.v3.Expr + 2, // 51: cedar.v3.ExprOr.right:type_name -> cedar.v3.Expr + 2, // 52: cedar.v3.ExprPlus.left:type_name -> cedar.v3.Expr + 2, // 53: cedar.v3.ExprPlus.right:type_name -> cedar.v3.Expr + 2, // 54: cedar.v3.ExprMinus.left:type_name -> cedar.v3.Expr + 2, // 55: cedar.v3.ExprMinus.right:type_name -> cedar.v3.Expr + 2, // 56: cedar.v3.ExprTimes.left:type_name -> cedar.v3.Expr + 2, // 57: cedar.v3.ExprTimes.right:type_name -> cedar.v3.Expr + 2, // 58: cedar.v3.ExprContains.left:type_name -> cedar.v3.Expr + 2, // 59: cedar.v3.ExprContains.right:type_name -> cedar.v3.Expr + 2, // 60: cedar.v3.ExprContainsAll.left:type_name -> cedar.v3.Expr + 2, // 61: cedar.v3.ExprContainsAll.right:type_name -> cedar.v3.Expr + 2, // 62: cedar.v3.ExprContainsAny.left:type_name -> cedar.v3.Expr + 2, // 63: cedar.v3.ExprContainsAny.right:type_name -> cedar.v3.Expr + 2, // 64: cedar.v3.ExprGetAttribute.left:type_name -> cedar.v3.Expr + 2, // 65: cedar.v3.ExprHasAttribute.left:type_name -> cedar.v3.Expr + 2, // 66: cedar.v3.ExprLike.left:type_name -> cedar.v3.Expr + 2, // 67: cedar.v3.ExprIs.left:type_name -> cedar.v3.Expr + 2, // 68: cedar.v3.ExprIs.in:type_name -> cedar.v3.Expr + 2, // 69: cedar.v3.ExprIfThenElse.if:type_name -> cedar.v3.Expr + 2, // 70: cedar.v3.ExprIfThenElse.then:type_name -> cedar.v3.Expr + 2, // 71: cedar.v3.ExprIfThenElse.else:type_name -> cedar.v3.Expr + 2, // 72: cedar.v3.ExprSet.expressions:type_name -> cedar.v3.Expr + 32, // 73: cedar.v3.ExprRecord.attributes:type_name -> cedar.v3.ExprRecord.AttributesEntry + 2, // 74: cedar.v3.ExprFuncCall.args:type_name -> cedar.v3.Expr + 2, // 75: cedar.v3.ExprRecord.AttributesEntry.value:type_name -> cedar.v3.Expr + 76, // [76:76] is the sub-list for method output_type + 76, // [76:76] is the sub-list for method input_type + 76, // [76:76] is the sub-list for extension type_name + 76, // [76:76] is the sub-list for extension extendee + 0, // [0:76] is the sub-list for field type_name +} + +func init() { file_cedar_v3_expr_proto_init() } +func file_cedar_v3_expr_proto_init() { + if File_cedar_v3_expr_proto != nil { + return + } + file_cedar_v3_value_proto_init() + if !protoimpl.UnsafeEnabled { + file_cedar_v3_expr_proto_msgTypes[0].Exporter = func(v any, i int) any { + switch v := v.(*Expr); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cedar_v3_expr_proto_msgTypes[1].Exporter = func(v any, i int) any { + switch v := v.(*ExprValue); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cedar_v3_expr_proto_msgTypes[2].Exporter = func(v any, i int) any { + switch v := v.(*ExprVar); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cedar_v3_expr_proto_msgTypes[3].Exporter = func(v any, i int) any { + switch v := v.(*ExprSlot); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cedar_v3_expr_proto_msgTypes[4].Exporter = func(v any, i int) any { + switch v := v.(*ExprUnknown); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cedar_v3_expr_proto_msgTypes[5].Exporter = func(v any, i int) any { + switch v := v.(*ExprNot); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cedar_v3_expr_proto_msgTypes[6].Exporter = func(v any, i int) any { + switch v := v.(*ExprNeg); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cedar_v3_expr_proto_msgTypes[7].Exporter = func(v any, i int) any { + switch v := v.(*ExprEquals); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cedar_v3_expr_proto_msgTypes[8].Exporter = func(v any, i int) any { + switch v := v.(*ExprNotEquals); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cedar_v3_expr_proto_msgTypes[9].Exporter = func(v any, i int) any { + switch v := v.(*ExprIn); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cedar_v3_expr_proto_msgTypes[10].Exporter = func(v any, i int) any { + switch v := v.(*ExprLessThan); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cedar_v3_expr_proto_msgTypes[11].Exporter = func(v any, i int) any { + switch v := v.(*ExprLessThanOrEquals); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cedar_v3_expr_proto_msgTypes[12].Exporter = func(v any, i int) any { + switch v := v.(*ExprGreaterThan); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cedar_v3_expr_proto_msgTypes[13].Exporter = func(v any, i int) any { + switch v := v.(*ExprGreaterThanOrEquals); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cedar_v3_expr_proto_msgTypes[14].Exporter = func(v any, i int) any { + switch v := v.(*ExprAnd); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cedar_v3_expr_proto_msgTypes[15].Exporter = func(v any, i int) any { + switch v := v.(*ExprOr); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cedar_v3_expr_proto_msgTypes[16].Exporter = func(v any, i int) any { + switch v := v.(*ExprPlus); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cedar_v3_expr_proto_msgTypes[17].Exporter = func(v any, i int) any { + switch v := v.(*ExprMinus); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cedar_v3_expr_proto_msgTypes[18].Exporter = func(v any, i int) any { + switch v := v.(*ExprTimes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cedar_v3_expr_proto_msgTypes[19].Exporter = func(v any, i int) any { + switch v := v.(*ExprContains); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cedar_v3_expr_proto_msgTypes[20].Exporter = func(v any, i int) any { + switch v := v.(*ExprContainsAll); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cedar_v3_expr_proto_msgTypes[21].Exporter = func(v any, i int) any { + switch v := v.(*ExprContainsAny); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cedar_v3_expr_proto_msgTypes[22].Exporter = func(v any, i int) any { + switch v := v.(*ExprGetAttribute); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cedar_v3_expr_proto_msgTypes[23].Exporter = func(v any, i int) any { + switch v := v.(*ExprHasAttribute); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cedar_v3_expr_proto_msgTypes[24].Exporter = func(v any, i int) any { + switch v := v.(*ExprLike); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cedar_v3_expr_proto_msgTypes[25].Exporter = func(v any, i int) any { + switch v := v.(*ExprIs); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cedar_v3_expr_proto_msgTypes[26].Exporter = func(v any, i int) any { + switch v := v.(*ExprIfThenElse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cedar_v3_expr_proto_msgTypes[27].Exporter = func(v any, i int) any { + switch v := v.(*ExprSet); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cedar_v3_expr_proto_msgTypes[28].Exporter = func(v any, i int) any { + switch v := v.(*ExprRecord); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cedar_v3_expr_proto_msgTypes[29].Exporter = func(v any, i int) any { + switch v := v.(*ExprFuncCall); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_cedar_v3_expr_proto_msgTypes[0].OneofWrappers = []any{ + (*Expr_Value)(nil), + (*Expr_Var)(nil), + (*Expr_Slot)(nil), + (*Expr_Unknown)(nil), + (*Expr_Not)(nil), + (*Expr_Neg)(nil), + (*Expr_Equals)(nil), + (*Expr_NotEquals)(nil), + (*Expr_In)(nil), + (*Expr_LessThan)(nil), + (*Expr_LessThanOrEquals)(nil), + (*Expr_GreaterThan)(nil), + (*Expr_GreaterThanOrEquals)(nil), + (*Expr_And)(nil), + (*Expr_Or)(nil), + (*Expr_Plus)(nil), + (*Expr_Minus)(nil), + (*Expr_Times)(nil), + (*Expr_Contains)(nil), + (*Expr_ContainsAll)(nil), + (*Expr_ContainsAny)(nil), + (*Expr_GetAttribute)(nil), + (*Expr_HasAttribute)(nil), + (*Expr_Like)(nil), + (*Expr_Is)(nil), + (*Expr_IfThenElse)(nil), + (*Expr_Set)(nil), + (*Expr_Record)(nil), + (*Expr_FuncCall)(nil), + } + file_cedar_v3_expr_proto_msgTypes[25].OneofWrappers = []any{} + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_cedar_v3_expr_proto_rawDesc, + NumEnums: 2, + NumMessages: 31, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_cedar_v3_expr_proto_goTypes, + DependencyIndexes: file_cedar_v3_expr_proto_depIdxs, + EnumInfos: file_cedar_v3_expr_proto_enumTypes, + MessageInfos: file_cedar_v3_expr_proto_msgTypes, + }.Build() + File_cedar_v3_expr_proto = out.File + file_cedar_v3_expr_proto_rawDesc = nil + file_cedar_v3_expr_proto_goTypes = nil + file_cedar_v3_expr_proto_depIdxs = nil +} diff --git a/go/proto/cedar/v3/policy.pb.go b/go/proto/cedar/v3/policy.pb.go new file mode 100644 index 0000000..8219f50 --- /dev/null +++ b/go/proto/cedar/v3/policy.pb.go @@ -0,0 +1,764 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.34.2 +// protoc (unknown) +// source: cedar/v3/policy.proto + +package cedarpb + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type PolicyEffect int32 + +const ( + PolicyEffect_POLICY_EFFECT_UNSPECIFIED PolicyEffect = 0 + PolicyEffect_POLICY_EFFECT_PERMIT PolicyEffect = 1 + PolicyEffect_POLICY_EFFECT_FORBID PolicyEffect = 2 +) + +// Enum value maps for PolicyEffect. +var ( + PolicyEffect_name = map[int32]string{ + 0: "POLICY_EFFECT_UNSPECIFIED", + 1: "POLICY_EFFECT_PERMIT", + 2: "POLICY_EFFECT_FORBID", + } + PolicyEffect_value = map[string]int32{ + "POLICY_EFFECT_UNSPECIFIED": 0, + "POLICY_EFFECT_PERMIT": 1, + "POLICY_EFFECT_FORBID": 2, + } +) + +func (x PolicyEffect) Enum() *PolicyEffect { + p := new(PolicyEffect) + *p = x + return p +} + +func (x PolicyEffect) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (PolicyEffect) Descriptor() protoreflect.EnumDescriptor { + return file_cedar_v3_policy_proto_enumTypes[0].Descriptor() +} + +func (PolicyEffect) Type() protoreflect.EnumType { + return &file_cedar_v3_policy_proto_enumTypes[0] +} + +func (x PolicyEffect) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use PolicyEffect.Descriptor instead. +func (PolicyEffect) EnumDescriptor() ([]byte, []int) { + return file_cedar_v3_policy_proto_rawDescGZIP(), []int{0} +} + +type PolicyOp int32 + +const ( + PolicyOp_POLICY_OP_UNSPECIFIED PolicyOp = 0 + PolicyOp_POLICY_OP_ALL PolicyOp = 1 + PolicyOp_POLICY_OP_EQUALS PolicyOp = 2 + PolicyOp_POLICY_OP_IN PolicyOp = 3 + PolicyOp_POLICY_OP_IS PolicyOp = 4 +) + +// Enum value maps for PolicyOp. +var ( + PolicyOp_name = map[int32]string{ + 0: "POLICY_OP_UNSPECIFIED", + 1: "POLICY_OP_ALL", + 2: "POLICY_OP_EQUALS", + 3: "POLICY_OP_IN", + 4: "POLICY_OP_IS", + } + PolicyOp_value = map[string]int32{ + "POLICY_OP_UNSPECIFIED": 0, + "POLICY_OP_ALL": 1, + "POLICY_OP_EQUALS": 2, + "POLICY_OP_IN": 3, + "POLICY_OP_IS": 4, + } +) + +func (x PolicyOp) Enum() *PolicyOp { + p := new(PolicyOp) + *p = x + return p +} + +func (x PolicyOp) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (PolicyOp) Descriptor() protoreflect.EnumDescriptor { + return file_cedar_v3_policy_proto_enumTypes[1].Descriptor() +} + +func (PolicyOp) Type() protoreflect.EnumType { + return &file_cedar_v3_policy_proto_enumTypes[1] +} + +func (x PolicyOp) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use PolicyOp.Descriptor instead. +func (PolicyOp) EnumDescriptor() ([]byte, []int) { + return file_cedar_v3_policy_proto_rawDescGZIP(), []int{1} +} + +type PolicyConditionKind int32 + +const ( + PolicyConditionKind_POLICY_CONDITION_KIND_UNSPECIFIED PolicyConditionKind = 0 + PolicyConditionKind_POLICY_CONDITION_KIND_WHEN PolicyConditionKind = 1 + PolicyConditionKind_POLICY_CONDITION_KIND_UNLESS PolicyConditionKind = 2 +) + +// Enum value maps for PolicyConditionKind. +var ( + PolicyConditionKind_name = map[int32]string{ + 0: "POLICY_CONDITION_KIND_UNSPECIFIED", + 1: "POLICY_CONDITION_KIND_WHEN", + 2: "POLICY_CONDITION_KIND_UNLESS", + } + PolicyConditionKind_value = map[string]int32{ + "POLICY_CONDITION_KIND_UNSPECIFIED": 0, + "POLICY_CONDITION_KIND_WHEN": 1, + "POLICY_CONDITION_KIND_UNLESS": 2, + } +) + +func (x PolicyConditionKind) Enum() *PolicyConditionKind { + p := new(PolicyConditionKind) + *p = x + return p +} + +func (x PolicyConditionKind) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (PolicyConditionKind) Descriptor() protoreflect.EnumDescriptor { + return file_cedar_v3_policy_proto_enumTypes[2].Descriptor() +} + +func (PolicyConditionKind) Type() protoreflect.EnumType { + return &file_cedar_v3_policy_proto_enumTypes[2] +} + +func (x PolicyConditionKind) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use PolicyConditionKind.Descriptor instead. +func (PolicyConditionKind) EnumDescriptor() ([]byte, []int) { + return file_cedar_v3_policy_proto_rawDescGZIP(), []int{2} +} + +type Policy struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id *string `protobuf:"bytes,1,opt,name=id,proto3,oneof" json:"id,omitempty"` + Effect PolicyEffect `protobuf:"varint,2,opt,name=effect,proto3,enum=cedar.v3.PolicyEffect" json:"effect,omitempty"` + Principal *PolicyPrincipal `protobuf:"bytes,3,opt,name=principal,proto3" json:"principal,omitempty"` + Action *PolicyAction `protobuf:"bytes,4,opt,name=action,proto3" json:"action,omitempty"` + Resource *PolicyResource `protobuf:"bytes,5,opt,name=resource,proto3" json:"resource,omitempty"` + Conditions []*PolicyCondition `protobuf:"bytes,6,rep,name=conditions,proto3" json:"conditions,omitempty"` + Annotations map[string]string `protobuf:"bytes,7,rep,name=annotations,proto3" json:"annotations,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` +} + +func (x *Policy) Reset() { + *x = Policy{} + if protoimpl.UnsafeEnabled { + mi := &file_cedar_v3_policy_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Policy) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Policy) ProtoMessage() {} + +func (x *Policy) ProtoReflect() protoreflect.Message { + mi := &file_cedar_v3_policy_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Policy.ProtoReflect.Descriptor instead. +func (*Policy) Descriptor() ([]byte, []int) { + return file_cedar_v3_policy_proto_rawDescGZIP(), []int{0} +} + +func (x *Policy) GetId() string { + if x != nil && x.Id != nil { + return *x.Id + } + return "" +} + +func (x *Policy) GetEffect() PolicyEffect { + if x != nil { + return x.Effect + } + return PolicyEffect_POLICY_EFFECT_UNSPECIFIED +} + +func (x *Policy) GetPrincipal() *PolicyPrincipal { + if x != nil { + return x.Principal + } + return nil +} + +func (x *Policy) GetAction() *PolicyAction { + if x != nil { + return x.Action + } + return nil +} + +func (x *Policy) GetResource() *PolicyResource { + if x != nil { + return x.Resource + } + return nil +} + +func (x *Policy) GetConditions() []*PolicyCondition { + if x != nil { + return x.Conditions + } + return nil +} + +func (x *Policy) GetAnnotations() map[string]string { + if x != nil { + return x.Annotations + } + return nil +} + +type PolicyPrincipal struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Op PolicyOp `protobuf:"varint,1,opt,name=op,proto3,enum=cedar.v3.PolicyOp" json:"op,omitempty"` + Entity *EntityId `protobuf:"bytes,2,opt,name=entity,proto3,oneof" json:"entity,omitempty"` + EntityType *string `protobuf:"bytes,3,opt,name=entity_type,json=entityType,proto3,oneof" json:"entity_type,omitempty"` +} + +func (x *PolicyPrincipal) Reset() { + *x = PolicyPrincipal{} + if protoimpl.UnsafeEnabled { + mi := &file_cedar_v3_policy_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PolicyPrincipal) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PolicyPrincipal) ProtoMessage() {} + +func (x *PolicyPrincipal) ProtoReflect() protoreflect.Message { + mi := &file_cedar_v3_policy_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PolicyPrincipal.ProtoReflect.Descriptor instead. +func (*PolicyPrincipal) Descriptor() ([]byte, []int) { + return file_cedar_v3_policy_proto_rawDescGZIP(), []int{1} +} + +func (x *PolicyPrincipal) GetOp() PolicyOp { + if x != nil { + return x.Op + } + return PolicyOp_POLICY_OP_UNSPECIFIED +} + +func (x *PolicyPrincipal) GetEntity() *EntityId { + if x != nil { + return x.Entity + } + return nil +} + +func (x *PolicyPrincipal) GetEntityType() string { + if x != nil && x.EntityType != nil { + return *x.EntityType + } + return "" +} + +type PolicyAction struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Op PolicyOp `protobuf:"varint,1,opt,name=op,proto3,enum=cedar.v3.PolicyOp" json:"op,omitempty"` + Entity *EntityId `protobuf:"bytes,2,opt,name=entity,proto3,oneof" json:"entity,omitempty"` + Entities []*EntityId `protobuf:"bytes,3,rep,name=entities,proto3" json:"entities,omitempty"` +} + +func (x *PolicyAction) Reset() { + *x = PolicyAction{} + if protoimpl.UnsafeEnabled { + mi := &file_cedar_v3_policy_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PolicyAction) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PolicyAction) ProtoMessage() {} + +func (x *PolicyAction) ProtoReflect() protoreflect.Message { + mi := &file_cedar_v3_policy_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PolicyAction.ProtoReflect.Descriptor instead. +func (*PolicyAction) Descriptor() ([]byte, []int) { + return file_cedar_v3_policy_proto_rawDescGZIP(), []int{2} +} + +func (x *PolicyAction) GetOp() PolicyOp { + if x != nil { + return x.Op + } + return PolicyOp_POLICY_OP_UNSPECIFIED +} + +func (x *PolicyAction) GetEntity() *EntityId { + if x != nil { + return x.Entity + } + return nil +} + +func (x *PolicyAction) GetEntities() []*EntityId { + if x != nil { + return x.Entities + } + return nil +} + +type PolicyResource struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Op PolicyOp `protobuf:"varint,1,opt,name=op,proto3,enum=cedar.v3.PolicyOp" json:"op,omitempty"` + Entity *EntityId `protobuf:"bytes,2,opt,name=entity,proto3,oneof" json:"entity,omitempty"` + EntityType *string `protobuf:"bytes,3,opt,name=entity_type,json=entityType,proto3,oneof" json:"entity_type,omitempty"` +} + +func (x *PolicyResource) Reset() { + *x = PolicyResource{} + if protoimpl.UnsafeEnabled { + mi := &file_cedar_v3_policy_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PolicyResource) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PolicyResource) ProtoMessage() {} + +func (x *PolicyResource) ProtoReflect() protoreflect.Message { + mi := &file_cedar_v3_policy_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PolicyResource.ProtoReflect.Descriptor instead. +func (*PolicyResource) Descriptor() ([]byte, []int) { + return file_cedar_v3_policy_proto_rawDescGZIP(), []int{3} +} + +func (x *PolicyResource) GetOp() PolicyOp { + if x != nil { + return x.Op + } + return PolicyOp_POLICY_OP_UNSPECIFIED +} + +func (x *PolicyResource) GetEntity() *EntityId { + if x != nil { + return x.Entity + } + return nil +} + +func (x *PolicyResource) GetEntityType() string { + if x != nil && x.EntityType != nil { + return *x.EntityType + } + return "" +} + +type PolicyCondition struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Kind PolicyConditionKind `protobuf:"varint,1,opt,name=kind,proto3,enum=cedar.v3.PolicyConditionKind" json:"kind,omitempty"` + Body *Expr `protobuf:"bytes,2,opt,name=body,proto3" json:"body,omitempty"` +} + +func (x *PolicyCondition) Reset() { + *x = PolicyCondition{} + if protoimpl.UnsafeEnabled { + mi := &file_cedar_v3_policy_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PolicyCondition) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PolicyCondition) ProtoMessage() {} + +func (x *PolicyCondition) ProtoReflect() protoreflect.Message { + mi := &file_cedar_v3_policy_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PolicyCondition.ProtoReflect.Descriptor instead. +func (*PolicyCondition) Descriptor() ([]byte, []int) { + return file_cedar_v3_policy_proto_rawDescGZIP(), []int{4} +} + +func (x *PolicyCondition) GetKind() PolicyConditionKind { + if x != nil { + return x.Kind + } + return PolicyConditionKind_POLICY_CONDITION_KIND_UNSPECIFIED +} + +func (x *PolicyCondition) GetBody() *Expr { + if x != nil { + return x.Body + } + return nil +} + +var File_cedar_v3_policy_proto protoreflect.FileDescriptor + +var file_cedar_v3_policy_proto_rawDesc = []byte{ + 0x0a, 0x15, 0x63, 0x65, 0x64, 0x61, 0x72, 0x2f, 0x76, 0x33, 0x2f, 0x70, 0x6f, 0x6c, 0x69, 0x63, + 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x08, 0x63, 0x65, 0x64, 0x61, 0x72, 0x2e, 0x76, + 0x33, 0x1a, 0x18, 0x63, 0x65, 0x64, 0x61, 0x72, 0x2f, 0x76, 0x33, 0x2f, 0x65, 0x6e, 0x74, 0x69, + 0x74, 0x79, 0x5f, 0x69, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x13, 0x63, 0x65, 0x64, + 0x61, 0x72, 0x2f, 0x76, 0x33, 0x2f, 0x65, 0x78, 0x70, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x22, 0xb3, 0x03, 0x0a, 0x06, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12, 0x13, 0x0a, 0x02, 0x69, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x02, 0x69, 0x64, 0x88, 0x01, 0x01, + 0x12, 0x2e, 0x0a, 0x06, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, + 0x32, 0x16, 0x2e, 0x63, 0x65, 0x64, 0x61, 0x72, 0x2e, 0x76, 0x33, 0x2e, 0x50, 0x6f, 0x6c, 0x69, + 0x63, 0x79, 0x45, 0x66, 0x66, 0x65, 0x63, 0x74, 0x52, 0x06, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, + 0x12, 0x37, 0x0a, 0x09, 0x70, 0x72, 0x69, 0x6e, 0x63, 0x69, 0x70, 0x61, 0x6c, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x65, 0x64, 0x61, 0x72, 0x2e, 0x76, 0x33, 0x2e, 0x50, + 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x50, 0x72, 0x69, 0x6e, 0x63, 0x69, 0x70, 0x61, 0x6c, 0x52, 0x09, + 0x70, 0x72, 0x69, 0x6e, 0x63, 0x69, 0x70, 0x61, 0x6c, 0x12, 0x2e, 0x0a, 0x06, 0x61, 0x63, 0x74, + 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x63, 0x65, 0x64, 0x61, + 0x72, 0x2e, 0x76, 0x33, 0x2e, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x41, 0x63, 0x74, 0x69, 0x6f, + 0x6e, 0x52, 0x06, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x34, 0x0a, 0x08, 0x72, 0x65, 0x73, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x63, 0x65, + 0x64, 0x61, 0x72, 0x2e, 0x76, 0x33, 0x2e, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x52, 0x65, 0x73, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, + 0x39, 0x0a, 0x0a, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x06, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x65, 0x64, 0x61, 0x72, 0x2e, 0x76, 0x33, 0x2e, 0x50, + 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0a, + 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x43, 0x0a, 0x0b, 0x61, 0x6e, + 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x21, 0x2e, 0x63, 0x65, 0x64, 0x61, 0x72, 0x2e, 0x76, 0x33, 0x2e, 0x50, 0x6f, 0x6c, 0x69, 0x63, + 0x79, 0x2e, 0x41, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x45, 0x6e, 0x74, + 0x72, 0x79, 0x52, 0x0b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x1a, + 0x3e, 0x0a, 0x10, 0x41, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 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, + 0x05, 0x0a, 0x03, 0x5f, 0x69, 0x64, 0x22, 0xa7, 0x01, 0x0a, 0x0f, 0x50, 0x6f, 0x6c, 0x69, 0x63, + 0x79, 0x50, 0x72, 0x69, 0x6e, 0x63, 0x69, 0x70, 0x61, 0x6c, 0x12, 0x22, 0x0a, 0x02, 0x6f, 0x70, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x12, 0x2e, 0x63, 0x65, 0x64, 0x61, 0x72, 0x2e, 0x76, + 0x33, 0x2e, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x4f, 0x70, 0x52, 0x02, 0x6f, 0x70, 0x12, 0x2f, + 0x0a, 0x06, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, + 0x2e, 0x63, 0x65, 0x64, 0x61, 0x72, 0x2e, 0x76, 0x33, 0x2e, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, + 0x49, 0x64, 0x48, 0x00, 0x52, 0x06, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x88, 0x01, 0x01, 0x12, + 0x24, 0x0a, 0x0b, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x09, 0x48, 0x01, 0x52, 0x0a, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x54, 0x79, + 0x70, 0x65, 0x88, 0x01, 0x01, 0x42, 0x09, 0x0a, 0x07, 0x5f, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, + 0x42, 0x0e, 0x0a, 0x0c, 0x5f, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x5f, 0x74, 0x79, 0x70, 0x65, + 0x22, 0x9e, 0x01, 0x0a, 0x0c, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x41, 0x63, 0x74, 0x69, 0x6f, + 0x6e, 0x12, 0x22, 0x0a, 0x02, 0x6f, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x12, 0x2e, + 0x63, 0x65, 0x64, 0x61, 0x72, 0x2e, 0x76, 0x33, 0x2e, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x4f, + 0x70, 0x52, 0x02, 0x6f, 0x70, 0x12, 0x2f, 0x0a, 0x06, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x63, 0x65, 0x64, 0x61, 0x72, 0x2e, 0x76, 0x33, + 0x2e, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x49, 0x64, 0x48, 0x00, 0x52, 0x06, 0x65, 0x6e, 0x74, + 0x69, 0x74, 0x79, 0x88, 0x01, 0x01, 0x12, 0x2e, 0x0a, 0x08, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x69, + 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x63, 0x65, 0x64, 0x61, 0x72, + 0x2e, 0x76, 0x33, 0x2e, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x49, 0x64, 0x52, 0x08, 0x65, 0x6e, + 0x74, 0x69, 0x74, 0x69, 0x65, 0x73, 0x42, 0x09, 0x0a, 0x07, 0x5f, 0x65, 0x6e, 0x74, 0x69, 0x74, + 0x79, 0x22, 0xa6, 0x01, 0x0a, 0x0e, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x52, 0x65, 0x73, 0x6f, + 0x75, 0x72, 0x63, 0x65, 0x12, 0x22, 0x0a, 0x02, 0x6f, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, + 0x32, 0x12, 0x2e, 0x63, 0x65, 0x64, 0x61, 0x72, 0x2e, 0x76, 0x33, 0x2e, 0x50, 0x6f, 0x6c, 0x69, + 0x63, 0x79, 0x4f, 0x70, 0x52, 0x02, 0x6f, 0x70, 0x12, 0x2f, 0x0a, 0x06, 0x65, 0x6e, 0x74, 0x69, + 0x74, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x63, 0x65, 0x64, 0x61, 0x72, + 0x2e, 0x76, 0x33, 0x2e, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x49, 0x64, 0x48, 0x00, 0x52, 0x06, + 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x88, 0x01, 0x01, 0x12, 0x24, 0x0a, 0x0b, 0x65, 0x6e, 0x74, + 0x69, 0x74, 0x79, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x48, 0x01, + 0x52, 0x0a, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x54, 0x79, 0x70, 0x65, 0x88, 0x01, 0x01, 0x42, + 0x09, 0x0a, 0x07, 0x5f, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x42, 0x0e, 0x0a, 0x0c, 0x5f, 0x65, + 0x6e, 0x74, 0x69, 0x74, 0x79, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x22, 0x68, 0x0a, 0x0f, 0x50, 0x6f, + 0x6c, 0x69, 0x63, 0x79, 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x31, 0x0a, + 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1d, 0x2e, 0x63, 0x65, + 0x64, 0x61, 0x72, 0x2e, 0x76, 0x33, 0x2e, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x43, 0x6f, 0x6e, + 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x4b, 0x69, 0x6e, 0x64, 0x52, 0x04, 0x6b, 0x69, 0x6e, 0x64, + 0x12, 0x22, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, + 0x2e, 0x63, 0x65, 0x64, 0x61, 0x72, 0x2e, 0x76, 0x33, 0x2e, 0x45, 0x78, 0x70, 0x72, 0x52, 0x04, + 0x62, 0x6f, 0x64, 0x79, 0x2a, 0x61, 0x0a, 0x0c, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x45, 0x66, + 0x66, 0x65, 0x63, 0x74, 0x12, 0x1d, 0x0a, 0x19, 0x50, 0x4f, 0x4c, 0x49, 0x43, 0x59, 0x5f, 0x45, + 0x46, 0x46, 0x45, 0x43, 0x54, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, + 0x44, 0x10, 0x00, 0x12, 0x18, 0x0a, 0x14, 0x50, 0x4f, 0x4c, 0x49, 0x43, 0x59, 0x5f, 0x45, 0x46, + 0x46, 0x45, 0x43, 0x54, 0x5f, 0x50, 0x45, 0x52, 0x4d, 0x49, 0x54, 0x10, 0x01, 0x12, 0x18, 0x0a, + 0x14, 0x50, 0x4f, 0x4c, 0x49, 0x43, 0x59, 0x5f, 0x45, 0x46, 0x46, 0x45, 0x43, 0x54, 0x5f, 0x46, + 0x4f, 0x52, 0x42, 0x49, 0x44, 0x10, 0x02, 0x2a, 0x72, 0x0a, 0x08, 0x50, 0x6f, 0x6c, 0x69, 0x63, + 0x79, 0x4f, 0x70, 0x12, 0x19, 0x0a, 0x15, 0x50, 0x4f, 0x4c, 0x49, 0x43, 0x59, 0x5f, 0x4f, 0x50, + 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x11, + 0x0a, 0x0d, 0x50, 0x4f, 0x4c, 0x49, 0x43, 0x59, 0x5f, 0x4f, 0x50, 0x5f, 0x41, 0x4c, 0x4c, 0x10, + 0x01, 0x12, 0x14, 0x0a, 0x10, 0x50, 0x4f, 0x4c, 0x49, 0x43, 0x59, 0x5f, 0x4f, 0x50, 0x5f, 0x45, + 0x51, 0x55, 0x41, 0x4c, 0x53, 0x10, 0x02, 0x12, 0x10, 0x0a, 0x0c, 0x50, 0x4f, 0x4c, 0x49, 0x43, + 0x59, 0x5f, 0x4f, 0x50, 0x5f, 0x49, 0x4e, 0x10, 0x03, 0x12, 0x10, 0x0a, 0x0c, 0x50, 0x4f, 0x4c, + 0x49, 0x43, 0x59, 0x5f, 0x4f, 0x50, 0x5f, 0x49, 0x53, 0x10, 0x04, 0x2a, 0x7e, 0x0a, 0x13, 0x50, + 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x4b, 0x69, + 0x6e, 0x64, 0x12, 0x25, 0x0a, 0x21, 0x50, 0x4f, 0x4c, 0x49, 0x43, 0x59, 0x5f, 0x43, 0x4f, 0x4e, + 0x44, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x4b, 0x49, 0x4e, 0x44, 0x5f, 0x55, 0x4e, 0x53, 0x50, + 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x1e, 0x0a, 0x1a, 0x50, 0x4f, 0x4c, + 0x49, 0x43, 0x59, 0x5f, 0x43, 0x4f, 0x4e, 0x44, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x4b, 0x49, + 0x4e, 0x44, 0x5f, 0x57, 0x48, 0x45, 0x4e, 0x10, 0x01, 0x12, 0x20, 0x0a, 0x1c, 0x50, 0x4f, 0x4c, + 0x49, 0x43, 0x59, 0x5f, 0x43, 0x4f, 0x4e, 0x44, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x4b, 0x49, + 0x4e, 0x44, 0x5f, 0x55, 0x4e, 0x4c, 0x45, 0x53, 0x53, 0x10, 0x02, 0x42, 0x93, 0x01, 0x0a, 0x0c, + 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x65, 0x64, 0x61, 0x72, 0x2e, 0x76, 0x33, 0x42, 0x0b, 0x50, 0x6f, + 0x6c, 0x69, 0x63, 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x35, 0x67, 0x69, 0x74, + 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x65, 0x6c, 0x65, 0x73, 0x74, 0x2d, 0x64, + 0x65, 0x76, 0x2f, 0x63, 0x6f, 0x72, 0x6b, 0x73, 0x2f, 0x67, 0x6f, 0x2f, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x2f, 0x63, 0x65, 0x64, 0x61, 0x72, 0x2f, 0x76, 0x33, 0x3b, 0x63, 0x65, 0x64, 0x61, 0x72, + 0x70, 0x62, 0xa2, 0x02, 0x03, 0x43, 0x58, 0x58, 0xaa, 0x02, 0x08, 0x43, 0x65, 0x64, 0x61, 0x72, + 0x2e, 0x56, 0x33, 0xca, 0x02, 0x08, 0x43, 0x65, 0x64, 0x61, 0x72, 0x5c, 0x56, 0x33, 0xe2, 0x02, + 0x14, 0x43, 0x65, 0x64, 0x61, 0x72, 0x5c, 0x56, 0x33, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, + 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x09, 0x43, 0x65, 0x64, 0x61, 0x72, 0x3a, 0x3a, 0x56, + 0x33, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_cedar_v3_policy_proto_rawDescOnce sync.Once + file_cedar_v3_policy_proto_rawDescData = file_cedar_v3_policy_proto_rawDesc +) + +func file_cedar_v3_policy_proto_rawDescGZIP() []byte { + file_cedar_v3_policy_proto_rawDescOnce.Do(func() { + file_cedar_v3_policy_proto_rawDescData = protoimpl.X.CompressGZIP(file_cedar_v3_policy_proto_rawDescData) + }) + return file_cedar_v3_policy_proto_rawDescData +} + +var file_cedar_v3_policy_proto_enumTypes = make([]protoimpl.EnumInfo, 3) +var file_cedar_v3_policy_proto_msgTypes = make([]protoimpl.MessageInfo, 6) +var file_cedar_v3_policy_proto_goTypes = []any{ + (PolicyEffect)(0), // 0: cedar.v3.PolicyEffect + (PolicyOp)(0), // 1: cedar.v3.PolicyOp + (PolicyConditionKind)(0), // 2: cedar.v3.PolicyConditionKind + (*Policy)(nil), // 3: cedar.v3.Policy + (*PolicyPrincipal)(nil), // 4: cedar.v3.PolicyPrincipal + (*PolicyAction)(nil), // 5: cedar.v3.PolicyAction + (*PolicyResource)(nil), // 6: cedar.v3.PolicyResource + (*PolicyCondition)(nil), // 7: cedar.v3.PolicyCondition + nil, // 8: cedar.v3.Policy.AnnotationsEntry + (*EntityId)(nil), // 9: cedar.v3.EntityId + (*Expr)(nil), // 10: cedar.v3.Expr +} +var file_cedar_v3_policy_proto_depIdxs = []int32{ + 0, // 0: cedar.v3.Policy.effect:type_name -> cedar.v3.PolicyEffect + 4, // 1: cedar.v3.Policy.principal:type_name -> cedar.v3.PolicyPrincipal + 5, // 2: cedar.v3.Policy.action:type_name -> cedar.v3.PolicyAction + 6, // 3: cedar.v3.Policy.resource:type_name -> cedar.v3.PolicyResource + 7, // 4: cedar.v3.Policy.conditions:type_name -> cedar.v3.PolicyCondition + 8, // 5: cedar.v3.Policy.annotations:type_name -> cedar.v3.Policy.AnnotationsEntry + 1, // 6: cedar.v3.PolicyPrincipal.op:type_name -> cedar.v3.PolicyOp + 9, // 7: cedar.v3.PolicyPrincipal.entity:type_name -> cedar.v3.EntityId + 1, // 8: cedar.v3.PolicyAction.op:type_name -> cedar.v3.PolicyOp + 9, // 9: cedar.v3.PolicyAction.entity:type_name -> cedar.v3.EntityId + 9, // 10: cedar.v3.PolicyAction.entities:type_name -> cedar.v3.EntityId + 1, // 11: cedar.v3.PolicyResource.op:type_name -> cedar.v3.PolicyOp + 9, // 12: cedar.v3.PolicyResource.entity:type_name -> cedar.v3.EntityId + 2, // 13: cedar.v3.PolicyCondition.kind:type_name -> cedar.v3.PolicyConditionKind + 10, // 14: cedar.v3.PolicyCondition.body:type_name -> cedar.v3.Expr + 15, // [15:15] is the sub-list for method output_type + 15, // [15:15] is the sub-list for method input_type + 15, // [15:15] is the sub-list for extension type_name + 15, // [15:15] is the sub-list for extension extendee + 0, // [0:15] is the sub-list for field type_name +} + +func init() { file_cedar_v3_policy_proto_init() } +func file_cedar_v3_policy_proto_init() { + if File_cedar_v3_policy_proto != nil { + return + } + file_cedar_v3_entity_id_proto_init() + file_cedar_v3_expr_proto_init() + if !protoimpl.UnsafeEnabled { + file_cedar_v3_policy_proto_msgTypes[0].Exporter = func(v any, i int) any { + switch v := v.(*Policy); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cedar_v3_policy_proto_msgTypes[1].Exporter = func(v any, i int) any { + switch v := v.(*PolicyPrincipal); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cedar_v3_policy_proto_msgTypes[2].Exporter = func(v any, i int) any { + switch v := v.(*PolicyAction); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cedar_v3_policy_proto_msgTypes[3].Exporter = func(v any, i int) any { + switch v := v.(*PolicyResource); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cedar_v3_policy_proto_msgTypes[4].Exporter = func(v any, i int) any { + switch v := v.(*PolicyCondition); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_cedar_v3_policy_proto_msgTypes[0].OneofWrappers = []any{} + file_cedar_v3_policy_proto_msgTypes[1].OneofWrappers = []any{} + file_cedar_v3_policy_proto_msgTypes[2].OneofWrappers = []any{} + file_cedar_v3_policy_proto_msgTypes[3].OneofWrappers = []any{} + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_cedar_v3_policy_proto_rawDesc, + NumEnums: 3, + NumMessages: 6, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_cedar_v3_policy_proto_goTypes, + DependencyIndexes: file_cedar_v3_policy_proto_depIdxs, + EnumInfos: file_cedar_v3_policy_proto_enumTypes, + MessageInfos: file_cedar_v3_policy_proto_msgTypes, + }.Build() + File_cedar_v3_policy_proto = out.File + file_cedar_v3_policy_proto_rawDesc = nil + file_cedar_v3_policy_proto_goTypes = nil + file_cedar_v3_policy_proto_depIdxs = nil +} diff --git a/go/proto/cedar/v3/value.pb.go b/go/proto/cedar/v3/value.pb.go new file mode 100644 index 0000000..1c1069f --- /dev/null +++ b/go/proto/cedar/v3/value.pb.go @@ -0,0 +1,561 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.34.2 +// protoc (unknown) +// source: cedar/v3/value.proto + +package cedarpb + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type Value struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Value: + // + // *Value_String_ + // *Value_Long + // *Value_Bool + // *Value_Set + // *Value_Record + // *Value_Extension + // *Value_Entity + Value isValue_Value `protobuf_oneof:"value"` +} + +func (x *Value) Reset() { + *x = Value{} + if protoimpl.UnsafeEnabled { + mi := &file_cedar_v3_value_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Value) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Value) ProtoMessage() {} + +func (x *Value) ProtoReflect() protoreflect.Message { + mi := &file_cedar_v3_value_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Value.ProtoReflect.Descriptor instead. +func (*Value) Descriptor() ([]byte, []int) { + return file_cedar_v3_value_proto_rawDescGZIP(), []int{0} +} + +func (m *Value) GetValue() isValue_Value { + if m != nil { + return m.Value + } + return nil +} + +func (x *Value) GetString_() string { + if x, ok := x.GetValue().(*Value_String_); ok { + return x.String_ + } + return "" +} + +func (x *Value) GetLong() int64 { + if x, ok := x.GetValue().(*Value_Long); ok { + return x.Long + } + return 0 +} + +func (x *Value) GetBool() bool { + if x, ok := x.GetValue().(*Value_Bool); ok { + return x.Bool + } + return false +} + +func (x *Value) GetSet() *SetValue { + if x, ok := x.GetValue().(*Value_Set); ok { + return x.Set + } + return nil +} + +func (x *Value) GetRecord() *RecordValue { + if x, ok := x.GetValue().(*Value_Record); ok { + return x.Record + } + return nil +} + +func (x *Value) GetExtension() *ExtensionValue { + if x, ok := x.GetValue().(*Value_Extension); ok { + return x.Extension + } + return nil +} + +func (x *Value) GetEntity() *EntityValue { + if x, ok := x.GetValue().(*Value_Entity); ok { + return x.Entity + } + return nil +} + +type isValue_Value interface { + isValue_Value() +} + +type Value_String_ struct { + String_ string `protobuf:"bytes,1,opt,name=string,proto3,oneof"` +} + +type Value_Long struct { + Long int64 `protobuf:"varint,2,opt,name=long,proto3,oneof"` +} + +type Value_Bool struct { + Bool bool `protobuf:"varint,3,opt,name=bool,proto3,oneof"` +} + +type Value_Set struct { + Set *SetValue `protobuf:"bytes,4,opt,name=set,proto3,oneof"` +} + +type Value_Record struct { + Record *RecordValue `protobuf:"bytes,5,opt,name=record,proto3,oneof"` +} + +type Value_Extension struct { + Extension *ExtensionValue `protobuf:"bytes,6,opt,name=extension,proto3,oneof"` +} + +type Value_Entity struct { + Entity *EntityValue `protobuf:"bytes,7,opt,name=entity,proto3,oneof"` +} + +func (*Value_String_) isValue_Value() {} + +func (*Value_Long) isValue_Value() {} + +func (*Value_Bool) isValue_Value() {} + +func (*Value_Set) isValue_Value() {} + +func (*Value_Record) isValue_Value() {} + +func (*Value_Extension) isValue_Value() {} + +func (*Value_Entity) isValue_Value() {} + +type SetValue struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Values []*Value `protobuf:"bytes,1,rep,name=values,proto3" json:"values,omitempty"` +} + +func (x *SetValue) Reset() { + *x = SetValue{} + if protoimpl.UnsafeEnabled { + mi := &file_cedar_v3_value_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SetValue) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SetValue) ProtoMessage() {} + +func (x *SetValue) ProtoReflect() protoreflect.Message { + mi := &file_cedar_v3_value_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SetValue.ProtoReflect.Descriptor instead. +func (*SetValue) Descriptor() ([]byte, []int) { + return file_cedar_v3_value_proto_rawDescGZIP(), []int{1} +} + +func (x *SetValue) GetValues() []*Value { + if x != nil { + return x.Values + } + return nil +} + +type RecordValue struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Values map[string]*Value `protobuf:"bytes,1,rep,name=values,proto3" json:"values,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` +} + +func (x *RecordValue) Reset() { + *x = RecordValue{} + if protoimpl.UnsafeEnabled { + mi := &file_cedar_v3_value_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RecordValue) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RecordValue) ProtoMessage() {} + +func (x *RecordValue) ProtoReflect() protoreflect.Message { + mi := &file_cedar_v3_value_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RecordValue.ProtoReflect.Descriptor instead. +func (*RecordValue) Descriptor() ([]byte, []int) { + return file_cedar_v3_value_proto_rawDescGZIP(), []int{2} +} + +func (x *RecordValue) GetValues() map[string]*Value { + if x != nil { + return x.Values + } + return nil +} + +type ExtensionValue struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Fn string `protobuf:"bytes,1,opt,name=fn,proto3" json:"fn,omitempty"` + Arg *Value `protobuf:"bytes,2,opt,name=arg,proto3" json:"arg,omitempty"` +} + +func (x *ExtensionValue) Reset() { + *x = ExtensionValue{} + if protoimpl.UnsafeEnabled { + mi := &file_cedar_v3_value_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ExtensionValue) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ExtensionValue) ProtoMessage() {} + +func (x *ExtensionValue) ProtoReflect() protoreflect.Message { + mi := &file_cedar_v3_value_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ExtensionValue.ProtoReflect.Descriptor instead. +func (*ExtensionValue) Descriptor() ([]byte, []int) { + return file_cedar_v3_value_proto_rawDescGZIP(), []int{3} +} + +func (x *ExtensionValue) GetFn() string { + if x != nil { + return x.Fn + } + return "" +} + +func (x *ExtensionValue) GetArg() *Value { + if x != nil { + return x.Arg + } + return nil +} + +type EntityValue struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Uid *EntityId `protobuf:"bytes,1,opt,name=uid,proto3" json:"uid,omitempty"` +} + +func (x *EntityValue) Reset() { + *x = EntityValue{} + if protoimpl.UnsafeEnabled { + mi := &file_cedar_v3_value_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EntityValue) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EntityValue) ProtoMessage() {} + +func (x *EntityValue) ProtoReflect() protoreflect.Message { + mi := &file_cedar_v3_value_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use EntityValue.ProtoReflect.Descriptor instead. +func (*EntityValue) Descriptor() ([]byte, []int) { + return file_cedar_v3_value_proto_rawDescGZIP(), []int{4} +} + +func (x *EntityValue) GetUid() *EntityId { + if x != nil { + return x.Uid + } + return nil +} + +var File_cedar_v3_value_proto protoreflect.FileDescriptor + +var file_cedar_v3_value_proto_rawDesc = []byte{ + 0x0a, 0x14, 0x63, 0x65, 0x64, 0x61, 0x72, 0x2f, 0x76, 0x33, 0x2f, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x08, 0x63, 0x65, 0x64, 0x61, 0x72, 0x2e, 0x76, 0x33, + 0x1a, 0x18, 0x63, 0x65, 0x64, 0x61, 0x72, 0x2f, 0x76, 0x33, 0x2f, 0x65, 0x6e, 0x74, 0x69, 0x74, + 0x79, 0x5f, 0x69, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x9a, 0x02, 0x0a, 0x05, 0x56, + 0x61, 0x6c, 0x75, 0x65, 0x12, 0x18, 0x0a, 0x06, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x06, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x12, 0x14, + 0x0a, 0x04, 0x6c, 0x6f, 0x6e, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x48, 0x00, 0x52, 0x04, + 0x6c, 0x6f, 0x6e, 0x67, 0x12, 0x14, 0x0a, 0x04, 0x62, 0x6f, 0x6f, 0x6c, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x08, 0x48, 0x00, 0x52, 0x04, 0x62, 0x6f, 0x6f, 0x6c, 0x12, 0x26, 0x0a, 0x03, 0x73, 0x65, + 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x63, 0x65, 0x64, 0x61, 0x72, 0x2e, + 0x76, 0x33, 0x2e, 0x53, 0x65, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x48, 0x00, 0x52, 0x03, 0x73, + 0x65, 0x74, 0x12, 0x2f, 0x0a, 0x06, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x18, 0x05, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x63, 0x65, 0x64, 0x61, 0x72, 0x2e, 0x76, 0x33, 0x2e, 0x52, 0x65, + 0x63, 0x6f, 0x72, 0x64, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x48, 0x00, 0x52, 0x06, 0x72, 0x65, 0x63, + 0x6f, 0x72, 0x64, 0x12, 0x38, 0x0a, 0x09, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, + 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x63, 0x65, 0x64, 0x61, 0x72, 0x2e, 0x76, + 0x33, 0x2e, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x56, 0x61, 0x6c, 0x75, 0x65, + 0x48, 0x00, 0x52, 0x09, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x2f, 0x0a, + 0x06, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, + 0x63, 0x65, 0x64, 0x61, 0x72, 0x2e, 0x76, 0x33, 0x2e, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x56, + 0x61, 0x6c, 0x75, 0x65, 0x48, 0x00, 0x52, 0x06, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x42, 0x07, + 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x33, 0x0a, 0x08, 0x53, 0x65, 0x74, 0x56, 0x61, + 0x6c, 0x75, 0x65, 0x12, 0x27, 0x0a, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x01, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x63, 0x65, 0x64, 0x61, 0x72, 0x2e, 0x76, 0x33, 0x2e, 0x56, + 0x61, 0x6c, 0x75, 0x65, 0x52, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x22, 0x94, 0x01, 0x0a, + 0x0b, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x39, 0x0a, 0x06, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x63, + 0x65, 0x64, 0x61, 0x72, 0x2e, 0x76, 0x33, 0x2e, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x56, 0x61, + 0x6c, 0x75, 0x65, 0x2e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, + 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x1a, 0x4a, 0x0a, 0x0b, 0x56, 0x61, 0x6c, 0x75, 0x65, + 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, 0x25, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x63, 0x65, 0x64, 0x61, 0x72, 0x2e, + 0x76, 0x33, 0x2e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, + 0x02, 0x38, 0x01, 0x22, 0x43, 0x0a, 0x0e, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, + 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x66, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x02, 0x66, 0x6e, 0x12, 0x21, 0x0a, 0x03, 0x61, 0x72, 0x67, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x63, 0x65, 0x64, 0x61, 0x72, 0x2e, 0x76, 0x33, 0x2e, 0x56, 0x61, + 0x6c, 0x75, 0x65, 0x52, 0x03, 0x61, 0x72, 0x67, 0x22, 0x33, 0x0a, 0x0b, 0x45, 0x6e, 0x74, 0x69, + 0x74, 0x79, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x24, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x63, 0x65, 0x64, 0x61, 0x72, 0x2e, 0x76, 0x33, 0x2e, + 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x49, 0x64, 0x52, 0x03, 0x75, 0x69, 0x64, 0x42, 0x92, 0x01, + 0x0a, 0x0c, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x65, 0x64, 0x61, 0x72, 0x2e, 0x76, 0x33, 0x42, 0x0a, + 0x56, 0x61, 0x6c, 0x75, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x35, 0x67, 0x69, + 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x65, 0x6c, 0x65, 0x73, 0x74, 0x2d, + 0x64, 0x65, 0x76, 0x2f, 0x63, 0x6f, 0x72, 0x6b, 0x73, 0x2f, 0x67, 0x6f, 0x2f, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x2f, 0x63, 0x65, 0x64, 0x61, 0x72, 0x2f, 0x76, 0x33, 0x3b, 0x63, 0x65, 0x64, 0x61, + 0x72, 0x70, 0x62, 0xa2, 0x02, 0x03, 0x43, 0x58, 0x58, 0xaa, 0x02, 0x08, 0x43, 0x65, 0x64, 0x61, + 0x72, 0x2e, 0x56, 0x33, 0xca, 0x02, 0x08, 0x43, 0x65, 0x64, 0x61, 0x72, 0x5c, 0x56, 0x33, 0xe2, + 0x02, 0x14, 0x43, 0x65, 0x64, 0x61, 0x72, 0x5c, 0x56, 0x33, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, + 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x09, 0x43, 0x65, 0x64, 0x61, 0x72, 0x3a, 0x3a, + 0x56, 0x33, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_cedar_v3_value_proto_rawDescOnce sync.Once + file_cedar_v3_value_proto_rawDescData = file_cedar_v3_value_proto_rawDesc +) + +func file_cedar_v3_value_proto_rawDescGZIP() []byte { + file_cedar_v3_value_proto_rawDescOnce.Do(func() { + file_cedar_v3_value_proto_rawDescData = protoimpl.X.CompressGZIP(file_cedar_v3_value_proto_rawDescData) + }) + return file_cedar_v3_value_proto_rawDescData +} + +var file_cedar_v3_value_proto_msgTypes = make([]protoimpl.MessageInfo, 6) +var file_cedar_v3_value_proto_goTypes = []any{ + (*Value)(nil), // 0: cedar.v3.Value + (*SetValue)(nil), // 1: cedar.v3.SetValue + (*RecordValue)(nil), // 2: cedar.v3.RecordValue + (*ExtensionValue)(nil), // 3: cedar.v3.ExtensionValue + (*EntityValue)(nil), // 4: cedar.v3.EntityValue + nil, // 5: cedar.v3.RecordValue.ValuesEntry + (*EntityId)(nil), // 6: cedar.v3.EntityId +} +var file_cedar_v3_value_proto_depIdxs = []int32{ + 1, // 0: cedar.v3.Value.set:type_name -> cedar.v3.SetValue + 2, // 1: cedar.v3.Value.record:type_name -> cedar.v3.RecordValue + 3, // 2: cedar.v3.Value.extension:type_name -> cedar.v3.ExtensionValue + 4, // 3: cedar.v3.Value.entity:type_name -> cedar.v3.EntityValue + 0, // 4: cedar.v3.SetValue.values:type_name -> cedar.v3.Value + 5, // 5: cedar.v3.RecordValue.values:type_name -> cedar.v3.RecordValue.ValuesEntry + 0, // 6: cedar.v3.ExtensionValue.arg:type_name -> cedar.v3.Value + 6, // 7: cedar.v3.EntityValue.uid:type_name -> cedar.v3.EntityId + 0, // 8: cedar.v3.RecordValue.ValuesEntry.value:type_name -> cedar.v3.Value + 9, // [9:9] is the sub-list for method output_type + 9, // [9:9] is the sub-list for method input_type + 9, // [9:9] is the sub-list for extension type_name + 9, // [9:9] is the sub-list for extension extendee + 0, // [0:9] is the sub-list for field type_name +} + +func init() { file_cedar_v3_value_proto_init() } +func file_cedar_v3_value_proto_init() { + if File_cedar_v3_value_proto != nil { + return + } + file_cedar_v3_entity_id_proto_init() + if !protoimpl.UnsafeEnabled { + file_cedar_v3_value_proto_msgTypes[0].Exporter = func(v any, i int) any { + switch v := v.(*Value); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cedar_v3_value_proto_msgTypes[1].Exporter = func(v any, i int) any { + switch v := v.(*SetValue); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cedar_v3_value_proto_msgTypes[2].Exporter = func(v any, i int) any { + switch v := v.(*RecordValue); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cedar_v3_value_proto_msgTypes[3].Exporter = func(v any, i int) any { + switch v := v.(*ExtensionValue); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cedar_v3_value_proto_msgTypes[4].Exporter = func(v any, i int) any { + switch v := v.(*EntityValue); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_cedar_v3_value_proto_msgTypes[0].OneofWrappers = []any{ + (*Value_String_)(nil), + (*Value_Long)(nil), + (*Value_Bool)(nil), + (*Value_Set)(nil), + (*Value_Record)(nil), + (*Value_Extension)(nil), + (*Value_Entity)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_cedar_v3_value_proto_rawDesc, + NumEnums: 0, + NumMessages: 6, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_cedar_v3_value_proto_goTypes, + DependencyIndexes: file_cedar_v3_value_proto_depIdxs, + MessageInfos: file_cedar_v3_value_proto_msgTypes, + }.Build() + File_cedar_v3_value_proto = out.File + file_cedar_v3_value_proto_rawDesc = nil + file_cedar_v3_value_proto_goTypes = nil + file_cedar_v3_value_proto_depIdxs = nil +} diff --git a/go/proto/corks/v1/cork.pb.go b/go/proto/corks/v1/cork.pb.go new file mode 100644 index 0000000..5fc0dde --- /dev/null +++ b/go/proto/corks/v1/cork.pb.go @@ -0,0 +1,273 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.34.2 +// protoc (unknown) +// source: corks/v1/cork.proto + +package corkspb + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + anypb "google.golang.org/protobuf/types/known/anypb" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type Cork struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id []byte `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + KeyId []byte `protobuf:"bytes,2,opt,name=key_id,json=keyId,proto3" json:"key_id,omitempty"` + Bearer *SignedBlock `protobuf:"bytes,3,opt,name=bearer,proto3,oneof" json:"bearer,omitempty"` + Caveats []*SignedBlock `protobuf:"bytes,4,rep,name=caveats,proto3" json:"caveats,omitempty"` + Signature []byte `protobuf:"bytes,5,opt,name=signature,proto3" json:"signature,omitempty"` +} + +func (x *Cork) Reset() { + *x = Cork{} + if protoimpl.UnsafeEnabled { + mi := &file_corks_v1_cork_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Cork) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Cork) ProtoMessage() {} + +func (x *Cork) ProtoReflect() protoreflect.Message { + mi := &file_corks_v1_cork_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Cork.ProtoReflect.Descriptor instead. +func (*Cork) Descriptor() ([]byte, []int) { + return file_corks_v1_cork_proto_rawDescGZIP(), []int{0} +} + +func (x *Cork) GetId() []byte { + if x != nil { + return x.Id + } + return nil +} + +func (x *Cork) GetKeyId() []byte { + if x != nil { + return x.KeyId + } + return nil +} + +func (x *Cork) GetBearer() *SignedBlock { + if x != nil { + return x.Bearer + } + return nil +} + +func (x *Cork) GetCaveats() []*SignedBlock { + if x != nil { + return x.Caveats + } + return nil +} + +func (x *Cork) GetSignature() []byte { + if x != nil { + return x.Signature + } + return nil +} + +type SignedBlock struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Block *anypb.Any `protobuf:"bytes,1,opt,name=block,proto3" json:"block,omitempty"` + Signature []byte `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"` +} + +func (x *SignedBlock) Reset() { + *x = SignedBlock{} + if protoimpl.UnsafeEnabled { + mi := &file_corks_v1_cork_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SignedBlock) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SignedBlock) ProtoMessage() {} + +func (x *SignedBlock) ProtoReflect() protoreflect.Message { + mi := &file_corks_v1_cork_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SignedBlock.ProtoReflect.Descriptor instead. +func (*SignedBlock) Descriptor() ([]byte, []int) { + return file_corks_v1_cork_proto_rawDescGZIP(), []int{1} +} + +func (x *SignedBlock) GetBlock() *anypb.Any { + if x != nil { + return x.Block + } + return nil +} + +func (x *SignedBlock) GetSignature() []byte { + if x != nil { + return x.Signature + } + return nil +} + +var File_corks_v1_cork_proto protoreflect.FileDescriptor + +var file_corks_v1_cork_proto_rawDesc = []byte{ + 0x0a, 0x13, 0x63, 0x6f, 0x72, 0x6b, 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x72, 0x6b, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x08, 0x63, 0x6f, 0x72, 0x6b, 0x73, 0x2e, 0x76, 0x31, 0x1a, + 0x19, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2f, 0x61, 0x6e, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xbb, 0x01, 0x0a, 0x04, 0x43, + 0x6f, 0x72, 0x6b, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, + 0x02, 0x69, 0x64, 0x12, 0x15, 0x0a, 0x06, 0x6b, 0x65, 0x79, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0c, 0x52, 0x05, 0x6b, 0x65, 0x79, 0x49, 0x64, 0x12, 0x32, 0x0a, 0x06, 0x62, 0x65, + 0x61, 0x72, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x63, 0x6f, 0x72, + 0x6b, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x6c, 0x6f, 0x63, + 0x6b, 0x48, 0x00, 0x52, 0x06, 0x62, 0x65, 0x61, 0x72, 0x65, 0x72, 0x88, 0x01, 0x01, 0x12, 0x2f, + 0x0a, 0x07, 0x63, 0x61, 0x76, 0x65, 0x61, 0x74, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x15, 0x2e, 0x63, 0x6f, 0x72, 0x6b, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, + 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x07, 0x63, 0x61, 0x76, 0x65, 0x61, 0x74, 0x73, 0x12, + 0x1c, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x05, 0x20, 0x01, + 0x28, 0x0c, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x42, 0x09, 0x0a, + 0x07, 0x5f, 0x62, 0x65, 0x61, 0x72, 0x65, 0x72, 0x22, 0x57, 0x0a, 0x0b, 0x53, 0x69, 0x67, 0x6e, + 0x65, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x2a, 0x0a, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x05, 0x62, 0x6c, + 0x6f, 0x63, 0x6b, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, + 0x65, 0x42, 0x91, 0x01, 0x0a, 0x0c, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x72, 0x6b, 0x73, 0x2e, + 0x76, 0x31, 0x42, 0x09, 0x43, 0x6f, 0x72, 0x6b, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, + 0x35, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x65, 0x6c, 0x65, + 0x73, 0x74, 0x2d, 0x64, 0x65, 0x76, 0x2f, 0x63, 0x6f, 0x72, 0x6b, 0x73, 0x2f, 0x67, 0x6f, 0x2f, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x63, 0x6f, 0x72, 0x6b, 0x73, 0x2f, 0x76, 0x31, 0x3b, 0x63, + 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x62, 0xa2, 0x02, 0x03, 0x43, 0x58, 0x58, 0xaa, 0x02, 0x08, 0x43, + 0x6f, 0x72, 0x6b, 0x73, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x08, 0x43, 0x6f, 0x72, 0x6b, 0x73, 0x5c, + 0x56, 0x31, 0xe2, 0x02, 0x14, 0x43, 0x6f, 0x72, 0x6b, 0x73, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, + 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x09, 0x43, 0x6f, 0x72, 0x6b, + 0x73, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_corks_v1_cork_proto_rawDescOnce sync.Once + file_corks_v1_cork_proto_rawDescData = file_corks_v1_cork_proto_rawDesc +) + +func file_corks_v1_cork_proto_rawDescGZIP() []byte { + file_corks_v1_cork_proto_rawDescOnce.Do(func() { + file_corks_v1_cork_proto_rawDescData = protoimpl.X.CompressGZIP(file_corks_v1_cork_proto_rawDescData) + }) + return file_corks_v1_cork_proto_rawDescData +} + +var file_corks_v1_cork_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_corks_v1_cork_proto_goTypes = []any{ + (*Cork)(nil), // 0: corks.v1.Cork + (*SignedBlock)(nil), // 1: corks.v1.SignedBlock + (*anypb.Any)(nil), // 2: google.protobuf.Any +} +var file_corks_v1_cork_proto_depIdxs = []int32{ + 1, // 0: corks.v1.Cork.bearer:type_name -> corks.v1.SignedBlock + 1, // 1: corks.v1.Cork.caveats:type_name -> corks.v1.SignedBlock + 2, // 2: corks.v1.SignedBlock.block:type_name -> google.protobuf.Any + 3, // [3:3] is the sub-list for method output_type + 3, // [3:3] is the sub-list for method input_type + 3, // [3:3] is the sub-list for extension type_name + 3, // [3:3] is the sub-list for extension extendee + 0, // [0:3] is the sub-list for field type_name +} + +func init() { file_corks_v1_cork_proto_init() } +func file_corks_v1_cork_proto_init() { + if File_corks_v1_cork_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_corks_v1_cork_proto_msgTypes[0].Exporter = func(v any, i int) any { + switch v := v.(*Cork); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_corks_v1_cork_proto_msgTypes[1].Exporter = func(v any, i int) any { + switch v := v.(*SignedBlock); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_corks_v1_cork_proto_msgTypes[0].OneofWrappers = []any{} + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_corks_v1_cork_proto_rawDesc, + NumEnums: 0, + NumMessages: 2, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_corks_v1_cork_proto_goTypes, + DependencyIndexes: file_corks_v1_cork_proto_depIdxs, + MessageInfos: file_corks_v1_cork_proto_msgTypes, + }.Build() + File_corks_v1_cork_proto = out.File + file_corks_v1_cork_proto_rawDesc = nil + file_corks_v1_cork_proto_goTypes = nil + file_corks_v1_cork_proto_depIdxs = nil +} diff --git a/go/proto/dart/dart_options.pb.go b/go/proto/dart/dart_options.pb.go new file mode 100644 index 0000000..dc094de --- /dev/null +++ b/go/proto/dart/dart_options.pb.go @@ -0,0 +1,427 @@ +// Experimental options controlling Dart code generation. + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.34.2 +// protoc (unknown) +// source: dart/dart_options.proto + +package dartoptionspb + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + descriptorpb "google.golang.org/protobuf/types/descriptorpb" + _ "google.golang.org/protobuf/types/pluginpb" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// A mixin that can be used in the 'with' clause of the generated Dart class +// for a proto message. +type DartMixin struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The name of the mixin class. + Name *string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // A URI pointing to the Dart library that defines the mixin. + // The generated Dart code will use this in an import statement. + ImportFrom *string `protobuf:"bytes,2,opt,name=import_from,json=importFrom" json:"import_from,omitempty"` + // The name of another mixin to be applied ahead of this one. + // The generated class for the message will inherit from all mixins + // in the parent chain. + Parent *string `protobuf:"bytes,3,opt,name=parent" json:"parent,omitempty"` +} + +func (x *DartMixin) Reset() { + *x = DartMixin{} + if protoimpl.UnsafeEnabled { + mi := &file_dart_dart_options_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DartMixin) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DartMixin) ProtoMessage() {} + +func (x *DartMixin) ProtoReflect() protoreflect.Message { + mi := &file_dart_dart_options_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DartMixin.ProtoReflect.Descriptor instead. +func (*DartMixin) Descriptor() ([]byte, []int) { + return file_dart_dart_options_proto_rawDescGZIP(), []int{0} +} + +func (x *DartMixin) GetName() string { + if x != nil && x.Name != nil { + return *x.Name + } + return "" +} + +func (x *DartMixin) GetImportFrom() string { + if x != nil && x.ImportFrom != nil { + return *x.ImportFrom + } + return "" +} + +func (x *DartMixin) GetParent() string { + if x != nil && x.Parent != nil { + return *x.Parent + } + return "" +} + +// Defines additional Dart imports to be used with messages in this file. +type Imports struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Mixins to be used on messages in this file. + // These mixins are in addition to internally defined mixins (e.g PbMapMixin) + // and may override them. + // + // Warning: mixins are experimental. The protoc Dart plugin doesn't check + // for name conflicts between mixin class members and generated class members, + // so the generated code may contain errors. Therefore, running dartanalyzer + // on the generated file is a good idea. + Mixins []*DartMixin `protobuf:"bytes,1,rep,name=mixins" json:"mixins,omitempty"` +} + +func (x *Imports) Reset() { + *x = Imports{} + if protoimpl.UnsafeEnabled { + mi := &file_dart_dart_options_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Imports) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Imports) ProtoMessage() {} + +func (x *Imports) ProtoReflect() protoreflect.Message { + mi := &file_dart_dart_options_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Imports.ProtoReflect.Descriptor instead. +func (*Imports) Descriptor() ([]byte, []int) { + return file_dart_dart_options_proto_rawDescGZIP(), []int{1} +} + +func (x *Imports) GetMixins() []*DartMixin { + if x != nil { + return x.Mixins + } + return nil +} + +var file_dart_dart_options_proto_extTypes = []protoimpl.ExtensionInfo{ + { + ExtendedType: (*descriptorpb.FileOptions)(nil), + ExtensionType: (*Imports)(nil), + Field: 28125061, + Name: "dart_options.imports", + Tag: "bytes,28125061,opt,name=imports", + Filename: "dart/dart_options.proto", + }, + { + ExtendedType: (*descriptorpb.FileOptions)(nil), + ExtensionType: (*string)(nil), + Field: 96128839, + Name: "dart_options.default_mixin", + Tag: "bytes,96128839,opt,name=default_mixin", + Filename: "dart/dart_options.proto", + }, + { + ExtendedType: (*descriptorpb.MessageOptions)(nil), + ExtensionType: (*string)(nil), + Field: 96128839, + Name: "dart_options.mixin", + Tag: "bytes,96128839,opt,name=mixin", + Filename: "dart/dart_options.proto", + }, + { + ExtendedType: (*descriptorpb.FieldOptions)(nil), + ExtensionType: (*bool)(nil), + Field: 28205290, + Name: "dart_options.override_getter", + Tag: "varint,28205290,opt,name=override_getter", + Filename: "dart/dart_options.proto", + }, + { + ExtendedType: (*descriptorpb.FieldOptions)(nil), + ExtensionType: (*bool)(nil), + Field: 28937366, + Name: "dart_options.override_setter", + Tag: "varint,28937366,opt,name=override_setter", + Filename: "dart/dart_options.proto", + }, + { + ExtendedType: (*descriptorpb.FieldOptions)(nil), + ExtensionType: (*bool)(nil), + Field: 28937461, + Name: "dart_options.override_has_method", + Tag: "varint,28937461,opt,name=override_has_method", + Filename: "dart/dart_options.proto", + }, + { + ExtendedType: (*descriptorpb.FieldOptions)(nil), + ExtensionType: (*bool)(nil), + Field: 28907907, + Name: "dart_options.override_clear_method", + Tag: "varint,28907907,opt,name=override_clear_method", + Filename: "dart/dart_options.proto", + }, + { + ExtendedType: (*descriptorpb.FieldOptions)(nil), + ExtensionType: (*string)(nil), + Field: 28700919, + Name: "dart_options.dart_name", + Tag: "bytes,28700919,opt,name=dart_name", + Filename: "dart/dart_options.proto", + }, +} + +// Extension fields to descriptorpb.FileOptions. +var ( + // optional dart_options.Imports imports = 28125061; + E_Imports = &file_dart_dart_options_proto_extTypes[0] + // Applies the named mixin to all messages in this file. + // (May be overridden by the "mixin" option on a message.) + // For now, "PbMapMixin" is the only available mixin. + // + // optional string default_mixin = 96128839; + E_DefaultMixin = &file_dart_dart_options_proto_extTypes[1] +) + +// Extension fields to descriptorpb.MessageOptions. +var ( + // Applies the named mixin. + // For now, "PbMapMixin" is the only available mixin. + // The empty string can be used to turn off mixins for this message. + // + // optional string mixin = 96128839; + E_Mixin = &file_dart_dart_options_proto_extTypes[2] +) + +// Extension fields to descriptorpb.FieldOptions. +var ( + // Adds @override annotation to the field's getter (for use with mixins). + // + // optional bool override_getter = 28205290; + E_OverrideGetter = &file_dart_dart_options_proto_extTypes[3] + // Adds @override annotation to the field's setter (for use with mixins). + // + // optional bool override_setter = 28937366; + E_OverrideSetter = &file_dart_dart_options_proto_extTypes[4] + // Adds @override annotation to the field's hasX() method (for use with + // mixins). + // + // optional bool override_has_method = 28937461; + E_OverrideHasMethod = &file_dart_dart_options_proto_extTypes[5] + // Adds @override annotation to the field's clearX() method (for use with + // mixins). + // + // optional bool override_clear_method = 28907907; + E_OverrideClearMethod = &file_dart_dart_options_proto_extTypes[6] + // Uses the given name for getters, setters and as suffixes for has/clear + // methods in the generated Dart file. Should be lowerCamelCase. + // + // optional string dart_name = 28700919; + E_DartName = &file_dart_dart_options_proto_extTypes[7] +) + +var File_dart_dart_options_proto protoreflect.FileDescriptor + +var file_dart_dart_options_proto_rawDesc = []byte{ + 0x0a, 0x17, 0x64, 0x61, 0x72, 0x74, 0x2f, 0x64, 0x61, 0x72, 0x74, 0x5f, 0x6f, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0c, 0x64, 0x61, 0x72, 0x74, 0x5f, + 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x1a, 0x20, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, + 0x74, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x70, 0x6c, 0x75, 0x67, 0x69, + 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x58, 0x0a, 0x09, 0x44, 0x61, 0x72, 0x74, 0x4d, + 0x69, 0x78, 0x69, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x69, 0x6d, 0x70, 0x6f, + 0x72, 0x74, 0x5f, 0x66, 0x72, 0x6f, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x69, + 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x46, 0x72, 0x6f, 0x6d, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x61, 0x72, + 0x65, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, + 0x74, 0x22, 0x3a, 0x0a, 0x07, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x73, 0x12, 0x2f, 0x0a, 0x06, + 0x6d, 0x69, 0x78, 0x69, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x64, + 0x61, 0x72, 0x74, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x44, 0x61, 0x72, 0x74, + 0x4d, 0x69, 0x78, 0x69, 0x6e, 0x52, 0x06, 0x6d, 0x69, 0x78, 0x69, 0x6e, 0x73, 0x3a, 0x50, 0x0a, + 0x07, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x73, 0x12, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x4f, + 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x85, 0xcf, 0xb4, 0x0d, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x15, 0x2e, 0x64, 0x61, 0x72, 0x74, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x49, + 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x73, 0x52, 0x07, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x73, 0x3a, + 0x44, 0x0a, 0x0d, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x6d, 0x69, 0x78, 0x69, 0x6e, + 0x12, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xc7, + 0x9e, 0xeb, 0x2d, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, + 0x4d, 0x69, 0x78, 0x69, 0x6e, 0x3a, 0x38, 0x0a, 0x05, 0x6d, 0x69, 0x78, 0x69, 0x6e, 0x12, 0x1f, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, + 0xc7, 0x9e, 0xeb, 0x2d, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6d, 0x69, 0x78, 0x69, 0x6e, 0x3a, + 0x49, 0x0a, 0x0f, 0x6f, 0x76, 0x65, 0x72, 0x72, 0x69, 0x64, 0x65, 0x5f, 0x67, 0x65, 0x74, 0x74, + 0x65, 0x72, 0x12, 0x1d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x18, 0xea, 0xc1, 0xb9, 0x0d, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0e, 0x6f, 0x76, 0x65, 0x72, + 0x72, 0x69, 0x64, 0x65, 0x47, 0x65, 0x74, 0x74, 0x65, 0x72, 0x3a, 0x49, 0x0a, 0x0f, 0x6f, 0x76, + 0x65, 0x72, 0x72, 0x69, 0x64, 0x65, 0x5f, 0x73, 0x65, 0x74, 0x74, 0x65, 0x72, 0x12, 0x1d, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, + 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x96, 0x99, 0xe6, + 0x0d, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0e, 0x6f, 0x76, 0x65, 0x72, 0x72, 0x69, 0x64, 0x65, 0x53, + 0x65, 0x74, 0x74, 0x65, 0x72, 0x3a, 0x50, 0x0a, 0x13, 0x6f, 0x76, 0x65, 0x72, 0x72, 0x69, 0x64, + 0x65, 0x5f, 0x68, 0x61, 0x73, 0x5f, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x12, 0x1d, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, + 0x69, 0x65, 0x6c, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xf5, 0x99, 0xe6, 0x0d, + 0x20, 0x01, 0x28, 0x08, 0x52, 0x11, 0x6f, 0x76, 0x65, 0x72, 0x72, 0x69, 0x64, 0x65, 0x48, 0x61, + 0x73, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x3a, 0x54, 0x0a, 0x15, 0x6f, 0x76, 0x65, 0x72, 0x72, + 0x69, 0x64, 0x65, 0x5f, 0x63, 0x6c, 0x65, 0x61, 0x72, 0x5f, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, + 0x12, 0x1d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, + 0x83, 0xb3, 0xe4, 0x0d, 0x20, 0x01, 0x28, 0x08, 0x52, 0x13, 0x6f, 0x76, 0x65, 0x72, 0x72, 0x69, + 0x64, 0x65, 0x43, 0x6c, 0x65, 0x61, 0x72, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x3a, 0x3d, 0x0a, + 0x09, 0x64, 0x61, 0x72, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1d, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, + 0x6c, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xf7, 0xe1, 0xd7, 0x0d, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x08, 0x64, 0x61, 0x72, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x42, 0xa9, 0x01, 0x0a, + 0x10, 0x63, 0x6f, 0x6d, 0x2e, 0x64, 0x61, 0x72, 0x74, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x42, 0x10, 0x44, 0x61, 0x72, 0x74, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x50, 0x72, + 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x37, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, + 0x6d, 0x2f, 0x63, 0x65, 0x6c, 0x65, 0x73, 0x74, 0x2d, 0x64, 0x65, 0x76, 0x2f, 0x63, 0x6f, 0x72, + 0x6b, 0x73, 0x2f, 0x67, 0x6f, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x64, 0x61, 0x72, 0x74, + 0x3b, 0x64, 0x61, 0x72, 0x74, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x70, 0x62, 0xa2, 0x02, + 0x03, 0x44, 0x58, 0x58, 0xaa, 0x02, 0x0b, 0x44, 0x61, 0x72, 0x74, 0x4f, 0x70, 0x74, 0x69, 0x6f, + 0x6e, 0x73, 0xca, 0x02, 0x0b, 0x44, 0x61, 0x72, 0x74, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0xe2, 0x02, 0x17, 0x44, 0x61, 0x72, 0x74, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x5c, 0x47, + 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0b, 0x44, 0x61, 0x72, + 0x74, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, +} + +var ( + file_dart_dart_options_proto_rawDescOnce sync.Once + file_dart_dart_options_proto_rawDescData = file_dart_dart_options_proto_rawDesc +) + +func file_dart_dart_options_proto_rawDescGZIP() []byte { + file_dart_dart_options_proto_rawDescOnce.Do(func() { + file_dart_dart_options_proto_rawDescData = protoimpl.X.CompressGZIP(file_dart_dart_options_proto_rawDescData) + }) + return file_dart_dart_options_proto_rawDescData +} + +var file_dart_dart_options_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_dart_dart_options_proto_goTypes = []any{ + (*DartMixin)(nil), // 0: dart_options.DartMixin + (*Imports)(nil), // 1: dart_options.Imports + (*descriptorpb.FileOptions)(nil), // 2: google.protobuf.FileOptions + (*descriptorpb.MessageOptions)(nil), // 3: google.protobuf.MessageOptions + (*descriptorpb.FieldOptions)(nil), // 4: google.protobuf.FieldOptions +} +var file_dart_dart_options_proto_depIdxs = []int32{ + 0, // 0: dart_options.Imports.mixins:type_name -> dart_options.DartMixin + 2, // 1: dart_options.imports:extendee -> google.protobuf.FileOptions + 2, // 2: dart_options.default_mixin:extendee -> google.protobuf.FileOptions + 3, // 3: dart_options.mixin:extendee -> google.protobuf.MessageOptions + 4, // 4: dart_options.override_getter:extendee -> google.protobuf.FieldOptions + 4, // 5: dart_options.override_setter:extendee -> google.protobuf.FieldOptions + 4, // 6: dart_options.override_has_method:extendee -> google.protobuf.FieldOptions + 4, // 7: dart_options.override_clear_method:extendee -> google.protobuf.FieldOptions + 4, // 8: dart_options.dart_name:extendee -> google.protobuf.FieldOptions + 1, // 9: dart_options.imports:type_name -> dart_options.Imports + 10, // [10:10] is the sub-list for method output_type + 10, // [10:10] is the sub-list for method input_type + 9, // [9:10] is the sub-list for extension type_name + 1, // [1:9] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +} + +func init() { file_dart_dart_options_proto_init() } +func file_dart_dart_options_proto_init() { + if File_dart_dart_options_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_dart_dart_options_proto_msgTypes[0].Exporter = func(v any, i int) any { + switch v := v.(*DartMixin); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_dart_dart_options_proto_msgTypes[1].Exporter = func(v any, i int) any { + switch v := v.(*Imports); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_dart_dart_options_proto_rawDesc, + NumEnums: 0, + NumMessages: 2, + NumExtensions: 8, + NumServices: 0, + }, + GoTypes: file_dart_dart_options_proto_goTypes, + DependencyIndexes: file_dart_dart_options_proto_depIdxs, + MessageInfos: file_dart_dart_options_proto_msgTypes, + ExtensionInfos: file_dart_dart_options_proto_extTypes, + }.Build() + File_dart_dart_options_proto = out.File + file_dart_dart_options_proto_rawDesc = nil + file_dart_dart_options_proto_goTypes = nil + file_dart_dart_options_proto_depIdxs = nil +} diff --git a/go/signer.go b/go/signer.go new file mode 100644 index 0000000..a42c6a3 --- /dev/null +++ b/go/signer.go @@ -0,0 +1,70 @@ +package corks + +import ( + "crypto/hmac" + "crypto/sha256" + "errors" + "hash" +) + +var ( + ErrSignerClosed = errors.New("signer closed") + ErrInvalidSignature = errors.New("invalid signature") +) + +type Signable interface { + Sign(signer Signer) (*SignedBlock, error) +} + +type Signer interface { + // KeyID returns the ID of the signing key. + KeyID() []byte + + // Sign signs the given block and returns the intermediate signature. + Sign(block []byte) ([]byte, error) + + // Close finalizes the block and returns its signature. + Close() ([]byte, error) +} + +type LocalSigner struct { + keyID []byte + hmac hash.Hash + + // closed indicates whether the signer has been closed. + // + // The signer can only be used to sign blocks before it is closed. + closed bool +} + +func NewLocalSigner(keyID []byte, secretKey []byte) *LocalSigner { + return &LocalSigner{ + keyID: keyID, + hmac: hmac.New(sha256.New, secretKey), + } +} + +var _ Signer = (*LocalSigner)(nil) + +func (s *LocalSigner) KeyID() []byte { + return s.keyID +} + +func (s *LocalSigner) Sign(data []byte) ([]byte, error) { + if s.closed { + return nil, ErrSignerClosed + } + _, err := s.hmac.Write(data) + if err != nil { + return nil, err + } + return s.hmac.Sum(nil), nil +} + +func (s *LocalSigner) Close() ([]byte, error) { + if s.closed { + return nil, ErrSignerClosed + } + s.closed = true + return s.hmac.Sum(nil), nil +} diff --git a/proto/buf.gen.yaml b/proto/buf.gen.yaml deleted file mode 100644 index 0618fbf..0000000 --- a/proto/buf.gen.yaml +++ /dev/null @@ -1,6 +0,0 @@ -version: v1 -managed: - enabled: true -plugins: - - plugin: buf.build/protocolbuffers/dart:v21.1.2 - out: ../dart/lib/src/proto diff --git a/proto/buf.yaml b/proto/buf.yaml deleted file mode 100644 index 1e8b5e0..0000000 --- a/proto/buf.yaml +++ /dev/null @@ -1,10 +0,0 @@ -version: v1 -breaking: - use: - - FILE -lint: - use: - - DEFAULT - ignore: - - dart - - google diff --git a/proto/cedar/v3/context.proto b/proto/cedar/v3/context.proto index b217e0a..40a02d0 100644 --- a/proto/cedar/v3/context.proto +++ b/proto/cedar/v3/context.proto @@ -4,6 +4,8 @@ package cedar.v3; import "cedar/v3/value.proto"; +option go_package = "github.com/celest-dev/corks/go/proto/cedar/v3;cedarpb"; + message Context { map values = 1; } diff --git a/proto/cedar/v3/entity.proto b/proto/cedar/v3/entity.proto index 8e3c614..21d49ad 100644 --- a/proto/cedar/v3/entity.proto +++ b/proto/cedar/v3/entity.proto @@ -5,6 +5,8 @@ package cedar.v3; import "cedar/v3/entity_id.proto"; import "cedar/v3/value.proto"; +option go_package = "github.com/celest-dev/corks/go/proto/cedar/v3;cedarpb"; + message Entity { EntityId uid = 1; repeated EntityId parents = 2; diff --git a/proto/cedar/v3/entity_id.proto b/proto/cedar/v3/entity_id.proto index d807b16..48e2bdb 100644 --- a/proto/cedar/v3/entity_id.proto +++ b/proto/cedar/v3/entity_id.proto @@ -2,6 +2,8 @@ syntax = "proto3"; package cedar.v3; +option go_package = "github.com/celest-dev/corks/go/proto/cedar/v3;cedarpb"; + message EntityId { string type = 1; string id = 2; diff --git a/proto/cedar/v3/expr.proto b/proto/cedar/v3/expr.proto index 02a44f2..b97439f 100644 --- a/proto/cedar/v3/expr.proto +++ b/proto/cedar/v3/expr.proto @@ -5,6 +5,8 @@ package cedar.v3; import "cedar/v3/value.proto"; import "dart/dart_options.proto"; +option go_package = "github.com/celest-dev/corks/go/proto/cedar/v3;cedarpb"; + message Expr { oneof expr { ExprValue value = 1; diff --git a/proto/cedar/v3/policy.proto b/proto/cedar/v3/policy.proto index a80b43a..c03e909 100644 --- a/proto/cedar/v3/policy.proto +++ b/proto/cedar/v3/policy.proto @@ -5,6 +5,8 @@ package cedar.v3; import "cedar/v3/entity_id.proto"; import "cedar/v3/expr.proto"; +option go_package = "github.com/celest-dev/corks/go/proto/cedar/v3;cedarpb"; + enum PolicyEffect { POLICY_EFFECT_UNSPECIFIED = 0; POLICY_EFFECT_PERMIT = 1; diff --git a/proto/cedar/v3/value.proto b/proto/cedar/v3/value.proto index aa6bcf3..f02c0a5 100644 --- a/proto/cedar/v3/value.proto +++ b/proto/cedar/v3/value.proto @@ -4,6 +4,8 @@ package cedar.v3; import "cedar/v3/entity_id.proto"; +option go_package = "github.com/celest-dev/corks/go/proto/cedar/v3;cedarpb"; + message Value { oneof value { string string = 1; diff --git a/proto/corks/v1/cork.proto b/proto/corks/v1/cork.proto index 8d8d1c4..cf12271 100644 --- a/proto/corks/v1/cork.proto +++ b/proto/corks/v1/cork.proto @@ -2,6 +2,10 @@ syntax = "proto3"; package corks.v1; +import "google/protobuf/any.proto"; + +option go_package = "github.com/celest-dev/corks/go/proto/corks/v1;corkspb"; + message Cork { bytes id = 1; bytes key_id = 2; @@ -11,7 +15,6 @@ message Cork { } message SignedBlock { - bytes block = 1; - bytes type_url = 2; - bytes signature = 3; + google.protobuf.Any block = 1; + bytes signature = 2; } diff --git a/proto/dart/dart_options.proto b/third_party/dart/dart_options.proto similarity index 100% rename from proto/dart/dart_options.proto rename to third_party/dart/dart_options.proto diff --git a/proto/google/protobuf/README.md b/third_party/google/protobuf/README.md similarity index 100% rename from proto/google/protobuf/README.md rename to third_party/google/protobuf/README.md diff --git a/proto/google/protobuf/any.proto b/third_party/google/protobuf/any.proto similarity index 100% rename from proto/google/protobuf/any.proto rename to third_party/google/protobuf/any.proto diff --git a/proto/google/protobuf/descriptor.proto b/third_party/google/protobuf/descriptor.proto similarity index 100% rename from proto/google/protobuf/descriptor.proto rename to third_party/google/protobuf/descriptor.proto diff --git a/proto/google/protobuf/duration.proto b/third_party/google/protobuf/duration.proto similarity index 100% rename from proto/google/protobuf/duration.proto rename to third_party/google/protobuf/duration.proto diff --git a/proto/google/protobuf/plugin.proto b/third_party/google/protobuf/plugin.proto similarity index 100% rename from proto/google/protobuf/plugin.proto rename to third_party/google/protobuf/plugin.proto diff --git a/proto/google/protobuf/timestamp.proto b/third_party/google/protobuf/timestamp.proto similarity index 100% rename from proto/google/protobuf/timestamp.proto rename to third_party/google/protobuf/timestamp.proto