-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat!: Updated service to use connect (#163)
Connect is a family of libraries for building browser and gRPC-compatible HTTP APIs. It is backwards compatible with gRPC and allows for all currently listed service providers and their 'variations' (gRPC, http(s), unix / tcp) to be managed by a single service provider with a single set of handlers. Using connect introduces the `connect protocol`, directly compatible with the `connect-go` andf `connect-web` client libraries. This provides the benefit avoiding the use of heavy libraries such as `grpc-web` in the front end applications. It is also fully compatible with gRPC meaning that any existing clients that match the interface will still work, thus, providers can still be writen for other languages using pure grpc clients, without requiring a language specifc conenct library. Breaking changes: The http routes are changed, there is currently no support for providing 'custom' routes. A request which previously will have looked like this: ``` $ curl -X POST "localhost:8013/flags/headerColor/resolve/string" -d '{"email": "[email protected]"}' {"value":"#0000FF","reason":"TARGETING_MATCH","variant":"blue"} ``` will not look like this: ``` $ curl -X POST "localhost:8013/schema.v1.Service/ResolveString" -d ''{"flagKey":"headerColor","context":{"email": "[email protected]"}}'' -H "Content-Type: application/json" {"value":"#0000FF","reason":"TARGETING_MATCH","variant":"blue"} ``` This may not be an issue going forwards as these URLs are internal, and will only requre an update to the provider. route prefixes can be added to allow for /api/ to be appended to the front of each route. There is no longer a `--service-provider` option, this is because all variations of this flagkey are now available through the single `connect` service. (there may be argument for keeping this flag and setting the default to `'connect'`) Signed-off-by: James-Milligan <[email protected]> Co-authored-by: Alex Jones <[email protected]>
- Loading branch information
1 parent
50fe46f
commit 828d5c4
Showing
16 changed files
with
402 additions
and
875 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -45,9 +45,9 @@ Flags defined as such: | |
will return variant `red` 50% of the time, `blue` 20% of the time & `green` 30% of the time. | ||
|
||
```shell | ||
$ curl -X POST "localhost:8013/flags/headerColor/resolve/string" -d '{"email": "[email protected]"}' | ||
$ curl -X POST "localhost:8013/schema.v1.Service/ResolveString" -d ''{"flagKey":"headerColor","context":{"email": "[email protected]"}}'' -H "Content-Type: application/json" | ||
{"value":"#0000FF","reason":"TARGETING_MATCH","variant":"blue"}% | ||
|
||
$ curl -X POST "localhost:8013/flags/headerColor/resolve/string" -d '{"email": "[email protected]"}' | ||
$ curl -X POST "localhost:8013/schema.v1.Service/ResolveString" -d ''{"flagKey":"headerColor","context":{"email": "[email protected]"}}'' -H "Content-Type: application/json" | ||
{"value":"#00FF00","reason":"TARGETING_MATCH","variant":"green"}% | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.