Coder Social home page Coder Social logo

promisedlandt / tyrant Goto Github PK

View Code? Open in Web Editor NEW

This project forked from apotonick/tyrant

0.0 1.0 0.0 35 KB

Agnostic authentication gem with signup, signin, forgot password, sticky login, and so on.

Home Page: http://www.trailblazer.to/gems/tyrant

License: MIT License

Ruby 100.00%

tyrant's Introduction

Tyrant

"Freedom choked in dread we live, since tyrant was enthroned."

Tyrant implements all common steps of authorization workflows using overridable operations. It allows a quick setup of sign in, sign up, forgot password, etc. Tyrant works well in Rails, but plays well with any Ruby environment.

Operations are provided for the following steps.

  • SignIn
    • Confirmed
    • Hammer protection (3x wrong blabla)
    • Sticky (Remember me)
  • SignUp
  • SignOut
  • ResetPassword
  • Forgot pw
  • Mutiple sessions with scopes

Operations

trb instead of pushing into controller

Tyrant exposes its public API using operations.

Operations are the pivotal element in the Trailblazer architecture. When it comes to customization, Tyrant doesn't rely on a "hopefully complete" configuration language as Devise does it.

Tyrant allows you to customize with Ruby. You can override entire workflow steps (operations), forms and validations (contracts) or methods using simple object-orientation and a clean API.

This means you can easily use them in Rails controllers.

class SessionController < ApplicationController
  def sign_in
    run Tyrant::SignIn
  end

You can also run the public API in any other Ruby environment, e.g. a console or a Roda action.

Tyrant::SignIn.run(params)

Tyrant provides forms for all workflow steps. using Reform objects that are embedded into the operations.

=> Customize with inheritance, or override. Or just don't use the operation and write your own "step".

Installation

Add this line to your application's Gemfile:

gem 'tyrant'

Rails

Tyrant comes with a railtie to provide you an initializer. In Rails, add this to an initializer.

require "tyrant/railtie"

License

The gem is available as open source under the terms of the MIT License.

tyrant's People

Contributors

acaron avatar apotonick avatar chrisalley avatar timoschilling avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.