{"id":22085581,"url":"https://github.com/nexmo/nexmo-rack","last_synced_at":"2025-07-24T17:31:23.943Z","repository":{"id":56620828,"uuid":"215793808","full_name":"Nexmo/nexmo-rack","owner":"Nexmo","description":"Rack Middleware to help work with Nexmo webhooks","archived":false,"fork":false,"pushed_at":"2021-02-02T13:37:31.000Z","size":28,"stargazers_count":3,"open_issues_count":0,"forks_count":3,"subscribers_count":15,"default_branch":"main","last_synced_at":"2024-11-20T13:56:34.899Z","etag":null,"topics":["middleware","nexmo","rack","ruby"],"latest_commit_sha":null,"homepage":"","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/Nexmo.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGES.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-10-17T13:02:31.000Z","updated_at":"2020-11-16T14:19:46.000Z","dependencies_parsed_at":"2022-08-15T22:10:10.054Z","dependency_job_id":null,"html_url":"https://github.com/Nexmo/nexmo-rack","commit_stats":null,"previous_names":["nexmo/rack-verify-signature-middleware"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nexmo%2Fnexmo-rack","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nexmo%2Fnexmo-rack/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nexmo%2Fnexmo-rack/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nexmo%2Fnexmo-rack/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Nexmo","download_url":"https://codeload.github.com/Nexmo/nexmo-rack/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227463798,"owners_count":17778465,"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":["middleware","nexmo","rack","ruby"],"created_at":"2024-12-01T01:15:05.785Z","updated_at":"2024-12-01T01:15:06.421Z","avatar_url":"https://github.com/Nexmo.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Nexmo Rack Middleware\n\nThis repo contains Rack middleware that can be used to help integrate Nexmo in to your Rack-based application. It currently contains the following middleware:\n\n* Verify [Nexmo signatures](https://developer.nexmo.com/concepts/guides/signing-messages).\n* Plus more to be added\n\n## Table of contents\n\n* [Installation and Usage](#installation-and-usage)\n    * [As a standalone application](#as-a-standalone-application)\n    * [Mounted into a Rails application](#mounted-into-a-rails-application)\n* [Contributing](#contributing)\n* [License](#license)\n\n## Installation and Usage\n\nThe verify signature middleware can be used standalone or integrated into a Ruby application. The middleware will return a `403` HTTP status code if the signature is not valid, and will continue the application if it is valid.\n\n### Configuration\n\nYou'll need to provide a Nexmo signature secret and signature method using either `ENV` variables or the Rails credentials system.\n\n`.env` example:\n\n```\nNEXMO_SIGNATURE_SECRET = 'your_secret_key'\nNEXMO_SIGNATURE_METHOD = 'md5hash'\n```\n\nAlternatively, you can specify them in the Rails credentials system\n\n```\nEDITOR=\"code --wait\" rails credentials:edit\n```\n\nYou can replace the EDITOR variable with your preferred editor. Once the credentials file is open, you are able to add the Nexmo credentials with the following namespacing:\n\n```yaml\nnexmo:\n    signature_secret: your_secret_key\n    signature_method: md5hash\n```\n\nFinally, this middleware will ignore any requests that do not contain a `sig` key. To enforce all requests to be validated, set `NEXMO_SIGNATURE_REQUIRED` to `true` in the environment.\n\n### As a standalone application\n\nInstall the gem on your system:\n\n``` shell\n$ gem install nexmo_rack\n```\n\nThen require it from within your `config.ru` Rack configuration:\n\n``` ruby\nuse Nexmo::Rack::VerifySignature\n```\n\nAn example [config.ru](examples/config.ru.example) can be found in the examples folder. More information on getting up and running with Rack can be found at the [Rack GitHub repository](https://github.com/rack/rack/wiki/(tutorial)-rackup-howto#with-a-ru-config-file).\n\n### Mounted into a Rails Application\n\nRequire it in your `Gemfile`:\n\n```ruby\ngem nexmo_rack\n```\n\nAnd then add the middleware to your `config/application.rb` file to initialize it with your application:\n\n```ruby\nconfig.middleware.use Nexmo::Rack::VerifySignature\n```\n\n## Contributing\nWe ❤️ contributions from everyone! [Bug reports](https://github.com/Nexmo/nexmo_rack/issues), [bug fixes](https://github.com/Nexmo/nexmo_rack/pulls) and feedback on the library is always appreciated. Look at the [Contributor Guidelines](https://github.com/Nexmo/nexmo_rack/blob/master/CONTRIBUTING.md) for more information.\n\n## License\nThis project is under the [MIT LICENSE](https://github.com/Nexmo/nexmo_rack/blob/master/LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnexmo%2Fnexmo-rack","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnexmo%2Fnexmo-rack","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnexmo%2Fnexmo-rack/lists"}