@@ -30,14 +30,14 @@ func newCacheServiceClient() cachev1connect.CacheServiceClient {
3030// UploadCacheEntry uploads content to the Depot Cache service as a generic entry.
3131// It uses a 3-step process: CreateEntry, HTTP PUT to presigned URL, FinalizeEntry.
3232// If the entry already exists (content-addressed), it returns nil.
33- func UploadCacheEntry (ctx context.Context , token , key string , content []byte ) error {
33+ func UploadCacheEntry (ctx context.Context , token , orgID , key string , content []byte ) error {
3434 client := newCacheServiceClient ()
3535
3636 // Step 1: Create cache entry
37- createResp , err := client .CreateEntry (ctx , WithAuthentication (connect .NewRequest (& cachev1.CreateEntryRequest {
37+ createResp , err := client .CreateEntry (ctx , WithAuthenticationAndOrg (connect .NewRequest (& cachev1.CreateEntryRequest {
3838 EntryType : "generic" ,
3939 Key : key ,
40- }), token ))
40+ }), token , orgID ))
4141 if err != nil {
4242 // Content-addressed: if already exists, skip upload
4343 if connect .CodeOf (err ) == connect .CodeAlreadyExists {
@@ -74,11 +74,11 @@ func UploadCacheEntry(ctx context.Context, token, key string, content []byte) er
7474 }
7575
7676 // Step 3: Finalize the entry
77- _ , err = client .FinalizeEntry (ctx , WithAuthentication (connect .NewRequest (& cachev1.FinalizeEntryRequest {
77+ _ , err = client .FinalizeEntry (ctx , WithAuthenticationAndOrg (connect .NewRequest (& cachev1.FinalizeEntryRequest {
7878 EntryId : createResp .Msg .EntryId ,
7979 SizeBytes : int64 (len (content )),
8080 UploadPartEtags : []string {etag },
81- }), token ))
81+ }), token , orgID ))
8282 if err != nil {
8383 return fmt .Errorf ("failed to finalize cache entry: %w" , err )
8484 }
0 commit comments