{"id":37027233,"url":"https://github.com/networknt/light-controller","last_synced_at":"2026-01-14T03:13:36.691Z","repository":{"id":237101271,"uuid":"311443350","full_name":"networknt/light-controller","owner":"networknt","description":"The runtime control pane for the light-platform","archived":true,"fork":false,"pushed_at":"2024-10-09T13:08:18.000Z","size":3044,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":17,"default_branch":"master","last_synced_at":"2025-07-07T12:18:06.804Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/networknt.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-11-09T19:27:17.000Z","updated_at":"2024-10-15T14:58:25.000Z","dependencies_parsed_at":"2024-05-06T15:08:37.616Z","dependency_job_id":null,"html_url":"https://github.com/networknt/light-controller","commit_stats":null,"previous_names":["networknt/light-controller"],"tags_count":30,"template":false,"template_full_name":null,"purl":"pkg:github/networknt/light-controller","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/networknt%2Flight-controller","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/networknt%2Flight-controller/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/networknt%2Flight-controller/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/networknt%2Flight-controller/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/networknt","download_url":"https://codeload.github.com/networknt/light-controller/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/networknt%2Flight-controller/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28408816,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T01:52:23.358Z","status":"online","status_checked_at":"2026-01-14T02:00:06.678Z","response_time":107,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-01-14T03:13:36.156Z","updated_at":"2026-01-14T03:13:36.686Z","avatar_url":"https://github.com/networknt.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# light-controller\nThe runtime control pane for the light-platform\n\n## Build and Start\n\nFor testing locally, you don't need to create the artifact for the document, source code, and the fatjar. You can build and start the server with the following command.\n\n```\nmvn clean install exec:exec\n```\n\nor\n\n```\nmvn clean package exec:exec\n```\n\nIf you want to build the fatjar and other artifacts, please use the following command.\n\n```\nmvn clean install -Prelease\n```\n\nWith the fatjar in the target directory, you can start the server with the following command.\n\n```\njava -jar target/controller.jar\n```\n\n## Test\n\nBy default, the OAuth2 JWT security verification is enabled. You can use Curl or Postman to test your service. For example,\n\n\n```\ncurl -k https://localhost:8438/services\n```\n\nYou should have an error message.\n\n```\n{\"statusCode\":401,\"code\":\"ERR10002\",\"message\":\"MISSING_AUTH_TOKEN\",\"description\":\"No Authorization header or the token is not bearer type\",\"severity\":\"ERROR\"}\n```\n\n## Security\n\nThe OAuth JWT token verifier protects all endpoints, but it is enabled in the openapi-security.yml config file. The following command uses a long-lived test token to get all registered services.\n\n```\ncurl -k -X GET https://localhost:8438/services \\\n  -H 'Authorization: Bearer eyJraWQiOiIxMDAiLCJhbGciOiJSUzI1NiJ9.eyJpc3MiOiJ1cm46Y29tOm5ldHdvcmtudDpvYXV0aDI6djEiLCJhdWQiOiJ1cm46Y29tLm5ldHdvcmtudCIsImV4cCI6MTk2Mjk4NTUyOCwianRpIjoiT0Y4VGFZSDRVSjNTOFZyNnJ3REdDQSIsImlhdCI6MTY0NzYyNTUyOCwibmJmIjoxNjQ3NjI1NDA4LCJ2ZXJzaW9uIjoiMS4wIiwidXNlcl9pZCI6InN0ZXZlaHVAZ21haWwuY29tIiwidXNlcl90eXBlIjoiRU1QTE9ZRUUiLCJjbGllbnRfaWQiOiJmN2Q0MjM0OC1jNjQ3LTRlZmItYTUyZC00YzU3ODc0MjFlNzMiLCJyb2xlcyI6InVzZXIgQ3RsUGx0QWRtaW4gQ3RsUGx0UmVhZCBDdGxQbHRXcml0ZSIsInNjb3BlIjpbInBvcnRhbC5yIiwicG9ydGFsLnciXX0.MIWNwUfdVsV7rjctaeugFYgzsbnolUeXsIrvOdj9bFrkM4UfShKOD3XnkOpRU2TNcp2pa2wla-5bSN5p-aQQ1fnpk_2QW_E7GbWHv0Rbj3Epq_yLB8DJAjoeEYn2Ux9OrssYYtMuq63kd3FflOi10wr01sZ47tZQleQPzCetsm2hZOZGZU8gSwBSlYXJs4bxTaYNlPnRNVEBZEgiprxyLbwssDZISTcFWBsOlCEzBKrLqeQdDXxRzp9HlZprXzq30rtuRrTfwGBC39x3miAyNbPV8dqokzCc8PzTpwC7irmGv3PoXJ-IiroJV_-s83ZrAUcDnjxuNFZ4x02kjjwf9g'\n```\n\nIf you have any registered service, you can expect the following message.\n\n```\n{\"com.networknt.petstore-3.0.1|test1\":[{\"protocol\":\"https\",\"address\":\"172.17.0.1\",\"port\":9443}]}\n```\n\n### Register\n\n```\n# reference.v1 instance 1\ncurl -k --location --request POST 'https://localhost:8438/services' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\"serviceId\":\"com.networknt.reference.v1\",\"tag\":\"uat\",\"address\":\"192.168.1.144\",\"port\":8000,\"check\":{\"id\":\"check-com.networknt.reference.v1:192.168.1.144:8080\", \"deregisterCriticalServiceAfter\":\"1m\",\"http\":\"https://192.168.1.144:8080/health/com.networknt.reference.v1\",\"tlsSkipVerify\":true,\"interval\":\"10s\"}}'\n\n# reference.v1 instance 2\ncurl -k --location --request POST 'https://localhost:8438/services' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\"serviceId\":\"com.networknt.reference.v1\",\"tag\":\"uat\",\"address\":\"192.168.1.145\",\"port\":8000,\"check\":{\"id\":\"check-com.networknt.reference.v1:192.168.1.145:8080\",\"deregisterCriticalServiceAfter\":\"1m\",\"http\":\"https://192.168.1.145:8080/health/com.networknt.reference.v1\",\"tlsSkipVerify\":true,\"interval\":\"10s\"}}'\n\n# reference.v1 instance 3\ncurl -k --location --request POST 'https://localhost:8438/services' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\"serviceId\":\"com.networknt.reference.v1\",\"tag\":\"uat\",\"address\":\"192.168.1.146\",\"port\":8000,\"check\":{\"id\":\"check-com.networknt.reference.v1:192.168.1.146:8080\",\"deregisterCriticalServiceAfter\":\"1m\",\"http\":\"https://192.168.1.145:8080/health/com.networknt.reference.v1\",\"tlsSkipVerify\":true,\"interval\":\"10s\"}}'\n\n# reference.v2 instance 1\ncurl -k --location --request POST 'https://localhost:8438/services' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\"serviceId\":\"com.networknt.reference.v2\",\"tag\":\"uat\",\"address\":\"192.168.1.144\",\"port\":8001,\"check\":{\"id\":\"check-com.networknt.reference.v2:192.168.1.144:8080\", \"deregisterCriticalServiceAfter\":\"1m\",\"http\":\"https://192.168.1.144:8080/health/com.networknt.reference.v1\",\"tlsSkipVerify\":true,\"interval\":\"10s\"}}'\n\n# reference.v2 instance 2\ncurl -k --location --request POST 'https://localhost:8438/services' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\"serviceId\":\"com.networknt.reference.v2\",\"tag\":\"uat\",\"address\":\"192.168.1.145\",\"port\":8001,\"check\":{\"id\":\"check-com.networknt.reference.v2:192.168.1.145:8080\", \"deregisterCriticalServiceAfter\":\"1m\",\"http\":\"https://192.168.1.145:8080/health/com.networknt.reference.v1\",\"tlsSkipVerify\":true,\"interval\":\"10s\"}}'\n\n```\n\n### Query All\n\n```\ncurl -k https://localhost:8438/services\n```\n\nThe result should be\n\n```\n{\n  \"com.networknt.reference.v2|uat\": {\n    \"nodes\": \"[{\\\"address\\\":\\\"192.168.1.144\\\",\\\"port\\\":8001},{\\\"address\\\":\\\"192.168.1.145\\\",\\\"port\\\":8001}]\"\n  },\n  \"com.networknt.reference.v1|uat\": {\n    \"nodes\": \"[{\\\"address\\\":\\\"192.168.1.144\\\",\\\"port\\\":8000},{\\\"address\\\":\\\"192.168.1.145\\\",\\\"port\\\":8000},{\\\"address\\\":\\\"192.168.1.146\\\",\\\"port\\\":8000}]\"\n  }\n}\n```\n\n### Query ServiceId\n\n```\ncurl -k 'https://localhost:8438/services?serviceId=com.networknt.reference.v1\u0026tag=uat'\n```\n\n### Deregister\n\n```\ncurl -k --request DELETE 'https://localhost:8438/services?serviceId=com.networknt.reference.v1\u0026tag=uat\u0026address=192.168.1.146\u0026port=8000'\n```\n\n### Server Info\n\n\n```\ncurl -k https://localhost:8438/services/info/172.18.0.1:8443\n```\n\n### Check Status\n\n```\ncurl -k https://localhost:8438/services/check/com.networknt.petstore-3.0.1:172.18.0.1:8443\n```\n\nAnd result:\n\n```\n{\"lastExecuteTimestamp\":1605563379912,\"lastFailedTimestamp\":0,\"serviceId\":\"com.networknt.petstore-3.0.1\",\"address\":\"172.18.0.1\",\"port\":8443,\"tlsSkipVerify\":true,\"http\":\"https://172.18.0.1:8443/health/com.networknt.petstore-3.0.1\",\"interval\":10000,\"id\":\"com.networknt.petstore-3.0.1:172.18.0.1:8443\",\"deregisterCriticalServiceAfter\":120000}\n```\n### Get: All modules\n\n```\ncurl -k https://localhost:8438/services/modules?protocol=https\u0026address=172.18.0.1\u0026port=9443\n```\n\nAnd result:\n\n```\n[\n    \"com.networknt.correlation.CorrelationHandler\",\n    \"com.networknt.server.Server\",\n    \"com.networknt.handler.Handler\",\n    \"com.networknt.audit.AuditHandler\",\n    \"com.networknt.traceability.TraceabilityHandler\",\n    ...\n]\n```\n\n### Post: Reload Module Configuration\n\n```\ncurl -k https://localhost:8438/services/modules\n```\nRequest Body:\n```\n{\n\t\t\"protocol\": \"https\",\n        \"address\": \"172.18.0.1\",\n        \"port\": 9443,\n\t\t\"modules\": [\t\"com.networknt.audit.AuditHandler\",\n\t\t\t\t\t    \"com.networknt.traceability.TraceabilityHandler\",\n\t\t\t\t\t    \"com.networknt.service.SingletonServiceFactory\"\n\t\t\t\t]\n}\n```\n\nAnd result:\n\n```\n[\n    \"com.networknt.audit.AuditHandler\",\n    \"com.networknt.traceability.TraceabilityHandler\",\n]\n```\nResponse 200\n```\n\n### Post: Shutdown Service\n```\ncurl -k https://localhost:8438/services/shutdown\n```\nRequest Body:\n```\n{\n\t\t\"protocol\": \"https\",\n        \"address\": \"172.18.0.1\",\n        \"port\": 9443\n}\n```\nAnd result(from light-4j):\n\n```\n[\n    \"tag\":\"dev\",\n    \"serviceId\":\"com.networknt.petstore-3.0.1\",\n\t \"time\":\"1605563379912\"\n]\n```\nResponse 200\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnetworknt%2Flight-controller","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnetworknt%2Flight-controller","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnetworknt%2Flight-controller/lists"}