feat: Add validation and account management functionality (#21)

* feat: Add validation and account management functionality

- Add validation for clientID and clientSecret in refreshOIDCToken function
- Add weight field for load balancing priority in Account struct
- Implement weighted轮询策略以根据账号权重分配选择概率。
- Add batch account management functionality including enabling, disabling, refreshing, and retrieving account details.
- Update Kiro API version and adjust user agent strings to reflect new version numbers.
- Update Kiro version and modify user agent strings and header settings.
- Refactor model mapping to an ordered list for precise key matching.
- Add account bulk actions and filtering toolbar to index.html

* feat: Add logic to skip accounts with exhausted usage limits

- Add logic to skip accounts with exhausted usage limits when selecting the next account.
This commit is contained in:
hkxiaoyao
2026-02-23 21:47:17 +08:00
committed by GitHub
parent d71bf09dde
commit ad7aabd554
7 changed files with 323 additions and 23 deletions

View File

@@ -20,6 +20,9 @@ func RefreshToken(account *config.Account) (string, string, int64, error) {
// refreshOIDCToken IdC/Builder ID token 刷新
func refreshOIDCToken(refreshToken, clientID, clientSecret, region string) (string, string, int64, error) {
if clientID == "" || clientSecret == "" {
return "", "", 0, fmt.Errorf("OIDC refresh requires clientId and clientSecret")
}
if region == "" {
region = "us-east-1"
}