mirror of
https://github.com/memohai/Memoh.git
synced 2026-04-27 07:16:19 +09:00
feat(channel): redact credentials from IM error messages (#240)
This commit is contained in:
@@ -12,6 +12,7 @@ import (
|
||||
"github.com/jackc/pgx/v5"
|
||||
"github.com/jackc/pgx/v5/pgtype"
|
||||
|
||||
"github.com/memohai/memoh/internal/channel"
|
||||
"github.com/memohai/memoh/internal/db"
|
||||
"github.com/memohai/memoh/internal/db/sqlc"
|
||||
)
|
||||
@@ -487,7 +488,14 @@ func FetchProviderByID(ctx context.Context, queries *sqlc.Queries, providerID st
|
||||
if err != nil {
|
||||
return sqlc.LlmProvider{}, err
|
||||
}
|
||||
return queries.GetLlmProviderByID(ctx, parsed)
|
||||
provider, err := queries.GetLlmProviderByID(ctx, parsed)
|
||||
if err != nil {
|
||||
return sqlc.LlmProvider{}, err
|
||||
}
|
||||
if strings.TrimSpace(provider.ApiKey) != "" {
|
||||
channel.SetIMErrorSecrets("llm-provider:"+providerID, provider.ApiKey)
|
||||
}
|
||||
return provider, nil
|
||||
}
|
||||
|
||||
func intToInt4(value int, name string) (pgtype.Int4, error) {
|
||||
|
||||
Reference in New Issue
Block a user