スキル一覧に戻る
Mcafee123

bff-setup

by Mcafee123

0🍴 0📅 2026年1月10日
GitHubで見るManusで実行

SKILL.md


name: bff-setup description: Configure affolterNET.Web.Bff service registration and middleware pipeline. Use when setting up AddBffServices, ConfigureBffApp, or configuring the BFF middleware order.

BFF Setup

Configure the affolterNET.Web.Bff service registration and middleware pipeline.

For complete reference, see Library Guide.

Quick Start

// Program.cs
var builder = WebApplication.CreateBuilder(args);

// Step 1: Register services
var options = builder.Services.AddBffServices(
    builder.Environment.IsDevelopment(),
    builder.Configuration,
    opts => {
        opts.EnableSecurityHeaders = true;
        opts.ConfigureBff = bff => {
            bff.AuthMode = AuthenticationMode.Authorize;
            bff.EnableSessionManagement = true;
        };
    });

var app = builder.Build();

// Step 2: Configure middleware
app.ConfigureBffApp(options);

app.Run();

Configuration Options

BffAppOptions

PropertyTypeDescription
EnableSecurityHeadersboolEnable security headers middleware
ConfigureBffActionConfigure BFF-specific options
ConfigureAfterRoutingCustomMiddlewareActionAdd custom middleware after routing
ConfigureBeforeEndpointsCustomMiddlewareActionAdd custom middleware before endpoints

BffOptions

PropertyTypeDefaultDescription
AuthModeAuthenticationModeNoneAuthentication mode
EnableSessionManagementboolfalseEnable session management

Middleware Pipeline

The ConfigureBffApp configures middleware in this order:

  1. Exception Handling
  2. Security Headers Middleware
  3. HTTPS Redirection
  4. Static Files
  5. Swagger/OpenAPI
  6. Routing
  7. Custom Middleware (after routing hook)
  8. CORS
  9. Antiforgery (CSRF protection)
  10. Authentication & Authorization
  11. Token Refresh Middleware
  12. RPT Middleware
  13. NoUnauthorizedRedirect Middleware (API routes)
  14. Antiforgery Token Middleware
  15. Custom Middleware (before endpoints hook)
  16. API 404 Handling
  17. Endpoint Mapping (Razor Pages, Controllers, YARP, Fallback)

Common Patterns

Development vs Production

var options = builder.Services.AddBffServices(
    builder.Environment.IsDevelopment(),  // isDev flag
    builder.Configuration,
    opts => {
        // Development-specific config happens automatically
    });

Adding Custom Middleware

var options = builder.Services.AddBffServices(isDev, config, opts => {
    opts.ConfigureAfterRoutingCustomMiddleware = app => {
        app.UseMiddleware<TenantMiddleware>();
    };
    opts.ConfigureBeforeEndpointsCustomMiddleware = app => {
        app.UseMiddleware<AuditMiddleware>();
    };
});

With Session Management

var options = builder.Services.AddBffServices(isDev, config, opts => {
    opts.ConfigureBff = bff => {
        bff.EnableSessionManagement = true;
    };
});

スコア

総合スコア

50/100

リポジトリの品質指標に基づく評価

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

0/10
説明文

100文字以上の説明がある

0/10
人気

GitHub Stars 100以上

0/15
最近の活動

3ヶ月以内に更新がある

0/10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

0/5

レビュー

💬

レビュー機能は近日公開予定です