From 2d677957754dccad5b2ea4f8455bd5171d623dab Mon Sep 17 00:00:00 2001 From: "Natalie B." <22222885+espeon@users.noreply.github.com> Date: Tue, 18 Nov 2025 21:05:29 -0600 Subject: [PATCH] add admin DIDs to getBroadcaster --- .../src/streamplace-store/branding.tsx | 3 +++ .../src/streamplace-store/streamplace-store.tsx | 4 ++++ .../place-stream-broadcast-getbroadcaster.md | 17 +++++++++++++---- .../src/content/docs/lex-reference/openapi.json | 8 ++++++++ .../place/stream/broadcast/getBroadcaster.json | 8 ++++++++ pkg/spxrpc/place_stream_broadcast.go | 1 + pkg/streamplace/broadcastgetBroadcaster.go | 2 ++ 7 files changed, 39 insertions(+), 4 deletions(-) diff --git a/js/components/src/streamplace-store/branding.tsx b/js/components/src/streamplace-store/branding.tsx index 19fcbe75..c1beac5d 100644 --- a/js/components/src/streamplace-store/branding.tsx +++ b/js/components/src/streamplace-store/branding.tsx @@ -41,6 +41,9 @@ export function useFetchBroadcasterDID() { if (result.data.server) { store.setState({ serverDID: result.data.server }); } + if (result.data.admins) { + store.setState({ adminDIDs: result.data.admins }); + } } catch (err) { console.error("Failed to fetch broadcaster DID:", err); } diff --git a/js/components/src/streamplace-store/streamplace-store.tsx b/js/components/src/streamplace-store/streamplace-store.tsx index ed86fc0e..513ce322 100644 --- a/js/components/src/streamplace-store/streamplace-store.tsx +++ b/js/components/src/streamplace-store/streamplace-store.tsx @@ -49,6 +49,8 @@ export interface StreamplaceState { setBroadcasterDID: (broadcasterDID: string | null) => void; serverDID: string | null; setServerDID: (serverDID: string | null) => void; + adminDIDs: string[]; + setAdminDIDs: (adminDIDs: string[]) => void; // Branding state branding: Record | null; @@ -117,6 +119,8 @@ export const makeStreamplaceStore = ({ set({ broadcasterDID }), serverDID: null, setServerDID: (serverDID: string | null) => set({ serverDID }), + adminDIDs: [], + setAdminDIDs: (adminDIDs: string[]) => set({ adminDIDs }), // Content metadata contentMetadata: null, diff --git a/js/docs/src/content/docs/lex-reference/broadcast/place-stream-broadcast-getbroadcaster.md b/js/docs/src/content/docs/lex-reference/broadcast/place-stream-broadcast-getbroadcaster.md index 53a7377e..99c06020 100644 --- a/js/docs/src/content/docs/lex-reference/broadcast/place-stream-broadcast-getbroadcaster.md +++ b/js/docs/src/content/docs/lex-reference/broadcast/place-stream-broadcast-getbroadcaster.md @@ -24,10 +24,11 @@ Get information about a Streamplace broadcaster. **Schema Type:** `object` -| Name | Type | Req'd | Description | Constraints | -| ------------- | -------- | ----- | --------------------------------------------------------------- | ------------- | -| `broadcaster` | `string` | ✅ | DID of the Streamplace broadcaster to which this server belongs | Format: `did` | -| `server` | `string` | ❌ | DID of this particular Streamplace server | Format: `did` | +| Name | Type | Req'd | Description | Constraints | +| ------------- | ----------------- | ----- | --------------------------------------------------------------- | ------------- | +| `broadcaster` | `string` | ✅ | DID of the Streamplace broadcaster to which this server belongs | Format: `did` | +| `server` | `string` | ❌ | DID of this particular Streamplace server | Format: `did` | +| `admins` | Array of `string` | ❌ | Array of DIDs authorized as admins | | --- @@ -61,6 +62,14 @@ Get information about a Streamplace broadcaster. "type": "string", "format": "did", "description": "DID of this particular Streamplace server" + }, + "admins": { + "type": "array", + "items": { + "type": "string", + "format": "did" + }, + "description": "Array of DIDs authorized as admins" } } } diff --git a/js/docs/src/content/docs/lex-reference/openapi.json b/js/docs/src/content/docs/lex-reference/openapi.json index ad8ad277..0906105d 100644 --- a/js/docs/src/content/docs/lex-reference/openapi.json +++ b/js/docs/src/content/docs/lex-reference/openapi.json @@ -881,6 +881,14 @@ "type": "string", "description": "DID of this particular Streamplace server", "format": "did" + }, + "admins": { + "type": "array", + "description": "Array of DIDs authorized as admins", + "items": { + "type": "string", + "format": "did" + } } }, "required": ["broadcaster"] diff --git a/lexicons/place/stream/broadcast/getBroadcaster.json b/lexicons/place/stream/broadcast/getBroadcaster.json index 2dd32a4a..91d9258c 100644 --- a/lexicons/place/stream/broadcast/getBroadcaster.json +++ b/lexicons/place/stream/broadcast/getBroadcaster.json @@ -25,6 +25,14 @@ "type": "string", "format": "did", "description": "DID of this particular Streamplace server" + }, + "admins": { + "type": "array", + "items": { + "type": "string", + "format": "did" + }, + "description": "Array of DIDs authorized as admins" } } } diff --git a/pkg/spxrpc/place_stream_broadcast.go b/pkg/spxrpc/place_stream_broadcast.go index 0e789d4d..993e1483 100644 --- a/pkg/spxrpc/place_stream_broadcast.go +++ b/pkg/spxrpc/place_stream_broadcast.go @@ -13,5 +13,6 @@ func (s *Server) handlePlaceStreamBroadcastGetBroadcaster(ctx context.Context) ( return &placestreamtypes.BroadcastGetBroadcaster_Output{ Broadcaster: broadcaster, Server: &server, + Admins: s.cli.AdminDIDs, }, nil } diff --git a/pkg/streamplace/broadcastgetBroadcaster.go b/pkg/streamplace/broadcastgetBroadcaster.go index c0aebf8c..486cc621 100644 --- a/pkg/streamplace/broadcastgetBroadcaster.go +++ b/pkg/streamplace/broadcastgetBroadcaster.go @@ -12,6 +12,8 @@ import ( // BroadcastGetBroadcaster_Output is the output of a place.stream.broadcast.getBroadcaster call. type BroadcastGetBroadcaster_Output struct { + // admins: Array of DIDs authorized as admins + Admins []string `json:"admins,omitempty" cborgen:"admins,omitempty"` // broadcaster: DID of the Streamplace broadcaster to which this server belongs Broadcaster string `json:"broadcaster" cborgen:"broadcaster"` // server: DID of this particular Streamplace server -- 2.51.2