Skip to content

Commit

Permalink
meeting: add check function for meeting name length
Browse files Browse the repository at this point in the history
  • Loading branch information
PhilippKilian committed May 16, 2024
1 parent 0c5ab94 commit 63f3e36
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 11 deletions.
18 changes: 9 additions & 9 deletions b3lb/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
# b3lb v3.1 - Delay update to Django 4.x because of dependencies
Django==3.2.23
PyGObject==3.46.0
aiohttp==3.8.6
boto3==1.28.77
Django==3.2.25
PyGObject==3.48.2
aiohttp==3.9.5
boto3==1.34.106
django-extensions==3.2.3
celery==5.3.4
celery==5.4.0
celery-singleton==0.3.1
django-cacheops==7.0.2
django-db-file-storage==0.5.5
django-celery-admin==0.1
django-celery-beat==2.5.0
django-celery-beat==2.6.0
django-celery-results==2.5.1
django-db-file-storage==0.5.6.1
django-environ==0.11.2
django-redis==5.4.0
django-storages==1.14.2
django-storages==1.14.3
intervaltree==3.1.0
pyjwt==2.8.0
psycopg2cffi==2.9.0
requests==2.31.0
uvicorn[standard]==0.23.2
uvicorn[standard]==0.29.0
xmltodict==0.13.0
4 changes: 2 additions & 2 deletions b3lb/rest/classes/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
from rest.b3lb.metrics import incr_metric, update_create_metrics
from rest.b3lb.parameters import ALLOW_START_STOP_RECORDING, AUTO_START_RECORDING, BLOCK, LOGO, OVERRIDE, PARAMETERS_CREATE, PARAMETERS_JOIN, RECORD, SET, USERDATA_BBB_CUSTOM_STYLE_URL
from rest.b3lb.utils import get_checksum
from rest.models import ClusterGroupRelation, Meeting, Metric, Node, Parameter, Record, RecordSet, Secret, SecretMeetingList, SecretMetricsList, Stats
from rest.models import check_room_name, ClusterGroupRelation, Meeting, Metric, Node, Parameter, Record, RecordSet, Secret, SecretMeetingList, SecretMetricsList, Stats
from typing import Any, Dict, List, Literal, Union
from uuid import UUID
from urllib.parse import urlencode
Expand Down Expand Up @@ -432,7 +432,7 @@ def is_node_free(self) -> bool:

## Getter Routines ##
def get_meeting_defaults(self) -> Dict[str, Any]:
return {"id": self.meeting_id, "secret": self.secret, "node": self.node, "room_name": self.parameters.get("name", "Unknown"), "end_callback_url": self.parameters.get("meta_endCallbackUrl", "")}
return {"id": self.meeting_id, "secret": self.secret, "node": self.node, "room_name": check_room_name(self.parameters.get("name", "Unknown")), "end_callback_url": self.parameters.get("meta_endCallbackUrl", "")}

def get_node_endpoint_url(self) -> str:
parameter_str = ""
Expand Down
5 changes: 5 additions & 0 deletions b3lb/rest/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@
#
# FUNCTIONS
#
def check_room_name(name: str) -> str:
if len(name) > cst.MEETING_NAME_LENGTH:
return name[:cst.MEETING_NAME_LENGTH]
return name

def get_nonce():
return get_random_string(cst.NONCE_LENGTH, cst.NONCE_CHAR_POOL)

Expand Down

0 comments on commit 63f3e36

Please sign in to comment.