{"id":16042892,"url":"https://github.com/nylen/discourse-api-proxy","last_synced_at":"2025-06-15T02:38:06.790Z","repository":{"id":137375887,"uuid":"198573777","full_name":"nylen/discourse-api-proxy","owner":"nylen","description":"PHP script to simulate more fine-grained authentication capabilities for the Discourse REST API.","archived":false,"fork":false,"pushed_at":"2020-09-14T19:33:18.000Z","size":10,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-22T07:18:16.102Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","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/nylen.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":"2019-07-24T06:36:57.000Z","updated_at":"2024-02-25T03:45:43.000Z","dependencies_parsed_at":null,"dependency_job_id":"c1243f66-6c3b-4fc8-9ed6-e941ff793288","html_url":"https://github.com/nylen/discourse-api-proxy","commit_stats":{"total_commits":6,"total_committers":1,"mean_commits":6.0,"dds":0.0,"last_synced_commit":"9b94cb47b0c71fd33687eb5acc741f485d8198ed"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/nylen/discourse-api-proxy","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nylen%2Fdiscourse-api-proxy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nylen%2Fdiscourse-api-proxy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nylen%2Fdiscourse-api-proxy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nylen%2Fdiscourse-api-proxy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nylen","download_url":"https://codeload.github.com/nylen/discourse-api-proxy/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nylen%2Fdiscourse-api-proxy/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259913607,"owners_count":22931242,"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-10-09T00:03:03.671Z","updated_at":"2025-06-15T02:38:06.766Z","avatar_url":"https://github.com/nylen.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# discourse-api-proxy\n\nThis is a PHP script to simulate more fine-grained authentication capabilities\nfor the\n[Discourse](https://www.discourse.org)\nREST API.\n\n[Currently](https://meta.discourse.org/t/cant-generate-multiple-api-keys/21011),\nDiscourse manages API access through a single master key (and\nuser-specific keys which may not be adequate for your needs).\n\nIf you need more fine-grained authentication, then this script may work for\nyou.  It stores the master API key in a config file, and allows configuring and\ndistributing multiple \"client keys\".\n\nDiscourse API clients can then point to this script as if it were the real\nDiscourse API, and you can give out one of your \"client keys\" instead of the\nmaster API key.\n\nFor each client key, you can define the Discourse API endpoints that clients\nare allowed to call, and also a list or pattern of allowed IP addresses for\nincoming requests.\n\n## Usage\n\n- Copy `sample-config.php` to `config.php` and fill in the values.\n- Host your `config.php`, the `index.php` script and its accompanying\n  `.htaccess` file using Apache (or make sure all requests will be routed to\n  `index.php` using your server software of choice).\n- Configure your Discourse API client(s) to point to this script instead of the\n  real Discourse API, and use one of the \"client key\" values defined in\n  `config.php` instead of the real Discourse API key.\n\n## Caveats\n\nAt the moment, Discourse API clients **must not** send a **JSON body** with\ntheir requests!  `POST` or `PUT` requests are only supported using\n**form-encoded request bodies**.\n\nIf you are using Discourse as an SSO provider via the `/session/sso_provider`\nendpoint, you **must** configure your client to talk to this endpoint directly\nvia the Discourse API instead!  This is because this endpoint sets a cookie\nfor the next step in the login process inside Discourse, and this cookie must\nbe recognized on the same domain and subdomain as the Discourse install.\n\nUsing this script will introduce a mismatch between the forum URL and the forum\nAPI URL, and client code may assume these two base URLs are the same.\n\nGiven these caveats, many Discourse clients **will need modification** in order\nto work with this script.\n\n## Contributions\n\nBug reports and change requests via GitHub issues and PRs are welcome.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnylen%2Fdiscourse-api-proxy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnylen%2Fdiscourse-api-proxy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnylen%2Fdiscourse-api-proxy/lists"}