Git Product home page Git Product logo

hello's Introduction

Hello

A Rails Engine.
Provides a set of valuable features for Registration, Authentication, Management and Internationalization.

Tested With The Latest

Ruby 2.3 Ruby 2.4.0-dev Rails 5.0

Status

Is It Working? Is It Tested? Code Quality
Master Build Status Code Climate Code Climate
# of Downloads Maintainance Status Get Involved!
Downloads Dependency Status GitHub Issues

Install

Gemfile
gem 'hello-rails'
gem 'bcrypt'   # bcrypt is a requirement
gem 'nav_lynx' # nav_lynx is optional, add it if you are using hello for the first time
Terminal
bundle install
bundle exec rails generate hello:install
bundle exec rake db:migrate

Generators

After you are comfortable with this gem, come back and give these guys a try!

bundle exec rails generate hello:install # initial setup
bundle exec rails generate hello:users # our secret-sauce scaffold for users
bundle exec rails generate hello:views # copies our view files to your project
bundle exec rails generate hello:locales # copies our translation files to your project
bundle exec rails generate hello:concerns # copies our key-behavior files to your project

How To

Contributing

Versions

Semantic Versioning 2.0.0

Thank You

Tim Lucas, John Nunemaker, Dan Everton and Johan Andersson or their open source gem user_agent_parser. As well as Tobie Langel and everybody involved in BrowserScope (full list), as our device and browser detection derives from their open-source work.

Iain Hecker for his open source gem http_accept_language that helps us understand browser's favorite locales.

Brian Landau and Ryan Foster for NavLynx as well as everybody on the Bootstrap Team as we use these open source projects on our generated view code.

Copyright

Copyright 2013-2016 James Pinto โ€“ Released under MIT License

hello's People

Contributors

acamino avatar brodock avatar davidzhu001 avatar demental avatar evandrodp avatar gomayonqui avatar marcelobarreto avatar matleroux avatar mpapis avatar mschnack avatar nebtrx avatar rthbound avatar sadjow avatar th1agoalmeida avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

hello's Issues

Stateless hello_keep_current_url_on_session!

Draw specs for hello_keep_current_url_on_session! on Stateless requests.

Tip: move the code from
lib/hello/railsy/controller/sudo_mode_concern.rb
to
hello/lib/hello/manager/*

Rename UpdateMyUserEntity

Rename UpdateMyUserEntity to UpdateCurrentUserEntity or CurrentUserEntity.
the current name no longer makes sense.

Sudo Mode for POST requests

Draw specs for sudo mode when requests are not type GET.

Explaining.

A good example of Sudo Mode in use is the feature to cancel your account.
It is not safe to allow a user to cancel their account if you are not sure the user who claims to be.
So you ask for their password again before you allow them to use the feature. feature description and bdd/rspec/capybara sources here

Currently Sudo Mode works as the following:

a method sudo_mode invoked from the controller will redirect to "/hello/sudo_mode" if sudo_mode? returns false. This can be observed here. And it is actually done by rendering, not redirection. sources here

The explanation above you render you a form. Submitting this form will lead you to this action sources here. which will ensure your password and update your current_access_token, and from now on the controller method sudo_mode? will return true instead of false.

The updating of current_access_token is done using a datetime field as explained in these sources, allowing the user to access controller actions restricted by the sudo mode for a limited time. This limited time is configurable in the hello initializer sources here

What are we looking for?

Currently the Sudo Mode feature only allows you to deny the user access to the forms which will submit the actions that will actually perform sensitive and restricted changes.
It works very well for hiding sensitive information that you don't want shown to the user unless they validate they are who they claim to be.

However, here is an even better feature in some cases.
We will use the example of "add an admin to a group" for this pair of scenario.

Scenario 1, success
Given I am on the members page for group "Vegans of The World"
When I attempt to turn "John" into an admin;
And I fill in the correct password on the Sudo Mode Form
Then I should see "John was turned to an admin"

Scenario 2
Given I am on the members page for group "Vegans of The World"
When I attempt to turn "John" into an admin;
And I fill in the incorrect password on the Sudo Mode Form
Then I should see "Data on your failed attempt has been emailed to the owner of this account"

Conclusion

This feature should

  1. intercept non-GET actions,
  2. store the information on the request,
  3. authenticate the user again by their password
    4.1. use the stored information to execute their originally intended request
    or
    4.2 use the store information to notify the owner of the account somebody has failed to perform a sensitive action on their account.

Issue open for discussion.

What do you think about this feature?
Do you see any problems with the description?
Do you think you can write this feature?
Help us improve this project.

Configurable BCrypt cost

BCrypt allows for us to specify a cost, or number of cycles it's gonna run.

BCrypt::Engine.cost = (Rails.env.test? ? 1 : 10)

Decide and implement where that configuration should take place in either of these 2 places.
A. initializer.rb
B. extensions/encrypt_password.rb

Please implement this configuration either way, focusing on which one is easiest for the end-developer to configure in case he wants to change from BCrypt to something else.

rename credential to email_credential

Past changes have made Credential be renamed to EmailCredential.
But some places still do use the old name, and that can be misleading to other developers.
Please manage and change this if you can, problematic places can still keep the old name, that's fine.

Sudo Mode template should have a sidebar

screen shot 2016-02-10 at 4 46 14 am

When the user comes to this page they can no longer see the sidebar,
this is confusing,
please add the sidebar on the sudo_mode/form template following the example on current_users/show and many other template files.

screen shot 2016-02-10 at 4 44 26 am

Write documentation for authorization API

controllers/kicking_concern.rb implements all of our authorization logic in the following methods

kick dont_kick dont_kick_people

they should fall under Goal Authentication.
Please implement documentation anywhere on README.MD explaining how they work.

Do not care so much about where to place the content as it can be moved in the future.

all controllers inside app/controllers implement at least one of the three methods mentioned above.

they do a "pre-authorization" step based on the user model which can be easily...

  1. extended by altering user.rb (view issue #12 )
  2. extended or replaced by other authorization gems such as cancan, pundit etc...
  3. or both ๐Ÿ˜„

Also note they work at both instance and class level, wrapping a before_action call

Please also open any issues regarding the implementation of KickingConcern if you think it is suitable.

Configurable registration_enabled

initializer.rb should include this configuration with true as a default value.

config.registration_enabled = true

Decide and implement what perspective a user should have from a website that, for any reason, is not currently taking in new users.

OAuth, Facebook, Twitter

Such features would be great to have, would be great if you could implement gem omniauth as a dependency.
A nice suggestion for implementing this would be inheriting from Credential with STI as we currently already have 2 classes inheriting from it.

Thread safety

Please find the term "Thread" and help us implement more ruby implementations on .travis.yml or any other tasks that make it threadsafe and compatible with other implementations of Ruby.

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.