{"id":21512012,"url":"https://github.com/strvcom/target-rest","last_synced_at":"2025-03-17T15:26:02.799Z","repository":{"id":97728398,"uuid":"434552393","full_name":"strvcom/target-rest","owner":"strvcom","description":"Send Singer data to a REST server","archived":false,"fork":false,"pushed_at":"2021-12-10T13:57:05.000Z","size":27,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-01-24T01:43:40.002Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/strvcom.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2021-12-03T10:16:25.000Z","updated_at":"2022-03-14T16:04:05.000Z","dependencies_parsed_at":null,"dependency_job_id":"36e76b0b-8396-4a3f-ab86-52623491df56","html_url":"https://github.com/strvcom/target-rest","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/strvcom%2Ftarget-rest","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/strvcom%2Ftarget-rest/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/strvcom%2Ftarget-rest/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/strvcom%2Ftarget-rest/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/strvcom","download_url":"https://codeload.github.com/strvcom/target-rest/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244056748,"owners_count":20390783,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":"2024-11-23T22:25:34.919Z","updated_at":"2025-03-17T15:26:02.779Z","avatar_url":"https://github.com/strvcom.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Target REST API\n\nThis is a [Singer](https://singer.io) target that sends JSON-formatted data to the REST API\nfollowing the [Singer spec](https://github.com/singer-io/getting-started/blob/master/SPEC.md).\n\n\n## Configuration\n\nExample configuration with all possible configuration keys is below. The only required key is `api_url`. Other keys are optional.\n\n``` json\n{\n    \"api_url\": \"https://some_url.com/v1/endpoint\",\n    \"disable_collection\": true,\n    \"batch_size\": null,\n    \"auth_token\": null,\n    \"allowed_keys\": [\"a\", \"b\"],\n    \"request_timeout\": 10\n}\n```\n\nDescription of configuration keys:\n* `api_url` - REST API endpoint URL. The only required configuration key.\n* `disable_collection` - disable sending anonymous usage data to singer.io if set to `true`\n* `batch_size` - number of JSON lines that should be send in one batch. If set to `null` or not specified the batch size is set to 1\n* `auth_token` - authorization token\n* `allowed_keys` - keys from input JSON that should be propagated to the REST API\n* `request_timeout` - time for one request in seconds\n\n## Testing\n\nThere are no automatic tests yet, but you can find the instructions for manual testing in the folder [test](test)\n\n## TODOs\n\n* **Handle server authentification** \n* **Handle bad URL and issues with REST server**\n* **Make batching safer** It is probably fine now but someone should check it\n* **Implement reaction to singer message [ActivateVersionMessage](https://github.com/singer-io/singer-python/blob/0c066de21111d8572425083b4a8792d193c80af1/singer/messages.py#L137)** Now it is just ignored but to implement this could be tricky. We would need specific enpoint that will delete all previously send records and check record version.\n* **Think about better way to handle the last batch** that is smaller then batch_size (for cases when data_size % batch_size != 0)\n* **Better handling of REST server response codes \u003c 400** For example response codes like `204 - No content` is treated like everithing is fine but it can mean some problems\n* **Implement `allowed_keys` and `request_timeout` from configuration**\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstrvcom%2Ftarget-rest","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstrvcom%2Ftarget-rest","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstrvcom%2Ftarget-rest/lists"}