Exemple #1
0
        /// <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>);
        }
Exemple #2
0
        /// <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>);
        }
Exemple #3
0
        /// <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>);
        }
Exemple #4
0
        /// <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();
        }
Exemple #5
0
        /// <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
            }));
        }