auth

package
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 18, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApplicationManager

type ApplicationManager struct {
	// contains filtered or unexported fields
}

ApplicationManager 애플리케이션 로딩 및 인증을 담당하는 매니저입니다.

이 구조체는 다음과 같은 역할을 수행합니다:

  • 설정 파일에서 등록된 애플리케이션 정보를 메모리에 로드
  • Application ID와 App Key를 통한 인증 처리
  • 인증 실패 시 적절한 HTTP 에러 반환

ApplicationManager는 API 버전(v1, v2 등)과 무관하게 모든 핸들러에서 재사용 가능하며, 애플리케이션 인증이 필요한 모든 엔드포인트에서 공통으로 사용됩니다.

사용 예시:

manager := auth.NewApplicationManager(appConfig)
app, err := manager.Authenticate(applicationID, appKey)
if err != nil {
    return err // 401 Unauthorized
}
// app 사용

func NewApplicationManager

func NewApplicationManager(appConfig *config.AppConfig) *ApplicationManager

NewApplicationManager 설정에서 애플리케이션을 로드하여 ApplicationManager를 생성합니다.

func (*ApplicationManager) Authenticate

func (m *ApplicationManager) Authenticate(applicationID, appKey string) (*domain.Application, error)

Authenticate 애플리케이션을 찾고 인증을 수행합니다. 성공 시 Application 객체를 반환하고, 실패 시 적절한 HTTP 에러를 반환합니다.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL