diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 67169206..321e9f81 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -38,16 +38,15 @@ jobs: python-version: ${{ matrix.python-version }} cache: "pip" - - uses: bufbuild/buf-action@v1 - with: - github_token: ${{ github.token }} - setup_only: true - - name: Install hatch run: pip install hatch + - name: Building first to generate files + run: hatch build + working-directory: ${{ matrix.package }} + - name: Test with pytest - run: hatch run cov + run: hatch test -c working-directory: ${{ matrix.package }} - if: matrix.python-version == '3.11' diff --git a/.gitmodules b/.gitmodules index fe96453f..466f2596 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,9 +1,9 @@ [submodule "schemas"] - path = providers/openfeature-provider-flagd/schemas + path = providers/openfeature-provider-flagd/openfeature/schemas url = https://github.com/open-feature/schemas [submodule "providers/openfeature-provider-flagd/test-harness"] - path = providers/openfeature-provider-flagd/test-harness + path = providers/openfeature-provider-flagd/openfeature/test-harness url = git@github.com:open-feature/flagd-testbed.git [submodule "providers/openfeature-provider-flagd/spec"] - path = providers/openfeature-provider-flagd/spec + path = providers/openfeature-provider-flagd/openfeature/spec url = https://github.com/open-feature/spec diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 3f9c9096..2d7b16e5 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -18,9 +18,13 @@ To install Hatch, just run `pip install hatch`. You will also need to setup the `pre-commit` hooks. Run `pre-commit install` in the root directory of the repository. If you don't have `pre-commit` installed, you can install it with `pip install pre-commit`. +> **Note** +> Currently our protobuf files will be generated during `hatch build` +> Please run this command once, to generate all necessary files. + ### Testing -Run tests by entering the package directory and running `hatch run test`. +Run tests by entering the package directory and running `hatch test`. We use `pytest` for our unit testing, making use of `parametrized` to inject cases at scale. diff --git a/providers/openfeature-provider-flagd/openfeature/schemas b/providers/openfeature-provider-flagd/openfeature/schemas new file mode 160000 index 00000000..76d611fd --- /dev/null +++ b/providers/openfeature-provider-flagd/openfeature/schemas @@ -0,0 +1 @@ +Subproject commit 76d611fd94689d906af316105ac12670d40f7648 diff --git a/providers/openfeature-provider-flagd/spec b/providers/openfeature-provider-flagd/openfeature/spec similarity index 100% rename from providers/openfeature-provider-flagd/spec rename to providers/openfeature-provider-flagd/openfeature/spec diff --git a/providers/openfeature-provider-flagd/test-harness b/providers/openfeature-provider-flagd/openfeature/test-harness similarity index 100% rename from providers/openfeature-provider-flagd/test-harness rename to providers/openfeature-provider-flagd/openfeature/test-harness diff --git a/providers/openfeature-provider-flagd/pyproject.toml b/providers/openfeature-provider-flagd/pyproject.toml index 5da8c69c..a9efd290 100644 --- a/providers/openfeature-provider-flagd/pyproject.toml +++ b/providers/openfeature-provider-flagd/pyproject.toml @@ -32,7 +32,7 @@ Homepage = "https://github.com/open-feature/python-sdk-contrib" [tool.hatch] -[tool.hatch.envs.default] +[tool.hatch.envs.hatch-test] dependencies = [ "coverage[toml]>=6.5", "pytest", @@ -41,26 +41,47 @@ dependencies = [ "asserts", "grpcio-health-checking==1.60.0", ] -post-install-commands = [ - "./scripts/gen_protos.sh" +pre-install-commands = [ + "hatch build", ] -[tool.hatch.envs.default.scripts] -test = "pytest {args:tests}" -test-cov = "coverage run -m pytest {args:tests}" +[tool.hatch.envs.hatch-test.scripts] +run = "pytest {args:tests}" +run-cov = "coverage run -m pytest {args:tests}" +cov-combine = "coverage combine" cov-report = [ "coverage xml", "coverage html", + "coverage report", ] cov = [ "test-cov", "cov-report", ] +[tool.hatch.build.hooks.protobuf] +generate_pyi = false +dependencies = [ + "hatch-protobuf", + "mypy-protobuf~=3.0", +] +proto_paths = [ + ".", +] +output_path = "src/" + +[[tool.hatch.build.hooks.protobuf.generators]] +name = "mypy" +outputs = ["{proto_path}/{proto_name}_pb2.pyi"] + +[[tool.hatch.build.hooks.protobuf.generators]] +name = "mypy_grpc" +outputs = ["{proto_path}/{proto_name}_pb2_grpc.pyi"] + [tool.hatch.build.targets.sdist] exclude = [ ".gitignore", - "schemas", + "/openfeature", ] [tool.hatch.build.targets.wheel] diff --git a/providers/openfeature-provider-flagd/schemas b/providers/openfeature-provider-flagd/schemas deleted file mode 160000 index d897c245..00000000 --- a/providers/openfeature-provider-flagd/schemas +++ /dev/null @@ -1 +0,0 @@ -Subproject commit d897c24594784c242358bc1817d1318aba7b3b28 diff --git a/providers/openfeature-provider-flagd/scripts/gen_protos.sh b/providers/openfeature-provider-flagd/scripts/gen_protos.sh deleted file mode 100755 index 5c7c5fb2..00000000 --- a/providers/openfeature-provider-flagd/scripts/gen_protos.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash - -set -e - -buf generate buf.build/open-feature/flagd --template schemas/protobuf/buf.gen.python.yaml --output schemas -rm -rf openfeature/contrib/provider/flagd/proto -sed -i.bak 's/^from schema.v1 import/from . import/' proto/python/schema/v1/*.py -rm proto/python/schema/v1/*.bak -mv proto/python src/openfeature/contrib/provider/flagd/proto -rmdir proto diff --git a/providers/openfeature-provider-flagd/src/openfeature/.gitignore b/providers/openfeature-provider-flagd/src/openfeature/.gitignore new file mode 100644 index 00000000..6fbcf5b9 --- /dev/null +++ b/providers/openfeature-provider-flagd/src/openfeature/.gitignore @@ -0,0 +1,2 @@ + +schemas \ No newline at end of file diff --git a/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/proto/flagd/evaluation/v1/evaluation_pb2.py b/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/proto/flagd/evaluation/v1/evaluation_pb2.py deleted file mode 100644 index addd44aa..00000000 --- a/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/proto/flagd/evaluation/v1/evaluation_pb2.py +++ /dev/null @@ -1,62 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: flagd/evaluation/v1/evaluation.proto -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import symbol_database as _symbol_database -from google.protobuf.internal import builder as _builder -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from google.protobuf import struct_pb2 as google_dot_protobuf_dot_struct__pb2 - - -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n$flagd/evaluation/v1/evaluation.proto\x12\x13\x66lagd.evaluation.v1\x1a\x1cgoogle/protobuf/struct.proto\"F\n\x11ResolveAllRequest\x12\x31\n\x07\x63ontext\x18\x01 \x01(\x0b\x32\x17.google.protobuf.StructR\x07\x63ontext\"\xb6\x01\n\x12ResolveAllResponse\x12H\n\x05\x66lags\x18\x01 \x03(\x0b\x32\x32.flagd.evaluation.v1.ResolveAllResponse.FlagsEntryR\x05\x66lags\x1aV\n\nFlagsEntry\x12\x10\n\x03key\x18\x01 \x01(\tR\x03key\x12\x32\n\x05value\x18\x02 \x01(\x0b\x32\x1c.flagd.evaluation.v1.AnyFlagR\x05value:\x02\x38\x01\"\xed\x01\n\x07\x41nyFlag\x12\x16\n\x06reason\x18\x01 \x01(\tR\x06reason\x12\x18\n\x07variant\x18\x02 \x01(\tR\x07variant\x12\x1f\n\nbool_value\x18\x03 \x01(\x08H\x00R\tboolValue\x12#\n\x0cstring_value\x18\x04 \x01(\tH\x00R\x0bstringValue\x12#\n\x0c\x64ouble_value\x18\x05 \x01(\x01H\x00R\x0b\x64oubleValue\x12<\n\x0cobject_value\x18\x06 \x01(\x0b\x32\x17.google.protobuf.StructH\x00R\x0bobjectValueB\x07\n\x05value\"e\n\x15ResolveBooleanRequest\x12\x19\n\x08\x66lag_key\x18\x01 \x01(\tR\x07\x66lagKey\x12\x31\n\x07\x63ontext\x18\x02 \x01(\x0b\x32\x17.google.protobuf.StructR\x07\x63ontext\"\x95\x01\n\x16ResolveBooleanResponse\x12\x14\n\x05value\x18\x01 \x01(\x08R\x05value\x12\x16\n\x06reason\x18\x02 \x01(\tR\x06reason\x12\x18\n\x07variant\x18\x03 \x01(\tR\x07variant\x12\x33\n\x08metadata\x18\x04 \x01(\x0b\x32\x17.google.protobuf.StructR\x08metadata\"d\n\x14ResolveStringRequest\x12\x19\n\x08\x66lag_key\x18\x01 \x01(\tR\x07\x66lagKey\x12\x31\n\x07\x63ontext\x18\x02 \x01(\x0b\x32\x17.google.protobuf.StructR\x07\x63ontext\"\x94\x01\n\x15ResolveStringResponse\x12\x14\n\x05value\x18\x01 \x01(\tR\x05value\x12\x16\n\x06reason\x18\x02 \x01(\tR\x06reason\x12\x18\n\x07variant\x18\x03 \x01(\tR\x07variant\x12\x33\n\x08metadata\x18\x04 \x01(\x0b\x32\x17.google.protobuf.StructR\x08metadata\"c\n\x13ResolveFloatRequest\x12\x19\n\x08\x66lag_key\x18\x01 \x01(\tR\x07\x66lagKey\x12\x31\n\x07\x63ontext\x18\x02 \x01(\x0b\x32\x17.google.protobuf.StructR\x07\x63ontext\"\x93\x01\n\x14ResolveFloatResponse\x12\x14\n\x05value\x18\x01 \x01(\x01R\x05value\x12\x16\n\x06reason\x18\x02 \x01(\tR\x06reason\x12\x18\n\x07variant\x18\x03 \x01(\tR\x07variant\x12\x33\n\x08metadata\x18\x04 \x01(\x0b\x32\x17.google.protobuf.StructR\x08metadata\"a\n\x11ResolveIntRequest\x12\x19\n\x08\x66lag_key\x18\x01 \x01(\tR\x07\x66lagKey\x12\x31\n\x07\x63ontext\x18\x02 \x01(\x0b\x32\x17.google.protobuf.StructR\x07\x63ontext\"\x91\x01\n\x12ResolveIntResponse\x12\x14\n\x05value\x18\x01 \x01(\x03R\x05value\x12\x16\n\x06reason\x18\x02 \x01(\tR\x06reason\x12\x18\n\x07variant\x18\x03 \x01(\tR\x07variant\x12\x33\n\x08metadata\x18\x04 \x01(\x0b\x32\x17.google.protobuf.StructR\x08metadata\"d\n\x14ResolveObjectRequest\x12\x19\n\x08\x66lag_key\x18\x01 \x01(\tR\x07\x66lagKey\x12\x31\n\x07\x63ontext\x18\x02 \x01(\x0b\x32\x17.google.protobuf.StructR\x07\x63ontext\"\xad\x01\n\x15ResolveObjectResponse\x12-\n\x05value\x18\x01 \x01(\x0b\x32\x17.google.protobuf.StructR\x05value\x12\x16\n\x06reason\x18\x02 \x01(\tR\x06reason\x12\x18\n\x07variant\x18\x03 \x01(\tR\x07variant\x12\x33\n\x08metadata\x18\x04 \x01(\x0b\x32\x17.google.protobuf.StructR\x08metadata\"V\n\x13\x45ventStreamResponse\x12\x12\n\x04type\x18\x01 \x01(\tR\x04type\x12+\n\x04\x64\x61ta\x18\x02 \x01(\x0b\x32\x17.google.protobuf.StructR\x04\x64\x61ta\"\x14\n\x12\x45ventStreamRequest2\xd9\x05\n\x07Service\x12_\n\nResolveAll\x12&.flagd.evaluation.v1.ResolveAllRequest\x1a\'.flagd.evaluation.v1.ResolveAllResponse\"\x00\x12k\n\x0eResolveBoolean\x12*.flagd.evaluation.v1.ResolveBooleanRequest\x1a+.flagd.evaluation.v1.ResolveBooleanResponse\"\x00\x12h\n\rResolveString\x12).flagd.evaluation.v1.ResolveStringRequest\x1a*.flagd.evaluation.v1.ResolveStringResponse\"\x00\x12\x65\n\x0cResolveFloat\x12(.flagd.evaluation.v1.ResolveFloatRequest\x1a).flagd.evaluation.v1.ResolveFloatResponse\"\x00\x12_\n\nResolveInt\x12&.flagd.evaluation.v1.ResolveIntRequest\x1a\'.flagd.evaluation.v1.ResolveIntResponse\"\x00\x12h\n\rResolveObject\x12).flagd.evaluation.v1.ResolveObjectRequest\x1a*.flagd.evaluation.v1.ResolveObjectResponse\"\x00\x12\x64\n\x0b\x45ventStream\x12\'.flagd.evaluation.v1.EventStreamRequest\x1a(.flagd.evaluation.v1.EventStreamResponse\"\x00\x30\x01\x42\xad\x01\n\x17\x63om.flagd.evaluation.v1B\x0f\x45valuationProtoP\x01Z\x13\x66lagd/evaluation/v1\xa2\x02\x03\x46\x45X\xaa\x02\x13\x46lagd.Evaluation.V1\xca\x02\x13\x46lagd\\Evaluation\\V1\xe2\x02\x1f\x46lagd\\Evaluation\\V1\\GPBMetadata\xea\x02\x15\x46lagd::Evaluation::V1b\x06proto3') - -_globals = globals() -_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'flagd.evaluation.v1.evaluation_pb2', _globals) -if _descriptor._USE_C_DESCRIPTORS == False: - - DESCRIPTOR._options = None - DESCRIPTOR._serialized_options = b'\n\027com.flagd.evaluation.v1B\017EvaluationProtoP\001Z\023flagd/evaluation/v1\242\002\003FEX\252\002\023Flagd.Evaluation.V1\312\002\023Flagd\\Evaluation\\V1\342\002\037Flagd\\Evaluation\\V1\\GPBMetadata\352\002\025Flagd::Evaluation::V1' - _RESOLVEALLRESPONSE_FLAGSENTRY._options = None - _RESOLVEALLRESPONSE_FLAGSENTRY._serialized_options = b'8\001' - _globals['_RESOLVEALLREQUEST']._serialized_start=91 - _globals['_RESOLVEALLREQUEST']._serialized_end=161 - _globals['_RESOLVEALLRESPONSE']._serialized_start=164 - _globals['_RESOLVEALLRESPONSE']._serialized_end=346 - _globals['_RESOLVEALLRESPONSE_FLAGSENTRY']._serialized_start=260 - _globals['_RESOLVEALLRESPONSE_FLAGSENTRY']._serialized_end=346 - _globals['_ANYFLAG']._serialized_start=349 - _globals['_ANYFLAG']._serialized_end=586 - _globals['_RESOLVEBOOLEANREQUEST']._serialized_start=588 - _globals['_RESOLVEBOOLEANREQUEST']._serialized_end=689 - _globals['_RESOLVEBOOLEANRESPONSE']._serialized_start=692 - _globals['_RESOLVEBOOLEANRESPONSE']._serialized_end=841 - _globals['_RESOLVESTRINGREQUEST']._serialized_start=843 - _globals['_RESOLVESTRINGREQUEST']._serialized_end=943 - _globals['_RESOLVESTRINGRESPONSE']._serialized_start=946 - _globals['_RESOLVESTRINGRESPONSE']._serialized_end=1094 - _globals['_RESOLVEFLOATREQUEST']._serialized_start=1096 - _globals['_RESOLVEFLOATREQUEST']._serialized_end=1195 - _globals['_RESOLVEFLOATRESPONSE']._serialized_start=1198 - _globals['_RESOLVEFLOATRESPONSE']._serialized_end=1345 - _globals['_RESOLVEINTREQUEST']._serialized_start=1347 - _globals['_RESOLVEINTREQUEST']._serialized_end=1444 - _globals['_RESOLVEINTRESPONSE']._serialized_start=1447 - _globals['_RESOLVEINTRESPONSE']._serialized_end=1592 - _globals['_RESOLVEOBJECTREQUEST']._serialized_start=1594 - _globals['_RESOLVEOBJECTREQUEST']._serialized_end=1694 - _globals['_RESOLVEOBJECTRESPONSE']._serialized_start=1697 - _globals['_RESOLVEOBJECTRESPONSE']._serialized_end=1870 - _globals['_EVENTSTREAMRESPONSE']._serialized_start=1872 - _globals['_EVENTSTREAMRESPONSE']._serialized_end=1958 - _globals['_EVENTSTREAMREQUEST']._serialized_start=1960 - _globals['_EVENTSTREAMREQUEST']._serialized_end=1980 - _globals['_SERVICE']._serialized_start=1983 - _globals['_SERVICE']._serialized_end=2712 -# @@protoc_insertion_point(module_scope) diff --git a/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/proto/flagd/evaluation/v1/evaluation_pb2_grpc.py b/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/proto/flagd/evaluation/v1/evaluation_pb2_grpc.py deleted file mode 100644 index 299a004b..00000000 --- a/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/proto/flagd/evaluation/v1/evaluation_pb2_grpc.py +++ /dev/null @@ -1,267 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -"""Client and server classes corresponding to protobuf-defined services.""" -import grpc - -from flagd.evaluation.v1 import evaluation_pb2 as flagd_dot_evaluation_dot_v1_dot_evaluation__pb2 - - -class ServiceStub(object): - """Service defines the exposed rpcs of flagd - """ - - def __init__(self, channel): - """Constructor. - - Args: - channel: A grpc.Channel. - """ - self.ResolveAll = channel.unary_unary( - '/flagd.evaluation.v1.Service/ResolveAll', - request_serializer=flagd_dot_evaluation_dot_v1_dot_evaluation__pb2.ResolveAllRequest.SerializeToString, - response_deserializer=flagd_dot_evaluation_dot_v1_dot_evaluation__pb2.ResolveAllResponse.FromString, - ) - self.ResolveBoolean = channel.unary_unary( - '/flagd.evaluation.v1.Service/ResolveBoolean', - request_serializer=flagd_dot_evaluation_dot_v1_dot_evaluation__pb2.ResolveBooleanRequest.SerializeToString, - response_deserializer=flagd_dot_evaluation_dot_v1_dot_evaluation__pb2.ResolveBooleanResponse.FromString, - ) - self.ResolveString = channel.unary_unary( - '/flagd.evaluation.v1.Service/ResolveString', - request_serializer=flagd_dot_evaluation_dot_v1_dot_evaluation__pb2.ResolveStringRequest.SerializeToString, - response_deserializer=flagd_dot_evaluation_dot_v1_dot_evaluation__pb2.ResolveStringResponse.FromString, - ) - self.ResolveFloat = channel.unary_unary( - '/flagd.evaluation.v1.Service/ResolveFloat', - request_serializer=flagd_dot_evaluation_dot_v1_dot_evaluation__pb2.ResolveFloatRequest.SerializeToString, - response_deserializer=flagd_dot_evaluation_dot_v1_dot_evaluation__pb2.ResolveFloatResponse.FromString, - ) - self.ResolveInt = channel.unary_unary( - '/flagd.evaluation.v1.Service/ResolveInt', - request_serializer=flagd_dot_evaluation_dot_v1_dot_evaluation__pb2.ResolveIntRequest.SerializeToString, - response_deserializer=flagd_dot_evaluation_dot_v1_dot_evaluation__pb2.ResolveIntResponse.FromString, - ) - self.ResolveObject = channel.unary_unary( - '/flagd.evaluation.v1.Service/ResolveObject', - request_serializer=flagd_dot_evaluation_dot_v1_dot_evaluation__pb2.ResolveObjectRequest.SerializeToString, - response_deserializer=flagd_dot_evaluation_dot_v1_dot_evaluation__pb2.ResolveObjectResponse.FromString, - ) - self.EventStream = channel.unary_stream( - '/flagd.evaluation.v1.Service/EventStream', - request_serializer=flagd_dot_evaluation_dot_v1_dot_evaluation__pb2.EventStreamRequest.SerializeToString, - response_deserializer=flagd_dot_evaluation_dot_v1_dot_evaluation__pb2.EventStreamResponse.FromString, - ) - - -class ServiceServicer(object): - """Service defines the exposed rpcs of flagd - """ - - def ResolveAll(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def ResolveBoolean(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def ResolveString(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def ResolveFloat(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def ResolveInt(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def ResolveObject(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def EventStream(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - -def add_ServiceServicer_to_server(servicer, server): - rpc_method_handlers = { - 'ResolveAll': grpc.unary_unary_rpc_method_handler( - servicer.ResolveAll, - request_deserializer=flagd_dot_evaluation_dot_v1_dot_evaluation__pb2.ResolveAllRequest.FromString, - response_serializer=flagd_dot_evaluation_dot_v1_dot_evaluation__pb2.ResolveAllResponse.SerializeToString, - ), - 'ResolveBoolean': grpc.unary_unary_rpc_method_handler( - servicer.ResolveBoolean, - request_deserializer=flagd_dot_evaluation_dot_v1_dot_evaluation__pb2.ResolveBooleanRequest.FromString, - response_serializer=flagd_dot_evaluation_dot_v1_dot_evaluation__pb2.ResolveBooleanResponse.SerializeToString, - ), - 'ResolveString': grpc.unary_unary_rpc_method_handler( - servicer.ResolveString, - request_deserializer=flagd_dot_evaluation_dot_v1_dot_evaluation__pb2.ResolveStringRequest.FromString, - response_serializer=flagd_dot_evaluation_dot_v1_dot_evaluation__pb2.ResolveStringResponse.SerializeToString, - ), - 'ResolveFloat': grpc.unary_unary_rpc_method_handler( - servicer.ResolveFloat, - request_deserializer=flagd_dot_evaluation_dot_v1_dot_evaluation__pb2.ResolveFloatRequest.FromString, - response_serializer=flagd_dot_evaluation_dot_v1_dot_evaluation__pb2.ResolveFloatResponse.SerializeToString, - ), - 'ResolveInt': grpc.unary_unary_rpc_method_handler( - servicer.ResolveInt, - request_deserializer=flagd_dot_evaluation_dot_v1_dot_evaluation__pb2.ResolveIntRequest.FromString, - response_serializer=flagd_dot_evaluation_dot_v1_dot_evaluation__pb2.ResolveIntResponse.SerializeToString, - ), - 'ResolveObject': grpc.unary_unary_rpc_method_handler( - servicer.ResolveObject, - request_deserializer=flagd_dot_evaluation_dot_v1_dot_evaluation__pb2.ResolveObjectRequest.FromString, - response_serializer=flagd_dot_evaluation_dot_v1_dot_evaluation__pb2.ResolveObjectResponse.SerializeToString, - ), - 'EventStream': grpc.unary_stream_rpc_method_handler( - servicer.EventStream, - request_deserializer=flagd_dot_evaluation_dot_v1_dot_evaluation__pb2.EventStreamRequest.FromString, - response_serializer=flagd_dot_evaluation_dot_v1_dot_evaluation__pb2.EventStreamResponse.SerializeToString, - ), - } - generic_handler = grpc.method_handlers_generic_handler( - 'flagd.evaluation.v1.Service', rpc_method_handlers) - server.add_generic_rpc_handlers((generic_handler,)) - - - # This class is part of an EXPERIMENTAL API. -class Service(object): - """Service defines the exposed rpcs of flagd - """ - - @staticmethod - def ResolveAll(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary(request, target, '/flagd.evaluation.v1.Service/ResolveAll', - flagd_dot_evaluation_dot_v1_dot_evaluation__pb2.ResolveAllRequest.SerializeToString, - flagd_dot_evaluation_dot_v1_dot_evaluation__pb2.ResolveAllResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - @staticmethod - def ResolveBoolean(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary(request, target, '/flagd.evaluation.v1.Service/ResolveBoolean', - flagd_dot_evaluation_dot_v1_dot_evaluation__pb2.ResolveBooleanRequest.SerializeToString, - flagd_dot_evaluation_dot_v1_dot_evaluation__pb2.ResolveBooleanResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - @staticmethod - def ResolveString(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary(request, target, '/flagd.evaluation.v1.Service/ResolveString', - flagd_dot_evaluation_dot_v1_dot_evaluation__pb2.ResolveStringRequest.SerializeToString, - flagd_dot_evaluation_dot_v1_dot_evaluation__pb2.ResolveStringResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - @staticmethod - def ResolveFloat(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary(request, target, '/flagd.evaluation.v1.Service/ResolveFloat', - flagd_dot_evaluation_dot_v1_dot_evaluation__pb2.ResolveFloatRequest.SerializeToString, - flagd_dot_evaluation_dot_v1_dot_evaluation__pb2.ResolveFloatResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - @staticmethod - def ResolveInt(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary(request, target, '/flagd.evaluation.v1.Service/ResolveInt', - flagd_dot_evaluation_dot_v1_dot_evaluation__pb2.ResolveIntRequest.SerializeToString, - flagd_dot_evaluation_dot_v1_dot_evaluation__pb2.ResolveIntResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - @staticmethod - def ResolveObject(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary(request, target, '/flagd.evaluation.v1.Service/ResolveObject', - flagd_dot_evaluation_dot_v1_dot_evaluation__pb2.ResolveObjectRequest.SerializeToString, - flagd_dot_evaluation_dot_v1_dot_evaluation__pb2.ResolveObjectResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - @staticmethod - def EventStream(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_stream(request, target, '/flagd.evaluation.v1.Service/EventStream', - flagd_dot_evaluation_dot_v1_dot_evaluation__pb2.EventStreamRequest.SerializeToString, - flagd_dot_evaluation_dot_v1_dot_evaluation__pb2.EventStreamResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) diff --git a/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/proto/flagd/sync/v1/sync_pb2.py b/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/proto/flagd/sync/v1/sync_pb2.py deleted file mode 100644 index 89345624..00000000 --- a/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/proto/flagd/sync/v1/sync_pb2.py +++ /dev/null @@ -1,40 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: flagd/sync/v1/sync.proto -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import symbol_database as _symbol_database -from google.protobuf.internal import builder as _builder -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from google.protobuf import struct_pb2 as google_dot_protobuf_dot_struct__pb2 - - -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x18\x66lagd/sync/v1/sync.proto\x12\rflagd.sync.v1\x1a\x1cgoogle/protobuf/struct.proto\"O\n\x10SyncFlagsRequest\x12\x1f\n\x0bprovider_id\x18\x01 \x01(\tR\nproviderId\x12\x1a\n\x08selector\x18\x02 \x01(\tR\x08selector\"B\n\x11SyncFlagsResponse\x12-\n\x12\x66lag_configuration\x18\x01 \x01(\tR\x11\x66lagConfiguration\"S\n\x14\x46\x65tchAllFlagsRequest\x12\x1f\n\x0bprovider_id\x18\x01 \x01(\tR\nproviderId\x12\x1a\n\x08selector\x18\x02 \x01(\tR\x08selector\"F\n\x15\x46\x65tchAllFlagsResponse\x12-\n\x12\x66lag_configuration\x18\x01 \x01(\tR\x11\x66lagConfiguration\"\x14\n\x12GetMetadataRequest\"P\n\x13GetMetadataResponse\x12\x33\n\x08metadata\x18\x02 \x01(\x0b\x32\x17.google.protobuf.StructR\x08metadataJ\x04\x08\x01\x10\x02\x32\x9b\x02\n\x0f\x46lagSyncService\x12R\n\tSyncFlags\x12\x1f.flagd.sync.v1.SyncFlagsRequest\x1a .flagd.sync.v1.SyncFlagsResponse\"\x00\x30\x01\x12\\\n\rFetchAllFlags\x12#.flagd.sync.v1.FetchAllFlagsRequest\x1a$.flagd.sync.v1.FetchAllFlagsResponse\"\x00\x12V\n\x0bGetMetadata\x12!.flagd.sync.v1.GetMetadataRequest\x1a\".flagd.sync.v1.GetMetadataResponse\"\x00\x42\x83\x01\n\x11\x63om.flagd.sync.v1B\tSyncProtoP\x01Z\rflagd/sync/v1\xa2\x02\x03\x46SX\xaa\x02\rFlagd.Sync.V1\xca\x02\rFlagd\\Sync\\V1\xe2\x02\x19\x46lagd\\Sync\\V1\\GPBMetadata\xea\x02\x0f\x46lagd::Sync::V1b\x06proto3') - -_globals = globals() -_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'flagd.sync.v1.sync_pb2', _globals) -if _descriptor._USE_C_DESCRIPTORS == False: - - DESCRIPTOR._options = None - DESCRIPTOR._serialized_options = b'\n\021com.flagd.sync.v1B\tSyncProtoP\001Z\rflagd/sync/v1\242\002\003FSX\252\002\rFlagd.Sync.V1\312\002\rFlagd\\Sync\\V1\342\002\031Flagd\\Sync\\V1\\GPBMetadata\352\002\017Flagd::Sync::V1' - _globals['_SYNCFLAGSREQUEST']._serialized_start=73 - _globals['_SYNCFLAGSREQUEST']._serialized_end=152 - _globals['_SYNCFLAGSRESPONSE']._serialized_start=154 - _globals['_SYNCFLAGSRESPONSE']._serialized_end=220 - _globals['_FETCHALLFLAGSREQUEST']._serialized_start=222 - _globals['_FETCHALLFLAGSREQUEST']._serialized_end=305 - _globals['_FETCHALLFLAGSRESPONSE']._serialized_start=307 - _globals['_FETCHALLFLAGSRESPONSE']._serialized_end=377 - _globals['_GETMETADATAREQUEST']._serialized_start=379 - _globals['_GETMETADATAREQUEST']._serialized_end=399 - _globals['_GETMETADATARESPONSE']._serialized_start=401 - _globals['_GETMETADATARESPONSE']._serialized_end=481 - _globals['_FLAGSYNCSERVICE']._serialized_start=484 - _globals['_FLAGSYNCSERVICE']._serialized_end=767 -# @@protoc_insertion_point(module_scope) diff --git a/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/proto/flagd/sync/v1/sync_pb2_grpc.py b/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/proto/flagd/sync/v1/sync_pb2_grpc.py deleted file mode 100644 index ce040715..00000000 --- a/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/proto/flagd/sync/v1/sync_pb2_grpc.py +++ /dev/null @@ -1,135 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -"""Client and server classes corresponding to protobuf-defined services.""" -import grpc - -from flagd.sync.v1 import sync_pb2 as flagd_dot_sync_dot_v1_dot_sync__pb2 - - -class FlagSyncServiceStub(object): - """FlagService implements a server streaming to provide realtime flag configurations - """ - - def __init__(self, channel): - """Constructor. - - Args: - channel: A grpc.Channel. - """ - self.SyncFlags = channel.unary_stream( - '/flagd.sync.v1.FlagSyncService/SyncFlags', - request_serializer=flagd_dot_sync_dot_v1_dot_sync__pb2.SyncFlagsRequest.SerializeToString, - response_deserializer=flagd_dot_sync_dot_v1_dot_sync__pb2.SyncFlagsResponse.FromString, - ) - self.FetchAllFlags = channel.unary_unary( - '/flagd.sync.v1.FlagSyncService/FetchAllFlags', - request_serializer=flagd_dot_sync_dot_v1_dot_sync__pb2.FetchAllFlagsRequest.SerializeToString, - response_deserializer=flagd_dot_sync_dot_v1_dot_sync__pb2.FetchAllFlagsResponse.FromString, - ) - self.GetMetadata = channel.unary_unary( - '/flagd.sync.v1.FlagSyncService/GetMetadata', - request_serializer=flagd_dot_sync_dot_v1_dot_sync__pb2.GetMetadataRequest.SerializeToString, - response_deserializer=flagd_dot_sync_dot_v1_dot_sync__pb2.GetMetadataResponse.FromString, - ) - - -class FlagSyncServiceServicer(object): - """FlagService implements a server streaming to provide realtime flag configurations - """ - - def SyncFlags(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def FetchAllFlags(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def GetMetadata(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - -def add_FlagSyncServiceServicer_to_server(servicer, server): - rpc_method_handlers = { - 'SyncFlags': grpc.unary_stream_rpc_method_handler( - servicer.SyncFlags, - request_deserializer=flagd_dot_sync_dot_v1_dot_sync__pb2.SyncFlagsRequest.FromString, - response_serializer=flagd_dot_sync_dot_v1_dot_sync__pb2.SyncFlagsResponse.SerializeToString, - ), - 'FetchAllFlags': grpc.unary_unary_rpc_method_handler( - servicer.FetchAllFlags, - request_deserializer=flagd_dot_sync_dot_v1_dot_sync__pb2.FetchAllFlagsRequest.FromString, - response_serializer=flagd_dot_sync_dot_v1_dot_sync__pb2.FetchAllFlagsResponse.SerializeToString, - ), - 'GetMetadata': grpc.unary_unary_rpc_method_handler( - servicer.GetMetadata, - request_deserializer=flagd_dot_sync_dot_v1_dot_sync__pb2.GetMetadataRequest.FromString, - response_serializer=flagd_dot_sync_dot_v1_dot_sync__pb2.GetMetadataResponse.SerializeToString, - ), - } - generic_handler = grpc.method_handlers_generic_handler( - 'flagd.sync.v1.FlagSyncService', rpc_method_handlers) - server.add_generic_rpc_handlers((generic_handler,)) - - - # This class is part of an EXPERIMENTAL API. -class FlagSyncService(object): - """FlagService implements a server streaming to provide realtime flag configurations - """ - - @staticmethod - def SyncFlags(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_stream(request, target, '/flagd.sync.v1.FlagSyncService/SyncFlags', - flagd_dot_sync_dot_v1_dot_sync__pb2.SyncFlagsRequest.SerializeToString, - flagd_dot_sync_dot_v1_dot_sync__pb2.SyncFlagsResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - @staticmethod - def FetchAllFlags(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary(request, target, '/flagd.sync.v1.FlagSyncService/FetchAllFlags', - flagd_dot_sync_dot_v1_dot_sync__pb2.FetchAllFlagsRequest.SerializeToString, - flagd_dot_sync_dot_v1_dot_sync__pb2.FetchAllFlagsResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - @staticmethod - def GetMetadata(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary(request, target, '/flagd.sync.v1.FlagSyncService/GetMetadata', - flagd_dot_sync_dot_v1_dot_sync__pb2.GetMetadataRequest.SerializeToString, - flagd_dot_sync_dot_v1_dot_sync__pb2.GetMetadataResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) diff --git a/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/proto/schema/v1/schema_pb2.py b/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/proto/schema/v1/schema_pb2.py deleted file mode 100644 index 5a6a9134..00000000 --- a/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/proto/schema/v1/schema_pb2.py +++ /dev/null @@ -1,62 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: schema/v1/schema.proto -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import symbol_database as _symbol_database -from google.protobuf.internal import builder as _builder -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from google.protobuf import struct_pb2 as google_dot_protobuf_dot_struct__pb2 - - -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x16schema/v1/schema.proto\x12\tschema.v1\x1a\x1cgoogle/protobuf/struct.proto\"F\n\x11ResolveAllRequest\x12\x31\n\x07\x63ontext\x18\x01 \x01(\x0b\x32\x17.google.protobuf.StructR\x07\x63ontext\"\xa2\x01\n\x12ResolveAllResponse\x12>\n\x05\x66lags\x18\x01 \x03(\x0b\x32(.schema.v1.ResolveAllResponse.FlagsEntryR\x05\x66lags\x1aL\n\nFlagsEntry\x12\x10\n\x03key\x18\x01 \x01(\tR\x03key\x12(\n\x05value\x18\x02 \x01(\x0b\x32\x12.schema.v1.AnyFlagR\x05value:\x02\x38\x01\"\xed\x01\n\x07\x41nyFlag\x12\x16\n\x06reason\x18\x01 \x01(\tR\x06reason\x12\x18\n\x07variant\x18\x02 \x01(\tR\x07variant\x12\x1f\n\nbool_value\x18\x03 \x01(\x08H\x00R\tboolValue\x12#\n\x0cstring_value\x18\x04 \x01(\tH\x00R\x0bstringValue\x12#\n\x0c\x64ouble_value\x18\x05 \x01(\x01H\x00R\x0b\x64oubleValue\x12<\n\x0cobject_value\x18\x06 \x01(\x0b\x32\x17.google.protobuf.StructH\x00R\x0bobjectValueB\x07\n\x05value\"e\n\x15ResolveBooleanRequest\x12\x19\n\x08\x66lag_key\x18\x01 \x01(\tR\x07\x66lagKey\x12\x31\n\x07\x63ontext\x18\x02 \x01(\x0b\x32\x17.google.protobuf.StructR\x07\x63ontext\"\x95\x01\n\x16ResolveBooleanResponse\x12\x14\n\x05value\x18\x01 \x01(\x08R\x05value\x12\x16\n\x06reason\x18\x02 \x01(\tR\x06reason\x12\x18\n\x07variant\x18\x03 \x01(\tR\x07variant\x12\x33\n\x08metadata\x18\x04 \x01(\x0b\x32\x17.google.protobuf.StructR\x08metadata\"d\n\x14ResolveStringRequest\x12\x19\n\x08\x66lag_key\x18\x01 \x01(\tR\x07\x66lagKey\x12\x31\n\x07\x63ontext\x18\x02 \x01(\x0b\x32\x17.google.protobuf.StructR\x07\x63ontext\"\x94\x01\n\x15ResolveStringResponse\x12\x14\n\x05value\x18\x01 \x01(\tR\x05value\x12\x16\n\x06reason\x18\x02 \x01(\tR\x06reason\x12\x18\n\x07variant\x18\x03 \x01(\tR\x07variant\x12\x33\n\x08metadata\x18\x04 \x01(\x0b\x32\x17.google.protobuf.StructR\x08metadata\"c\n\x13ResolveFloatRequest\x12\x19\n\x08\x66lag_key\x18\x01 \x01(\tR\x07\x66lagKey\x12\x31\n\x07\x63ontext\x18\x02 \x01(\x0b\x32\x17.google.protobuf.StructR\x07\x63ontext\"\x93\x01\n\x14ResolveFloatResponse\x12\x14\n\x05value\x18\x01 \x01(\x01R\x05value\x12\x16\n\x06reason\x18\x02 \x01(\tR\x06reason\x12\x18\n\x07variant\x18\x03 \x01(\tR\x07variant\x12\x33\n\x08metadata\x18\x04 \x01(\x0b\x32\x17.google.protobuf.StructR\x08metadata\"a\n\x11ResolveIntRequest\x12\x19\n\x08\x66lag_key\x18\x01 \x01(\tR\x07\x66lagKey\x12\x31\n\x07\x63ontext\x18\x02 \x01(\x0b\x32\x17.google.protobuf.StructR\x07\x63ontext\"\x91\x01\n\x12ResolveIntResponse\x12\x14\n\x05value\x18\x01 \x01(\x03R\x05value\x12\x16\n\x06reason\x18\x02 \x01(\tR\x06reason\x12\x18\n\x07variant\x18\x03 \x01(\tR\x07variant\x12\x33\n\x08metadata\x18\x04 \x01(\x0b\x32\x17.google.protobuf.StructR\x08metadata\"d\n\x14ResolveObjectRequest\x12\x19\n\x08\x66lag_key\x18\x01 \x01(\tR\x07\x66lagKey\x12\x31\n\x07\x63ontext\x18\x02 \x01(\x0b\x32\x17.google.protobuf.StructR\x07\x63ontext\"\xad\x01\n\x15ResolveObjectResponse\x12-\n\x05value\x18\x01 \x01(\x0b\x32\x17.google.protobuf.StructR\x05value\x12\x16\n\x06reason\x18\x02 \x01(\tR\x06reason\x12\x18\n\x07variant\x18\x03 \x01(\tR\x07variant\x12\x33\n\x08metadata\x18\x04 \x01(\x0b\x32\x17.google.protobuf.StructR\x08metadata\"V\n\x13\x45ventStreamResponse\x12\x12\n\x04type\x18\x01 \x01(\tR\x04type\x12+\n\x04\x64\x61ta\x18\x02 \x01(\x0b\x32\x17.google.protobuf.StructR\x04\x64\x61ta\"\x14\n\x12\x45ventStreamRequest2\xcd\x04\n\x07Service\x12K\n\nResolveAll\x12\x1c.schema.v1.ResolveAllRequest\x1a\x1d.schema.v1.ResolveAllResponse\"\x00\x12W\n\x0eResolveBoolean\x12 .schema.v1.ResolveBooleanRequest\x1a!.schema.v1.ResolveBooleanResponse\"\x00\x12T\n\rResolveString\x12\x1f.schema.v1.ResolveStringRequest\x1a .schema.v1.ResolveStringResponse\"\x00\x12Q\n\x0cResolveFloat\x12\x1e.schema.v1.ResolveFloatRequest\x1a\x1f.schema.v1.ResolveFloatResponse\"\x00\x12K\n\nResolveInt\x12\x1c.schema.v1.ResolveIntRequest\x1a\x1d.schema.v1.ResolveIntResponse\"\x00\x12T\n\rResolveObject\x12\x1f.schema.v1.ResolveObjectRequest\x1a .schema.v1.ResolveObjectResponse\"\x00\x12P\n\x0b\x45ventStream\x12\x1d.schema.v1.EventStreamRequest\x1a\x1e.schema.v1.EventStreamResponse\"\x00\x30\x01\x42t\n\rcom.schema.v1B\x0bSchemaProtoP\x01Z\x11schema/service/v1\xa2\x02\x03SXX\xaa\x02\tSchema.V1\xca\x02\tSchema\\V1\xe2\x02\x15Schema\\V1\\GPBMetadata\xea\x02\nSchema::V1b\x06proto3') - -_globals = globals() -_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'schema.v1.schema_pb2', _globals) -if _descriptor._USE_C_DESCRIPTORS == False: - - DESCRIPTOR._options = None - DESCRIPTOR._serialized_options = b'\n\rcom.schema.v1B\013SchemaProtoP\001Z\021schema/service/v1\242\002\003SXX\252\002\tSchema.V1\312\002\tSchema\\V1\342\002\025Schema\\V1\\GPBMetadata\352\002\nSchema::V1' - _RESOLVEALLRESPONSE_FLAGSENTRY._options = None - _RESOLVEALLRESPONSE_FLAGSENTRY._serialized_options = b'8\001' - _globals['_RESOLVEALLREQUEST']._serialized_start=67 - _globals['_RESOLVEALLREQUEST']._serialized_end=137 - _globals['_RESOLVEALLRESPONSE']._serialized_start=140 - _globals['_RESOLVEALLRESPONSE']._serialized_end=302 - _globals['_RESOLVEALLRESPONSE_FLAGSENTRY']._serialized_start=226 - _globals['_RESOLVEALLRESPONSE_FLAGSENTRY']._serialized_end=302 - _globals['_ANYFLAG']._serialized_start=305 - _globals['_ANYFLAG']._serialized_end=542 - _globals['_RESOLVEBOOLEANREQUEST']._serialized_start=544 - _globals['_RESOLVEBOOLEANREQUEST']._serialized_end=645 - _globals['_RESOLVEBOOLEANRESPONSE']._serialized_start=648 - _globals['_RESOLVEBOOLEANRESPONSE']._serialized_end=797 - _globals['_RESOLVESTRINGREQUEST']._serialized_start=799 - _globals['_RESOLVESTRINGREQUEST']._serialized_end=899 - _globals['_RESOLVESTRINGRESPONSE']._serialized_start=902 - _globals['_RESOLVESTRINGRESPONSE']._serialized_end=1050 - _globals['_RESOLVEFLOATREQUEST']._serialized_start=1052 - _globals['_RESOLVEFLOATREQUEST']._serialized_end=1151 - _globals['_RESOLVEFLOATRESPONSE']._serialized_start=1154 - _globals['_RESOLVEFLOATRESPONSE']._serialized_end=1301 - _globals['_RESOLVEINTREQUEST']._serialized_start=1303 - _globals['_RESOLVEINTREQUEST']._serialized_end=1400 - _globals['_RESOLVEINTRESPONSE']._serialized_start=1403 - _globals['_RESOLVEINTRESPONSE']._serialized_end=1548 - _globals['_RESOLVEOBJECTREQUEST']._serialized_start=1550 - _globals['_RESOLVEOBJECTREQUEST']._serialized_end=1650 - _globals['_RESOLVEOBJECTRESPONSE']._serialized_start=1653 - _globals['_RESOLVEOBJECTRESPONSE']._serialized_end=1826 - _globals['_EVENTSTREAMRESPONSE']._serialized_start=1828 - _globals['_EVENTSTREAMRESPONSE']._serialized_end=1914 - _globals['_EVENTSTREAMREQUEST']._serialized_start=1916 - _globals['_EVENTSTREAMREQUEST']._serialized_end=1936 - _globals['_SERVICE']._serialized_start=1939 - _globals['_SERVICE']._serialized_end=2528 -# @@protoc_insertion_point(module_scope) diff --git a/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/proto/schema/v1/schema_pb2_grpc.py b/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/proto/schema/v1/schema_pb2_grpc.py deleted file mode 100644 index e1dfad8f..00000000 --- a/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/proto/schema/v1/schema_pb2_grpc.py +++ /dev/null @@ -1,267 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -"""Client and server classes corresponding to protobuf-defined services.""" -import grpc - -from . import schema_pb2 as schema_dot_v1_dot_schema__pb2 - - -class ServiceStub(object): - """Service defines the exposed rpcs of flagd - """ - - def __init__(self, channel): - """Constructor. - - Args: - channel: A grpc.Channel. - """ - self.ResolveAll = channel.unary_unary( - '/schema.v1.Service/ResolveAll', - request_serializer=schema_dot_v1_dot_schema__pb2.ResolveAllRequest.SerializeToString, - response_deserializer=schema_dot_v1_dot_schema__pb2.ResolveAllResponse.FromString, - ) - self.ResolveBoolean = channel.unary_unary( - '/schema.v1.Service/ResolveBoolean', - request_serializer=schema_dot_v1_dot_schema__pb2.ResolveBooleanRequest.SerializeToString, - response_deserializer=schema_dot_v1_dot_schema__pb2.ResolveBooleanResponse.FromString, - ) - self.ResolveString = channel.unary_unary( - '/schema.v1.Service/ResolveString', - request_serializer=schema_dot_v1_dot_schema__pb2.ResolveStringRequest.SerializeToString, - response_deserializer=schema_dot_v1_dot_schema__pb2.ResolveStringResponse.FromString, - ) - self.ResolveFloat = channel.unary_unary( - '/schema.v1.Service/ResolveFloat', - request_serializer=schema_dot_v1_dot_schema__pb2.ResolveFloatRequest.SerializeToString, - response_deserializer=schema_dot_v1_dot_schema__pb2.ResolveFloatResponse.FromString, - ) - self.ResolveInt = channel.unary_unary( - '/schema.v1.Service/ResolveInt', - request_serializer=schema_dot_v1_dot_schema__pb2.ResolveIntRequest.SerializeToString, - response_deserializer=schema_dot_v1_dot_schema__pb2.ResolveIntResponse.FromString, - ) - self.ResolveObject = channel.unary_unary( - '/schema.v1.Service/ResolveObject', - request_serializer=schema_dot_v1_dot_schema__pb2.ResolveObjectRequest.SerializeToString, - response_deserializer=schema_dot_v1_dot_schema__pb2.ResolveObjectResponse.FromString, - ) - self.EventStream = channel.unary_stream( - '/schema.v1.Service/EventStream', - request_serializer=schema_dot_v1_dot_schema__pb2.EventStreamRequest.SerializeToString, - response_deserializer=schema_dot_v1_dot_schema__pb2.EventStreamResponse.FromString, - ) - - -class ServiceServicer(object): - """Service defines the exposed rpcs of flagd - """ - - def ResolveAll(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def ResolveBoolean(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def ResolveString(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def ResolveFloat(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def ResolveInt(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def ResolveObject(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def EventStream(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - -def add_ServiceServicer_to_server(servicer, server): - rpc_method_handlers = { - 'ResolveAll': grpc.unary_unary_rpc_method_handler( - servicer.ResolveAll, - request_deserializer=schema_dot_v1_dot_schema__pb2.ResolveAllRequest.FromString, - response_serializer=schema_dot_v1_dot_schema__pb2.ResolveAllResponse.SerializeToString, - ), - 'ResolveBoolean': grpc.unary_unary_rpc_method_handler( - servicer.ResolveBoolean, - request_deserializer=schema_dot_v1_dot_schema__pb2.ResolveBooleanRequest.FromString, - response_serializer=schema_dot_v1_dot_schema__pb2.ResolveBooleanResponse.SerializeToString, - ), - 'ResolveString': grpc.unary_unary_rpc_method_handler( - servicer.ResolveString, - request_deserializer=schema_dot_v1_dot_schema__pb2.ResolveStringRequest.FromString, - response_serializer=schema_dot_v1_dot_schema__pb2.ResolveStringResponse.SerializeToString, - ), - 'ResolveFloat': grpc.unary_unary_rpc_method_handler( - servicer.ResolveFloat, - request_deserializer=schema_dot_v1_dot_schema__pb2.ResolveFloatRequest.FromString, - response_serializer=schema_dot_v1_dot_schema__pb2.ResolveFloatResponse.SerializeToString, - ), - 'ResolveInt': grpc.unary_unary_rpc_method_handler( - servicer.ResolveInt, - request_deserializer=schema_dot_v1_dot_schema__pb2.ResolveIntRequest.FromString, - response_serializer=schema_dot_v1_dot_schema__pb2.ResolveIntResponse.SerializeToString, - ), - 'ResolveObject': grpc.unary_unary_rpc_method_handler( - servicer.ResolveObject, - request_deserializer=schema_dot_v1_dot_schema__pb2.ResolveObjectRequest.FromString, - response_serializer=schema_dot_v1_dot_schema__pb2.ResolveObjectResponse.SerializeToString, - ), - 'EventStream': grpc.unary_stream_rpc_method_handler( - servicer.EventStream, - request_deserializer=schema_dot_v1_dot_schema__pb2.EventStreamRequest.FromString, - response_serializer=schema_dot_v1_dot_schema__pb2.EventStreamResponse.SerializeToString, - ), - } - generic_handler = grpc.method_handlers_generic_handler( - 'schema.v1.Service', rpc_method_handlers) - server.add_generic_rpc_handlers((generic_handler,)) - - - # This class is part of an EXPERIMENTAL API. -class Service(object): - """Service defines the exposed rpcs of flagd - """ - - @staticmethod - def ResolveAll(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary(request, target, '/schema.v1.Service/ResolveAll', - schema_dot_v1_dot_schema__pb2.ResolveAllRequest.SerializeToString, - schema_dot_v1_dot_schema__pb2.ResolveAllResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - @staticmethod - def ResolveBoolean(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary(request, target, '/schema.v1.Service/ResolveBoolean', - schema_dot_v1_dot_schema__pb2.ResolveBooleanRequest.SerializeToString, - schema_dot_v1_dot_schema__pb2.ResolveBooleanResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - @staticmethod - def ResolveString(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary(request, target, '/schema.v1.Service/ResolveString', - schema_dot_v1_dot_schema__pb2.ResolveStringRequest.SerializeToString, - schema_dot_v1_dot_schema__pb2.ResolveStringResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - @staticmethod - def ResolveFloat(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary(request, target, '/schema.v1.Service/ResolveFloat', - schema_dot_v1_dot_schema__pb2.ResolveFloatRequest.SerializeToString, - schema_dot_v1_dot_schema__pb2.ResolveFloatResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - @staticmethod - def ResolveInt(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary(request, target, '/schema.v1.Service/ResolveInt', - schema_dot_v1_dot_schema__pb2.ResolveIntRequest.SerializeToString, - schema_dot_v1_dot_schema__pb2.ResolveIntResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - @staticmethod - def ResolveObject(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary(request, target, '/schema.v1.Service/ResolveObject', - schema_dot_v1_dot_schema__pb2.ResolveObjectRequest.SerializeToString, - schema_dot_v1_dot_schema__pb2.ResolveObjectResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - @staticmethod - def EventStream(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_stream(request, target, '/schema.v1.Service/EventStream', - schema_dot_v1_dot_schema__pb2.EventStreamRequest.SerializeToString, - schema_dot_v1_dot_schema__pb2.EventStreamResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) diff --git a/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/proto/sync/v1/sync_service_pb2.py b/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/proto/sync/v1/sync_service_pb2.py deleted file mode 100644 index 8135eb75..00000000 --- a/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/proto/sync/v1/sync_service_pb2.py +++ /dev/null @@ -1,37 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: sync/v1/sync_service.proto -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import symbol_database as _symbol_database -from google.protobuf.internal import builder as _builder -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - - - -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1async/v1/sync_service.proto\x12\x07sync.v1\"O\n\x10SyncFlagsRequest\x12\x1f\n\x0bprovider_id\x18\x01 \x01(\tR\nproviderId\x12\x1a\n\x08selector\x18\x02 \x01(\tR\x08selector\"l\n\x11SyncFlagsResponse\x12-\n\x12\x66lag_configuration\x18\x01 \x01(\tR\x11\x66lagConfiguration\x12(\n\x05state\x18\x02 \x01(\x0e\x32\x12.sync.v1.SyncStateR\x05state\"S\n\x14\x46\x65tchAllFlagsRequest\x12\x1f\n\x0bprovider_id\x18\x01 \x01(\tR\nproviderId\x12\x1a\n\x08selector\x18\x02 \x01(\tR\x08selector\"F\n\x15\x46\x65tchAllFlagsResponse\x12-\n\x12\x66lag_configuration\x18\x01 \x01(\tR\x11\x66lagConfiguration*\x92\x01\n\tSyncState\x12\x1a\n\x16SYNC_STATE_UNSPECIFIED\x10\x00\x12\x12\n\x0eSYNC_STATE_ALL\x10\x01\x12\x12\n\x0eSYNC_STATE_ADD\x10\x02\x12\x15\n\x11SYNC_STATE_UPDATE\x10\x03\x12\x15\n\x11SYNC_STATE_DELETE\x10\x04\x12\x13\n\x0fSYNC_STATE_PING\x10\x05\x32\xab\x01\n\x0f\x46lagSyncService\x12\x46\n\tSyncFlags\x12\x19.sync.v1.SyncFlagsRequest\x1a\x1a.sync.v1.SyncFlagsResponse\"\x00\x30\x01\x12P\n\rFetchAllFlags\x12\x1d.sync.v1.FetchAllFlagsRequest\x1a\x1e.sync.v1.FetchAllFlagsResponse\"\x00\x42l\n\x0b\x63om.sync.v1B\x10SyncServiceProtoP\x01Z\x0e\x66lagd/grpcsync\xa2\x02\x03SXX\xaa\x02\x07Sync.V1\xca\x02\x07Sync\\V1\xe2\x02\x13Sync\\V1\\GPBMetadata\xea\x02\x08Sync::V1b\x06proto3') - -_globals = globals() -_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'sync.v1.sync_service_pb2', _globals) -if _descriptor._USE_C_DESCRIPTORS == False: - - DESCRIPTOR._options = None - DESCRIPTOR._serialized_options = b'\n\013com.sync.v1B\020SyncServiceProtoP\001Z\016flagd/grpcsync\242\002\003SXX\252\002\007Sync.V1\312\002\007Sync\\V1\342\002\023Sync\\V1\\GPBMetadata\352\002\010Sync::V1' - _globals['_SYNCSTATE']._serialized_start=388 - _globals['_SYNCSTATE']._serialized_end=534 - _globals['_SYNCFLAGSREQUEST']._serialized_start=39 - _globals['_SYNCFLAGSREQUEST']._serialized_end=118 - _globals['_SYNCFLAGSRESPONSE']._serialized_start=120 - _globals['_SYNCFLAGSRESPONSE']._serialized_end=228 - _globals['_FETCHALLFLAGSREQUEST']._serialized_start=230 - _globals['_FETCHALLFLAGSREQUEST']._serialized_end=313 - _globals['_FETCHALLFLAGSRESPONSE']._serialized_start=315 - _globals['_FETCHALLFLAGSRESPONSE']._serialized_end=385 - _globals['_FLAGSYNCSERVICE']._serialized_start=537 - _globals['_FLAGSYNCSERVICE']._serialized_end=708 -# @@protoc_insertion_point(module_scope) diff --git a/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/proto/sync/v1/sync_service_pb2_grpc.py b/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/proto/sync/v1/sync_service_pb2_grpc.py deleted file mode 100644 index fa38ac67..00000000 --- a/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/proto/sync/v1/sync_service_pb2_grpc.py +++ /dev/null @@ -1,102 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -"""Client and server classes corresponding to protobuf-defined services.""" -import grpc - -from sync.v1 import sync_service_pb2 as sync_dot_v1_dot_sync__service__pb2 - - -class FlagSyncServiceStub(object): - """FlagService implements a server streaming to provide realtime flag configurations - """ - - def __init__(self, channel): - """Constructor. - - Args: - channel: A grpc.Channel. - """ - self.SyncFlags = channel.unary_stream( - '/sync.v1.FlagSyncService/SyncFlags', - request_serializer=sync_dot_v1_dot_sync__service__pb2.SyncFlagsRequest.SerializeToString, - response_deserializer=sync_dot_v1_dot_sync__service__pb2.SyncFlagsResponse.FromString, - ) - self.FetchAllFlags = channel.unary_unary( - '/sync.v1.FlagSyncService/FetchAllFlags', - request_serializer=sync_dot_v1_dot_sync__service__pb2.FetchAllFlagsRequest.SerializeToString, - response_deserializer=sync_dot_v1_dot_sync__service__pb2.FetchAllFlagsResponse.FromString, - ) - - -class FlagSyncServiceServicer(object): - """FlagService implements a server streaming to provide realtime flag configurations - """ - - def SyncFlags(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def FetchAllFlags(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - -def add_FlagSyncServiceServicer_to_server(servicer, server): - rpc_method_handlers = { - 'SyncFlags': grpc.unary_stream_rpc_method_handler( - servicer.SyncFlags, - request_deserializer=sync_dot_v1_dot_sync__service__pb2.SyncFlagsRequest.FromString, - response_serializer=sync_dot_v1_dot_sync__service__pb2.SyncFlagsResponse.SerializeToString, - ), - 'FetchAllFlags': grpc.unary_unary_rpc_method_handler( - servicer.FetchAllFlags, - request_deserializer=sync_dot_v1_dot_sync__service__pb2.FetchAllFlagsRequest.FromString, - response_serializer=sync_dot_v1_dot_sync__service__pb2.FetchAllFlagsResponse.SerializeToString, - ), - } - generic_handler = grpc.method_handlers_generic_handler( - 'sync.v1.FlagSyncService', rpc_method_handlers) - server.add_generic_rpc_handlers((generic_handler,)) - - - # This class is part of an EXPERIMENTAL API. -class FlagSyncService(object): - """FlagService implements a server streaming to provide realtime flag configurations - """ - - @staticmethod - def SyncFlags(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_stream(request, target, '/sync.v1.FlagSyncService/SyncFlags', - sync_dot_v1_dot_sync__service__pb2.SyncFlagsRequest.SerializeToString, - sync_dot_v1_dot_sync__service__pb2.SyncFlagsResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - @staticmethod - def FetchAllFlags(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary(request, target, '/sync.v1.FlagSyncService/FetchAllFlags', - sync_dot_v1_dot_sync__service__pb2.FetchAllFlagsRequest.SerializeToString, - sync_dot_v1_dot_sync__service__pb2.FetchAllFlagsResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) diff --git a/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/grpc.py b/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/grpc.py index 194dc558..41b1e82f 100644 --- a/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/grpc.py +++ b/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/grpc.py @@ -13,10 +13,13 @@ TypeMismatchError, ) from openfeature.flag_evaluation import FlagResolutionDetails +from openfeature.schemas.protobuf.flagd.evaluation.v1 import ( # type:ignore[import-not-found] + evaluation_pb2, + evaluation_pb2_grpc, +) from ..config import Config from ..flag_type import FlagType -from ..proto.schema.v1 import schema_pb2, schema_pb2_grpc T = typing.TypeVar("T") @@ -28,7 +31,7 @@ def __init__(self, config: Config): grpc.secure_channel if self.config.tls else grpc.insecure_channel ) self.channel = channel_factory(f"{self.config.host}:{self.config.port}") - self.stub = schema_pb2_grpc.ServiceStub(self.channel) + self.stub = evaluation_pb2_grpc.ServiceStub(self.channel) def shutdown(self) -> None: self.channel.close() @@ -83,20 +86,27 @@ def _resolve( # noqa: PLR0915 context = self._convert_context(evaluation_context) call_args = {"timeout": self.config.timeout} try: + request: typing.Union[ + evaluation_pb2.ResolveBooleanRequest, + evaluation_pb2.ResolveIntRequest, + evaluation_pb2.ResolveStringRequest, + evaluation_pb2.ResolveObjectRequest, + evaluation_pb2.ResolveFloatRequest, + ] if flag_type == FlagType.BOOLEAN: - request = schema_pb2.ResolveBooleanRequest( # type:ignore[attr-defined] + request = evaluation_pb2.ResolveBooleanRequest( flag_key=flag_key, context=context ) response = self.stub.ResolveBoolean(request, **call_args) value = response.value elif flag_type == FlagType.STRING: - request = schema_pb2.ResolveStringRequest( # type:ignore[attr-defined] + request = evaluation_pb2.ResolveStringRequest( flag_key=flag_key, context=context ) response = self.stub.ResolveString(request, **call_args) value = response.value elif flag_type == FlagType.OBJECT: - request = schema_pb2.ResolveObjectRequest( # type:ignore[attr-defined] + request = evaluation_pb2.ResolveObjectRequest( flag_key=flag_key, context=context ) response = self.stub.ResolveObject(request, **call_args) @@ -104,13 +114,13 @@ def _resolve( # noqa: PLR0915 "value" ] elif flag_type == FlagType.FLOAT: - request = schema_pb2.ResolveFloatRequest( # type:ignore[attr-defined] + request = evaluation_pb2.ResolveFloatRequest( flag_key=flag_key, context=context ) response = self.stub.ResolveFloat(request, **call_args) value = response.value elif flag_type == FlagType.INTEGER: - request = schema_pb2.ResolveIntRequest( # type:ignore[attr-defined] + request = evaluation_pb2.ResolveIntRequest( flag_key=flag_key, context=context ) response = self.stub.ResolveInt(request, **call_args) diff --git a/providers/openfeature-provider-flagd/tests/e2e/conftest.py b/providers/openfeature-provider-flagd/tests/e2e/conftest.py index 2aae58d9..af14e299 100644 --- a/providers/openfeature-provider-flagd/tests/e2e/conftest.py +++ b/providers/openfeature-provider-flagd/tests/e2e/conftest.py @@ -10,6 +10,9 @@ JsonPrimitive = typing.Union[str, bool, float, int] +TEST_HARNESS_PATH = "../../openfeature/test-harness" +SPEC_PATH = "../../openfeature/spec" + @pytest.fixture(autouse=True, scope="package") def setup(request, port, image, resolver_type): diff --git a/providers/openfeature-provider-flagd/tests/e2e/test_in-process-file.py b/providers/openfeature-provider-flagd/tests/e2e/test_in-process-file.py index 2d09ca11..9f1568a4 100644 --- a/providers/openfeature-provider-flagd/tests/e2e/test_in-process-file.py +++ b/providers/openfeature-provider-flagd/tests/e2e/test_in-process-file.py @@ -6,6 +6,7 @@ import pytest import yaml from pytest_bdd import scenario, scenarios +from tests.e2e.conftest import SPEC_PATH, TEST_HARNESS_PATH from openfeature import api from openfeature.contrib.provider.flagd import FlagdProvider @@ -24,7 +25,7 @@ def file_name(request): result = {KEY_FLAGS: {}, KEY_EVALUATORS: {}} path = os.path.abspath( - os.path.join(os.path.dirname(__file__), "../../test-harness/flags/") + os.path.join(os.path.dirname(__file__), f"{TEST_HARNESS_PATH}/flags/") ) for f in listdir(path): @@ -60,13 +61,13 @@ def setup(request, file_name): @pytest.mark.skip(reason="Eventing not implemented") -@scenario("../../test-harness/gherkin/flagd.feature", "Flag change event") +@scenario(f"{TEST_HARNESS_PATH}/gherkin/flagd.feature", "Flag change event") def test_flag_change_event(): """not implemented""" scenarios( - "../../test-harness/gherkin/flagd.feature", - "../../test-harness/gherkin/flagd-json-evaluator.feature", - "../../spec/specification/assets/gherkin/evaluation.feature", + f"{TEST_HARNESS_PATH}/gherkin/flagd.feature", + f"{TEST_HARNESS_PATH}/gherkin/flagd-json-evaluator.feature", + f"{SPEC_PATH}/specification/assets/gherkin/evaluation.feature", ) diff --git a/providers/openfeature-provider-flagd/tests/e2e/test_rpc.py b/providers/openfeature-provider-flagd/tests/e2e/test_rpc.py index d2fe57e9..2a5d1c15 100644 --- a/providers/openfeature-provider-flagd/tests/e2e/test_rpc.py +++ b/providers/openfeature-provider-flagd/tests/e2e/test_rpc.py @@ -1,5 +1,6 @@ import pytest from pytest_bdd import scenario, scenarios +from tests.e2e.conftest import SPEC_PATH, TEST_HARNESS_PATH from openfeature.contrib.provider.flagd.config import ResolverType @@ -20,13 +21,13 @@ def image(): @pytest.mark.skip(reason="Eventing not implemented") -@scenario("../../test-harness/gherkin/flagd.feature", "Flag change event") +@scenario(f"{TEST_HARNESS_PATH}/gherkin/flagd.feature", "Flag change event") def test_flag_change_event(): """not implemented""" scenarios( - "../../test-harness/gherkin/flagd.feature", - "../../test-harness/gherkin/flagd-json-evaluator.feature", - "../../spec/specification/assets/gherkin/evaluation.feature", + f"{TEST_HARNESS_PATH}/gherkin/flagd.feature", + f"{TEST_HARNESS_PATH}/gherkin/flagd-json-evaluator.feature", + f"{SPEC_PATH}/specification/assets/gherkin/evaluation.feature", ) diff --git a/ruff.toml b/ruff.toml index a92d6eec..55f93a89 100644 --- a/ruff.toml +++ b/ruff.toml @@ -3,7 +3,7 @@ exclude = [ ".venv", "__pycache__", "venv", - "providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/proto/*" + "providers/openfeature-provider-flagd/src/openfeature/schemas/**" ] target-version = "py38"