Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
10 changes: 5 additions & 5 deletions cmd/fetch_antigravity_models/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ import (
"strings"
"time"

"github.com/router-for-me/CLIProxyAPI/v7/internal/logging"
"github.com/router-for-me/CLIProxyAPI/v7/internal/misc"
sdkauth "github.com/router-for-me/CLIProxyAPI/v7/sdk/auth"
coreauth "github.com/router-for-me/CLIProxyAPI/v7/sdk/cliproxy/auth"
"github.com/router-for-me/CLIProxyAPI/v7/sdk/proxyutil"
"github.com/awsl-project/CLIProxyAPI/v7/internal/logging"
"github.com/awsl-project/CLIProxyAPI/v7/internal/misc"
sdkauth "github.com/awsl-project/CLIProxyAPI/v7/sdk/auth"
coreauth "github.com/awsl-project/CLIProxyAPI/v7/sdk/cliproxy/auth"
"github.com/awsl-project/CLIProxyAPI/v7/sdk/proxyutil"
log "github.com/sirupsen/logrus"
"github.com/tidwall/gjson"
)
Expand Down
32 changes: 16 additions & 16 deletions cmd/server/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,22 +19,22 @@ import (
"time"

"github.com/joho/godotenv"
configaccess "github.com/router-for-me/CLIProxyAPI/v7/internal/access/config_access"
"github.com/router-for-me/CLIProxyAPI/v7/internal/buildinfo"
"github.com/router-for-me/CLIProxyAPI/v7/internal/cmd"
"github.com/router-for-me/CLIProxyAPI/v7/internal/config"
"github.com/router-for-me/CLIProxyAPI/v7/internal/home"
"github.com/router-for-me/CLIProxyAPI/v7/internal/logging"
"github.com/router-for-me/CLIProxyAPI/v7/internal/managementasset"
"github.com/router-for-me/CLIProxyAPI/v7/internal/misc"
"github.com/router-for-me/CLIProxyAPI/v7/internal/redisqueue"
"github.com/router-for-me/CLIProxyAPI/v7/internal/registry"
"github.com/router-for-me/CLIProxyAPI/v7/internal/store"
_ "github.com/router-for-me/CLIProxyAPI/v7/internal/translator"
"github.com/router-for-me/CLIProxyAPI/v7/internal/tui"
"github.com/router-for-me/CLIProxyAPI/v7/internal/util"
sdkAuth "github.com/router-for-me/CLIProxyAPI/v7/sdk/auth"
coreauth "github.com/router-for-me/CLIProxyAPI/v7/sdk/cliproxy/auth"
configaccess "github.com/awsl-project/CLIProxyAPI/v7/internal/access/config_access"
"github.com/awsl-project/CLIProxyAPI/v7/internal/buildinfo"
"github.com/awsl-project/CLIProxyAPI/v7/internal/cmd"
"github.com/awsl-project/CLIProxyAPI/v7/internal/config"
"github.com/awsl-project/CLIProxyAPI/v7/internal/home"
"github.com/awsl-project/CLIProxyAPI/v7/internal/logging"
"github.com/awsl-project/CLIProxyAPI/v7/internal/managementasset"
"github.com/awsl-project/CLIProxyAPI/v7/internal/misc"
"github.com/awsl-project/CLIProxyAPI/v7/internal/redisqueue"
"github.com/awsl-project/CLIProxyAPI/v7/internal/registry"
"github.com/awsl-project/CLIProxyAPI/v7/internal/store"
_ "github.com/awsl-project/CLIProxyAPI/v7/internal/translator"
"github.com/awsl-project/CLIProxyAPI/v7/internal/tui"
"github.com/awsl-project/CLIProxyAPI/v7/internal/util"
sdkAuth "github.com/awsl-project/CLIProxyAPI/v7/sdk/auth"
coreauth "github.com/awsl-project/CLIProxyAPI/v7/sdk/cliproxy/auth"
log "github.com/sirupsen/logrus"
)

Expand Down
10 changes: 5 additions & 5 deletions docs/sdk-access.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
# @sdk/access SDK Reference

The `github.com/router-for-me/CLIProxyAPI/v6/sdk/access` package centralizes inbound request authentication for the proxy. It offers a lightweight manager that chains credential providers, so servers can reuse the same access control logic inside or outside the CLI runtime.
The `github.com/awsl-project/CLIProxyAPI/v7/sdk/access` package centralizes inbound request authentication for the proxy. It offers a lightweight manager that chains credential providers, so servers can reuse the same access control logic inside or outside the CLI runtime.

