package domain

import "time"

type HeadlessJWKSParsedKey struct {
	Kid string `json:"kid,omitempty"`
	Kty string `json:"kty,omitempty"`
	Use string `json:"use,omitempty"`
	Alg string `json:"alg,omitempty"`
	N   string `json:"n,omitempty"`
}

// HeadlessJWKSCacheState는 headless login용 JWKS 캐시 상태와 최근 동기화 결과를 나타냅니다.
type HeadlessJWKSCacheState struct {
	ClientID                     string                  `json:"clientId"`
	JWKSURI                      string                  `json:"jwksUri"`
	CachedAt                     *time.Time              `json:"cachedAt,omitempty"`
	ExpiresAt                    *time.Time              `json:"expiresAt,omitempty"`
	LastCheckedAt                *time.Time              `json:"lastCheckedAt,omitempty"`
	NextRetryAt                  *time.Time              `json:"nextRetryAt,omitempty"`
	LastSuccessfulVerificationAt *time.Time              `json:"lastSuccessfulVerificationAt,omitempty"`
	LastRefreshStatus            string                  `json:"lastRefreshStatus,omitempty"`
	LastError                    string                  `json:"lastError,omitempty"`
	ConsecutiveFailures          int                     `json:"consecutiveFailures,omitempty"`
	CachedKids                   []string                `json:"cachedKids,omitempty"`
	ParsedKeys                   []HeadlessJWKSParsedKey `json:"parsedKeys,omitempty"`
	ETag                         string                  `json:"etag,omitempty"`
	LastModified                 string                  `json:"lastModified,omitempty"`
	RawJWKS                      string                  `json:"-"`
}
