Skip to content

Commit f2da1bb

Browse files
committed
add auth integration
1 parent c755d64 commit f2da1bb

File tree

6 files changed

+175
-34
lines changed

6 files changed

+175
-34
lines changed

cmd/bricksllm/main.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,10 @@ func main() {
286286
psCache := redisStorage.NewProviderSettingsCache(providerSettingsRedisCache, cfg.RedisWriteTimeout, cfg.RedisReadTimeout)
287287
keysCache := redisStorage.NewKeysCache(keysRedisCache, cfg.RedisWriteTimeout, cfg.RedisReadTimeout)
288288

289-
encryptor := encryptor.NewEncryptor(cfg.DecryptionEndpoint, cfg.EncryptionEndpoint, cfg.EnableEncrytion, cfg.EncryptionTimeout)
289+
encryptor, err := encryptor.NewEncryptor(cfg.DecryptionEndpoint, cfg.EncryptionEndpoint, cfg.EnableEncrytion, cfg.EncryptionTimeout, cfg.Audience)
290+
if cfg.EnableEncrytion && err != nil {
291+
log.Sugar().Fatalf("error creating encryption client: %v", err)
292+
}
290293

291294
m := manager.NewManager(store, costLimitCache, rateLimitCache, accessCache, keysCache)
292295
krm := manager.NewReportingManager(costStorage, store, store)

go.mod

Lines changed: 26 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,25 +19,44 @@ require (
1919
github.com/pkoukk/tiktoken-go v0.1.7
2020
github.com/redis/go-redis/v9 v9.0.5
2121
github.com/sashabaranov/go-openai v1.32.5
22-
github.com/stretchr/testify v1.8.4
22+
github.com/stretchr/testify v1.9.0
2323
github.com/tidwall/gjson v1.17.0
2424
github.com/tidwall/sjson v1.2.5
2525
go.uber.org/zap v1.24.0
26+
google.golang.org/api v0.206.0
2627
)
2728

2829
require (
30+
cloud.google.com/go/auth v0.10.2 // indirect
31+
cloud.google.com/go/auth/oauth2adapt v0.2.5 // indirect
32+
cloud.google.com/go/compute/metadata v0.5.2 // indirect
2933
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.4 // indirect
3034
github.com/beorn7/perks v1.0.1 // indirect
35+
github.com/felixge/httpsnoop v1.0.4 // indirect
3136
github.com/fsnotify/fsnotify v1.6.0 // indirect
37+
github.com/go-logr/logr v1.4.2 // indirect
38+
github.com/go-logr/stdr v1.2.2 // indirect
3239
github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1 // indirect
40+
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
41+
github.com/google/s2a-go v0.1.8 // indirect
42+
github.com/googleapis/enterprise-certificate-proxy v0.3.4 // indirect
43+
github.com/googleapis/gax-go/v2 v2.14.0 // indirect
3344
github.com/knadh/koanf/maps v0.1.1 // indirect
3445
github.com/kr/text v0.2.0 // indirect
3546
github.com/mitchellh/copystructure v1.2.0 // indirect
3647
github.com/mitchellh/reflectwalk v1.0.2 // indirect
3748
github.com/prometheus/client_model v0.5.0 // indirect
3849
github.com/prometheus/common v0.48.0 // indirect
3950
github.com/prometheus/procfs v0.12.0 // indirect
51+
go.opencensus.io v0.24.0 // indirect
52+
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.54.0 // indirect
53+
go.opentelemetry.io/otel v1.29.0 // indirect
54+
go.opentelemetry.io/otel/metric v1.29.0 // indirect
55+
go.opentelemetry.io/otel/trace v1.29.0 // indirect
4056
go.uber.org/atomic v1.7.0 // indirect
57+
golang.org/x/oauth2 v0.24.0 // indirect
58+
google.golang.org/genproto/googleapis/rpc v0.0.0-20241104194629-dd2ea8efbc28 // indirect
59+
google.golang.org/grpc v1.67.1 // indirect
4160
)
4261

4362
require (
@@ -57,7 +76,7 @@ require (
5776
github.com/aws/aws-sdk-go-v2/service/sts v1.28.4 // indirect
5877
github.com/aws/smithy-go v1.20.4 // indirect
5978
github.com/bytedance/sonic v1.9.1 // indirect
60-
github.com/cespare/xxhash/v2 v2.2.0 // indirect
79+
github.com/cespare/xxhash/v2 v2.3.0 // indirect
6180
github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311 // indirect
6281
github.com/davecgh/go-spew v1.1.1 // indirect
6382
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect
@@ -86,10 +105,10 @@ require (
86105
github.com/ugorji/go/codec v1.2.11 // indirect
87106
go.uber.org/multierr v1.10.0 // indirect
88107
golang.org/x/arch v0.3.0 // indirect
89-
golang.org/x/crypto v0.18.0 // indirect
90-
golang.org/x/net v0.20.0 // indirect
91-
golang.org/x/sys v0.17.0 // indirect
92-
golang.org/x/text v0.14.0 // indirect
93-
google.golang.org/protobuf v1.33.0 // indirect
108+
golang.org/x/crypto v0.29.0 // indirect
109+
golang.org/x/net v0.31.0 // indirect
110+
golang.org/x/sys v0.27.0 // indirect
111+
golang.org/x/text v0.20.0 // indirect
112+
google.golang.org/protobuf v1.35.1 // indirect
94113
gopkg.in/yaml.v3 v3.0.1 // indirect
95114
)

0 commit comments

Comments
 (0)