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
{{ message }}
Repository navigation
Validate both-or-neither on signing keypair on IdP create #1564
In the IdP create UI, we have two file fields for the signing keypair. In the API, these are optional as a pair. If (as concluded in oxidecomputer/omicron#3155 after some confusion on my part) we do want to have first-class support for the no-keypair option, I think the UI should be more explicit about how you need either both or neither. Maybe something that collapses both together, or a radio, or something. Even if we don't do that, we should validate both-or-neither client-side with a helpful message.
changed the title [-]More explicit both-or-neither on signing keypair on IdP create[/-][+]Validate both-or-neither on signing keypair on IdP create[/+]on Nov 6, 2024
Ok, this is pretty bad! If one is present and not the other, we don't get the expected API error you because we just leave the one that's present out of the request body.
Activity
[-]More explicit both-or-neither on signing keypair on IdP create[/-][+]Validate both-or-neither on signing keypair on IdP create[/+]david-crespo commentedon Nov 6, 2024
Ok, this is pretty bad! If one is present and not the other, we don't get the expected API error you because we just leave the one that's present out of the request body.
console/app/forms/idp/create.tsx
Lines 77 to 84 in b01ca85
By tweaking the logic we can see that the mock API does validate the keypair object correctly if the client sends a partial one: