{"id":16926089,"url":"https://github.com/databus23/keystone","last_synced_at":"2025-04-11T17:35:00.235Z","repository":{"id":57497963,"uuid":"43963881","full_name":"databus23/keystone","owner":"databus23","description":"A go http middleware for authenticating users via Openstack's Keystone","archived":false,"fork":false,"pushed_at":"2018-01-11T11:09:17.000Z","size":22,"stargazers_count":15,"open_issues_count":0,"forks_count":8,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-25T13:39:26.893Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","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/databus23.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}},"created_at":"2015-10-09T15:23:14.000Z","updated_at":"2020-04-14T02:27:48.000Z","dependencies_parsed_at":"2022-09-04T00:10:20.493Z","dependency_job_id":null,"html_url":"https://github.com/databus23/keystone","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/databus23%2Fkeystone","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/databus23%2Fkeystone/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/databus23%2Fkeystone/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/databus23%2Fkeystone/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/databus23","download_url":"https://codeload.github.com/databus23/keystone/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248450343,"owners_count":21105665,"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-13T20:29:00.150Z","updated_at":"2025-04-11T17:35:00.214Z","avatar_url":"https://github.com/databus23.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.org/databus23/keystone.png?branch=master)](https://travis-ci.org/databus23/keystone)\n\nGo Keystone Middleware\n======================\nA go http middleware for authenticating incoming http request against Openstack Keystone. It it modelled after the original [python middleware for keystone](http://docs.openstack.org/developer/keystonemiddleware/middlewarearchitecture.html).\n\nThe middleware authenticates incoming requests by validating the `X-Auth-Token` header and adding additional headers to the incoming request containing the validation result. The final authentication/authorisation decision is delegated to subsequent http handlers.\n\nYou can view the API docs here:\nhttp://godoc.org/github.com/databus23/keystone\n\nUsage\n-----\n```\n// main.go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\n\t\"github.com/databus23/keystone\"\n)\n\nvar myApp = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {\n\tif r.Header.Get(\"X-Identity-Status\") == \"Confirmed\" {\n\t\tfmt.Fprintf(w, \"This is an authenticated request\")\n\t\tfmt.Fprintf(w, \"Username: %s\", r.Header.Get(\"X-User-Name\"))\n\n\t} else {\n\t\tw.WriteHeader(401)\n\t\tfmt.Fprintf(w, \"Invalid or no token provided\")\n\t}\n})\n\nfunc main() {\n\tauth := keystone.New(\"http://keystone.endpoint:5000/v3\")\n\thandler := auth.Handler(myApp)\n\thttp.ListenAndServe(\"0.0.0.0:3000\", handler)\n}\n```\n\nHeaders \n-------\nThe middleware sets the following HTTP header for subsequent handlers.\n\n * `X-Identity-Status`: Token validation result. Either `Confirmed` or `Invalid`\n\nIf the validation was successful the following headers are also set\n\n * `X-User-Id`\n * `X-User-Name`\n * `X-User-Domain-Id`\n * `X-User-Domain-Name`\n * `X-Project-Name` *project scoped tokens only*\n * `X-Project-Id` *project scoped tokens only*\n * `X-Project-Domain-Name` *project scoped tokens only*\n * `X-Project-Domain-Id` *project scoped tokens only*\n * `X-Domain-Id` *domain scoped tokens only*\n * `X-Domain-Name` *domain scoped tokens only*\n * `X-Roles` A comma separated list of role names associated with the user for the current scope\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdatabus23%2Fkeystone","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdatabus23%2Fkeystone","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdatabus23%2Fkeystone/lists"}