/// <summary> /// Adds the logout BFF management endpoint /// </summary> /// <param name="endpoints"></param> public static void MapBffDiagnosticsEndpoint(this IEndpointRouteBuilder endpoints) { endpoints.CheckLicense(); var options = endpoints.ServiceProvider.GetRequiredService <BffOptions>(); endpoints.MapGet(options.DiagnosticsPath, ProcessWith <IDiagnosticsService>); }
/// <summary> /// Adds the back channel BFF management endpoint /// </summary> /// <param name="endpoints"></param> public static void MapBffManagementBackchannelEndpoint(this IEndpointRouteBuilder endpoints) { endpoints.CheckLicense(); var options = endpoints.ServiceProvider.GetRequiredService <BffOptions>(); endpoints.MapPost(options.BackChannelLogoutPath, ProcessWith <IBackchannelLogoutService>); }
/// <summary> /// Adds the login BFF management endpoint /// </summary> /// <param name="endpoints"></param> public static void MapBffManagementLoginEndpoint(this IEndpointRouteBuilder endpoints) { endpoints.CheckLicense(); var options = endpoints.ServiceProvider.GetRequiredService <BffOptions>(); endpoints.MapGet(options.LoginPath, ProcessWith <ILoginService>); }
/// <summary> /// Adds the user BFF management endpoint /// </summary> /// <param name="endpoints"></param> public static void MapBffManagementUserEndpoint(this IEndpointRouteBuilder endpoints) { endpoints.CheckLicense(); var options = endpoints.ServiceProvider.GetRequiredService <BffOptions>(); endpoints.MapGet(options.UserPath, ProcessWith <IUserService>) .AsBffApiEndpoint(); }
/// <summary> /// Adds a remote BFF API endpoint /// </summary> /// <param name="endpoints"></param> /// <param name="localPath"></param> /// <param name="apiAddress"></param> /// <param name="requireAntiForgeryCheck"></param> /// <returns></returns> public static IEndpointConventionBuilder MapRemoteBffApiEndpoint( this IEndpointRouteBuilder endpoints, PathString localPath, string apiAddress, bool requireAntiForgeryCheck = true) { endpoints.CheckLicense(); return(endpoints.Map( localPath.Add("/{**catch-all}").Value, RemoteApiEndpoint.Map(localPath, apiAddress)) .WithMetadata(new BffRemoteApiEndpointMetadata { RequireAntiForgeryHeader = requireAntiForgeryCheck })); }