## Importing

```go
import (
sdkaccess "github.com/router-for-me/CLIProxyAPI/v6/sdk/access"
sdkaccess "github.com/awsl-project/CLIProxyAPI/v7/sdk/access"
)
```

Add the module with `go get github.com/router-for-me/CLIProxyAPI/v6/sdk/access`.
Add the module with `go get github.com/awsl-project/CLIProxyAPI/v7/sdk/access`.

## Provider Registry

Expand Down Expand Up @@ -76,7 +76,7 @@ To consume a provider shipped in another Go module, import it for its registrati
```go
import (
_ "github.com/acme/xplatform/sdk/access/providers/partner" // registers partner-token
sdkaccess "github.com/router-for-me/CLIProxyAPI/v6/sdk/access"
sdkaccess "github.com/awsl-project/CLIProxyAPI/v7/sdk/access"
)
```

Expand Down Expand Up @@ -146,7 +146,7 @@ Register any custom providers (typically via blank imports) before calling `Buil
When configuration changes, refresh any config-backed providers and then reset the manager's provider chain:

```go
// configaccess is github.com/router-for-me/CLIProxyAPI/v6/internal/access/config_access
// configaccess is github.com/awsl-project/CLIProxyAPI/v7/internal/access/config_access
configaccess.Register(&newCfg.SDKConfig)
accessManager.SetProviders(sdkaccess.RegisteredProviders())
```
Expand Down
10 changes: 5 additions & 5 deletions docs/sdk-access_CN.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
# @sdk/access 开发指引

`github.com/router-for-me/CLIProxyAPI/v6/sdk/access` 包负责代理的入站访问认证。它提供一个轻量的管理器,用于按顺序链接多种凭证校验实现,让服务器在 CLI 运行时内外都能复用相同的访问控制逻辑。
`github.com/awsl-project/CLIProxyAPI/v7/sdk/access` 包负责代理的入站访问认证。它提供一个轻量的管理器,用于按顺序链接多种凭证校验实现,让服务器在 CLI 运行时内外都能复用相同的访问控制逻辑。

## 引用方式

```go
import (
sdkaccess "github.com/router-for-me/CLIProxyAPI/v6/sdk/access"
sdkaccess "github.com/awsl-project/CLIProxyAPI/v7/sdk/access"
)
```

通过 `go get github.com/router-for-me/CLIProxyAPI/v6/sdk/access` 添加依赖。
通过 `go get github.com/awsl-project/CLIProxyAPI/v7/sdk/access` 添加依赖。

## Provider Registry

Expand Down Expand Up @@ -76,7 +76,7 @@ api-keys:
```go
import (
_ "github.com/acme/xplatform/sdk/access/providers/partner" // registers partner-token
sdkaccess "github.com/router-for-me/CLIProxyAPI/v6/sdk/access"
sdkaccess "github.com/awsl-project/CLIProxyAPI/v7/sdk/access"
)
```

Expand Down Expand Up @@ -146,7 +146,7 @@ svc, _ := cliproxy.NewBuilder().
当配置发生变化时,刷新依赖配置的 provider,然后重置 manager 的 provider 链:

```go
// configaccess is github.com/router-for-me/CLIProxyAPI/v6/internal/access/config_access
// configaccess is github.com/awsl-project/CLIProxyAPI/v7/internal/access/config_access
configaccess.Register(&newCfg.SDKConfig)
accessManager.SetProviders(sdkaccess.RegisteredProviders())
```
Expand Down
6 changes: 3 additions & 3 deletions docs/sdk-advanced.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ import (
"context"
"net/http"

coreauth "github.com/router-for-me/CLIProxyAPI/v6/sdk/cliproxy/auth"
clipexec "github.com/router-for-me/CLIProxyAPI/v6/sdk/cliproxy/executor"
coreauth "github.com/awsl-project/CLIProxyAPI/v7/sdk/cliproxy/auth"
clipexec "github.com/awsl-project/CLIProxyAPI/v7/sdk/cliproxy/executor"
)

type Executor struct{}
Expand Down Expand Up @@ -82,7 +82,7 @@ package myprov

import (
"context"
sdktr "github.com/router-for-me/CLIProxyAPI/v6/sdk/translator"
sdktr "github.com/awsl-project/CLIProxyAPI/v7/sdk/translator"
)

const (
Expand Down
6 changes: 3 additions & 3 deletions docs/sdk-advanced_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ import (
"context"
"net/http"

coreauth "github.com/router-for-me/CLIProxyAPI/v6/sdk/cliproxy/auth"
clipexec "github.com/router-for-me/CLIProxyAPI/v6/sdk/cliproxy/executor"
coreauth "github.com/awsl-project/CLIProxyAPI/v7/sdk/cliproxy/auth"
clipexec "github.com/awsl-project/CLIProxyAPI/v7/sdk/cliproxy/executor"
)

type Executor struct{}
Expand Down Expand Up @@ -77,7 +77,7 @@ package myprov

import (
"context"
sdktr "github.com/router-for-me/CLIProxyAPI/v6/sdk/translator"
sdktr "github.com/awsl-project/CLIProxyAPI/v7/sdk/translator"
)

const (
Expand Down
6 changes: 3 additions & 3 deletions docs/sdk-usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ The `sdk/cliproxy` module exposes the proxy as a reusable Go library so external
## Install & Import

```bash
go get github.com/router-for-me/CLIProxyAPI/v6/sdk/cliproxy
go get github.com/awsl-project/CLIProxyAPI/v7/sdk/cliproxy
```

```go
Expand All @@ -14,8 +14,8 @@ import (
"errors"
"time"

"github.com/router-for-me/CLIProxyAPI/v6/internal/config"
"github.com/router-for-me/CLIProxyAPI/v6/sdk/cliproxy"
"github.com/awsl-project/CLIProxyAPI/v7/internal/config"
"github.com/awsl-project/CLIProxyAPI/v7/sdk/cliproxy"
)
```

Expand Down
6 changes: 3 additions & 3 deletions docs/sdk-usage_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
## 安装与导入

```bash
go get github.com/router-for-me/CLIProxyAPI/v6/sdk/cliproxy
go get github.com/awsl-project/CLIProxyAPI/v7/sdk/cliproxy
```

```go
Expand All @@ -14,8 +14,8 @@ import (
"errors"
"time"

"github.com/router-for-me/CLIProxyAPI/v6/internal/config"
"github.com/router-for-me/CLIProxyAPI/v6/sdk/cliproxy"
"github.com/awsl-project/CLIProxyAPI/v7/internal/config"
"github.com/awsl-project/CLIProxyAPI/v7/sdk/cliproxy"
)
```

Expand Down
16 changes: 8 additions & 8 deletions examples/custom-provider/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ import (
"time"

"github.com/gin-gonic/gin"
"github.com/router-for-me/CLIProxyAPI/v7/sdk/api"
sdkAuth "github.com/router-for-me/CLIProxyAPI/v7/sdk/auth"
"github.com/router-for-me/CLIProxyAPI/v7/sdk/cliproxy"
coreauth "github.com/router-for-me/CLIProxyAPI/v7/sdk/cliproxy/auth"
clipexec "github.com/router-for-me/CLIProxyAPI/v7/sdk/cliproxy/executor"
"github.com/router-for-me/CLIProxyAPI/v7/sdk/config"
"github.com/router-for-me/CLIProxyAPI/v7/sdk/logging"
sdktr "github.com/router-for-me/CLIProxyAPI/v7/sdk/translator"
"github.com/awsl-project/CLIProxyAPI/v7/sdk/api"
sdkAuth "github.com/awsl-project/CLIProxyAPI/v7/sdk/auth"
"github.com/awsl-project/CLIProxyAPI/v7/sdk/cliproxy"
coreauth "github.com/awsl-project/CLIProxyAPI/v7/sdk/cliproxy/auth"
clipexec "github.com/awsl-project/CLIProxyAPI/v7/sdk/cliproxy/executor"
"github.com/awsl-project/CLIProxyAPI/v7/sdk/config"
"github.com/awsl-project/CLIProxyAPI/v7/sdk/logging"
sdktr "github.com/awsl-project/CLIProxyAPI/v7/sdk/translator"
)

const (
Expand Down
4 changes: 2 additions & 2 deletions examples/http-request/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ import (
"strings"
"time"

coreauth "github.com/router-for-me/CLIProxyAPI/v7/sdk/cliproxy/auth"
clipexec "github.com/router-for-me/CLIProxyAPI/v7/sdk/cliproxy/executor"
coreauth "github.com/awsl-project/CLIProxyAPI/v7/sdk/cliproxy/auth"
clipexec "github.com/awsl-project/CLIProxyAPI/v7/sdk/cliproxy/executor"
log "github.com/sirupsen/logrus"
)

Expand Down
4 changes: 2 additions & 2 deletions examples/translator/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"context"
"fmt"

"github.com/router-for-me/CLIProxyAPI/v7/sdk/translator"
_ "github.com/router-for-me/CLIProxyAPI/v7/sdk/translator/builtin"
"github.com/awsl-project/CLIProxyAPI/v7/sdk/translator"
_ "github.com/awsl-project/CLIProxyAPI/v7/sdk/translator/builtin"
)

func main() {
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/router-for-me/CLIProxyAPI/v7
module github.com/awsl-project/CLIProxyAPI/v7

go 1.26.0

Expand Down
4 changes: 2 additions & 2 deletions internal/access/config_access/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"net/http"
"strings"

sdkaccess "github.com/router-for-me/CLIProxyAPI/v7/sdk/access"
sdkconfig "github.com/router-for-me/CLIProxyAPI/v7/sdk/config"
sdkaccess "github.com/awsl-project/CLIProxyAPI/v7/sdk/access"
sdkconfig "github.com/awsl-project/CLIProxyAPI/v7/sdk/config"
)

// Register ensures the config-access provider is available to the access manager.
Expand Down
6 changes: 3 additions & 3 deletions internal/access/reconcile.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import (
"sort"
"strings"

configaccess "github.com/router-for-me/CLIProxyAPI/v7/internal/access/config_access"
"github.com/router-for-me/CLIProxyAPI/v7/internal/config"
sdkaccess "github.com/router-for-me/CLIProxyAPI/v7/sdk/access"
configaccess "github.com/awsl-project/CLIProxyAPI/v7/internal/access/config_access"
"github.com/awsl-project/CLIProxyAPI/v7/internal/config"
sdkaccess "github.com/awsl-project/CLIProxyAPI/v7/sdk/access"
log "github.com/sirupsen/logrus"
)

Expand Down
2 changes: 1 addition & 1 deletion internal/api/handlers/management/api_key_usage.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"time"

"github.com/gin-gonic/gin"
coreauth "github.com/router-for-me/CLIProxyAPI/v7/sdk/cliproxy/auth"
coreauth "github.com/awsl-project/CLIProxyAPI/v7/sdk/cliproxy/auth"
)

type apiKeyUsageEntry struct {
Expand Down
4 changes: 2 additions & 2 deletions internal/api/handlers/management/api_key_usage_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (
"testing"

"github.com/gin-gonic/gin"
"github.com/router-for-me/CLIProxyAPI/v7/internal/config"
coreauth "github.com/router-for-me/CLIProxyAPI/v7/sdk/cliproxy/auth"
"github.com/awsl-project/CLIProxyAPI/v7/internal/config"
coreauth "github.com/awsl-project/CLIProxyAPI/v7/sdk/cliproxy/auth"
)

func sumRecentRequestBuckets(buckets []coreauth.RecentRequestBucket) (int64, int64) {
Expand Down
8 changes: 4 additions & 4 deletions internal/api/handlers/management/api_tools.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ import (
"time"

"github.com/gin-gonic/gin"
"github.com/router-for-me/CLIProxyAPI/v7/internal/config"
"github.com/router-for-me/CLIProxyAPI/v7/internal/runtime/geminicli"
coreauth "github.com/router-for-me/CLIProxyAPI/v7/sdk/cliproxy/auth"
"github.com/router-for-me/CLIProxyAPI/v7/sdk/proxyutil"
"github.com/awsl-project/CLIProxyAPI/v7/internal/config"
"github.com/awsl-project/CLIProxyAPI/v7/internal/runtime/geminicli"
coreauth "github.com/awsl-project/CLIProxyAPI/v7/sdk/cliproxy/auth"
"github.com/awsl-project/CLIProxyAPI/v7/sdk/proxyutil"
log "github.com/sirupsen/logrus"
"golang.org/x/oauth2"
"golang.org/x/oauth2/google"
Expand Down
6 changes: 3 additions & 3 deletions internal/api/handlers/management/api_tools_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import (
"net/http"
"testing"

"github.com/router-for-me/CLIProxyAPI/v7/internal/config"
coreauth "github.com/router-for-me/CLIProxyAPI/v7/sdk/cliproxy/auth"
sdkconfig "github.com/router-for-me/CLIProxyAPI/v7/sdk/config"
"github.com/awsl-project/CLIProxyAPI/v7/internal/config"
coreauth "github.com/awsl-project/CLIProxyAPI/v7/sdk/cliproxy/auth"
sdkconfig "github.com/awsl-project/CLIProxyAPI/v7/sdk/config"
)

func TestAPICallTransportDirectBypassesGlobalProxy(t *testing.T) {
Expand Down
22 changes: 11 additions & 11 deletions internal/api/handlers/management/auth_files.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,17 @@ import (
"time"

"github.com/gin-gonic/gin"
"github.com/router-for-me/CLIProxyAPI/v7/internal/auth/antigravity"
"github.com/router-for-me/CLIProxyAPI/v7/internal/auth/claude"
"github.com/router-for-me/CLIProxyAPI/v7/internal/auth/codex"
geminiAuth "github.com/router-for-me/CLIProxyAPI/v7/internal/auth/gemini"
"github.com/router-for-me/CLIProxyAPI/v7/internal/auth/kimi"
"github.com/router-for-me/CLIProxyAPI/v7/internal/interfaces"
"github.com/router-for-me/CLIProxyAPI/v7/internal/misc"
"github.com/router-for-me/CLIProxyAPI/v7/internal/registry"
"github.com/router-for-me/CLIProxyAPI/v7/internal/util"
sdkAuth "github.com/router-for-me/CLIProxyAPI/v7/sdk/auth"
coreauth "github.com/router-for-me/CLIProxyAPI/v7/sdk/cliproxy/auth"
"github.com/awsl-project/CLIProxyAPI/v7/internal/auth/antigravity"
"github.com/awsl-project/CLIProxyAPI/v7/internal/auth/claude"
"github.com/awsl-project/CLIProxyAPI/v7/internal/auth/codex"
geminiAuth "github.com/awsl-project/CLIProxyAPI/v7/internal/auth/gemini"
"github.com/awsl-project/CLIProxyAPI/v7/internal/auth/kimi"
"github.com/awsl-project/CLIProxyAPI/v7/internal/interfaces"
"github.com/awsl-project/CLIProxyAPI/v7/internal/misc"
"github.com/awsl-project/CLIProxyAPI/v7/internal/registry"
"github.com/awsl-project/CLIProxyAPI/v7/internal/util"
sdkAuth "github.com/awsl-project/CLIProxyAPI/v7/sdk/auth"
coreauth "github.com/awsl-project/CLIProxyAPI/v7/sdk/cliproxy/auth"
log "github.com/sirupsen/logrus"
"github.com/tidwall/gjson"
"golang.org/x/oauth2"
Expand Down
4 changes: 2 additions & 2 deletions internal/api/handlers/management/auth_files_batch_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import (
"testing"

"github.com/gin-gonic/gin"
"github.com/router-for-me/CLIProxyAPI/v7/internal/config"
coreauth "github.com/router-for-me/CLIProxyAPI/v7/sdk/cliproxy/auth"
"github.com/awsl-project/CLIProxyAPI/v7/internal/config"
coreauth "github.com/awsl-project/CLIProxyAPI/v7/sdk/cliproxy/auth"
)

func TestUploadAuthFile_BatchMultipart(t *testing.T) {
Expand Down
4 changes: 2 additions & 2 deletions internal/api/handlers/management/auth_files_delete_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import (
"testing"

"github.com/gin-gonic/gin"
"github.com/router-for-me/CLIProxyAPI/v7/internal/config"
coreauth "github.com/router-for-me/CLIProxyAPI/v7/sdk/cliproxy/auth"
"github.com/awsl-project/CLIProxyAPI/v7/internal/config"
coreauth "github.com/awsl-project/CLIProxyAPI/v7/sdk/cliproxy/auth"
)

func TestDeleteAuthFile_UsesAuthPathFromManager(t *testing.T) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"testing"

"github.com/gin-gonic/gin"
"github.com/router-for-me/CLIProxyAPI/v7/internal/config"
"github.com/awsl-project/CLIProxyAPI/v7/internal/config"
)

func TestDownloadAuthFile_ReturnsFile(t *testing.T) {
Expand Down
Loading
Loading