示例#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>);
        }
示例#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>);
        }
示例#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>);
        }
示例#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();
        }
示例#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
            }));
        }