Supervisor Authentication and Registration
The Supervisor Authenticator provides endpoints for managing supervisor service registration and forwarding login requests to the registered supervisor. This component acts as a proxy between clients and the registered supervisor service.
SUPERVISOR_CONFIG object:
{
"host": "10.10.11.38",
"registration_token": "token"
}SUPERVISOR_REGISTRATION_INFO object:
{
"host": "10.10.11.38"
}LOGIN_REQUEST object:
{
"username": "myusername",
"password": "mypassword"
}Path: /sv/register
Method: GET
Payload: None
Description: Returns the current supervisor registration information (host only).
Response:
200 OK: Returns SUPERVISOR_REGISTRATION_INFO objectExample:
curl -X GET http://localhost:9090/sv/register \
-H "token: your-auth-token"Path: /sv/register
Method: POST
Payload: SUPERVISOR_CONFIG
Description: Registers a supervisor service by storing its host and registration token. This configuration is persisted and will override any previous supervisor registration.
Response:
200 OK: “Supervisor registered successfully”400 Bad Request:
Example:
curl -X POST http://localhost:9090/sv/register \
-H "Content-Type: application/json" \
-H "token: your-auth-token" \
-d '{
"host": "10.10.11.38",
"registration_token": "token"
}'Path: /sv/register
Method: PUT
Payload: SUPERVISOR_CONFIG
Description: Updates the existing supervisor registration. A supervisor must already be registered.
Response:
200 OK: “Supervisor registration updated successfully”404 Not Found: “No supervisor registered to update” - when no supervisor is currently registered400 Bad Request:
Example:
curl -X PUT http://localhost:9090/sv/register \
-H "Content-Type: application/json" \
-H "token: your-auth-token" \
-d '{
"host": "10.10.14.14:443",
"registration_token": "token"
}'Path: /sv/register
Method: DELETE
Payload: None
Description: Removes any existing supervisor registration information.
Response:
200 OK: “Supervisor registration removed successfully”Example:
curl -X DELETE http://localhost:9090/sv/register \
-H "token: your-auth-token"Path: /sv/login
Method: POST
Payload: LOGIN_REQUEST
Description: Forwards login requests to the registered supervisor service. The request is proxied to http://{supervisor_host}/login and the supervisor’s response is returned to the client.
Response:
503 Service Unavailable: “Supervisor not registered” - when no supervisor is configured400 Bad Request:
500 Internal Server Error: “Login forwarding failed” - when communication with supervisor failsExample:
curl -X POST http://localhost:9090/sv/login \
-H "Content-Type: application/json" \
-d '{
"username": "myusername",
"password": "mypassword"
}'The supervisor configuration is stored persistently in the daemon’s cache. This ensures that the supervisor registration persists across daemon restarts.