Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions fishjam/_openapi_client/models/moq_token.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,34 +11,34 @@

@_attrs_define
class MoqToken:
"""Token for authorizing a MoQ relay connection
"""Connection details for a MoQ relay client

Attributes:
token (str): JWT token for MoQ relay Example: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJyb290IjoiZmlzaGphbSIsInB1d
CI6WyJteS1zdHJlYW0iXSwiZ2V0IjpbXSwiaWF0IjoxNzEzMzYwMDAwLCJleHAiOjE3MTMzNjM2MDB9.abc123.
url (str): Relay connection URL with the JWT embedded as a `?jwt=` query parameter. Pass directly to a MoQ
client SDK. Example: https://relay.fishjam.io/abc123?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9....
"""

token: str
url: str
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)

def to_dict(self) -> dict[str, Any]:
token = self.token
url = self.url

field_dict: dict[str, Any] = {}
field_dict.update(self.additional_properties)
field_dict.update({
"token": token,
"url": url,
})

return field_dict

@classmethod
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
d = dict(src_dict)
token = d.pop("token")
url = d.pop("url")

moq_token = cls(
token=token,
url=url,
)

moq_token.additional_properties = d
Expand Down
6 changes: 3 additions & 3 deletions fishjam/api/_fishjam_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -420,14 +420,14 @@ def create_moq_token(
publish_path: str | None = None,
subscribe_path: str | None = None,
) -> str:
Comment thread
Karolk99 marked this conversation as resolved.
Outdated
"""Generates a MoQ token.
"""Generates a MoQ relay connection URL.

Args:
publish_path: Path the token grants publish access to.
subscribe_path: Path the token grants subscribe access to.

Returns:
str: The generated token.
str: The relay connection URL with the JWT embedded as a ``?jwt=`` query parameter.
"""
config = MoqTokenConfig(
publish_path=publish_path, subscribe_path=subscribe_path
Expand All @@ -437,7 +437,7 @@ def create_moq_token(
self._request(moq_create_token, body=config),
)

return response.token
return response.url

def subscribe_peer(self, room_id: str, peer_id: str, target_peer_id: str):
"""Subscribes a peer to all tracks of another peer.
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "fishjam-server-sdk"
version = "0.28.0"
version = "0.28.1"
description = "Python server SDK for the Fishjam"
Comment thread
Karolk99 marked this conversation as resolved.
authors = [{ name = "Fishjam Team", email = "contact@fishjam.io" }]
requires-python = ">=3.10"
Expand Down
2 changes: 1 addition & 1 deletion uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading