fix: resolve Kiro profile ARN for generation requests (#46)

This commit is contained in:
Delicious233
2026-05-12 18:56:59 +08:00
committed by GitHub
parent f9e45a5f1d
commit 08a9747c99
4 changed files with 183 additions and 0 deletions

View File

@@ -50,6 +50,7 @@ type Account struct {
StartUrl string `json:"startUrl,omitempty"` // AWS SSO start URL
ExpiresAt int64 `json:"expiresAt,omitempty"` // Token expiration timestamp (Unix seconds)
MachineId string `json:"machineId,omitempty"` // UUID machine identifier for request tracking
ProfileArn string `json:"profileArn,omitempty"` // CodeWhisperer/Kiro profile ARN for generation requests
// Priority weight for load balancing (higher = more requests)
Weight int `json:"weight,omitempty"` // 0 or 1 = normal, 2+ = higher priority
@@ -274,6 +275,18 @@ func UpdateAccount(id string, account Account) error {
return nil
}
func UpdateAccountProfileArn(id, profileArn string) error {
cfgLock.Lock()
defer cfgLock.Unlock()
for i, a := range cfg.Accounts {
if a.ID == id {
cfg.Accounts[i].ProfileArn = profileArn
return Save()
}
}
return nil
}
func DeleteAccount(id string) error {
cfgLock.Lock()
defer cfgLock.Unlock()