{"id":16163374,"url":"https://github.com/gregorwolf/sap-business-one-service-layer-proxy","last_synced_at":"2026-02-18T07:02:39.559Z","repository":{"id":39021919,"uuid":"338321831","full_name":"gregorwolf/sap-business-one-service-layer-proxy","owner":"gregorwolf","description":"SAP Business One Service Layer Proxy","archived":false,"fork":false,"pushed_at":"2023-02-24T20:57:29.000Z","size":357,"stargazers_count":3,"open_issues_count":9,"forks_count":3,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-02T19:51:39.944Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gregorwolf.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"github":["gregorwolf"],"patreon":null,"open_collective":null,"ko_fi":"gregorwolf","tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2021-02-12T13:06:37.000Z","updated_at":"2023-05-15T10:14:16.000Z","dependencies_parsed_at":"2024-10-27T19:28:15.247Z","dependency_job_id":null,"html_url":"https://github.com/gregorwolf/sap-business-one-service-layer-proxy","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/gregorwolf/sap-business-one-service-layer-proxy","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gregorwolf%2Fsap-business-one-service-layer-proxy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gregorwolf%2Fsap-business-one-service-layer-proxy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gregorwolf%2Fsap-business-one-service-layer-proxy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gregorwolf%2Fsap-business-one-service-layer-proxy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gregorwolf","download_url":"https://codeload.github.com/gregorwolf/sap-business-one-service-layer-proxy/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gregorwolf%2Fsap-business-one-service-layer-proxy/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29571888,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-18T06:19:27.422Z","status":"ssl_error","status_checked_at":"2026-02-18T06:18:44.348Z","response_time":162,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":"2024-10-10T02:35:24.552Z","updated_at":"2026-02-18T07:02:39.542Z","avatar_url":"https://github.com/gregorwolf.png","language":"JavaScript","funding_links":["https://github.com/sponsors/gregorwolf","https://ko-fi.com/gregorwolf"],"categories":[],"sub_categories":[],"readme":"# SAP Business One Service Layer Reverse Proxy\n\nThis reverse proxy can be installed in front of the SAP Business One Service Layer to improve it's performance for multiple requests when called from the SAP Cloud Platform via the SAP Cloud connector. Unfortunately the initial request to the Service Layer is very slow using basic authentication. The next requests are faster when you use the session cookie. But for requests coming from the SAP Cloud Applicaiton Programming Model the cookies are not persisted. This proxy adds the functionality to cache the cookies. As the cookies are only valid for 30 minutes also a this timeout must be checked.\n\n## Architecture\n\n![Architecture](documentation/Architecture.png)\n\n## Basic procedure\n\n- Check that the request contains an authorization header\n- Check if session for authorization header exists, if not create session with current timestamp\n- if session exists check if the timeout was reached and delete the cookie\n- if there is a cookie in the session forward it in the request\n- when the response contains a cookie, store it in the session\n\n## Configuration\n\nThe configuration is done via the following environment variables:\n\n- TARGET_URL defines the URL of the Service Layer\n- PORT defines the port the proxy is listening to\n- TIMEOUT defines the session timeout in seconds\n- START_TESTSERVER defines if the testserver should be started\n- LOG_LEVEL is set to info by default. With debug you get a deeper insight\n- LOG_AS_TEXT pretty print the log output\n\nTo setup the environment variables quickly the dotenv module is included in the project. So you can create a *.env* file in the root folder of this project and add the following content:\n\n```\nTARGET_URL=\u003cFullURLtoYourServiceLayer or http://127.0.0.1:4004 if you set START_TESTSERVER=true\u003e\nPORT=5050\nTIMEOUT=1500\nSTART_TESTSERVER=true\nLOG_LEVEL=debug\nLOG_AS_TEXT=true\n```\n\n## Execution\n\nTo run the project on your local computer you have to install the required dependencies with\n\n`npm i`\n\nThen you can start it with:\n\n`npm start`\n\n## Test\n\nIf you want to run the REST Client test in *test/request.http* you have to create a *.env* file in the *test* folder with the following content:\n\n```\nUSERNAME={\"UserName\":\"\u003cYourUser\u003e\",\"CompanyDB\":\"\u003cYourCompanyDB\u003e\"}\nPASSWORD=\u003cYourPassword\u003e\nSERVICE_LAYER=http://localhost:5050\n```\n\nplease adjust YourUser, YourCompanyDB and YourPassword with your credentials for the SAP Business One Service Layer.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgregorwolf%2Fsap-business-one-service-layer-proxy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgregorwolf%2Fsap-business-one-service-layer-proxy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgregorwolf%2Fsap-business-one-service-layer-proxy/lists"}