Repository is archived
Low commit activity in last 3 years
No release in over a year
Doorman is a front of Warden used by Obscured and it's applications
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies
 Project Readme

Gem Version Vulnerabilities Build Status Test Coverage Code Climate

Obscured::Doorman

Requirements

  • geocoder
  • haml
  • mongoid
  • sinatra
  • sinatra-contrib
  • sinatra-flash
  • sinatra-partial
  • rack
  • rack-contrib
  • rest-client
  • warden

Installation

  1. Add this line to your application's Gemfile:
gem 'obscured-doorman'
  1. Execute:
$ bundle
  1. Require the library in your application:
require 'obscured-doorman'

Example

There are example html- and mail-templates in /example, look at these to get your started.

Configuration

The default configuration requires a mongoid client named :doorman, this will save users in a collection named 'users'

Obscured::Doorman.setup do |cfg|
  cfg.registration    = false
  cfg.confirmation    = false
end

Optional Configuration & Overrides

Obscured::Doorman.setup do |cfg|
  ...
  cfg.providers       = [
    Obscured::Doorman::Providers::Bitbucket.setup do |c|
      c.enabled         = nil
      c.client_id       = nil
      c.client_secret   = nil
      c.domains         = nil
    end,
    Obscured::Doorman::Providers::GitHub.setup do |c|
      c.enabled         = nil
      c.client_id       = nil
      c.client_secret   = nil
      c.domains         = nil
    end
  ]
  ...
end

All possible configurations

These values are representing the default values as well as all possible configurations.

Obscured::Doorman.setup do |cfg|
  cfg.registration    = false
  cfg.confirmation    = false
  cfg.db_name         = 'doorman'
  cfg.db_client       = :doorman,
  cfg.smtp_domain      = 'doorman.local'
  cfg.smtp_server     = '127.0.0.1'
  cfg.smtp_username   = nil
  cfg.smtp_password   = nil
  cfg.smtp_port       = 25
  cfg.remember_cookie = 'sinatra.doorman.remember'
  cfg.remember_for    = 30
  cfg.use_referrer    = true
  cfg.providers       = [
    Obscured::Doorman::Providers::Bitbucket.setup do |c|
      c.enabled         = false
      c.client_id       = nil
      c.client_secret   = nil
      c.domains         = nil
    end,
    Obscured::Doorman::Providers::GitHub.setup do |c|
      c.enabled         = false
      c.client_id       = nil
      c.client_secret   = nil
      c.domains         = nil
    end
  ],
  cfg.paths = {
    :success => '/home',
    :login   => '/doorman/login',
    :logout  => '/doorman/logout',
    :forgot  => '/doorman/forgot',
    :reset   => '/doorman/reset'
  }
)

TODO

  • Rewrite some parts to keep the gem dependencies down.
    • Rewrite to drop dependencies to rest-client.