Documentation
¶
Overview ¶
Package ginauth는 gin 기반 관리 API key 인증 middleware를 제공합니다.
패키지 개요 ¶
이 패키지는 shared-go의 프레임워크 독립 인증 비교 함수를 gin middleware로 감쌉니다. 빈 API key를 개발 모드로 통과시키는 일반 route middleware와, 인증 후에도 404를 반환하는 NoRoute handler 계약을 분리합니다.
주요 사용 패턴 ¶
router := gin.New() router.Use(ginauth.APIKeyAuthMiddleware(apiKey)) router.NoRoute(ginauth.NoRouteAuthHandler(apiKey))
Index ¶
Constants ¶
View Source
const ( // APIKeyHeader는 gin 인증 middleware가 읽는 API key 헤더 이름이다. APIKeyHeader = httputil.HeaderAPIKey )
Variables ¶
This section is empty.
Functions ¶
func APIKeyAuthMiddleware ¶
func APIKeyAuthMiddleware(apiKey string) gin.HandlerFunc
APIKeyAuthMiddleware는 hololive-shared형 gin API key 인증 middleware를 만든다.
func NoRouteAuthHandler ¶
func NoRouteAuthHandler(apiKey string) gin.HandlerFunc
NoRouteAuthHandler는 인증 후에도 not_found JSON을 반환하는 gin NoRoute handler를 만든다.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.