Skip to content
This repository was archived by the owner on May 28, 2024. It is now read-only.

Shuttlerock/rack-cloudflare-jwt

Repository files navigation

Rack::CloudflareJwt

CircleCI

About

This gem provides CloudFlare JSON Web Token (JWT) based authentication.

Requirements

  • Ruby 2.6.0 or greater

Installation

Add this line to your application's Gemfile:

gem 'rack-cloudflare-jwt'

And then execute:

$ bundle install

Or install it directly with:

$ gem install rack-cloudflare-jwt

Usage

Rack::CloudflareJwt::Auth accepts configuration options. All options are passed in a single Ruby Hash<String, String>. E.g. { '/admin' => 'aud-1', '/manager' => 'aud-2' }.

  • Hash key : String : A path string representing paths that should be checked for the presence of a valid JWT token. Includes sub-paths as of specified path as well (e.g. /docs includes /docs/some/thing.html also). Each path should start with a /. If a path doesn't matches the current request path this entire middleware is skipped and no authentication or verification of tokens takes place.

  • Hash value : String : A Application Audience (AUD) Tag.

Also, you should provide a Team Domain.

Rails

Rails.application.config.middleware.use Rack::CloudflareJwt::Auth, 'my-team-domain.cloudflareaccess.com',
                                                                   '/my-path-1' => 'aaa.bbb.ccc'
                                                                   '/my-path-2' => 'xxx.yyy.zzz',

Contributing

  1. Fork it ( https://github.com/Shuttlerock/rack-cloudflare-jwt/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

About

Rack middleware that provides authentication based on CloudFlare JSON Web Tokens

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 7

Languages

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy