Registration
A utility function that handles connector registration with the orchestrator service through WebSocket communication.
Function Definition
def register(kind: str, data: dict) -> None:
Registers a connector with the orchestrator via a WebSocket connection.
Parameters
- kind (str): The category or type of connector being registered.
- data (dict): The registration payload containing connector details.
Behavior
- Validate configuration – Ensures the
secretkey is present incdk_settings, raisingAttributeErrorif missing. - Log attempt – Records the registration attempt for debugging and auditing.
- Connect to orchestrator – Uses the
Wsservice to open a WebSocket connection to the orchestrator's registration endpoint. - Send payload – Transmits the registration data over the WebSocket.
- Await response – Waits for and processes the orchestrator's reply.
- Close connection – Gracefully terminates the WebSocket connection.
Exceptions
- AttributeError – Raised if the
secretis not configured in the environment.
Dependencies
- cdk_settings: Configuration settings containing authentication secret
- Ws: WebSocket service for orchestrator communication