-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathsync.proto
78 lines (66 loc) · 3.71 KB
/
sync.proto
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
/**
* Flag definition sync API
*
* This proto defines a simple API to synchronize a feature flag definition.
* It supports establishing a stream for getting notifications about changes in a flag definition.
*/
syntax = "proto3";
package flagd.sync.v1;
import "google/protobuf/struct.proto";
option csharp_namespace = "OpenFeature.Flagd.Grpc.Sync";
option go_package = "flagd/sync/v1";
option java_package = "dev.openfeature.flagd.grpc.sync";
option php_namespace = "OpenFeature\\Providers\\Flagd\\Schema\\Grpc\\Sync";
option ruby_package = "OpenFeature::Flagd::Provider::Grpc::Sync";
// SyncFlagsRequest is the request initiating the server-streaming rpc.
// Implementations of Flagd providers and Flagd itself send this request, acting as the client.
message SyncFlagsRequest {
// Optional: A unique identifier for flagd(grpc client) initiating the request. The server implementations may
// utilize this identifier to uniquely identify, validate(ex:- enforce authentication/authorization) and filter
// flag configurations that it can expose to this request. This field is intended to be optional. However server
// implementations may enforce it.
// ex:- provider_id: flagd-weatherapp-sidecar
string provider_id = 1;
// Optional: A selector for the flag configuration request. The server implementation may utilize this to select
// flag configurations from a collection, select the source of the flag or combine this to any desired underlying
// filtering mechanism.
// ex:- selector: 'source=database,app=weatherapp'
string selector = 2;
}
// SyncFlagsResponse is the server response containing feature flag configurations and the state
message SyncFlagsResponse {
// flagd feature flag configuration. Must be validated to schema - https://raw.githubusercontent.com/open-feature/schemas/main/json/flagd-definitions.json
string flag_configuration = 1;
}
// FetchAllFlagsRequest is the request to fetch all flags. Clients send this request as the client in order to resync their internal state
message FetchAllFlagsRequest {
// Optional: A unique identifier for clients initiating the request. The server implementations may
// utilize this identifier to uniquely identify, validate(ex:- enforce authentication/authorization) and filter
// flag configurations that it can expose to this request. This field is intended to be optional. However server
// implementations may enforce it.
// ex:- provider_id: flagd-weatherapp-sidecar
string provider_id = 1;
// Optional: A selector for the flag configuration request. The server implementation may utilize this to select
// flag configurations from a collection, select the source of the flag or combine this to any desired underlying
// filtering mechanism.
// ex:- selector: 'source=database,app=weatherapp'
string selector = 2;
}
// FetchAllFlagsResponse is the server response containing feature flag configurations
message FetchAllFlagsResponse {
// flagd feature flag configuration. Must be validated to schema - https://raw.githubusercontent.com/open-feature/schemas/main/json/flagd-definitions.json
string flag_configuration = 1;
}
// GetMetadataRequest is the request for retrieving metadata from the sync service
message GetMetadataRequest {}
// GetMetadataResponse contains metadata from the sync service
message GetMetadataResponse {
reserved 1; // old key/value metadata impl
google.protobuf.Struct metadata = 2;
}
// FlagService implements a server streaming to provide realtime flag configurations
service FlagSyncService {
rpc SyncFlags(SyncFlagsRequest) returns (stream SyncFlagsResponse) {}
rpc FetchAllFlags(FetchAllFlagsRequest) returns (FetchAllFlagsResponse) {}
rpc GetMetadata(GetMetadataRequest) returns (GetMetadataResponse) {}
}