Skip to content

Commit 7c6d465

Browse files
thisthataepfligemini-code-assist[bot]alexandraoberaignertoddbaert
authored
feat(docs): add documentation for HTTP OAuth (#1805)
<!-- Please use this template for your pull request. --> <!-- Please use the sections that you need and delete other sections --> ## This PR - adds docs for #1791 ### Related Issues Fixes #1785 --------- Signed-off-by: Giovanni Liva <[email protected]> Signed-off-by: Simon Schrottner <[email protected]> Signed-off-by: Todd Baert <[email protected]> Co-authored-by: Simon Schrottner <[email protected]> Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> Co-authored-by: alexandraoberaigner <[email protected]> Co-authored-by: Todd Baert <[email protected]>
1 parent 268fd75 commit 7c6d465

File tree

1 file changed

+49
-1
lines changed

1 file changed

+49
-1
lines changed

docs/reference/sync-configuration.md

Lines changed: 49 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ Sync providers:
7878
- `file` - config/samples/example_flags.json
7979
- `fsnotify` - config/samples/example_flags.json
8080
- `fileinfo` - config/samples/example_flags.json
81-
- `http` - <http://my-flag-source.com/flags.json>
81+
- [`http`](#http-configuration) - <http://my-flag-source.com/flags.json>
8282
- `https` - <https://my-secure-flag-source.com/flags.json>
8383
- `kubernetes` - default/my-flag-config
8484
- `grpc`(insecure) - grpc-source:8080
@@ -139,3 +139,51 @@ sources:
139139
- uri: azblob://my-container/my-flags.json
140140
provider: azblob
141141
```
142+
143+
### HTTP Configuration
144+
145+
The HTTP Configuration also supports OAuth that allows to securely fetch feature flag configurations from an HTTP endpoint
146+
that requires OAuth-based authentication.
147+
148+
#### CLI-based OAuth Configuration
149+
150+
To enable OAuth, you need to update your Flagd configuration setting the `oauth` object which contains parameters to configure
151+
152+
....
153+
154+
#### File-based OAuth Configuration
155+
156+
the `clientID`, `clientSecret`, and the `tokenURL` for the OAuth Server.
157+
158+
```sh
159+
./bin/flagd start
160+
--sources='[{
161+
"uri": "http://localhost:8180/flags",
162+
"provider": "http",
163+
"interval": 1,
164+
"timeoutS": 10,
165+
"oauth": {
166+
"clientID": "test",
167+
"clientSecret": "test",
168+
"tokenURL": "http://localhost:8180/sso/oauth2/token"
169+
}}]'
170+
```
171+
172+
Secrets can also be managed from the file system. This can be handy when, for example, deploying Flagd in Kubernetes. In this case, the client id and secret
173+
will be read from the files `client-id` and `client-secret`, respectively. If the `folder` attribute is set, client id and secret on top level will be ignored.
174+
To support rotating the secrets without restarting flagd, the additional parameter `ReloadDelayS` can be used to force
175+
the reload of the secrets from the filesystem every `ReloadDelayS` seconds.
176+
177+
```sh
178+
./bin/flagd start
179+
--sources='[{
180+
"uri": "http://localhost:8180/flags",
181+
"provider": "http",
182+
"interval": 1,
183+
"timeoutS": 10,
184+
"oauth": {
185+
"folder": "/etc/secrets",
186+
"ReloadDelayS": 60,
187+
"tokenURL": "http://localhost:8180/sso/oauth2/token"
188+
}}]'
189+
```

0 commit comments

Comments
 (0)