Skip to content

Commit 328ae3a

Browse files
committed
Update @azure/identity package to version 4.1.0 (#60)
support feature flags
1 parent e8a5c7c commit 328ae3a

File tree

6 files changed

+78
-40
lines changed

6 files changed

+78
-40
lines changed

examples/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"dependencies": {
33
"@azure/app-configuration-provider": "latest",
4-
"@azure/identity": "^4.0.0",
4+
"@azure/identity": "^4.1.0",
55
"dotenv": "^16.3.1"
66
}
77
}

package-lock.json

Lines changed: 36 additions & 36 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
},
5757
"dependencies": {
5858
"@azure/app-configuration": "^1.5.0",
59-
"@azure/identity": "^4.0.0",
59+
"@azure/identity": "^4.1.0",
6060
"@azure/keyvault-secrets": "^4.7.0"
6161
}
6262
}

src/AzureAppConfigurationImpl.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,6 @@ export class AzureAppConfigurationImpl implements AzureAppConfiguration {
8585
this.#refreshTimer = new RefreshTimer(this.#refreshInterval);
8686
}
8787

88-
// TODO: should add more adapters to process different type of values
89-
// feature flag, others
9088
this.#adapters.push(new AzureKeyVaultKeyValueAdapter(options?.keyVaultOptions));
9189
this.#adapters.push(new JsonKeyValueAdapter());
9290
}

src/AzureAppConfigurationOptions.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { AppConfigurationClientOptions } from "@azure/app-configuration";
55
import { KeyVaultOptions } from "./keyvault/KeyVaultOptions";
66
import { RefreshOptions } from "./RefreshOptions";
77
import { SettingSelector } from "./types";
8+
import { FeatureFlagOptions } from "./featureManagement/FeatureFlagOptions";
89

910
export const MaxRetries = 2;
1011
export const MaxRetryDelayInMs = 60000;
@@ -36,8 +37,14 @@ export interface AzureAppConfigurationOptions {
3637
* Specifies options used to resolve Vey Vault references.
3738
*/
3839
keyVaultOptions?: KeyVaultOptions;
40+
3941
/**
4042
* Specifies options for dynamic refresh key-values.
4143
*/
4244
refreshOptions?: RefreshOptions;
45+
46+
/**
47+
* Specifies options used to configure feature flags.
48+
*/
49+
featureFlagOptions?: FeatureFlagOptions;
4350
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
// Copyright (c) Microsoft Corporation.
2+
// Licensed under the MIT license.
3+
4+
import { SettingSelector } from "../types";
5+
6+
/**
7+
* Options used to configure feature flags.
8+
*/
9+
export interface FeatureFlagOptions {
10+
/**
11+
* Specifies whether feature flag support is enabled.
12+
*/
13+
enabled: boolean;
14+
15+
/**
16+
* Specifies the selectors used to filter feature flags.
17+
*
18+
* @remarks
19+
* keyFilter of selector will be prefixed with "appconfig.featureflag/" when request is sent.
20+
* If no selectors are specified then no feature flags will be retrieved.
21+
*/
22+
selectors?: SettingSelector[];
23+
24+
/**
25+
* Specifies whether feature flag refresh is enabled.
26+
*/
27+
refreshEnabled?: boolean;
28+
29+
/**
30+
* Specifies the interval in milliseconds to refresh feature flags. Defaults to 10 seconds.
31+
*/
32+
refreshIntervalInMs?: number;
33+
}

0 commit comments

Comments
 (0)