Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: remove ApiPluginAAD feature flag and update related logic #13065

Merged
merged 1 commit into from
Jan 17, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions packages/fx-core/src/common/featureFlags.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ export class FeatureFlagName {
static readonly DevTunnelTest = "TEAMSFX_DEV_TUNNEL_TEST";
static readonly SyncManifest = "TEAMSFX_SYNC_MANIFEST";
static readonly KiotaIntegration = "TEAMSFX_KIOTA_INTEGRATION";
static readonly ApiPluginAAD = "TEAMSFX_API_PLUGIN_AAD";
static readonly CEAEnabled = "TEAMSFX_CEA_ENABLED";
}

Expand Down Expand Up @@ -84,10 +83,6 @@ export class FeatureFlags {
name: FeatureFlagName.KiotaIntegration,
defaultValue: "false",
};
static readonly ApiPluginAAD = {
name: FeatureFlagName.ApiPluginAAD,
defaultValue: "false",
};
static readonly CEAEnabled = {
name: FeatureFlagName.CEAEnabled,
defaultValue: "false",
Expand Down
4 changes: 1 addition & 3 deletions packages/fx-core/src/question/create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -954,9 +954,7 @@ export function apiAuthQuestion(excludeNone = false): SingleSelectQuestion {
options.push(ApiAuthOptions.bearerToken(), ApiAuthOptions.microsoftEntra());
} else if (inputs[QuestionNames.ApiPluginType] === ApiPluginStartOptions.newApi().id) {
options.push(ApiAuthOptions.apiKey());
if (featureFlagManager.getBooleanValue(FeatureFlags.ApiPluginAAD)) {
options.push(ApiAuthOptions.microsoftEntra());
}
options.push(ApiAuthOptions.microsoftEntra());
options.push(ApiAuthOptions.oauth());
}
return options;
Expand Down
14 changes: 4 additions & 10 deletions packages/fx-core/tests/question/create.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1642,9 +1642,7 @@ describe("scaffold question", () => {
const tools = new MockTools();
setTools(tools);
beforeEach(() => {
mockedEnvRestore = mockedEnv({
[FeatureFlagName.ApiPluginAAD]: "true",
});
mockedEnvRestore = mockedEnv({});
});

afterEach(() => {
Expand Down Expand Up @@ -1981,7 +1979,6 @@ describe("scaffold question", () => {
it("traverse in cli", async () => {
mockedEnvRestore = mockedEnv({
TEAMSFX_CLI_DOTNET: "false",
[FeatureFlagName.ApiPluginAAD]: "true",
});

const inputs: Inputs = {
Expand Down Expand Up @@ -4064,9 +4061,7 @@ describe("scaffold question", () => {
const tools = new MockTools();
setTools(tools);
beforeEach(() => {
mockedEnvRestore = mockedEnv({
[FeatureFlagName.ApiPluginAAD]: "true",
});
mockedEnvRestore = mockedEnv({});
});

afterEach(() => {
Expand Down Expand Up @@ -4131,9 +4126,7 @@ describe("scaffold question", () => {
const tools = new MockTools();
setTools(tools);
beforeEach(() => {
mockedEnvRestore = mockedEnv({
[FeatureFlagName.ApiPluginAAD]: "false",
});
mockedEnvRestore = mockedEnv({});
});

afterEach(() => {
Expand All @@ -4154,6 +4147,7 @@ describe("scaffold question", () => {
assert.deepEqual(options, [
ApiAuthOptions.none(),
ApiAuthOptions.apiKey(),
ApiAuthOptions.microsoftEntra(),
ApiAuthOptions.oauth(),
]);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,8 @@
import { Capability } from "../../utils/constants";
import { ProgrammingLanguage } from "@microsoft/teamsfx-core";
import { CaseFactory } from "../caseFactory";
import { FeatureFlagName } from "../../../../fx-core/src/common/featureFlags";

class DeclarativeAgentWithEntra extends CaseFactory {
public override async onBefore(): Promise<void> {
process.env[FeatureFlagName.ApiPluginAAD] = "true";
}
}
class DeclarativeAgentWithEntra extends CaseFactory {}

const myRecord: Record<string, string> = {};
myRecord["with-plugin"] = "yes";
Expand Down
Loading