OpenStax centralized authentication and accounts service
Ruby HTML CSS CoffeeScript JavaScript
Latest commit 5db44dd Jul 20, 2017 @Dantemss Dantemss committed on GitHub Merge pull request #533 from openstax/speedup_salesforce_background_task
Sped up Salesforce communication
Permalink
Failed to load latest commit information.
app Merge pull request #533 from openstax/speedup_salesforce_background_task Jul 20, 2017
bin Guard config Nov 11, 2016
config Added kind argument to Simple Enumerator to fix #send_add exception i… Jul 19, 2017
db Sped up Salesforce communication Jul 19, 2017
deploy using mysql db, also copying in the before_migrate file we need in al… Feb 23, 2014
lib Reject leading non-ascii chars in email Jun 5, 2017
public Fixed handling of 404 and 400 routes; Upgraded some gems; Renamed .cs… Oct 25, 2016
script Upgrade to Rails 4.0.13 Oct 16, 2016
spec Merge pull request #533 from openstax/speedup_salesforce_background_task Jul 20, 2017
vendor Added security log pagination; Improved a few searches May 10, 2016
.codecov.yml trying to turn off codecov failures and populating full commented out… Jan 20, 2017
.gitignore rough sketch plus start of using openstax_salesforce Feb 20, 2017
.rspec rspec 3.x fixes Mar 10, 2016
.rspec_parallel Restored random parallel spec ordering Oct 28, 2016
.ruby-gemset Change gemset to "accounts" after repo rename Feb 23, 2014
.ruby-version ruby 2.3.3 Feb 21, 2017
.travis.yml travis fix Jun 23, 2017
COPYRIGHT Upgrade to Rails 4.0.13 Oct 16, 2016
GNU-AGPL-3.0 pointed to real gems, added license information which was intended to… Sep 18, 2013
Gemfile spec fixes May 24, 2017
Gemfile.lock spec fixes May 24, 2017
Guardfile Guard config Nov 11, 2016
LICENSING renamed application, some minor names, from services to accounts Feb 25, 2014
README.md document `student_signup` Jan 27, 2017
Rakefile Several updates towards Rails 4 and fixing spec failures Oct 22, 2016
coffeelint.json Add lint configuration file from tutor-js Mar 28, 2016
config.ru Several updates towards Rails 4 and fixing spec failures Oct 22, 2016
todo.txt fixes after lev changes Sep 27, 2013

README.md

OpenStax Accounts

Build Status Code Climate Coverage Status

OpenStax Accounts is a centralized provider of account-related services for OpenStax products, including:

  • User authentication
  • User profile data
  • User messaging and notifications
  • User groups

It uses OAuth mechanisms and API keys to provide these services to OpenStax products and their users.

Accounts requires the repeatable read isolation level to work properly. If using PostgreSQL, add the following to your postgresql.conf:

default_transaction_isolation = 'repeatable read'

Using

  • OAuth requests that arrive with query param go=signup will skip log in and go straight to signup. go=student_signup will skip to signup and force the signup to have the "student" role.
  • OAuth requests that arrive with query param signup_at=blah will redirect users to blah if they click the link to sign up.

Development Setup

In development, Accounts can be run as a normal Rails app on your machine, or you can run it in a Vagrant virtual machine that mimics our production setup.

Running as a normal Rails app on your machine

First, ensure you have ruby 2.2.3 installed. You should use either rbenv or RVM to manage your ruby versions.

To start running Accounts in a development environment, clone the repository, then run:

$ bundle install --without production

Just like with any Rails app, you need to migrate the database and then seed it with some default records:

$ rake db:migrate
$ rake db:seed

Then you can run:

$ rails server

which will start Accounts up on port 2999, i.e. http://localhost:2999.

Running Specs

When running feature specs, the default behavior is for exceptions to be rescued and nice error pages to be shown. This can make debugging difficult if you're not expecting an error. To not rescue exceptions, do:

$ RAISE=true rspec

Background Jobs

Accounts in production runs background jobs using delayed_job. In the development environment, however, background jobs are run "inline", i.e. in the foreground.

To actually run these jobs in the background in the development environment, set the environment variable USE_REAL_BACKGROUND_JOBS=true in your .env file and then start the delayed_job daemon:

bin/rake jobs:work