Skip to content

SPEC: Introduce Batch Signing Endpoint - #18254

Draft
sungwy wants to merge 2 commits into
apache:mainfrom
sungwy:spec-batch-sign
Draft

sungwy wants to merge 2 commits into
apache:mainfrom
sungwy:spec-batch-sign

Conversation

@sungwy

@sungwy sungwy commented Sep 25, 2026

Copy link
Copy Markdown
Contributor

Introduce a batch signing endpoint, as proposed in https://s.apache.org/irc-batch-signing

To be merged after #18080

@danielcweeks
danielcweeks self-requested a review October 8, 2026 16:21
type: object
required:
- uri
- headers

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think headers need to be required.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree, but I grandfathered this one in from the singular RemoteSignRequest

I know it is required in RemoteSignRequest for backward compatibility even after introducing remote-presigning (#18080) - do we want to divert away from that here? I was worried that it would be confusing to have different nullability semantic for the two

Comment thread open-api/rest-catalog-open-api.yaml Outdated
Comment on lines +5533 to +5534
description: The storage provider for every element of the batch. If this is not specified, the
provider is assumed to be `s3`, as in `RemoteSignRequest`.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this is a new endpoint, we don't need to carry forward this assumption. We should remove it.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay noted - that makes sense

Comment thread open-api/rest-catalog-open-api.yaml Outdated
Comment on lines +5560 to +5563
SignStatus:
description: Status of signing one element of a batch
type: string
enum: ["completed", "failed"]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This feels like it introduces an awkward indirection around failure. If the request fails, the response should be a failure otherwise you get Resp[200] -> Failed, which creates confusing response codes.

Comment thread open-api/rest-catalog-open-api.yaml Outdated
Comment on lines +1447 to +1449
A server MAY
advertise its batch size limit as `sign-batch-max-size` in `CatalogConfig`. If not the value is not advertised, the server
SHOULD use a default batch size of 100 elements. A batch above the server's limit is rejected with 413.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we want to define the default batch size. This almost feels like something we should add in the remote sign config, so it's not a guess (the service configures the client for the right batch size).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay - should we make the client fail instead if the sign-batch-max-size is not provided by the server when it attempts to use the batch signing API?

Comment thread open-api/rest-catalog-open-api.yaml Outdated
@@ -6050,6 +5807,22 @@ components:
}
}

ContentTooLargeResponse:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe make this BatchContentTooLargeResponse so we don't burn a generic name for a specific response.

Comment thread open-api/rest-catalog-open-api.yaml Outdated
- Catalog API
summary: Remotely signs a batch of requests to object storage
operationId: batchSignRequests
description: >

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
description: >
description:

nit: don't fold

Comment thread open-api/rest-catalog-open-api.yaml Outdated
Comment on lines +1447 to +1448
A server MAY
advertise its batch size limit as `sign-batch-max-size` in `CatalogConfig`. If not the value is not advertised, the server

@danielcweeks danielcweeks Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: strange formatting/line break here

advertise its batch size limit as sign-batch-max-size in CatalogConfig

Should be an added field in RemoteSigningConfiguration (not a catalog config)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see what you are saying - max batch signing limit should be a table level configuration, instead of being defined at the catalog scope.

Comment thread open-api/rest-catalog-open-api.yaml Outdated
Comment on lines +5602 to +5612
RemoteSignBatchResponse:
description: The result of a batch remote request signing operation.
type: object
required:
- results
properties:
results:
description: Results for each element of the request, in request order
type: array
items:
$ref: '#/components/schemas/RemoteSignBatchResult'

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to be able to allow partial results? What does it mean to be able to access some of the files? I think we need to decide if that's a reasonable model.

If we do allow this, I would prefer that we separate the successful and failed requests into two separate lists. It's easier to distinguish than a single list that's of mixed types. (Separate is more similar to how S3 do operations like DeleteObjects

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the thoughtful review Dan.

Do we need to be able to allow partial results? What does it mean to be able to access some of the files? I think we need to decide if that's a reasonable model.

I have the prior art analysis on the proposal doc, and the dominant pattern I saw was to allow partial failure handling. I observed that all-or-none semantic was mostly used for a batch request that needed an atomic guarantee (e.g. create a batch of items together).

I think handling partial failures would technically allow the client to grab the failed ones, and retry them in the next batch rather than retrying the entire batch.

If we do allow this, I would prefer that we separate the successful and failed requests into two separate lists. It's easier to distinguish than a single list that's of mixed types. (Separate is more similar to how S3 do operations like DeleteObjects

I initially thought keeping it in the same list would work best because we dont have an identifier (a whole RemoteSignRequest uniquely identifies the singular entry), so we are relying on the ordered response to match the requested individual entry to its response.

But I think we can do the same by including the index number in the response - and require that the client map the index in the response to the position of the RemoteSignBatchElement from the original batch request.

Let me update the PR with this change

@sungwy
sungwy requested a review from danielcweeks October 20, 2026 21:11

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants