openfeature-provider-flagd 0.1.5__py3-none-any.whl → 0.2.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. openfeature/.gitignore +2 -0
  2. openfeature/contrib/provider/flagd/config.py +214 -23
  3. openfeature/contrib/provider/flagd/provider.py +88 -12
  4. openfeature/contrib/provider/flagd/resolvers/__init__.py +1 -47
  5. openfeature/contrib/provider/flagd/resolvers/grpc.py +229 -17
  6. openfeature/contrib/provider/flagd/resolvers/in_process.py +40 -31
  7. openfeature/contrib/provider/flagd/resolvers/process/connector/__init__.py +11 -0
  8. openfeature/contrib/provider/flagd/resolvers/process/connector/file_watcher.py +107 -0
  9. openfeature/contrib/provider/flagd/resolvers/process/connector/grpc_watcher.py +218 -0
  10. openfeature/contrib/provider/flagd/resolvers/process/custom_ops.py +58 -19
  11. openfeature/contrib/provider/flagd/resolvers/process/flags.py +50 -6
  12. openfeature/contrib/provider/flagd/resolvers/process/targeting.py +35 -0
  13. openfeature/contrib/provider/flagd/resolvers/protocol.py +47 -0
  14. openfeature/contrib/provider/flagd/sync_metadata_hook.py +14 -0
  15. openfeature/schemas/protobuf/flagd/evaluation/v1/evaluation_pb2.py +72 -0
  16. openfeature/schemas/protobuf/flagd/evaluation/v1/evaluation_pb2.pyi +450 -0
  17. openfeature/schemas/protobuf/flagd/evaluation/v1/evaluation_pb2_grpc.py +358 -0
  18. openfeature/schemas/protobuf/flagd/evaluation/v1/evaluation_pb2_grpc.pyi +155 -0
  19. openfeature/schemas/protobuf/flagd/sync/v1/sync_pb2.py +50 -0
  20. openfeature/schemas/protobuf/flagd/sync/v1/sync_pb2.pyi +148 -0
  21. openfeature/schemas/protobuf/flagd/sync/v1/sync_pb2_grpc.py +186 -0
  22. openfeature/schemas/protobuf/flagd/sync/v1/sync_pb2_grpc.pyi +86 -0
  23. openfeature/schemas/protobuf/schema/v1/schema_pb2.py +72 -0
  24. openfeature/schemas/protobuf/schema/v1/schema_pb2.pyi +451 -0
  25. openfeature/schemas/protobuf/schema/v1/schema_pb2_grpc.py +358 -0
  26. openfeature/schemas/protobuf/schema/v1/schema_pb2_grpc.pyi +156 -0
  27. openfeature/schemas/protobuf/sync/v1/sync_service_pb2.py +47 -0
  28. openfeature/schemas/protobuf/sync/v1/sync_service_pb2.pyi +174 -0
  29. openfeature/schemas/protobuf/sync/v1/sync_service_pb2_grpc.py +143 -0
  30. openfeature/schemas/protobuf/sync/v1/sync_service_pb2_grpc.pyi +70 -0
  31. {openfeature_provider_flagd-0.1.5.dist-info → openfeature_provider_flagd-0.2.1.dist-info}/METADATA +116 -15
  32. openfeature_provider_flagd-0.2.1.dist-info/RECORD +36 -0
  33. {openfeature_provider_flagd-0.1.5.dist-info → openfeature_provider_flagd-0.2.1.dist-info}/WHEEL +1 -1
  34. {openfeature_provider_flagd-0.1.5.dist-info → openfeature_provider_flagd-0.2.1.dist-info}/licenses/LICENSE +1 -1
  35. openfeature/contrib/provider/flagd/proto/flagd/evaluation/v1/evaluation_pb2.py +0 -62
  36. openfeature/contrib/provider/flagd/proto/flagd/evaluation/v1/evaluation_pb2_grpc.py +0 -267
  37. openfeature/contrib/provider/flagd/proto/flagd/sync/v1/sync_pb2.py +0 -40
  38. openfeature/contrib/provider/flagd/proto/flagd/sync/v1/sync_pb2_grpc.py +0 -135
  39. openfeature/contrib/provider/flagd/proto/schema/v1/schema_pb2.py +0 -62
  40. openfeature/contrib/provider/flagd/proto/schema/v1/schema_pb2_grpc.py +0 -267
  41. openfeature/contrib/provider/flagd/proto/sync/v1/sync_service_pb2.py +0 -37
  42. openfeature/contrib/provider/flagd/proto/sync/v1/sync_service_pb2_grpc.py +0 -102
  43. openfeature/contrib/provider/flagd/resolvers/process/file_watcher.py +0 -89
  44. openfeature_provider_flagd-0.1.5.dist-info/RECORD +0 -22
