{"id":16539572,"url":"https://github.com/al3rez/guardian","last_synced_at":"2025-10-15T07:29:32.238Z","repository":{"id":127306776,"uuid":"175215210","full_name":"al3rez/guardian","owner":"al3rez","description":"💂‍Guardian - Poor man's basic authentication","archived":false,"fork":false,"pushed_at":"2019-03-12T13:18:08.000Z","size":5,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-09T23:40:46.041Z","etag":null,"topics":[],"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/al3rez.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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-03-12T13:17:36.000Z","updated_at":"2019-04-01T01:30:41.000Z","dependencies_parsed_at":null,"dependency_job_id":"e2fd7c41-2be0-4e5e-8744-4724619bf6fd","html_url":"https://github.com/al3rez/guardian","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/al3rez%2Fguardian","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/al3rez%2Fguardian/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/al3rez%2Fguardian/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/al3rez%2Fguardian/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/al3rez","download_url":"https://codeload.github.com/al3rez/guardian/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248358547,"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":[],"created_at":"2024-10-11T18:49:42.216Z","updated_at":"2025-10-15T07:29:27.200Z","avatar_url":"https://github.com/al3rez.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 💂‍Guardian\nPoor man's basic authentication \n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'guardian'\n```\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install guardian\n\n## Usage\n\nInclude `Guardian` in your specific controller or a base one\n\n```ruby\nclass ApplicationController \u003c ActionController::API\n  include Guardian\n\n  rescue_from Guardian::Unauthenticated do |error|\n    render json: { error_human: error }, status: :unauthorized\n  end\n\n  rescue_from Guardian::Unauthorized do |error|\n    render json: { error_human: error }, status: :forbidden\n  end\nend\n```\nAnd use `authenticate!` method to check whether user provided credentials\n\n```ruby\nclass PetsController \u003c ApplicationController\n  before_action :authenticate!, only: %i[create update delete]\n\n  def create\n    # create a pet\n  end\nend\n```\n\nDone! Whoah\n\n\n## Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` 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/[USERNAME]/guardian.\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%2Fal3rez%2Fguardian","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fal3rez%2Fguardian","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fal3rez%2Fguardian/lists"}