← スキル一覧に戻る

backend-controller-pattern-backdoor
by allenlin90
⭐ 1🍴 0📅 2026年1月24日
SKILL.md
name: backend-controller-pattern-backdoor description: Provides NestJS Controller patterns for Backdoor (Service-to-Service) endpoints. This skill should be used when building endpoints that require API Key authentication for internal communication.
Backdoor Controller Pattern (NestJS)
This skill outlines the patterns for Backdoor controllers in erify_api. These endpoints are designed for service-to-service communication or internal tools that bypass standard JWT authentication in favor of API Key authentication.
Core Principles
- Inheritance: All backdoor controllers MUST extend
BaseBackdoorController. - Authentication: Automatically authenticated via API Key using the
@Backdoor()decorator (from base class). - Path Structure: All routes must start with
backdoor/.
Base Controller
BaseBackdoorController provides:
@Backdoor()decorator application (skips JWT guard, applies API Key guard).
Implementation Pattern
import { Controller, Get, Param, UseGuards } from '@nestjs/common';
import { BaseBackdoorController } from '@/backdoor/base-backdoor.controller';
import { ZodResponse } from '@/lib/decorators/zod-response.decorator';
@Controller('backdoor/users')
export class BackdoorUserController extends BaseBackdoorController {
constructor(private readonly userService: UserService) {
super();
}
@Get(':ext_id')
@ZodResponse(UserDto)
async getUserByExtId(@Param('ext_id') extId: string) {
return this.userService.getUserByExtId(extId);
}
}
Checklist
- Controller extends
BaseBackdoorController. - Route prefix is
backdoor/<resource>. - Uses
@ZodResponsefor serialization. - NO
@CurrentUserdecorator (concept doesn't exist for API keys).
スコア
総合スコア
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
レビュー
💬
レビュー機能は近日公開予定です