You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We can easily remove the expiration values for all roles except root.
The argument why we would do 2 and why root is hard to remove is that we provide another endpoint GET /api/v1/config where we give information about repository settings to the user including the expiration policy for root. That means that even though we don't actually use this value anywhere we need to store it, so if an organization wants to check their expiration policy for all roles they could.
Now, the problem comes that when we call POST /api/v1/metadata there is a possibility to update the root expiration date (which itself is calculated to a particular date and stored inside root metadata), but what is not stored is how many days from the date of the metadata update ceremony this expiration was increased (or in other words the user choice for expiration policy for root).
One way to fix this problem is to send this new argument settings with information about root expiration as that's the only expiration policy that could be changed with the metadata update ceremony from the CLI (the rest of the expiration policies can be changed with PUT /api/v1/config.
Another solution could be to include this information as unrecognized_field inside the root metadata itself.
The good part is that this is not so visible to the user and won't lead to false conclusions as the existence of a settings argument could.
The only negative is that we don't do that for any other metadata role, but considering root is special in its own rights I think that's a viable solution.
What is the task about?
Currently, the
POST /api/v1/metadata
endpoint accepts the following payload:What is strange here is that we mention we support a
settings
dictionary with an expiration value for all roles, but that is not true inside the code:repository-service-tuf-api/repository_service_tuf_api/metadata.py
Line 21 in 407ffff
There are two solutions to this situation:
settings
dictionary from the examplesettings
dictionaryWe can easily remove the expiration values for all roles except
root
.The argument why we would do
2
and whyroot
is hard to remove is that we provide another endpointGET /api/v1/config
where we give information about repository settings to the user including the expiration policy forroot
. That means that even though we don't actually use this value anywhere we need to store it, so if an organization wants to check their expiration policy for all roles they could.Now, the problem comes that when we call
POST /api/v1/metadata
there is a possibility to update theroot
expiration date (which itself is calculated to a particular date and stored inside root metadata), but what is not stored is how many days from the date of themetadata update
ceremony this expiration was increased (or in other words the user choice for expiration policy forroot
).One way to fix this problem is to send this new argument
settings
with information aboutroot
expiration as that's the only expiration policy that could be changed with themetadata update
ceremony from the CLI (the rest of the expiration policies can be changed withPUT /api/v1/config
.Another solution could be to include this information as
unrecognized_field
inside theroot
metadata itself.The good part is that this is not so visible to the user and won't lead to false conclusions as the existence of a
settings
argument could.The only negative is that we don't do that for any other metadata role, but considering
root
is special in its own rights I think that's a viable solution.What do you think @kairoaraujo, @lukpueh @KAUTH?
Parent feature
No response
References
Code of Conduct
The text was updated successfully, but these errors were encountered: