mirror of
https://github.com/router-for-me/CLIProxyAPIPlus.git
synced 2026-03-08 06:43:41 +00:00
- Add --kiro-aws-login flag for AWS Builder ID device code flow - Add DoKiroAWSLogin function for AWS SSO OIDC authentication - Complete Kiro integration with AWS, Google OAuth, and social auth - Add kiro executor, translator, and SDK components - Update browser support for Kiro authentication flows
39 lines
753 B
Go
39 lines
753 B
Go
package executor
|
|
|
|
import (
|
|
"sync"
|
|
"time"
|
|
)
|
|
|
|
type codexCache struct {
|
|
ID string
|
|
Expire time.Time
|
|
}
|
|
|
|
var (
|
|
codexCacheMap = map[string]codexCache{}
|
|
codexCacheMutex sync.RWMutex
|
|
)
|
|
|
|
// getCodexCache safely retrieves a cache entry
|
|
func getCodexCache(key string) (codexCache, bool) {
|
|
codexCacheMutex.RLock()
|
|
defer codexCacheMutex.RUnlock()
|
|
cache, ok := codexCacheMap[key]
|
|
return cache, ok
|
|
}
|
|
|
|
// setCodexCache safely sets a cache entry
|
|
func setCodexCache(key string, cache codexCache) {
|
|
codexCacheMutex.Lock()
|
|
defer codexCacheMutex.Unlock()
|
|
codexCacheMap[key] = cache
|
|
}
|
|
|
|
// deleteCodexCache safely deletes a cache entry
|
|
func deleteCodexCache(key string) {
|
|
codexCacheMutex.Lock()
|
|
defer codexCacheMutex.Unlock()
|
|
delete(codexCacheMap, key)
|
|
}
|