-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
APIs design #172
Comments
@susperius thoughts? |
I think we also need some lower level API for incremental hashing. |
I think the serializer API takes care of it, it takes as input |
For the hash engine: does it take as input a file to hash or a memory string? Having |
In #188, I moved If we kept |
How is the hash_engine expected to be used? Will the serializer call update() and final() methods on the hash_engine? If that is the case, why does the hash_engine need to know what the shard size and chunk size is? I am sure I am missing something. |
Good observation, I think @mihaimaruseac had a related comment in #172 (comment) I think it depends what level of abstraction we're talking about: the underlying (traditional) hash engine (sha256, etc), the shard-aware hash, something else. The shard-aware hash engine would use a lower-level hash engine under the hood (eg sha256). It may also depends if we're talking about streaming engine or not. #188 has moved out the chunk size and shard out of the engine for now so we'll see if the original API def is needed or not. PTAL we'd love your feedback too |
That is correct. I'll implement this in #190 (WIP at the moment, but should push a new change tomorrow-ish).
Chunk size doesn't matter, see #188. Shard size matters, but more just for verifications. |
Based on the |
The keyless flow will be handled by There may be a case for supporting sigstore keyed flow, but I don't think we're prioritizing it atm.
Nothing official, just the overall direction :) Feel free to comment. |
+1, the proposal in the first message here is mostly informative, as you see in #188/#190 things are changing. For #190 I still need to find way to incorporate the current serialization format, but I have some ideas on that, which I'll test by next week. Any comments and suggestions for improvement, as well as PR reviews, are very very welcome |
This is the middle layer of the API design work (sigstore#172). We add a manifest abstract class to represent various manifests (sigstore#111 sigstore#112) and also ways to serialize a model directory into manifests and ways to verify the manifests. For now, this only does what was formerly known as `serialize_v0`. The v1 and the manifest versions will come soon. Note: This has a lot of inspiration from sigstore#112, but makes the API work with all the usecases we need to consider right now. Signed-off-by: Mihai Maruseac <[email protected]>
This is the middle layer of the API design work (sigstore#172). We add a manifest abstract class to represent various manifests (sigstore#111 sigstore#112) and also ways to serialize a model directory into manifests and ways to verify the manifests. For now, this only does what was formerly known as `serialize_v0`. The v1 and the manifest versions will come soon. Note: This has a lot of inspiration from sigstore#112, but makes the API work with all the usecases we need to consider right now. Signed-off-by: Mihai Maruseac <[email protected]>
This is the middle layer of the API design work (sigstore#172). We add a manifest abstract class to represent various manifests (sigstore#111 sigstore#112) and also ways to serialize a model directory into manifests and ways to verify the manifests. For now, this only does what was formerly known as `serialize_v0`. The v1 and the manifest versions will come soon. Note: This has a lot of inspiration from sigstore#112, but makes the API work with all the usecases we need to consider right now. Signed-off-by: Mihai Maruseac <[email protected]>
) * Migrate `serialize_v0` to new API. This is the middle layer of the API design work (#172). We add a manifest abstract class to represent various manifests (#111 #112) and also ways to serialize a model directory into manifests and ways to verify the manifests. For now, this only does what was formerly known as `serialize_v0`. The v1 and the manifest versions will come soon. Note: This has a lot of inspiration from #112, but makes the API work with all the usecases we need to consider right now. Signed-off-by: Mihai Maruseac <[email protected]> * Clarify some comments Signed-off-by: Mihai Maruseac <[email protected]> * Encode name with base64 Signed-off-by: Mihai Maruseac <[email protected]> * Add another test case Signed-off-by: Mihai Maruseac <[email protected]> * Empty commit to retrigger DCO check. See dcoapp/app#211 (comment) Signed-off-by: Mihai Maruseac <[email protected]> --------- Signed-off-by: Mihai Maruseac <[email protected]>
This issues proposes what the (long-term) APIs will look like. Looking for comments, nothing set in stone.
1. Hash engine
Tracked in #140
Why:
We will provide default hash engine that we use in this library, with the possibility to customize its parameters:
A hash name is parameterized. I suggest something simple like
<name>$param1$param2...
. For the existing sha256p, it could besha256pv1$1000000
for a shard of 1 GB.2. Serializer
This will serialize a model (folder or file).
Why: some callers may want to serialize models using our library but not sign it with our library.
3. Raw Signer / Verifier
This provides low-level signer: It allows to abstract away how private key is managed (TUF, HSM, static key, etc). The raw verifier lets callers set a custom verifier if needed, eg if the signature uses a different encoding, etc.
We can have helper function for common raw signers like (one will be the default?):
4. Signer / Verifier
This will create a generic signer class that can be instantiated for Sigstore, PKI, etc.
Example for Sigstore keyless:
Example for Sigstore key flow:
Example for PKI:
Example for ECSigner (no cert):
4. model sign / verify
This is the main entry point for callers to use.
The text was updated successfully, but these errors were encountered: