Skip to content

Commit 2724dfd

Browse files
committed
Use AsSystem for decrypting encrypted api keys
1 parent 106d58b commit 2724dfd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

coderd/workspaceapps.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1023,7 +1023,7 @@ func decryptAPIKey(ctx context.Context, db database.Store, encryptedAPIKey strin
10231023

10241024
// Lookup the API key so we can decrypt it.
10251025
keyID := object.Header.KeyID
1026-
key, err := db.GetAPIKeyByID(ctx, keyID)
1026+
key, err := db.GetAPIKeyByID(dbauthz.AsSystem(ctx), keyID)
10271027
if err != nil {
10281028
return database.APIKey{}, "", xerrors.Errorf("get API key by key ID: %w", err)
10291029
}

0 commit comments

Comments
 (0)