{"id":15704549,"url":"https://github.com/yujideveloper/rack-bearer_auth","last_synced_at":"2026-03-11T08:34:29.884Z","repository":{"id":49392328,"uuid":"132774683","full_name":"yujideveloper/rack-bearer_auth","owner":"yujideveloper","description":"Middleware for using RFC 6750 bearer auth in Rack apps","archived":false,"fork":false,"pushed_at":"2021-06-09T04:04:49.000Z","size":43,"stargazers_count":6,"open_issues_count":1,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-01-31T14:50:45.155Z","etag":null,"topics":["auth","rack","rack-middleware","rails","rfc-6750","ruby"],"latest_commit_sha":null,"homepage":null,"language":"Ruby","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/yujideveloper.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-05-09T15:08:45.000Z","updated_at":"2022-08-30T17:55:13.000Z","dependencies_parsed_at":"2022-08-27T11:50:27.878Z","dependency_job_id":null,"html_url":"https://github.com/yujideveloper/rack-bearer_auth","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/yujideveloper/rack-bearer_auth","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yujideveloper%2Frack-bearer_auth","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yujideveloper%2Frack-bearer_auth/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yujideveloper%2Frack-bearer_auth/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yujideveloper%2Frack-bearer_auth/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yujideveloper","download_url":"https://codeload.github.com/yujideveloper/rack-bearer_auth/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yujideveloper%2Frack-bearer_auth/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30376309,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-11T06:09:32.197Z","status":"ssl_error","status_checked_at":"2026-03-11T06:09:17.086Z","response_time":84,"last_error":"SSL_read: 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":["auth","rack","rack-middleware","rails","rfc-6750","ruby"],"created_at":"2024-10-03T20:12:24.248Z","updated_at":"2026-03-11T08:34:29.866Z","avatar_url":"https://github.com/yujideveloper.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Rack::BearerAuth\n\nRack::BearerAuth is middleware that make using [RFC 6750](https://tools.ietf.org/html/rfc6750) bearer auth in Rack apps.\n\n[![Gem Version](https://badge.fury.io/rb/rack-bearer_auth.svg)](https://badge.fury.io/rb/rack-bearer_auth)\n[![Build Status](https://travis-ci.org/yujideveloper/rack-bearer_auth.svg?branch=master)](https://travis-ci.org/yujideveloper/rack-bearer_auth)\n[![Maintainability](https://api.codeclimate.com/v1/badges/db47f9a4e48bd30edb98/maintainability)](https://codeclimate.com/github/yujideveloper/rack-bearer_auth/maintainability)\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'rack-bearer_auth'\n```\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install rack-bearer_auth\n\n## Configuration\n\n### Rails configuration\n\n``` ruby\nmodule YourApp\n  class Application \u003c Rails::Application\n\n    # ...\n\n    config.middleware.use Rack::BearerAuth::Middleware do\n      match path: \"/foo\" do |token|\n        # validate token\n        # AccessToken.where(token: token).exists?\n      end\n\n      match via: :all do |token|\n        # validate token\n        # AccessToken.where(token: token).exists?\n      end\n\n      match path: \"/bar\", via: %i[post patch delete], token: \"some_token\"\n    end\n  end\nend\n```\n\n### Rack configuration\n\n``` ruby\nuse Rack::BearerAuth::Middleware do\n  match path: \"/foo\" do |token|\n    # validate token\n    # AccessToken.where(token: token).exists?\n  end\n\n  match via: :all do |token|\n    # validate token\n    # AccessToken.where(token: token).exists?\n  end\n\n  match path: \"/bar\", via: %i[post patch delete], token: \"some_token\"\nend\n\n```\n\n### Configration reference\n\n#### matching options\n\n* `path` (`String`, `Regexp`, `Proc` , `Array`): The HTTP request path matches for the resource.\n* `via` (`Symbol`, `String`, `Regexp`, `Proc` , `Array`, `:all`): The HTTP request method matchs for the resource.\n* `token` (`String`, `Regexp`, `Proc` , `Array`): The access token for the resource.\n\n## Limitations\n\n* [Form-Encoded Body Parameter(RFC 6750 section 2.2)](https://tools.ietf.org/html/rfc6750#section-2.2) is not supported.\n* [URI Query Parameter(RFC 6750 section 2.3)](https://tools.ietf.org/html/rfc6750#section-2.3) is not supported.\n* `scope` attribute is not supported.\n\n## Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.\n\nTo install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/yujideveloper/rack-bearer_auth.\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyujideveloper%2Frack-bearer_auth","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyujideveloper%2Frack-bearer_auth","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyujideveloper%2Frack-bearer_auth/lists"}