@@ -0,0 +1,148 @@
1
+ """
2
+ @generated by mypy-protobuf. Do not edit manually!
3
+ isort:skip_file
4
+ *
5
+ Flag definition sync API
6
+
7
+ This proto defines a simple API to synchronize a feature flag definition.
8
+ It supports establishing a stream for getting notifications about changes in a flag definition.
9
+ """
10
+
11
+ import builtins
12
+ import google.protobuf.descriptor
13
+ import google.protobuf.message
14
+ import google.protobuf.struct_pb2
15
+ import typing
16
+
17
+ DESCRIPTOR: google.protobuf.descriptor.FileDescriptor
18
+
19
+ @typing.final
20
+ class SyncFlagsRequest(google.protobuf.message.Message):
21
+ """SyncFlagsRequest is the request initiating the server-streaming rpc.
22
+ Implementations of Flagd providers and Flagd itself send this request, acting as the client.
23
+ """
24
+
25
+ DESCRIPTOR: google.protobuf.descriptor.Descriptor
26
+
27
+ PROVIDER_ID_FIELD_NUMBER: builtins.int
28
+ SELECTOR_FIELD_NUMBER: builtins.int
29
+ provider_id: builtins.str
30
+ """Optional: A unique identifier for flagd(grpc client) initiating the request. The server implementations may
31
+ utilize this identifier to uniquely identify, validate(ex:- enforce authentication/authorization) and filter
32
+ flag configurations that it can expose to this request. This field is intended to be optional. However server
33
+ implementations may enforce it.
34
+ ex:- provider_id: flagd-weatherapp-sidecar
35
+ """
36
+ selector: builtins.str
37
+ """Optional: A selector for the flag configuration request. The server implementation may utilize this to select
38
+ flag configurations from a collection, select the source of the flag or combine this to any desired underlying
39
+ filtering mechanism.
40
+ ex:- selector: 'source=database,app=weatherapp'
41
+ """
42
+ def __init__(
43
+ self,
44
+ *,
45
+ provider_id: builtins.str = ...,
46
+ selector: builtins.str = ...,
47
+ ) -> None: ...
48
+ def ClearField(self, field_name: typing.Literal["provider_id", b"provider_id", "selector", b"selector"]) -> None: ...
49
+
50
+ global___SyncFlagsRequest = SyncFlagsRequest
51
+
52
+ @typing.final
53
+ class SyncFlagsResponse(google.protobuf.message.Message):
54
+ """SyncFlagsResponse is the server response containing feature flag configurations and the state"""
55
+
56
+ DESCRIPTOR: google.protobuf.descriptor.Descriptor
57
+
58
+ FLAG_CONFIGURATION_FIELD_NUMBER: builtins.int
59
+ flag_configuration: builtins.str
60
+ """flagd feature flag configuration. Must be validated to schema - https://raw.githubusercontent.com/open-feature/schemas/main/json/flagd-definitions.json"""
61
+ def __init__(
62
+ self,
63
+ *,
64
+ flag_configuration: builtins.str = ...,
65
+ ) -> None: ...
66
+ def ClearField(self, field_name: typing.Literal["flag_configuration", b"flag_configuration"]) -> None: ...
67
+
68
+ global___SyncFlagsResponse = SyncFlagsResponse
69
+
70
+ @typing.final
71
+ class FetchAllFlagsRequest(google.protobuf.message.Message):
72
+ """FetchAllFlagsRequest is the request to fetch all flags. Clients send this request as the client in order to resync their internal state"""
73
+
74
+ DESCRIPTOR: google.protobuf.descriptor.Descriptor
75
+
76
+ PROVIDER_ID_FIELD_NUMBER: builtins.int
77
+ SELECTOR_FIELD_NUMBER: builtins.int
78
+ provider_id: builtins.str
79
+ """Optional: A unique identifier for clients initiating the request. The server implementations may
80
+ utilize this identifier to uniquely identify, validate(ex:- enforce authentication/authorization) and filter
81
+ flag configurations that it can expose to this request. This field is intended to be optional. However server
82
+ implementations may enforce it.
83
+ ex:- provider_id: flagd-weatherapp-sidecar
84
+ """
85
+ selector: builtins.str
86
+ """Optional: A selector for the flag configuration request. The server implementation may utilize this to select
87
+ flag configurations from a collection, select the source of the flag or combine this to any desired underlying
88
+ filtering mechanism.
89
+ ex:- selector: 'source=database,app=weatherapp'
90
+ """
91
+ def __init__(
92
+ self,
93
+ *,
94
+ provider_id: builtins.str = ...,
95
+ selector: builtins.str = ...,
96
+ ) -> None: ...
97
+ def ClearField(self, field_name: typing.Literal["provider_id", b"provider_id", "selector", b"selector"]) -> None: ...
98
+
99
+ global___FetchAllFlagsRequest = FetchAllFlagsRequest
100
+
101
+ @typing.final
102
+ class FetchAllFlagsResponse(google.protobuf.message.Message):
103
+ """FetchAllFlagsResponse is the server response containing feature flag configurations"""
104
+
105
+ DESCRIPTOR: google.protobuf.descriptor.Descriptor
106
+
107
+ FLAG_CONFIGURATION_FIELD_NUMBER: builtins.int
108
+ flag_configuration: builtins.str
109
+ """flagd feature flag configuration. Must be validated to schema - https://raw.githubusercontent.com/open-feature/schemas/main/json/flagd-definitions.json"""
110
+ def __init__(
111
+ self,
112
+ *,
113
+ flag_configuration: builtins.str = ...,
114
+ ) -> None: ...
115
+ def ClearField(self, field_name: typing.Literal["flag_configuration", b"flag_configuration"]) -> None: ...
116
+
117
+ global___FetchAllFlagsResponse = FetchAllFlagsResponse
118
+
119
+ @typing.final
120
+ class GetMetadataRequest(google.protobuf.message.Message):
121
+ """GetMetadataRequest is the request for retrieving metadata from the sync service"""
122
+
123
+ DESCRIPTOR: google.protobuf.descriptor.Descriptor
124
+
125
+ def __init__(
126
+ self,
127
+ ) -> None: ...
128
+
129
+ global___GetMetadataRequest = GetMetadataRequest
130
+
131
+ @typing.final
132
+ class GetMetadataResponse(google.protobuf.message.Message):
133
+ """GetMetadataResponse contains metadata from the sync service"""
134
+
135
+ DESCRIPTOR: google.protobuf.descriptor.Descriptor
136
+
137
+ METADATA_FIELD_NUMBER: builtins.int
138
+ @property
139
+ def metadata(self) -> google.protobuf.struct_pb2.Struct: ...
140
+ def __init__(
141
+ self,
142
+ *,
143
+ metadata: google.protobuf.struct_pb2.Struct | None = ...,
144
+ ) -> None: ...
145
+ def HasField(self, field_name: typing.Literal["metadata", b"metadata"]) -> builtins.bool: ...
146
+ def ClearField(self, field_name: typing.Literal["metadata", b"metadata"]) -> None: ...
147
+
148
+ global___GetMetadataResponse = GetMetadataResponse
@@ -0,0 +1,186 @@
1
+ # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
2
+ """Client and server classes corresponding to protobuf-defined services."""
3
+ import grpc
4
+ import warnings
5
+
6
+ from openfeature.schemas.protobuf.flagd.sync.v1 import sync_pb2 as openfeature_dot_schemas_dot_protobuf_dot_flagd_dot_sync_dot_v1_dot_sync__pb2
7
+
8
+ GRPC_GENERATED_VERSION = '1.70.0'
9
+ GRPC_VERSION = grpc.__version__
10
+ _version_not_supported = False
11
+
12
+ try:
13
+ from grpc._utilities import first_version_is_lower
14
+ _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION)
15
+ except ImportError:
16
+ _version_not_supported = True
17
+
18
+ if _version_not_supported:
19
+ raise RuntimeError(
20
+ f'The grpc package installed is at version {GRPC_VERSION},'
21
+ + f' but the generated code in openfeature/schemas/protobuf/flagd/sync/v1/sync_pb2_grpc.py depends on'
22
+ + f' grpcio>={GRPC_GENERATED_VERSION}.'
23
+ + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}'
24
+ + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.'
25
+ )
26
+
27
+
28
+ class FlagSyncServiceStub(object):
29
+ """FlagService implements a server streaming to provide realtime flag configurations
30
+ """
31
+
32
+ def __init__(self, channel):
33
+ """Constructor.
34
+
35
+ Args:
36
+ channel: A grpc.Channel.
37
+ """
38
+ self.SyncFlags = channel.unary_stream(
39
+ '/flagd.sync.v1.FlagSyncService/SyncFlags',
40
+ request_serializer=openfeature_dot_schemas_dot_protobuf_dot_flagd_dot_sync_dot_v1_dot_sync__pb2.SyncFlagsRequest.SerializeToString,
41
+ response_deserializer=openfeature_dot_schemas_dot_protobuf_dot_flagd_dot_sync_dot_v1_dot_sync__pb2.SyncFlagsResponse.FromString,
42
+ _registered_method=True)
43
+ self.FetchAllFlags = channel.unary_unary(
44
+ '/flagd.sync.v1.FlagSyncService/FetchAllFlags',
45
+ request_serializer=openfeature_dot_schemas_dot_protobuf_dot_flagd_dot_sync_dot_v1_dot_sync__pb2.FetchAllFlagsRequest.SerializeToString,
46
+ response_deserializer=openfeature_dot_schemas_dot_protobuf_dot_flagd_dot_sync_dot_v1_dot_sync__pb2.FetchAllFlagsResponse.FromString,
47
+ _registered_method=True)
48
+ self.GetMetadata = channel.unary_unary(
49
+ '/flagd.sync.v1.FlagSyncService/GetMetadata',
50
+ request_serializer=openfeature_dot_schemas_dot_protobuf_dot_flagd_dot_sync_dot_v1_dot_sync__pb2.GetMetadataRequest.SerializeToString,
51
+ response_deserializer=openfeature_dot_schemas_dot_protobuf_dot_flagd_dot_sync_dot_v1_dot_sync__pb2.GetMetadataResponse.FromString,
52
+ _registered_method=True)
53
+
54
+
55
+ class FlagSyncServiceServicer(object):
56
+ """FlagService implements a server streaming to provide realtime flag configurations
57
+ """
58
+
59
+ def SyncFlags(self, request, context):
60
+ """Missing associated documentation comment in .proto file."""
61
+ context.set_code(grpc.StatusCode.UNIMPLEMENTED)
62
+ context.set_details('Method not implemented!')
63
+ raise NotImplementedError('Method not implemented!')
64
+
65
+ def FetchAllFlags(self, request, context):
66
+ """Missing associated documentation comment in .proto file."""
67
+ context.set_code(grpc.StatusCode.UNIMPLEMENTED)
68
+ context.set_details('Method not implemented!')
69
+ raise NotImplementedError('Method not implemented!')
70
+
71
+ def GetMetadata(self, request, context):
72
+ """Missing associated documentation comment in .proto file."""
73
+ context.set_code(grpc.StatusCode.UNIMPLEMENTED)
74
+ context.set_details('Method not implemented!')
75
+ raise NotImplementedError('Method not implemented!')
76
+
77
+
78
+ def add_FlagSyncServiceServicer_to_server(servicer, server):
79
+ rpc_method_handlers = {
80
+ 'SyncFlags': grpc.unary_stream_rpc_method_handler(
81
+ servicer.SyncFlags,
82
+ request_deserializer=openfeature_dot_schemas_dot_protobuf_dot_flagd_dot_sync_dot_v1_dot_sync__pb2.SyncFlagsRequest.FromString,
83
+ response_serializer=openfeature_dot_schemas_dot_protobuf_dot_flagd_dot_sync_dot_v1_dot_sync__pb2.SyncFlagsResponse.SerializeToString,
84
+ ),
85
+ 'FetchAllFlags': grpc.unary_unary_rpc_method_handler(
86
+ servicer.FetchAllFlags,
87
+ request_deserializer=openfeature_dot_schemas_dot_protobuf_dot_flagd_dot_sync_dot_v1_dot_sync__pb2.FetchAllFlagsRequest.FromString,
88
+ response_serializer=openfeature_dot_schemas_dot_protobuf_dot_flagd_dot_sync_dot_v1_dot_sync__pb2.FetchAllFlagsResponse.SerializeToString,
89
+ ),
90
+ 'GetMetadata': grpc.unary_unary_rpc_method_handler(
91
+ servicer.GetMetadata,
92
+ request_deserializer=openfeature_dot_schemas_dot_protobuf_dot_flagd_dot_sync_dot_v1_dot_sync__pb2.GetMetadataRequest.FromString,
93
+ response_serializer=openfeature_dot_schemas_dot_protobuf_dot_flagd_dot_sync_dot_v1_dot_sync__pb2.GetMetadataResponse.SerializeToString,
94
+ ),
95
+ }
96
+ generic_handler = grpc.method_handlers_generic_handler(
97
+ 'flagd.sync.v1.FlagSyncService', rpc_method_handlers)
98
+ server.add_generic_rpc_handlers((generic_handler,))
99
+ server.add_registered_method_handlers('flagd.sync.v1.FlagSyncService', rpc_method_handlers)
100
+
101
+
102
+ # This class is part of an EXPERIMENTAL API.
103
+ class FlagSyncService(object):
104
+ """FlagService implements a server streaming to provide realtime flag configurations
105
+ """
106
+
107
+ @staticmethod
108
+ def SyncFlags(request,
109
+ target,
110
+ options=(),
111
+ channel_credentials=None,
112
+ call_credentials=None,
113
+ insecure=False,
114
+ compression=None,
115
+ wait_for_ready=None,
116
+ timeout=None,
117
+ metadata=None):
118
+ return grpc.experimental.unary_stream(
119
+ request,
120
+ target,
121
+ '/flagd.sync.v1.FlagSyncService/SyncFlags',
122
+ openfeature_dot_schemas_dot_protobuf_dot_flagd_dot_sync_dot_v1_dot_sync__pb2.SyncFlagsRequest.SerializeToString,
123
+ openfeature_dot_schemas_dot_protobuf_dot_flagd_dot_sync_dot_v1_dot_sync__pb2.SyncFlagsResponse.FromString,
124
+ options,
125
+ channel_credentials,
126
+ insecure,
127
+ call_credentials,
128
+ compression,
129
+ wait_for_ready,
130
+ timeout,
131
+ metadata,
132
+ _registered_method=True)
133
+
134
+ @staticmethod
135
+ def FetchAllFlags(request,
136
+ target,
137
+ options=(),
138
+ channel_credentials=None,
139
+ call_credentials=None,
140
+ insecure=False,
141
+ compression=None,
142
+ wait_for_ready=None,
143
+ timeout=None,
144
+ metadata=None):
145
+ return grpc.experimental.unary_unary(
146
+ request,
147
+ target,
148
+ '/flagd.sync.v1.FlagSyncService/FetchAllFlags',
149
+ openfeature_dot_schemas_dot_protobuf_dot_flagd_dot_sync_dot_v1_dot_sync__pb2.FetchAllFlagsRequest.SerializeToString,
150
+ openfeature_dot_schemas_dot_protobuf_dot_flagd_dot_sync_dot_v1_dot_sync__pb2.FetchAllFlagsResponse.FromString,
151
+ options,
152
+ channel_credentials,
153
+ insecure,
154
+ call_credentials,
155
+ compression,
156
+ wait_for_ready,
157
+ timeout,
158
+ metadata,
159
+ _registered_method=True)
160
+
161
+ @staticmethod
162
+ def GetMetadata(request,
163
+ target,
164
+ options=(),
165
+ channel_credentials=None,
166
+ call_credentials=None,
167
+ insecure=False,
168
+ compression=None,
169
+ wait_for_ready=None,
170
+ timeout=None,
171
+ metadata=None):
172
+ return grpc.experimental.unary_unary(
173
+ request,
174
+ target,
175
+ '/flagd.sync.v1.FlagSyncService/GetMetadata',
176
+ openfeature_dot_schemas_dot_protobuf_dot_flagd_dot_sync_dot_v1_dot_sync__pb2.GetMetadataRequest.SerializeToString,
177
+ openfeature_dot_schemas_dot_protobuf_dot_flagd_dot_sync_dot_v1_dot_sync__pb2.GetMetadataResponse.FromString,
178
+ options,
179
+ channel_credentials,
180
+ insecure,
181
+ call_credentials,
182
+ compression,
183
+ wait_for_ready,
184
+ timeout,
185
+ metadata,
186
+ _registered_method=True)
@@ -0,0 +1,86 @@
1
+ """
2
+ @generated by mypy-protobuf. Do not edit manually!
3
+ isort:skip_file
4
+ *
5
+ Flag definition sync API
6
+
7
+ This proto defines a simple API to synchronize a feature flag definition.
8
+ It supports establishing a stream for getting notifications about changes in a flag definition.
9
+ """
10
+
11
+ import abc
12
+ import collections.abc
13
+ import grpc
14
+ import grpc.aio
15
+ import openfeature.schemas.protobuf.flagd.sync.v1.sync_pb2
16
+ import typing
17
+
18
+ _T = typing.TypeVar("_T")
19
+
20
+ class _MaybeAsyncIterator(collections.abc.AsyncIterator[_T], collections.abc.Iterator[_T], metaclass=abc.ABCMeta): ...
21
+
22
+ class _ServicerContext(grpc.ServicerContext, grpc.aio.ServicerContext): # type: ignore[misc, type-arg]
23
+ ...
24
+
25
+ class FlagSyncServiceStub:
26
+ """FlagService implements a server streaming to provide realtime flag configurations"""
27
+
28
+ def __init__(self, channel: typing.Union[grpc.Channel, grpc.aio.Channel]) -> None: ...
29
+ SyncFlags: grpc.UnaryStreamMultiCallable[
30
+ openfeature.schemas.protobuf.flagd.sync.v1.sync_pb2.SyncFlagsRequest,
31
+ openfeature.schemas.protobuf.flagd.sync.v1.sync_pb2.SyncFlagsResponse,
32
+ ]
33
+
34
+ FetchAllFlags: grpc.UnaryUnaryMultiCallable[
35
+ openfeature.schemas.protobuf.flagd.sync.v1.sync_pb2.FetchAllFlagsRequest,
36
+ openfeature.schemas.protobuf.flagd.sync.v1.sync_pb2.FetchAllFlagsResponse,
37
+ ]
38
+
39
+ GetMetadata: grpc.UnaryUnaryMultiCallable[
40
+ openfeature.schemas.protobuf.flagd.sync.v1.sync_pb2.GetMetadataRequest,
41
+ openfeature.schemas.protobuf.flagd.sync.v1.sync_pb2.GetMetadataResponse,
42
+ ]
43
+
44
+ class FlagSyncServiceAsyncStub:
45
+ """FlagService implements a server streaming to provide realtime flag configurations"""
46
+
47
+ SyncFlags: grpc.aio.UnaryStreamMultiCallable[
48
+ openfeature.schemas.protobuf.flagd.sync.v1.sync_pb2.SyncFlagsRequest,
49
+ openfeature.schemas.protobuf.flagd.sync.v1.sync_pb2.SyncFlagsResponse,
50
+ ]
51
+
52
+ FetchAllFlags: grpc.aio.UnaryUnaryMultiCallable[
53
+ openfeature.schemas.protobuf.flagd.sync.v1.sync_pb2.FetchAllFlagsRequest,
54
+ openfeature.schemas.protobuf.flagd.sync.v1.sync_pb2.FetchAllFlagsResponse,
55
+ ]
56
+
57
+ GetMetadata: grpc.aio.UnaryUnaryMultiCallable[
58
+ openfeature.schemas.protobuf.flagd.sync.v1.sync_pb2.GetMetadataRequest,
59
+ openfeature.schemas.protobuf.flagd.sync.v1.sync_pb2.GetMetadataResponse,
60
+ ]
61
+
62
+ class FlagSyncServiceServicer(metaclass=abc.ABCMeta):
63
+ """FlagService implements a server streaming to provide realtime flag configurations"""
64
+
65
+ @abc.abstractmethod
66
+ def SyncFlags(
67
+ self,
68
+ request: openfeature.schemas.protobuf.flagd.sync.v1.sync_pb2.SyncFlagsRequest,
69
+ context: _ServicerContext,
70
+ ) -> typing.Union[collections.abc.Iterator[openfeature.schemas.protobuf.flagd.sync.v1.sync_pb2.SyncFlagsResponse], collections.abc.AsyncIterator[openfeature.schemas.protobuf.flagd.sync.v1.sync_pb2.SyncFlagsResponse]]: ...
71
+
72
+ @abc.abstractmethod
73
+ def FetchAllFlags(
74
+ self,
75
+ request: openfeature.schemas.protobuf.flagd.sync.v1.sync_pb2.FetchAllFlagsRequest,
76
+ context: _ServicerContext,
77
+ ) -> typing.Union[openfeature.schemas.protobuf.flagd.sync.v1.sync_pb2.FetchAllFlagsResponse, collections.abc.Awaitable[openfeature.schemas.protobuf.flagd.sync.v1.sync_pb2.FetchAllFlagsResponse]]: ...
78
+
79
+ @abc.abstractmethod
80
+ def GetMetadata(
81
+ self,
82
+ request: openfeature.schemas.protobuf.flagd.sync.v1.sync_pb2.GetMetadataRequest,
83
+ context: _ServicerContext,
84
+ ) -> typing.Union[openfeature.schemas.protobuf.flagd.sync.v1.sync_pb2.GetMetadataResponse, collections.abc.Awaitable[openfeature.schemas.protobuf.flagd.sync.v1.sync_pb2.GetMetadataResponse]]: ...
85
+
86
+ def add_FlagSyncServiceServicer_to_server(servicer: FlagSyncServiceServicer, server: typing.Union[grpc.Server, grpc.aio.Server]) -> None: ...
@@ -0,0 +1,72 @@
1
+ # -*- coding: utf-8 -*-
2
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
3
+ # NO CHECKED-IN PROTOBUF GENCODE
4
+ # source: openfeature/schemas/protobuf/schema/v1/schema.proto
5
+ # Protobuf Python Version: 5.29.0
6
+ """Generated protocol buffer code."""
7
+ from google.protobuf import descriptor as _descriptor
8
+ from google.protobuf import descriptor_pool as _descriptor_pool
9
+ from google.protobuf import runtime_version as _runtime_version
10
+ from google.protobuf import symbol_database as _symbol_database
11
+ from google.protobuf.internal import builder as _builder
12
+ _runtime_version.ValidateProtobufRuntimeVersion(
13
+ _runtime_version.Domain.PUBLIC,
14
+ 5,
15
+ 29,
16
+ 0,
17
+ '',
18
+ 'openfeature/schemas/protobuf/schema/v1/schema.proto'
19
+ )
20
+ # @@protoc_insertion_point(imports)
21
+
22
+ _sym_db = _symbol_database.Default()
23
+
24
+
25
+ from google.protobuf import struct_pb2 as google_dot_protobuf_dot_struct__pb2
26
+
27
+
28
+ DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n3openfeature/schemas/protobuf/schema/v1/schema.proto\x12\tschema.v1\x1a\x1cgoogle/protobuf/struct.proto\"=\n\x11ResolveAllRequest\x12(\n\x07\x63ontext\x18\x01 \x01(\x0b\x32\x17.google.protobuf.Struct\"\x8f\x01\n\x12ResolveAllResponse\x12\x37\n\x05\x66lags\x18\x01 \x03(\x0b\x32(.schema.v1.ResolveAllResponse.FlagsEntry\x1a@\n\nFlagsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12!\n\x05value\x18\x02 \x01(\x0b\x32\x12.schema.v1.AnyFlag:\x02\x38\x01\"\xaa\x01\n\x07\x41nyFlag\x12\x0e\n\x06reason\x18\x01 \x01(\t\x12\x0f\n\x07variant\x18\x02 \x01(\t\x12\x14\n\nbool_value\x18\x03 \x01(\x08H\x00\x12\x16\n\x0cstring_value\x18\x04 \x01(\tH\x00\x12\x16\n\x0c\x64ouble_value\x18\x05 \x01(\x01H\x00\x12/\n\x0cobject_value\x18\x06 \x01(\x0b\x32\x17.google.protobuf.StructH\x00\x42\x07\n\x05value\"S\n\x15ResolveBooleanRequest\x12\x10\n\x08\x66lag_key\x18\x01 \x01(\t\x12(\n\x07\x63ontext\x18\x02 \x01(\x0b\x32\x17.google.protobuf.Struct\"s\n\x16ResolveBooleanResponse\x12\r\n\x05value\x18\x01 \x01(\x08\x12\x0e\n\x06reason\x18\x02 \x01(\t\x12\x0f\n\x07variant\x18\x03 \x01(\t\x12)\n\x08metadata\x18\x04 \x01(\x0b\x32\x17.google.protobuf.Struct\"R\n\x14ResolveStringRequest\x12\x10\n\x08\x66lag_key\x18\x01 \x01(\t\x12(\n\x07\x63ontext\x18\x02 \x01(\x0b\x32\x17.google.protobuf.Struct\"r\n\x15ResolveStringResponse\x12\r\n\x05value\x18\x01 \x01(\t\x12\x0e\n\x06reason\x18\x02 \x01(\t\x12\x0f\n\x07variant\x18\x03 \x01(\t\x12)\n\x08metadata\x18\x04 \x01(\x0b\x32\x17.google.protobuf.Struct\"Q\n\x13ResolveFloatRequest\x12\x10\n\x08\x66lag_key\x18\x01 \x01(\t\x12(\n\x07\x63ontext\x18\x02 \x01(\x0b\x32\x17.google.protobuf.Struct\"q\n\x14ResolveFloatResponse\x12\r\n\x05value\x18\x01 \x01(\x01\x12\x0e\n\x06reason\x18\x02 \x01(\t\x12\x0f\n\x07variant\x18\x03 \x01(\t\x12)\n\x08metadata\x18\x04 \x01(\x0b\x32\x17.google.protobuf.Struct\"O\n\x11ResolveIntRequest\x12\x10\n\x08\x66lag_key\x18\x01 \x01(\t\x12(\n\x07\x63ontext\x18\x02 \x01(\x0b\x32\x17.google.protobuf.Struct\"o\n\x12ResolveIntResponse\x12\r\n\x05value\x18\x01 \x01(\x03\x12\x0e\n\x06reason\x18\x02 \x01(\t\x12\x0f\n\x07variant\x18\x03 \x01(\t\x12)\n\x08metadata\x18\x04 \x01(\x0b\x32\x17.google.protobuf.Struct\"R\n\x14ResolveObjectRequest\x12\x10\n\x08\x66lag_key\x18\x01 \x01(\t\x12(\n\x07\x63ontext\x18\x02 \x01(\x0b\x32\x17.google.protobuf.Struct\"\x8b\x01\n\x15ResolveObjectResponse\x12&\n\x05value\x18\x01 \x01(\x0b\x32\x17.google.protobuf.Struct\x12\x0e\n\x06reason\x18\x02 \x01(\t\x12\x0f\n\x07variant\x18\x03 \x01(\t\x12)\n\x08metadata\x18\x04 \x01(\x0b\x32\x17.google.protobuf.Struct\"J\n\x13\x45ventStreamResponse\x12\x0c\n\x04type\x18\x01 \x01(\t\x12%\n\x04\x64\x61ta\x18\x02 \x01(\x0b\x32\x17.google.protobuf.Struct\"\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\x42\x9a\x01\n\x1a\x64\x65v.openfeature.flagd.grpcZ\x11schema/service/v1\xb8\x01\x01\xaa\x02\x16OpenFeature.Flagd.Grpc\xca\x02\'OpenFeature\\Providers\\Flagd\\Schema\\Grpc\xea\x02\"OpenFeature::FlagD::Provider::Grpcb\x06proto3')
29
+
30
+ _globals = globals()
31
+ _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
32
+ _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'openfeature.schemas.protobuf.schema.v1.schema_pb2', _globals)
33
+ if not _descriptor._USE_C_DESCRIPTORS:
34
+ _globals['DESCRIPTOR']._loaded_options = None
35
+ _globals['DESCRIPTOR']._serialized_options = b'\n\032dev.openfeature.flagd.grpcZ\021schema/service/v1\270\001\001\252\002\026OpenFeature.Flagd.Grpc\312\002\'OpenFeature\\Providers\\Flagd\\Schema\\Grpc\352\002\"OpenFeature::FlagD::Provider::Grpc'
36
+ _globals['_RESOLVEALLRESPONSE_FLAGSENTRY']._loaded_options = None
37
+ _globals['_RESOLVEALLRESPONSE_FLAGSENTRY']._serialized_options = b'8\001'
38
+ _globals['_RESOLVEALLREQUEST']._serialized_start=96
39
+ _globals['_RESOLVEALLREQUEST']._serialized_end=157
40
+ _globals['_RESOLVEALLRESPONSE']._serialized_start=160
41
+ _globals['_RESOLVEALLRESPONSE']._serialized_end=303
42
+ _globals['_RESOLVEALLRESPONSE_FLAGSENTRY']._serialized_start=239
43
+ _globals['_RESOLVEALLRESPONSE_FLAGSENTRY']._serialized_end=303
44
+ _globals['_ANYFLAG']._serialized_start=306
45
+ _globals['_ANYFLAG']._serialized_end=476
46
+ _globals['_RESOLVEBOOLEANREQUEST']._serialized_start=478
47
+ _globals['_RESOLVEBOOLEANREQUEST']._serialized_end=561
48
+ _globals['_RESOLVEBOOLEANRESPONSE']._serialized_start=563
49
+ _globals['_RESOLVEBOOLEANRESPONSE']._serialized_end=678
50
+ _globals['_RESOLVESTRINGREQUEST']._serialized_start=680
51
+ _globals['_RESOLVESTRINGREQUEST']._serialized_end=762
52
+ _globals['_RESOLVESTRINGRESPONSE']._serialized_start=764
53
+ _globals['_RESOLVESTRINGRESPONSE']._serialized_end=878
54
+ _globals['_RESOLVEFLOATREQUEST']._serialized_start=880
55
+ _globals['_RESOLVEFLOATREQUEST']._serialized_end=961
56
+ _globals['_RESOLVEFLOATRESPONSE']._serialized_start=963
57
+ _globals['_RESOLVEFLOATRESPONSE']._serialized_end=1076
58
+ _globals['_RESOLVEINTREQUEST']._serialized_start=1078
59
+ _globals['_RESOLVEINTREQUEST']._serialized_end=1157
60
+ _globals['_RESOLVEINTRESPONSE']._serialized_start=1159
61
+ _globals['_RESOLVEINTRESPONSE']._serialized_end=1270
62
+ _globals['_RESOLVEOBJECTREQUEST']._serialized_start=1272
63
+ _globals['_RESOLVEOBJECTREQUEST']._serialized_end=1354
64
+ _globals['_RESOLVEOBJECTRESPONSE']._serialized_start=1357
65
+ _globals['_RESOLVEOBJECTRESPONSE']._serialized_end=1496
66
+ _globals['_EVENTSTREAMRESPONSE']._serialized_start=1498
67
+ _globals['_EVENTSTREAMRESPONSE']._serialized_end=1572
68
+ _globals['_EVENTSTREAMREQUEST']._serialized_start=1574
69
+ _globals['_EVENTSTREAMREQUEST']._serialized_end=1594
70
+ _globals['_SERVICE']._serialized_start=1597
71
+ _globals['_SERVICE']._serialized_end=2186
72
+ # @@protoc_insertion_point(module_scope)