package com.openclaw.alfred.auth

import android.net.Uri
import com.openclaw.alfred.BuildConfig

/**
 * OAuth configuration for Authentik authentication.
 * Values injected from secrets.properties via BuildConfig.
 */
object OAuthConfig {
    
    // Authentik OAuth endpoints
    val AUTHORIZATION_ENDPOINT = Uri.parse("${BuildConfig.AUTHENTIK_URL}/application/o/authorize/")
    val TOKEN_ENDPOINT = Uri.parse("${BuildConfig.AUTHENTIK_URL}/application/o/token/")
    val USER_INFO_ENDPOINT = Uri.parse("${BuildConfig.AUTHENTIK_URL}/application/o/userinfo/")
    
    // Client configuration
    const val CLIENT_ID = BuildConfig.AUTHENTIK_CLIENT_ID
    val REDIRECT_URI = Uri.parse(BuildConfig.OAUTH_REDIRECT_URI)
    
    // OAuth scopes
    const val SCOPE = "openid profile email"
    
    // Gateway configuration
    const val GATEWAY_URL = BuildConfig.GATEWAY_URL
    
    // Token storage keys
    const val PREFS_NAME = "alfred_auth"
    const val KEY_ACCESS_TOKEN = "access_token"
    const val KEY_REFRESH_TOKEN = "refresh_token"
    const val KEY_ID_TOKEN = "id_token"
    const val KEY_TOKEN_EXPIRY = "token_expiry"
}
