corporate: Add prototype authentication system for self-hosters.

This makes it possible for a self-hosted realm administrator to
directly access a logged-page on the push notifications bouncer
service, enabling billing, support contacts, and other administrator
for enterprise customers to be managed without manual setup.
This commit is contained in:
Mateusz Mandera
2023-11-15 22:44:24 +01:00
committed by Tim Abbott
parent 1ec0d5bd9d
commit 3958743b33
15 changed files with 404 additions and 6 deletions

View File

@@ -46,6 +46,7 @@ class ErrorCode(Enum):
REACTION_ALREADY_EXISTS = auto()
REACTION_DOES_NOT_EXIST = auto()
SERVER_NOT_READY = auto()
MISSING_REMOTE_REALM = auto()
class JsonableError(Exception):
@@ -570,3 +571,16 @@ class ApiParamValidationError(JsonableError):
class ServerNotReadyError(JsonableError):
code = ErrorCode.SERVER_NOT_READY
http_status_code = 500
class MissingRemoteRealmError(JsonableError): # nocoverage
code: ErrorCode = ErrorCode.MISSING_REMOTE_REALM
http_status_code = 403
def __init__(self) -> None:
pass
@staticmethod
@override
def msg_format() -> str:
return _("Organization not registered")