GetAIProviderKeys returns AI provider key rows with their api_key decrypted. The list handler relies on the default scope (live providers only); the dbcrypt key rotation utility calls with includeDeleted=TRUE so it can walk every row holding a foreign-key reference to dbcrypt_keys before old keys ar
(ctx context.Context, includeDeleted bool)
| 557 | // includeDeleted=TRUE so it can walk every row holding a foreign-key |
| 558 | // reference to dbcrypt_keys before old keys are revoked. |
| 559 | func (db *dbCrypt) GetAIProviderKeys(ctx context.Context, includeDeleted bool) ([]database.AIProviderKey, error) { |
| 560 | keys, err := db.Store.GetAIProviderKeys(ctx, includeDeleted) |
| 561 | if err != nil { |
| 562 | return nil, err |
| 563 | } |
| 564 | for i := range keys { |
| 565 | if err := db.decryptAIProviderKey(&keys[i]); err != nil { |
| 566 | return nil, err |
| 567 | } |
| 568 | } |
| 569 | return keys, nil |
| 570 | } |
| 571 | |
| 572 | // UpdateEncryptedAIProviderKey re-encrypts the api_key column of a |
| 573 | // key row, so that dbcrypt key rotation can move every FK reference |
nothing calls this directly
no test coverage detected