A feature flag daemon with a Unix philosophy
Go to file
Zhiwei Liang 5ff38b43b6
test: add `buildHeaders` function for http sync tests (#1804)
## This PR

The previous way of building HTTP headers with raw map is not reliable
in some edge cases.

An example is case-sensitive issue for `ETag` header which requires
`Etag` (lower case `t`) to be the map key when building the response
with a raw map, in order to receive it via `resp.Header.Get("ETag")` on
the other end.

Having a `buildHeaders` function to utilize `Set` built-in function of
`http.Header` would solve this concern.

### How to test
```bash
go test ./core/pkg/sync/http/...
```

---------

Signed-off-by: Zhiwei Liang <zhiwei.liang27@pm.me>
2025-09-24 15:05:08 +02:00
.github build: decouple integration tests from the rest of the codebase (#1792) 2025-09-04 14:28:00 +02:00
config feat: multi-project support via selectors and flagSetId namespacing (#1702) 2025-08-13 16:03:07 -04:00
core test: add `buildHeaders` function for http sync tests (#1804) 2025-09-24 15:05:08 +02:00
docs Update decouple-flag-source-and-set.md 2025-07-29 12:18:07 -04:00
flagd feat: add support for http-based ofrep metrics (#1803) 2025-09-23 14:03:33 -04:00
flagd-proxy fix(security): update module github.com/go-viper/mapstructure/v2 to v2.4.0 [security] (#1784) 2025-08-29 15:14:05 -04:00
images docs: rename flagd proxy image (#713) 2023-06-19 15:22:11 -04:00
playground-app chore: bump flagd-core in playground, add metadata example, fix doc links 2025-01-07 20:52:31 +00:00
samples feat!: allow custom seed when using targetingKey override for fractional op (#1266) 2024-04-09 08:41:41 -07:00
schemas@08b4c52d3b feat: allowing null/missing defaultValue (#1659) 2025-07-09 15:25:30 -04:00
snap chore(main): release 0.4.2 (#475) 2023-03-09 16:34:39 -05:00
spec@a0b3777909 feat: s3 support for the blob sync (#1449) 2024-12-11 16:06:36 -05:00
systemd fix: Update flagd systemd config to use URI (#315) 2023-01-26 11:24:37 -05:00
test build: decouple integration tests from the rest of the codebase (#1792) 2025-09-04 14:28:00 +02:00
test-harness@6197b3d956 feat: s3 support for the blob sync (#1449) 2024-12-11 16:06:36 -05:00
.gitignore chore: fix benchmark (#1698) 2025-07-28 14:30:13 -04:00
.gitmodules chore: bump flagd-core in playground, add metadata example, fix doc links 2025-01-07 20:52:31 +00:00
.golangci.bck.yml fix(security): update vulnerable-dependencies (#1664) 2025-07-04 16:10:16 -04:00
.golangci.yml fix(security): update vulnerable-dependencies (#1664) 2025-07-04 16:10:16 -04:00
.goreleaser.yaml chore: add sbom generation for releases (#337) 2023-01-31 10:13:52 -05:00
.markdownlint-cli2.yaml docs(ADR): add architecture decision template (#1630) 2025-05-15 14:09:08 -04:00
.nvmrc chore(deps): update dependency node to v20 (#1099) 2024-01-03 16:55:28 -05:00
.pre-commit-config.yaml chore: pin golangci-lint (#849) 2023-08-21 10:06:47 -04:00
.release-please-manifest.json chore: release main (#1696) 2025-07-28 16:00:14 -04:00
CHANGELOG.md chore(main): release 0.4.2 (#475) 2023-03-09 16:34:39 -05:00
CODEOWNERS chore: fix CODEOWNERS 2025-08-18 11:34:22 -04:00
CONTRIBUTING.md feat: multi-project support via selectors and flagSetId namespacing (#1702) 2025-08-13 16:03:07 -04:00
Dockerfile feat: add mTLS support to otel exporter (#1389) 2024-09-23 08:16:42 -04:00
LICENSE Update LICENSE (#3) 2022-05-26 14:05:54 +01:00
Makefile build: decouple integration tests from the rest of the codebase (#1792) 2025-09-04 14:28:00 +02:00
README.md docs: fix a broken search link (#1241) 2024-03-07 14:20:45 -05:00
benchmark.txt chore(refactor): use memdb for flag storage (#1697) 2025-07-30 09:08:47 -04:00
mkdocs.yml docs: improve content tab anchors on getting started (#1628) 2025-04-29 14:09:53 -04:00
netlify.toml chore: fix netlify doc publish (#1431) 2024-10-28 15:33:13 -04:00
release-please-config.json fix: add component tag (#1050) 2023-12-04 09:59:56 -08:00
renovate.json Update renovate.json 2025-07-04 14:59:00 -04:00
requirements.txt chore: fix netlify doc publish (#1431) 2024-10-28 15:33:13 -04:00
runtime.txt chore: downgraded the python runtime 2023-08-04 18:07:52 -04:00

README.md

A feature flag daemon with a Unix philosophy.

Github Actions

What's flagd?

flagd is a feature flag daemon with a Unix philosophy. Think of it as a ready-made, open source, OpenFeature-compliant feature flag backend system.

Features

▶️ Quick Start

Experiment with flagd in your browser using the Killercoda tutorial or follow the instructions below to run on your own infrastructure.

  1. flagd can be run as a standalone binary or container. Download and install flagd or run it as a container

    Kubernetes-native? flagd can also be run as part of the Kubernetes Operator.

  2. Start flagd:

    flagd start \
      --port 8013 \
      --uri https://raw.githubusercontent.com/open-feature/flagd/main/samples/example_flags.flagd.json
    

    Or use docker: Note - In Windows, use WSL system for both the file location and Docker runtime. Mixed file systems don't work and this is a limitation of Docker

    docker run \
      --rm -it \
      --name flagd \
      -p 8013:8013 \
      ghcr.io/open-feature/flagd:latest start \
      --uri https://raw.githubusercontent.com/open-feature/flagd/main/samples/example_flags.flagd.json
    

    If you wish, download the file locally to make changes:

    wget https://raw.githubusercontent.com/open-feature/flagd/main/samples/example_flags.flagd.json
    

    In local mode, run flagd like this:

    flagd start \
      --port 8013 \
      --uri file:./example_flags.flagd.json
    

    Or use docker ( Note - In Windows, this requires WSL system for both the file location and Docker runtime):

    docker run \
      --rm -it \
      --name flagd \
      -p 8013:8013 \
      -v $(pwd):/etc/flagd \
      ghcr.io/open-feature/flagd:latest start \
      --uri file:./etc/flagd/example_flags.flagd.json
    

    --uri can be a local file or any remote endpoint. Use file: prefix for local files. eg. --uri file:/path/to/example_flags.flagd.json. gRPC and http have their own requirements. More information can be found here.

    Multiple --uri parameters can be specified. In other words, flagd can retrieve flags from multiple sources simultaneously.

  3. Flagd is now ready to perform flag evaluations over either HTTP(s) or gRPC. This example utilizes HTTP via cURL.

    Retrieve a String value:

    curl -X POST "http://localhost:8013/flagd.evaluation.v1.Service/ResolveString" \
      -d '{"flagKey":"myStringFlag","context":{}}' -H "Content-Type: application/json"
    

    For Windows we recommend using a WSL terminal. Otherwise, use the following with cmd:

    set json={"flagKey":"myStringFlag","context":{}}
    curl -i -X POST -H "Content-Type: application/json" -d %json:"=\"% "localhost:8013/flagd.evaluation.v1.Service/ResolveString"
    

    Result:

    {
      "value": "val1",
      "reason": "DEFAULT",
      "variant":"key1"
    }
    

    Updates to the underlying flag store (e.g. JSON file) are reflected by flagd in realtime. No restart is required.

    flagd also supports boolean, integer, float and object flag types.

  4. Now that flagd is running, it is time to integrate it into your application. Do this by using an OpenFeature provider in a language of your choice.

📐 High-level Architecture

logical architecture of flagd

📝 Further Documentation

Further documentation including flagd configuration options, fractional evaluation, targeting rules and flag configuration merging strategies can be found at flagd.dev or in this repository.

🫶 Contributing

Interested in contributing? Great, we'd love your help! To get started, take a look at the CONTRIBUTING guide.

We also hold regular community meetings that are open to everyone. Check the OpenFeature community page for all the ways to get involved.

Thanks so much to our contributors.

Made with contrib.rocks.

License

Apache License 2.0