Skip to content
This repository has been archived by the owner on Apr 16, 2024. It is now read-only.
/ accounts Public archive
forked from openstax/accounts

OpenStax centralized authentication and accounts service

Notifications You must be signed in to change notification settings

katalysteducation/accounts

 
 

Repository files navigation

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

About

OpenStax centralized authentication and accounts service

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Ruby 85.8%
  • HTML 8.5%
  • CSS 3.6%
  • CoffeeScript 1.9%
  • JavaScript 0.2%