{"id":16849361,"url":"https://github.com/beryju/distribution-oauth","last_synced_at":"2025-04-11T06:41:05.775Z","repository":{"id":38838383,"uuid":"480565031","full_name":"BeryJu/distribution-oauth","owner":"BeryJu","description":"OAuth 2 support for https://github.com/distribution/distribution","archived":false,"fork":false,"pushed_at":"2025-02-13T12:17:47.000Z","size":61,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-25T04:36:05.416Z","etag":null,"topics":["docker","oauth","registry","sso"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/BeryJu.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2022-04-11T21:59:25.000Z","updated_at":"2025-02-13T12:17:49.000Z","dependencies_parsed_at":"2023-12-06T12:35:45.765Z","dependency_job_id":"a60c164d-eec3-4e89-8ec7-6e72e28e27be","html_url":"https://github.com/BeryJu/distribution-oauth","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/BeryJu%2Fdistribution-oauth","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BeryJu%2Fdistribution-oauth/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BeryJu%2Fdistribution-oauth/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BeryJu%2Fdistribution-oauth/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BeryJu","download_url":"https://codeload.github.com/BeryJu/distribution-oauth/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248358549,"owners_count":21090401,"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":["docker","oauth","registry","sso"],"created_at":"2024-10-13T13:15:03.845Z","updated_at":"2025-04-11T06:41:05.757Z","avatar_url":"https://github.com/BeryJu.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# distribution-oauth\n\nAdapt (semi-)standard OAuth to Docker's token system.\n\nNeeds custom registry build because https://github.com/distribution/distribution/issues/2875\n(See ghcr.io/beryju/distribution:jwt)\n\n## Env variables\n\n- `TOKEN_URL`: URL to send POST Token request to\n- `CLIENT_ID`: OAuth Client ID\n- `SCOPE`: Special scope to append to requests\n- `LOG_LEVEL`: Log level, defaults to info, can be set to trace which will print out credentials for debugging\n\n*Optional variables*\n\n- `ANON_USERNAME`: Credentials to be used when the client doesn't send any (optional)\n- `ANON_PASSWORD`: Credentials to be used when the client doesn't send any (optional)\n- `ANON_KUBE_JWT`: (Requires kubernetes) If set, will use the current pod's service account as anonymous credentials\n- `PASS_JWT_USERNAME`: Username clients can use to pass a JWT directly as password (optional)\n- `SESSION_KEY`: Secret key used for sessions (only used when registry is used in a browser, for example https://github.com/Joxit/docker-registry-ui)\n\n## authentik setup\n\nScope mapping with this code to allow everything:\n\n```python\nscopes = request.http_request.POST.get(\"scope\", \"\").split()\naccess = []\nfor scope in scopes:\n    if scope.count(\":\") \u003c 2:\n        continue\n    type, name, actions = scope.split(\":\")\n    access.append({\n        \"type\": type,\n        \"name\": name,\n        \"actions\": actions.split(\",\"),\n    })\nreturn {\n    \"access\": access,\n}\n```\n\nCreate with unique scope name, add scope to provider and configure env correctly\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fberyju%2Fdistribution-oauth","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fberyju%2Fdistribution-oauth","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fberyju%2Fdistribution-oauth/lists"}