feat(api): iceServers configuration
This commit is contained in:
parent
94d3eaa61e
commit
1bc52fa53b
6 changed files with 45 additions and 37 deletions
|
|
@ -1,23 +1,21 @@
|
||||||
from chalice import Blueprint, Response
|
from chalice import Blueprint, Response
|
||||||
|
|
||||||
from chalicelib import _overrides
|
from chalicelib import _overrides
|
||||||
from chalicelib.core import metadata, errors_favorite_viewed, slack, alerts, sessions, integration_github, \
|
from chalicelib.core import boarding
|
||||||
integrations_manager
|
from chalicelib.core import errors
|
||||||
|
from chalicelib.core import license
|
||||||
|
from chalicelib.core import metadata, errors_favorite_viewed, slack, alerts, sessions, integrations_manager, assist
|
||||||
|
from chalicelib.core import notifications
|
||||||
|
from chalicelib.core import projects
|
||||||
|
from chalicelib.core import signup
|
||||||
|
from chalicelib.core import tenants
|
||||||
|
from chalicelib.core import users
|
||||||
|
from chalicelib.core import webhook
|
||||||
|
from chalicelib.core.collaboration_slack import Slack
|
||||||
from chalicelib.utils import captcha
|
from chalicelib.utils import captcha
|
||||||
from chalicelib.utils import helper
|
from chalicelib.utils import helper
|
||||||
from chalicelib.utils.helper import environ
|
from chalicelib.utils.helper import environ
|
||||||
|
|
||||||
from chalicelib.core import tenants
|
|
||||||
from chalicelib.core import signup
|
|
||||||
from chalicelib.core import users
|
|
||||||
from chalicelib.core import projects
|
|
||||||
from chalicelib.core import errors
|
|
||||||
from chalicelib.core import notifications
|
|
||||||
from chalicelib.core import boarding
|
|
||||||
from chalicelib.core import webhook
|
|
||||||
from chalicelib.core import license
|
|
||||||
from chalicelib.core.collaboration_slack import Slack
|
|
||||||
|
|
||||||
app = Blueprint(__name__)
|
app = Blueprint(__name__)
|
||||||
_overrides.chalice_app(app)
|
_overrides.chalice_app(app)
|
||||||
|
|
||||||
|
|
@ -47,6 +45,7 @@ def login():
|
||||||
c["projects"] = projects.get_projects(tenant_id=tenant_id, recording_state=True, recorded=True,
|
c["projects"] = projects.get_projects(tenant_id=tenant_id, recording_state=True, recorded=True,
|
||||||
stack_integrations=True, version=True)
|
stack_integrations=True, version=True)
|
||||||
c["smtp"] = helper.has_smtp()
|
c["smtp"] = helper.has_smtp()
|
||||||
|
c["iceServers"] = assist.get_ice_servers()
|
||||||
return {
|
return {
|
||||||
'jwt': r.pop('jwt'),
|
'jwt': r.pop('jwt'),
|
||||||
'data': {
|
'data': {
|
||||||
|
|
@ -68,7 +67,8 @@ def get_account(context):
|
||||||
"metadata": metadata.get_remaining_metadata_with_count(context['tenantId'])
|
"metadata": metadata.get_remaining_metadata_with_count(context['tenantId'])
|
||||||
},
|
},
|
||||||
**license.get_status(context["tenantId"]),
|
**license.get_status(context["tenantId"]),
|
||||||
"smtp": helper.has_smtp()
|
"smtp": helper.has_smtp(),
|
||||||
|
"iceServers": assist.get_ice_servers()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
from chalicelib.utils import pg_client, helper
|
|
||||||
from chalicelib.core import projects, sessions, sessions_metas
|
|
||||||
import requests
|
import requests
|
||||||
|
|
||||||
|
from chalicelib.core import projects, sessions, sessions_metas
|
||||||
|
from chalicelib.utils import pg_client, helper
|
||||||
from chalicelib.utils.helper import environ
|
from chalicelib.utils.helper import environ
|
||||||
|
|
||||||
SESSION_PROJECTION_COLS = """s.project_id,
|
SESSION_PROJECTION_COLS = """s.project_id,
|
||||||
|
|
@ -72,3 +73,8 @@ def is_live(project_id, session_id, project_key=None):
|
||||||
return False
|
return False
|
||||||
connected_peers = connected_peers.json().get("data", [])
|
connected_peers = connected_peers.json().get("data", [])
|
||||||
return str(session_id) in connected_peers
|
return str(session_id) in connected_peers
|
||||||
|
|
||||||
|
|
||||||
|
def get_ice_servers():
|
||||||
|
return environ.get("iceServers") if environ.get("iceServers") is not None \
|
||||||
|
and len(environ["iceServers"]) > 0 else None
|
||||||
|
|
|
||||||
|
|
@ -1,16 +1,14 @@
|
||||||
import json
|
import json
|
||||||
|
import secrets
|
||||||
|
|
||||||
from chalicelib.core import authorizers, metadata, projects
|
from chalicelib.core import authorizers, metadata, projects, assist
|
||||||
|
from chalicelib.core import tenants
|
||||||
|
from chalicelib.utils import dev
|
||||||
from chalicelib.utils import helper
|
from chalicelib.utils import helper
|
||||||
from chalicelib.utils import pg_client
|
from chalicelib.utils import pg_client
|
||||||
from chalicelib.utils import dev
|
|
||||||
from chalicelib.utils.TimeUTC import TimeUTC
|
from chalicelib.utils.TimeUTC import TimeUTC
|
||||||
from chalicelib.utils.helper import environ
|
from chalicelib.utils.helper import environ
|
||||||
|
|
||||||
from chalicelib.core import tenants
|
|
||||||
import secrets
|
|
||||||
|
|
||||||
|
|
||||||
def __generate_invitation_token():
|
def __generate_invitation_token():
|
||||||
return secrets.token_urlsafe(64)
|
return secrets.token_urlsafe(64)
|
||||||
|
|
@ -440,6 +438,7 @@ def change_password(tenant_id, user_id, email, old_password, new_password):
|
||||||
c["projects"] = projects.get_projects(tenant_id=tenant_id, recording_state=True, recorded=True,
|
c["projects"] = projects.get_projects(tenant_id=tenant_id, recording_state=True, recorded=True,
|
||||||
stack_integrations=True)
|
stack_integrations=True)
|
||||||
c["smtp"] = helper.has_smtp()
|
c["smtp"] = helper.has_smtp()
|
||||||
|
c["iceServers"]: assist.get_ice_servers()
|
||||||
return {
|
return {
|
||||||
'jwt': r.pop('jwt'),
|
'jwt': r.pop('jwt'),
|
||||||
'data': {
|
'data': {
|
||||||
|
|
@ -467,6 +466,7 @@ def set_password_invitation(user_id, new_password):
|
||||||
c["projects"] = projects.get_projects(tenant_id=tenant_id, recording_state=True, recorded=True,
|
c["projects"] = projects.get_projects(tenant_id=tenant_id, recording_state=True, recorded=True,
|
||||||
stack_integrations=True)
|
stack_integrations=True)
|
||||||
c["smtp"] = helper.has_smtp()
|
c["smtp"] = helper.has_smtp()
|
||||||
|
c["iceServers"]: assist.get_ice_servers()
|
||||||
return {
|
return {
|
||||||
'jwt': r.pop('jwt'),
|
'jwt': r.pop('jwt'),
|
||||||
'data': {
|
'data': {
|
||||||
|
|
|
||||||
|
|
@ -1,23 +1,21 @@
|
||||||
from chalice import Blueprint, Response
|
from chalice import Blueprint, Response
|
||||||
|
|
||||||
from chalicelib import _overrides
|
from chalicelib import _overrides
|
||||||
from chalicelib.core import metadata, errors_favorite_viewed, slack, alerts, sessions, integration_github, \
|
from chalicelib.core import boarding
|
||||||
integrations_manager
|
from chalicelib.core import errors
|
||||||
|
from chalicelib.core import license
|
||||||
|
from chalicelib.core import metadata, errors_favorite_viewed, slack, alerts, sessions, integrations_manager, assist
|
||||||
|
from chalicelib.core import notifications
|
||||||
|
from chalicelib.core import projects
|
||||||
|
from chalicelib.core import signup
|
||||||
|
from chalicelib.core import tenants
|
||||||
|
from chalicelib.core import users
|
||||||
|
from chalicelib.core import webhook
|
||||||
|
from chalicelib.core.collaboration_slack import Slack
|
||||||
from chalicelib.utils import captcha, SAML2_helper
|
from chalicelib.utils import captcha, SAML2_helper
|
||||||
from chalicelib.utils import helper
|
from chalicelib.utils import helper
|
||||||
from chalicelib.utils.helper import environ
|
from chalicelib.utils.helper import environ
|
||||||
|
|
||||||
from chalicelib.core import tenants
|
|
||||||
from chalicelib.core import signup
|
|
||||||
from chalicelib.core import users
|
|
||||||
from chalicelib.core import projects
|
|
||||||
from chalicelib.core import errors
|
|
||||||
from chalicelib.core import notifications
|
|
||||||
from chalicelib.core import boarding
|
|
||||||
from chalicelib.core import webhook
|
|
||||||
from chalicelib.core import license
|
|
||||||
from chalicelib.core.collaboration_slack import Slack
|
|
||||||
|
|
||||||
app = Blueprint(__name__)
|
app = Blueprint(__name__)
|
||||||
_overrides.chalice_app(app)
|
_overrides.chalice_app(app)
|
||||||
|
|
||||||
|
|
@ -70,7 +68,8 @@ def get_account(context):
|
||||||
},
|
},
|
||||||
**license.get_status(context["tenantId"]),
|
**license.get_status(context["tenantId"]),
|
||||||
"smtp": environ["EMAIL_HOST"] is not None and len(environ["EMAIL_HOST"]) > 0,
|
"smtp": environ["EMAIL_HOST"] is not None and len(environ["EMAIL_HOST"]) > 0,
|
||||||
"saml2": SAML2_helper.is_saml2_available()
|
"saml2": SAML2_helper.is_saml2_available(),
|
||||||
|
"iceServers": assist.get_ice_servers()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
import json
|
import json
|
||||||
import secrets
|
import secrets
|
||||||
|
|
||||||
from chalicelib.core import authorizers, metadata, projects
|
from chalicelib.core import authorizers, metadata, projects, assist
|
||||||
from chalicelib.core import tenants
|
from chalicelib.core import tenants
|
||||||
from chalicelib.utils import dev
|
from chalicelib.utils import dev
|
||||||
from chalicelib.utils import helper
|
from chalicelib.utils import helper
|
||||||
|
|
@ -450,6 +450,7 @@ def change_password(tenant_id, user_id, email, old_password, new_password):
|
||||||
c["projects"] = projects.get_projects(tenant_id=tenant_id, recording_state=True, recorded=True,
|
c["projects"] = projects.get_projects(tenant_id=tenant_id, recording_state=True, recorded=True,
|
||||||
stack_integrations=True)
|
stack_integrations=True)
|
||||||
c["smtp"] = helper.has_smtp()
|
c["smtp"] = helper.has_smtp()
|
||||||
|
c["iceServers"] = assist.get_ice_servers()
|
||||||
return {
|
return {
|
||||||
'jwt': r.pop('jwt'),
|
'jwt': r.pop('jwt'),
|
||||||
'data': {
|
'data': {
|
||||||
|
|
@ -477,6 +478,7 @@ def set_password_invitation(tenant_id, user_id, new_password):
|
||||||
c["projects"] = projects.get_projects(tenant_id=tenant_id, recording_state=True, recorded=True,
|
c["projects"] = projects.get_projects(tenant_id=tenant_id, recording_state=True, recorded=True,
|
||||||
stack_integrations=True)
|
stack_integrations=True)
|
||||||
c["smtp"] = helper.has_smtp()
|
c["smtp"] = helper.has_smtp()
|
||||||
|
c["iceServers"] = assist.get_ice_servers()
|
||||||
return {
|
return {
|
||||||
'jwt': r.pop('jwt'),
|
'jwt': r.pop('jwt'),
|
||||||
'data': {
|
'data': {
|
||||||
|
|
|
||||||
|
|
@ -63,3 +63,4 @@ env:
|
||||||
idp_sso_url: ''
|
idp_sso_url: ''
|
||||||
idp_x509cert: ''
|
idp_x509cert: ''
|
||||||
idp_sls_url: ''
|
idp_sls_url: ''
|
||||||
|
iceServers: ''
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue