-
Notifications
You must be signed in to change notification settings - Fork 285
Description
Ensure EntraID is identical to StaticWebApp
The goal is to ensure AppService is identical to StaticWebApp because we want to stop using StaticWebApp and start using AppService.
data-api-builder/src/Config/ObjectModel/EasyAuthType.cs
Lines 6 to 10 in ebbe989
| public enum EasyAuthType | |
| { | |
| StaticWebApps, | |
| AppService | |
| } |
Modify the Engine default references to StaticWebApps
These references are scattered throughout the codebase. We're shifting to AppService as the default, so wherever StaticWebApps appears in code or comments, it should be updated. We're not removing support for StaticWebApps, just removing it as the default.
Comment example:
| /// <param name="Provider">Identity Provider. Default is StaticWebApps. |
Code example:
| public record AuthenticationOptions(string Provider = nameof(EasyAuthType.StaticWebApps), JwtOptions? Jwt = null) |
Modify the CLI default references to StaticWebApps
This primarily applies to dab init. The goal is to ensure the CLI no longer defaults to StaticWebApps as the auth provider but to AppService. Users can still configure StaticWebApps, but they must do so manually.
Modify the JSON Schema
Update the schema to change the default value to AppService.
data-api-builder/schemas/dab.draft.schema.json
Lines 275 to 283 in ebbe989
| "authentication": { | |
| "type": ["object", "null"], | |
| "additionalProperties": false, | |
| "properties": { | |
| "provider": { | |
| "type": "string", | |
| "description": "The name of authentication provider", | |
| "default": "StaticWebApps" | |
| }, |
Also update the schema to restrict the provider property to only supported values (including StaticWebApps).
Modify DAB Validate
Update ValidateAuthenticationOptions to log a warning if the runtime host is set to StaticWebApps.
if (Enum.TryParse<EasyAuthType>(runtimeConfig.Runtime.Host.Authentication.Provider, ignoreCase: true, out var provider) &&
provider == EasyAuthType.StaticWebApps)
{
_logger.LogWarning("The 'StaticWebApps' authentication provider is deprecated.");
}| private void ValidateAuthenticationOptions(RuntimeConfig runtimeConfig) |
Modify DAB Init
Ensure dab init generates a config functionally identical to before. However, the default provider should now be AppService instead of StaticWebApps.
data-api-builder/src/Cli/Commands/InitOptions.cs
Lines 91 to 92 in ebbe989
| [Option("auth.provider", Default = "StaticWebApps", Required = false, HelpText = "Specify the Identity Provider.")] | |
| public string AuthenticationProvider { get; } |
Metadata
Metadata
Assignees
Labels
Type
Projects
Status