Repository navigation
feat(meta): advertise the team secret types the server accepts - #103
Merged
Merged
Conversation
A client newer than the server had no way to know that a team secret type was missing: uploading a port-knock sequence to a server without migration 055 came back as a bare 400 (VoltiusApp/voltius#608). /v1/meta now carries team_secret_types, built from the same table the upload handler uses to resolve a type's owner, so the list cannot drift from what is accepted. A client reads it before uploading and treats a server that omits the field as one that predates it.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of VoltiusApp/voltius#608.
Problem
A desktop client newer than a self-hosted server cannot tell which team secret types that server stores. Saving a port-knock sequence to a server without migration 055 came back as a bare
400, and the client had nothing to check beforehand.Change
GET /v1/metanow returnsteam_secret_types, the list of secret typesPUT /v1/teams/{id}/secretsaccepts.SECRET_TYPES, inroutes/team_objects.rs.secret_owner_typenow reads that same table, so the advertised list cannot drift from what the handler accepts.A client treats a server that omits the field as one that predates it (VoltiusApp/voltius client PR to follow).
Deploy order
Deploy this before the client release that reads the field. A client that meets a server without the field still works: it tries the upload and reads a
400on the knock type as "server too old".Tests
meta_advertises_the_team_secret_types_it_accepts.canonical_secret_ids_match_the_client_key_namesnow also asserts the advertised list equals the canonical-id table.cargo clippy --all-targets -- -D warnings: clean.cargo test: 693 pass locally, with no database configured, so the DB-backed tests skipped; CI runs them.