arena-py API v1.3.0
arena .auth
auth.py - Authentication methods for accessing the ARENA.
class
ArenaAuth:
def
authenticate_scene(self, web_host, realm, scene, username, video=False, env=False):
End authentication flow, requesting permissions may change by owner or admin, for now, get a fresh mqtt_token each time.
Parameters
- str web_host: The hostname of the ARENA webserver.
- str realm: The topic realm name.
- str scene: The namespace/scene name combination.
- str username: The ARENA username for the user.
- bool video: If Jitsi video conference is requested.
Returns
username and mqtt_token from arena-account.
def
authenticate_device(self, web_host):
Check for device mqtt_token, ask for a missing one, and save to local memory.
def
has_publish_rights(self, token, topic):
Check the MQTT token for permission to publish to topic.
def
store_environment_auth(self, username, token):
Keep a copy of the token in local memory for urlopen and other tasks.
def
upload_store_file(self, web_host, scenename, src_file_path, dest_file_path=None):
Upload a source file to the user's file store space. Google authentication is required.
Parameters
- str web_host: The hostname of the ARENA webserver.
- str scenename: The scene name/id.
- str src_file_path: Local path to the file to upload (required).
- str dest_file_path: Destination file path, can include dirs. Defaults to filename from src_file_path (optional).
Returns
Url address of successful file upload location, or None if failed.
def
signout():
def
permissions():