<!-- Please use this template for your pull request. -->
<!-- Please use the sections that you need and delete other sections -->
## This PR
<!-- add the description of the PR here -->
- adds a toggle `disable-sync-metadata` for the Sync Service to disable
or enable the deprecated `getMetadata` request
### Related Issues
[#1688 [FEATURE] Temporary Context Enrichment
toggle](https://github.com/open-feature/flagd/issues/1688)
---------
Signed-off-by: Konvalinka <lea.konvalinka@dynatrace.com>
<!-- Please use this template for your pull request. -->
<!-- Please use the sections that you need and delete other sections -->
## This PR
<!-- add the description of the PR here -->
- adds server side deadline for sync and event streams configurable via
cmd argument `--stream-deadline`
### Related Issues
#1582
### Notes
<!-- any additional notes for this PR -->
### How to test
1. Run flagd with `--stream-deadline 3s` // 3s can be replaced with any
duration the deadline should have
2. Test Event Stream deadline: run `grpcurl -v --proto
schemas/protobuf/flagd/evaluation/v1/evaluation.proto -plaintext
localhost:8013 flagd.evaluation.v1.Service/EventStream` or similar
depending on your flagd settings to check if the deadline exceeded is
returned after the specified duration
3. Test Sync Service Stream deadline: run `grpcurl -v --proto
schemas/protobuf/flagd/sync/v1/sync.proto -plaintext localhost:8015
flagd.sync.v1.FlagSyncService/SyncFlags` or similar depending on your
flagd settings to check if the deadline exceeded is returned after the
specified duration
Signed-off-by: alexandra.oberaigner <alexandra.oberaigner@dynatrace.com>
Signed-off-by: Todd Baert <todd.baert@dynatrace.com>
<!-- Please use this template for your pull request. -->
<!-- Please use the sections that you need and delete other sections -->
Able to update context map using headers present in
- OFREP requests
- Connect Requests (via Flag Evaluator V2 service)
### Related Issues
Fixes#1583
### Notes
Context values passed via headers is high priority
If same context key is updated via
- Headers
- Request Body
- Static Config
_Context via Headers will be considered_
### Usage
```
flagd start --port 8013 --uri file:./samples/example_flags.flagd.json -H Header=contextKey
```
or
```
flagd start --port 8013 --uri file:./samples/example_flags.flagd.json --context-from-header Header=contextKey
```
---------
Signed-off-by: Rahul Baradol <rahul.baradol.14@gmail.com>
## This PR
adds support for unix sockets in sync service
### Related Issues
<!-- add here the GitHub issue that this PR resolves if applicable -->
Fixes#1518
### How to test
start flagd with the new option `-e /tmp/socketpath` and try to connect
with an in-process provider to the same socket path & request a flag
---------
Signed-off-by: Alexandra Oberaigner <alexandra.oberaigner@dynatrace.com>
Signed-off-by: alexandraoberaigner <82218944+alexandraoberaigner@users.noreply.github.com>
Signed-off-by: Todd Baert <todd.baert@dynatrace.com>
Co-authored-by: Todd Baert <todd.baert@dynatrace.com>
- add the `--context-value` command line flag to pass arbitrary key
value pairs to the evaluation context
Signed-off-by: Aleksei Muratov <muratoff.alexey@gmail.com>
## This PR
The OpenTelemetry collectors in my production environment are configured
to use TLS for uploading metrics / traces so this PR aims to
- add the ability to use mTLS + self-signed certificates when exporting
to the opentelemetry collector
This is the 'quick and dirty' approach so wanted to make an initial PR
to make sure the high level implementation is the approach you're
looking for.
### Follow-up Tasks
- [ ] update the documentation when this approach is approved
### How to test
I am struggling to figure out how to test this with self signed
certificates to give a specific set of commands you can run because the
TLS connection is never successful (assuming this is because of my
commands)
```bash
openssl req -x509 -newkey rsa:4096 -keyout ca.key.pem -out ca.cert.pem -sha256 -days 3650 -nodes -subj "/C=XX/ST=StateName/L=CityName/O=CompanyName/OU=CompanySectionName/CN=localhost"
openssl req -x509 -newkey rsa:4096 -keyout client.key.pem -out client.cert.pem -CA ca.cert.pem -CAkey ca.key.pem -sha256 -days 3650 -nodes -subj "/C=XX/ST=StateName/L=CityName/O=CompanyName/OU=CompanySectionName/CN=localhost" -addext "subjectAltName = IP:127.0.0.1"
openssl req -x509 -newkey rsa:4096 -keyout server.key.pem -out server.cert.pem -CA ca.cert.pem -CAkey ca.key.pem -sha256 -days 3650 -nodes -subj "/C=XX/ST=StateName/L=CityName/O=CompanyName/OU=CompanySectionName/CN=localhost" -addext "subjectAltName = IP:127.0.0.1"
```
; however, when I pull certificates from my production environment to
test this works
---------
Signed-off-by: Kevin Schoonover <me@kschoon.me>
Signed-off-by: Todd Baert <todd.baert@dynatrace.com>
Co-authored-by: Todd Baert <todd.baert@dynatrace.com>
Co-authored-by: Michael Beemer <beeme1mr@users.noreply.github.com>
## This PR
Fixes#1245 and introduce OFREP support for flagd
OFREP service runs on 8016 by default and can simply use curl for flag
evaluations,
```shell
curl -X POST 'http://localhost:8016/ofrep/v1/evaluate/flags/myBoolFlag'
```
NOTE - This PR touch several files as I had to migrate from
`github.com/golang/mock/gomock` to `go.uber.org/mock/gomock`. This is
because https://github.com/golang/mock is no longer maintained.
---------
Signed-off-by: Kavindu Dodanduwa <kavindudodanduwa@gmail.com>
Signed-off-by: Kavindu Dodanduwa <Kavindu-Dodan@users.noreply.github.com>
Co-authored-by: Giovanni Liva <giovanni.liva@dynatrace.com>
Co-authored-by: Florian Bacher <florian.bacher@dynatrace.com>
## This PR
Introduce flag sync capability to flagd as discussed at [1] and fixes
https://github.com/open-feature/flagd/issues/1230 .
**What's changed ?**
The change included with this PR introduces the gRPC sync contract [2].
This allows flagd to expose its store to in-process provider which
consumes gRPC flag stream.

**How to use ?**
flagd will start sync service on port `8015`. You can alter the default
sync port by providing desired port to the startup flag `syncPort`
(`--sync-port=8686`)
**Implementation details**
- Sync service startup is delayed to allow configured flag sources to
complete their initial loading (dealy is 5 seconds)
- Sync request's `selector` can be used to specify the specific flag
source. If unset, all flags will be sent
- A new stream response will be created whenever there are updates from
flag sources
[1] - https://github.com/open-feature/flagd/discussions/1153
[2] -
https://github.com/open-feature/flagd-schemas/blob/main/protobuf/flagd/sync/v1/sync.proto
---------
Signed-off-by: Kavindu Dodanduwa <kavindudodanduwa@gmail.com>
Signed-off-by: Kavindu Dodanduwa <Kavindu-Dodan@users.noreply.github.com>
Co-authored-by: Michael Beemer <beeme1mr@users.noreply.github.com>
Co-authored-by: Todd Baert <todd.baert@dynatrace.com>
Remove deprecated flags in flagd and flagd-proxy. Slight clean up of the
code by removing `getPortValueOrDefault`. Setting the default value in
the definition of the flag accomplishes the same thing.
Signed-off-by: Craig Pastro <craig.pastro@gmail.com>
Co-authored-by: Michael Beemer <beeme1mr@users.noreply.github.com>
BREAKING CHANGE: OFO APIs were updated to version v1beta1, since they are more stable now. Resources of the alpha versions are no longer supported in flagd or flagd-proxy.
## This PR
- reworked to autogenerated docs to resolve a relative path issue
- fixed invalid links
- fixed various typos
### How to test
Run `make run-web-docs` and look at the squeaky clean output.
---------
Signed-off-by: Michael Beemer <beeme1mr@users.noreply.github.com>
Total web-docs overhaul:
- puts a helpful intro at the start, with a demo on the next page
- adds an "architecture" page which discusses in-process vs rpc
- adds a deployment page with mentions how to install/run
- adds a "reference" section which includes:
- specs
- protos (in the form of autogenerated markdown for easy navigation)
- autogenerated CLI docs
- adds FAQ
---------
Signed-off-by: Todd Baert <todd.baert@dynatrace.com>
Co-authored-by: Michael Beemer <beeme1mr@users.noreply.github.com>