Giter Club home page Giter Club logo

whenbot's People

Contributors

bonniecheung avatar burroak avatar camstevenson avatar caseyli avatar castrog avatar dewolfe avatar disaacs avatar dlitz avatar glongman avatar imsoftware avatar johntajima avatar kdriedger avatar m7 avatar paulrdukes avatar ryanseys avatar simeon12 avatar simplytech avatar trishume avatar wmill 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  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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

whenbot's Issues

[Test Post] Access to a running Whenbot app must be password protected

Since Whenbot will be hosted on Heroku, the app itself should be protected by a login and password.

As Tristan suggested below, we'll be going with a single password field for authentication.

Requirements

  1. When the User runs the install command, they're asked to include their password.
    • E.g. rails generate whenbot:install --password=my_password
  2. There should be a method that can be run as a before_filter in the controllers to ensure that a user is logged in.
  3. When the User visits any page without an active, authenticated session, they are redirected to an unlock page that requests their password.
  4. The password must be encrypted when stored in the database.
  5. Bonus: Allow the user to also include their email address during setup, so that Whenbot can email the User if needed.

Feel free to ask any questions that you may have.

This feature should be developed via Test Driven Development. Either way, a proper set of tests is required for this to be pulled into the main repository.

Contributing

If you'd like to work on this, and no-one else has assigned this task to themselves yet, assign this task to yourself. You can do this by clicking the gear icon beside the "No on is assigned" text above, and selecting your name.

If someone else beat you to it, do not reassign the task to yourself. Instead, check the comments (below) to see if they added a comment that says "Accepting teammates."

If you see "Accepting teammates" and would to join in, add a post here to say so and connect. You can also try reaching out to the original assignee via a private message or email.

Working in pairs or teams is encouraged. If you managed to snag this task by being the first to assign it to yourself, consider working with a teammate or two. To let people know you'd like to team up, add a comment below saying "Accepting teammates."

Keep an eye on new comments for this task, there may be someone reaching out to work with you.

Implementation

This can be implemented anyway you want. You may choose to use a pre-existing solution, such as Devise, or roll your own.

If you're interested in writing password protected login from scratch, read sections 7.1 and 7.2 of the Rails Tutorial Book for some hints.

You may want to supplement it with this section of the Rails Tutorial book, ignoring the parts about the username and email. It will walk you through creating a user account.

Testing hints:

Here's a few test ideas to get you started:

  1. Write a test that
    1. Gets the /whenbot/tasks/ page
    2. Asserts that you're redirected to the login page
  2. Run the tests, make sure it fails.
  3. Implement the code needed to make the test pass
  4. Write a Capybara test that
    1. Visits the /whenbot/tasks/without signing in
    2. Checks that you're redirected to page that has the content "Enter Password"
    3. Fill in the password field with your password (set via a Factory)
    4. Clicks on the "Sign In" button
    5. Checks that you're successfully logged in and brought to the /whenbot/tasks/ page
  5. Run the tests, make sure it fails.
  6. Implement the code needed to make the test pass
  7. Write a test that
    1. Logs into a User's account
    2. Visits the /whenbot/tasks/new page
    3. Asserts that you're not redirected away from the /whenbot/tasks/new page
    4. Asserts that the page contains text that says "Trigger Channel" (as in "Choose a Trigger Channel")
  8. Run the test, make sure it fails
  9. Write the code needed to make the test pass
  10. Add in any other functionality using TDD.

Contribute a One-Liner to Whenbot (guide included :)

One-Liners exercise

Want to make a contribution to Whenbot? Let's get you started! The main goal of the exercise is to show that it's not all that hard to contribute to an open source project.

We've taken away the hard part of figuring out exactly what to contribute, by providing you with a list of one-liners that need to be added to Whenbot. We've also provided you a step-by-step guide to walk you through the process.

All you need to do is choose a One-Liner from the list below (be sure to reserve your choice), and follow the Contribution Guide here.

Never contributed to Open Source before?

If it's your first time making an Open Source contribution, don't worry, it's not that hard. Be excited, follow the guide below, and very soon you should have made your first Open Source contribution!

How to participate

Follow these steps:

  1. Take a look at the list below and choose a One-Liner to work on.

  2. Make sure that the One-Liner you picked hasn't already been chosen by checking the comments below this post. If your One-Liner has already been reserved, choose another one.

  3. Then, reserve your One-Liner by posting a comment in this thread (below). Just write: "Working on one-liner number one-liner number in file path here, brief description of change". For example:

    Working on one-liner number 8 in app/models/task.rb, to make the :name, :active, :trigger_attributes, and :action_attributes attributes accessible.

    After posting your comment, you're ready to start working on your update. :)

  4. Once you have your one-liner chosen and reserved, follow the Whenbot One-Liner Contribution Guide to learn how to create your own fork of the app, clone the repository, make your changes, push your changes back to your fork, and issue a Pull Request.

The One-Liners

Choose a One-Liner number below, and follow the instructions above. Soon, you'll have contributed to a cool, new Open-Source project. :)

If you need help, you can find the solution for your one-liner in this branch. Just browse to the file you're working on.

