{"id":20595496,"url":"https://github.com/thefrontside/okapi.rb","last_synced_at":"2025-10-08T16:02:37.718Z","repository":{"id":56886258,"uuid":"104765171","full_name":"thefrontside/okapi.rb","owner":"thefrontside","description":"Ruby client to communicate with an OKAPI cluster","archived":false,"fork":false,"pushed_at":"2018-01-17T16:05:45.000Z","size":591,"stargazers_count":0,"open_issues_count":4,"forks_count":0,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-09-27T21:28:59.303Z","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/thefrontside.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":"2017-09-25T15:03:58.000Z","updated_at":"2017-09-25T15:14:35.000Z","dependencies_parsed_at":"2022-08-21T00:50:15.829Z","dependency_job_id":null,"html_url":"https://github.com/thefrontside/okapi.rb","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/thefrontside/okapi.rb","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thefrontside%2Fokapi.rb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thefrontside%2Fokapi.rb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thefrontside%2Fokapi.rb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thefrontside%2Fokapi.rb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thefrontside","download_url":"https://codeload.github.com/thefrontside/okapi.rb/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thefrontside%2Fokapi.rb/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278872214,"owners_count":26060537,"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","status":"online","status_checked_at":"2025-10-07T02:00:06.786Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2024-11-16T08:13:17.218Z","updated_at":"2025-10-08T16:02:37.692Z","avatar_url":"https://github.com/thefrontside.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Okapi\n[![Gem Version](https://badge.fury.io/rb/okapi.svg)](https://badge.fury.io/rb/okapi)\n[![Build Status](https://travis-ci.org/thefrontside/okapi.rb.svg?branch=master)](https://travis-ci.org/thefrontside/okapi.rb)\n\nRuby bindings and command line utility for the [Okapi][1] API gateway.\n\n## Synopsis\n\nTo make calls to an Okapi gateway from Ruby, instantiate an instance\nof the `Okapi::Client` class by passing in the URL, Tenant, and\nauth_token to use for requests.\n\n``` ruby\nrequire 'okapi'\nokapi = Okapi::Client.new('https://okapi.frontside.io', \"fs\", \"\u003cMY-AUTH-TOKEN\u003e\")\nokapi.get(\"/_/proxy/modules\") //=\u003e [{id: 'mod-kb-ebsco'}, {id: 'mod-config'}]\n```\n\nThe `okapi` client has methods corresponding to the major `REST`ful\nverbs: `okap.get`, `okapi.post`, `okapi.put`, `okapi.delete`\n\nBy default, even if you provided them to the constructor, the client\ndoes not send tenant and auth information with the request. This is\nbecause the gateway will reject requests that provide this information\nwhen it is not needed. For example, an authorization request that\nprovides an auth token will result in an error, so you don't want to\nsend it.\n\nTo send tenant, use the `tenant` property on the client\nto access an `Okapi::Client` that _will_ send tenant information.\n\n``` ruby\nokapi.tentant.post('/authn/login', username: 'admin', password: 'password')\n```\n\nTo send both tenant _and_ authorization information with a request,\nuse the `user` property of the okapi client which will give you a\nclient that _will_ send both these bits of information with the\nrequest:\n\n``` ruby\nokapi.user.get('/eholdings/configuration')\n```\n\n## Command Line\n\nThe okapi gem comes with a command line utility to help you easily\ninteract with an Okapi gateway from your shell.\n\n![installing, configuring and using the okapi command line\ntool](okapi-command-line.gif \"Okapi Command Line Demo\")\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'okapi'\n```\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install okapi\n\n\n## Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies. Then, run `bin/rspec 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/thefrontside/okapi.rb\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).\n\n[1]: https://github.com/folio-org/okapi\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthefrontside%2Fokapi.rb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthefrontside%2Fokapi.rb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthefrontside%2Fokapi.rb/lists"}