Address server review comments for deck share links

This commit is contained in:
Lukas Brübach 2026-09-18 22:56:51 +02:00 committed by GitHub
parent 5d0a23dffb
commit b7e4afa399
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
19 changed files with 348 additions and 66 deletions

View file

@ -24,6 +24,8 @@ set(PROTO_FILES
command_deck_share_create.proto
command_deck_share_download.proto
command_deck_share_list.proto
command_deck_share_list_mine.proto
command_deck_share_remove.proto
command_deck_upload.proto
command_del_counter.proto
command_delete_arrow.proto
@ -146,6 +148,7 @@ set(PROTO_FILES
response_deck_share_create.proto
response_deck_share_download.proto
response_deck_share_list.proto
response_deck_share_list_mine.proto
response_deck_upload.proto
response_dump_zone.proto
response_forgotpasswordrequest.proto
@ -185,6 +188,7 @@ set(PROTO_FILES
serverinfo_chat_message.proto
serverinfo_counter.proto
serverinfo_deck_share_item.proto
serverinfo_deck_share_summary.proto
serverinfo_deckstorage.proto
serverinfo_game.proto
serverinfo_gametype.proto

View file

@ -0,0 +1,10 @@
syntax = "proto2";
import "session_commands.proto";
// Requests the list of share bundles created by the calling user, so they can
// be reviewed and revoked before they expire.
message Command_DeckShareListMine {
extend SessionCommand {
optional Command_DeckShareListMine ext = 1032;
}
}

View file

@ -0,0 +1,11 @@
syntax = "proto2";
import "session_commands.proto";
// Revokes one of the calling user's own share bundles. The referenced items
// are removed by cascade.
message Command_DeckShareRemove {
extend SessionCommand {
optional Command_DeckShareRemove ext = 1033;
}
optional uint32 share_id = 1;
}

View file

@ -9,11 +9,9 @@ message Command_DeckUpload {
optional uint32 deck_id = 2; // to replace an existing deck
optional string deck_list = 3;
optional bool is_public = 4; // mark the deck public on upload (publish)
// Preview metadata computed by the uploading client (see ServerInfo_DeckStorage_File).
optional string banner_card_name = 5;
optional string banner_card_provider = 6;
// The server derives the banner card and tags from deck_list, so clients only
// need to send the color identity, which cannot be computed server-side.
reserved 5, 6, 8;
reserved "banner_card_name", "banner_card_provider", "tags";
optional string color_identity = 7;
// Comma-separated list of tag names associated with the deck, used to render
// and filter another user's public decks on the client.
optional string tags = 8;
}

View file

@ -84,6 +84,7 @@ message Response {
DECK_SHARE_CREATE = 1103; // Response to deck share creation
DECK_SHARE_LIST = 1104; // Response listing shared decks
DECK_SHARE_DOWNLOAD = 1105; // Response for shared deck download
DECK_SHARE_LIST_MINE = 1106; // Response listing the caller's own shares
CARD_ART_RULE_LIST = 1200; // Response containing a list of card art rules
}

View file

@ -0,0 +1,10 @@
syntax = "proto2";
import "response.proto";
import "serverinfo_deck_share_summary.proto";
message Response_DeckShareListMine {
extend Response {
optional Response_DeckShareListMine ext = 1106;
}
repeated ServerInfo_DeckShareSummary shares = 1;
}

View file

@ -0,0 +1,10 @@
syntax = "proto2";
// A share bundle created by a user, as reported by a "list my shares" query.
message ServerInfo_DeckShareSummary {
optional uint32 id = 1;
optional string name = 2;
optional uint64 creation_time = 3;
optional uint64 expires_at = 4;
optional uint32 item_count = 5;
}

View file

@ -8,10 +8,9 @@ message ServerInfo_DeckStorage_File {
optional string banner_card_name = 3;
optional string banner_card_provider = 4;
optional string color_identity = 5;
// Comma-separated list of tag names, matching the corresponding
// ServerInfo_DeckStorage_File upload metadata. Empty for decks uploaded
// before the tags column existed.
optional string tags = 6;
// Tag names associated with the deck. Empty for decks uploaded before the
// tags column existed.
repeated string tags = 6;
}
message ServerInfo_DeckStorage_Folder {

View file

@ -34,6 +34,8 @@ message SessionCommand {
DECK_LIST_OTHER_USER = 1029;
DECK_SET_VISIBILITY = 1030;
DECK_DOWNLOAD_PUBLIC = 1031;
DECK_SHARE_LIST_MINE = 1032;
DECK_SHARE_REMOVE = 1033;
REPLAY_LIST = 1100;
REPLAY_DOWNLOAD = 1101;
REPLAY_MODIFY_MATCH = 1102;