lib/whenbot.rb

  1. Line 15: add a call to #mattr_accessor to create a Module Attribute for :channels
  2. Line 50: Fill in the block to take a Channel class (e.g. Whenbot::Channels::Developer), convert it to a string, and extract the Channel's name out of the string. In the previous example, you'd want to get the word" Developer"

    lib/whenbot/trigger.rb

  3. Line 14: In the current_time method, return the current time in the set time zone.

    app/controllers/whenbot_controller.rb

  4. Line 6: Call the Task.handle_callback method (found in app/models/task.rb) with the following parameters in the given order, and set the response variable to the return value of that call:
    • params[:channel], params[:trigger], params, request.headers, request.body.read
  5. Line 7 and Line 20: Rename the #validate_response method to "#parse_response``.

    app/models/task.rb

  6. Line 3: Create a has_many association with the Action model
  7. Line 7: Make the following accessible attributes:
    • :name, :active, :trigger_attributes, :action_attributes
  8. Line 17: Call the Trigger#save_updated_triggers method with returned_triggers, and trigger_ids as parameters.
  9. Line 18: Return response

    app/models/trigger.rb

  10. Line 2: Create a named scope (use scope) called active that returns records where the active field is set to true
  11. Line 4: Allow the parameters field to be serializable as a Hash
  12. Line 5: Allow the match_data field to be serializable as a Hash
  13. Line 6: Allow the extra_data field to be serializable as a Hash
  14. Line 7: Set up a "belongs to" association with the Task model
  15. Line 8: Make the following accessible attributes:
    • channel, trigger, parameters, active
  16. Line 9: Ensure that the model validates the presence of channel, trigger, and ``parameters

Still active?

Hi, nice project. Is it dead or migrated elsewhere?

One-Liners ... Make your first commit! :)

One-Liners exercise

Want to make a contribution to Whenbot? Let's get you started!

The main goal of the exercise is to show that it's not all that hard to contribute to an open source project. We've taking out the hard part of figuring out exactly what to contribute by providing you with a list of one-line changes that need to be added. We've also provided you a step-by-step guide to walk you through the process.

All you need to do is choose a One-Liner from the list below, and follow the Contribution Guide here.

Never contributed to Open Source before?

If it's your first time making an Open Source contribution, don't worry, it's not that hard. Be excited, follow the guide below, and very soon you should have made your first Open Source contribution!

How to participate

Follow these steps:

  1. Take a look at the list below and choose a One-Liner to work on.

  2. Make sure that the One-Liner you picked hasn't already been chosen by checking the comments below this post. If your One-Liner has already been reserved, choose another one.

  3. Then, reserve your One-Liner by posting a comment in this thread (below). Just write: "Working on one-liner number one-liner number in file path here, brief description of change". For example:

    Working on one-liner number 8 in app/models/task.rb, to make the :name, :active, :trigger_attributes, and :action_attributes attributes accessible.

    After posting your comment, you're ready to start working on your update. :)

  4. Once you have your one-liner chosen and reserved, follow the Whenbot One-Liner Contribution Guide to learn how to create your own fork of the app, clone the repository, make your changes, push your changes back to your fork, and issue a Pull Request.

The One-Liners

Choose a One-Liner number below, and follow the instructions above. Soon, you'll have contributed to a cool, new Open-Source project. :)

If you need help, you can find the solution for your one-liner in this branch. Just browse to the file you're working on.

lib/whenbot.rb

  1. Line 15: add a call to #mattr_accessor to create a Module Attribute for :channels
  2. Line 50: Fill in the block to take a Channel class (e.g. Whenbot::Channels::Developer), convert it to a string, and extract the Channel's name out of the string. In the previous example, you'd want to get the word" Developer"

    lib/whenbot/trigger.rb

  3. Line 14: In the current_time method, return the current time in the set time zone.

    app/controllers/whenbot_controller.rb

  4. Line 6: Call the Task.handle_callback method (found in app/models/task.rb) with the following parameters in the given order, and set the response variable to the return value of that call:
    • params[:channel], params[:trigger], params, request.headers, request.body.read
  5. Line 7 and Line 20: Rename the #validate_response method to "#parse_response``.
  6. Line 27: Return response

    app/models/task.rb

  7. Line 3: Create a has_many association with the Action model
  8. Line 7: Make the following accessible attributes:
    • :name, :active, :trigger_attributes, :action_attributes
  9. Line 17: Call the Trigger#save_updated_triggers method with returned_triggers, and trigger_ids as parameters.
  10. Line 18: Return response

    app/models/trigger.rb

  11. Line 2: Create a named scope (use scope) called active that returns records where the active field is set to true
  12. Line 4: Allow the parameters field to be serializable as a Hash
  13. Line 5: Allow the match_data field to be serializable as a Hash
  14. Line 6: Allow the extra_data field to be serializable as a Hash
  15. Line 7: Set up a "belongs to" association with the Task model
  16. Line 8: Make the following accessible attributes:
    • channel, trigger, parameters, active
  17. Line 9: Ensure that the model validates the presence of channel, trigger, and ``parameters

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.