MCPcopy Index your code
hub / github.com/coder/coder / GetAIProviders

Method GetAIProviders

enterprise/dbcrypt/dbcrypt.go:438–449  ·  view source on GitHub ↗

GetAIProviders returns AI provider rows, with their settings decrypted, honoring the include_deleted and include_disabled flags from the underlying query.

(ctx context.Context, arg database.GetAIProvidersParams)

Source from the content-addressed store, hash-verified

436// decrypted, honoring the include_deleted and include_disabled flags
437// from the underlying query.
438func (db *dbCrypt) GetAIProviders(ctx context.Context, arg database.GetAIProvidersParams) ([]database.AIProvider, error) {
439 providers, err := db.Store.GetAIProviders(ctx, arg)
440 if err != nil {
441 return nil, err
442 }
443 for i := range providers {
444 if err := db.decryptAIProvider(&providers[i]); err != nil {
445 return nil, err
446 }
447 }
448 return providers, nil
449}
450
451func (db *dbCrypt) InsertAIProvider(ctx context.Context, params database.InsertAIProviderParams) (database.AIProvider, error) {
452 if err := db.encryptAIProviderSettings(&params.Settings, &params.SettingsKeyID); err != nil {

Callers

nothing calls this directly

Calls 2

decryptAIProviderMethod · 0.95
GetAIProvidersMethod · 0.65

Tested by

no test coverage detected