diff --git a/OmniAuth.html b/OmniAuth.html new file mode 100644 index 000000000..4aaf46c86 --- /dev/null +++ b/OmniAuth.html @@ -0,0 +1,233 @@ + + + + +Module: OmniAuth + + + + + + + + + + + + + + + +

Module: OmniAuth + + + +

+ +
+ + + + + + + + +
Defined in:
+
oa-core/lib/omniauth/test.rb,
+ oa-core/lib/omniauth/core.rb,
oa-core/lib/omniauth/form.rb,
oa-oauth/lib/omniauth/oauth.rb,
oa-basic/lib/omniauth/basic.rb,
oa-core/lib/omniauth/builder.rb,
oa-openid/lib/omniauth/openid.rb,
oa-core/lib/omniauth/strategy.rb,
oa-enterprise/lib/omniauth/enterprise.rb,
oa-oauth/lib/omniauth/strategies/oauth.rb,
oa-oauth/lib/omniauth/strategies/github.rb,
oa-oauth/lib/omniauth/strategies/oauth2.rb,
oa-oauth/lib/omniauth/strategies/gowalla.rb,
oa-core/lib/omniauth/strategies/password.rb,
oa-oauth/lib/omniauth/strategies/twitter.rb,
oa-oauth/lib/omniauth/strategies/identica.rb,
oa-core/lib/omniauth/test/strategy_macros.rb,
oa-openid/lib/omniauth/strategies/open_id.rb,
oa-oauth/lib/omniauth/strategies/facebook.rb,
oa-enterprise/lib/omniauth/strategies/cas.rb,
oa-oauth/lib/omniauth/strategies/linked_in.rb,
oa-enterprise/lib/omniauth/strategies/ldap.rb,
oa-oauth/lib/omniauth/strategies/foursquare.rb,
oa-basic/lib/omniauth/strategies/http_basic.rb,
oa-core/lib/omniauth/test/strategy_test_case.rb,
oa-openid/lib/omniauth/strategies/google_apps.rb,
oa-enterprise/lib/omniauth/strategies/ldap/adaptor.rb,
oa-oauth/lib/omniauth/strategies/thirty_seven_signals.rb,
oa-enterprise/lib/omniauth/strategies/cas/configuration.rb,
oa-enterprise/lib/omniauth/strategies/cas/service_ticket_validator.rb
+
+ +
+
+ +

Defined Under Namespace

+

+ + + Modules: Strategies, Strategy, Test, Utils + + + + Classes: Builder, Configuration, Form + + +

+ + + + +

+ Class Method Summary + (collapse) +

+ + + + + + +
+

Class Method Details

+ + +
+

+ + + (Object) config + + + +

+ + + + +
+
+
+
+47
+48
+49
+
+
# File 'oa-core/lib/omniauth/core.rb', line 47
+
+def self.config
+  Configuration.instance
+end
+
+
+
+ +
+

+ + + (Object) configure {|config| ... } + + + +

+
+ + +
+
+
+

Yields:

+
    + +
  • + + (config) + + + + +
  • + +
+ +
+ + + + +
+
+
+
+51
+52
+53
+
+
# File 'oa-core/lib/omniauth/core.rb', line 51
+
+def self.configure
+  yield config
+end
+
+
+
+ +
+ +
+ + + + + \ No newline at end of file diff --git a/OmniAuth/Builder.html b/OmniAuth/Builder.html new file mode 100644 index 000000000..fbea6a33b --- /dev/null +++ b/OmniAuth/Builder.html @@ -0,0 +1,403 @@ + + + + +Class: OmniAuth::Builder + + + + + + + + + + + + + + + +

Class: OmniAuth::Builder + + + +

+ +
+ +
Inherits:
+
+ Rack::Builder + +
    +
  • Object
  • + + + + + +
+ show all + +
+ + + + + + + + + +
Defined in:
+
oa-core/lib/omniauth/builder.rb
+ +
+
+ + + + + + +

+ Instance Method Summary + (collapse) +

+ + + + + +
+

Constructor Details

+ +
+

+ + - (Builder) initialize(app, &block) + + + +

+
+

+A new instance of Builder +

+ + +
+
+
+ +
+ + + + +
+
+
+
+5
+6
+7
+8
+
+
# File 'oa-core/lib/omniauth/builder.rb', line 5
+
+def initialize(app, &block)
+  @app = app
+  super(&block)
+end
+
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + - (Object) call(env) + + + +

+ + + + +
+
+
+
+28
+29
+30
+31
+
+
# File 'oa-core/lib/omniauth/builder.rb', line 28
+
+def call(env)
+  @ins << @app unless @ins.include?(@app)
+  to_app.call(env)
+end
+
+
+
+ +
+

+ + - (Object) configure(&block) + + + +

+ + + + +
+
+
+
+14
+15
+16
+
+
# File 'oa-core/lib/omniauth/builder.rb', line 14
+
+def configure(&block)
+  OmniAuth.configure(&block)
+end
+
+
+
+ +
+

+ + - (Object) on_failure(&block) + + + +

+ + + + +
+
+
+
+10
+11
+12
+
+
# File 'oa-core/lib/omniauth/builder.rb', line 10
+
+def on_failure(&block)
+  OmniAuth.config.on_failure = block
+end
+
+
+
+ +
+

+ + - (Object) provider(klass, *args, &block) + + + +

+ + + + +
+
+
+
+18
+19
+20
+21
+22
+23
+24
+25
+26
+
+
# File 'oa-core/lib/omniauth/builder.rb', line 18
+
+def provider(klass, *args, &block)
+  if klass.is_a?(Class)
+    middleware = klass
+  else
+    middleware = OmniAuth::Strategies.const_get("#{OmniAuth::Utils.camelize(klass.to_s)}")
+  end
+  
+  use middleware, *args, &block
+end
+
+
+
+ +
+ +
+ + + + + \ No newline at end of file diff --git a/OmniAuth/Configuration.html b/OmniAuth/Configuration.html new file mode 100644 index 000000000..06afb8812 --- /dev/null +++ b/OmniAuth/Configuration.html @@ -0,0 +1,482 @@ + + + + +Class: OmniAuth::Configuration + + + + + + + + + + + + + + + +

Class: OmniAuth::Configuration + + + +

+ +
+ +
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+ + + + + + +
Includes:
+
Singleton
+ + + + + +
Defined in:
+
oa-core/lib/omniauth/core.rb
+ +
+
+ + +

Constant Summary

+ +
+ +
@@defaults = + +
+
{
+  :path_prefix => '/auth',
+  :on_failure => Proc.new do |env, message_key|
+    new_path = "#{OmniAuth.config.path_prefix}/failure?message=#{message_key}"
+    [302, {'Location' => "#{new_path}", 'Content-Type'=> 'text/html'}, []]
+  end,
+  :form_css => Form::DEFAULT_CSS
+}
+
+ +
+ + + + +

Instance Attribute Summary (collapse)

+ + + + +

+ Class Method Summary + (collapse) +

+ + + +

+ Instance Method Summary + (collapse) +

+ + + + + +
+

Constructor Details

+ +
+

+ + - (Configuration) initialize + + + +

+
+

+A new instance of Configuration +

+ + +
+
+
+ +
+ + + + +
+
+
+
+31
+32
+33
+
+
# File 'oa-core/lib/omniauth/core.rb', line 31
+
+def initialize
+  @@defaults.each_pair{|k,v| self.send("#{k}=",v)}
+end
+
+
+
+ +
+ +
+

Instance Attribute Details

+ + + + +
+

+ + - (Object) form_css + + + +

+
+

+Returns the value of attribute form_css +

+ + +
+
+
+ +
+ + + + +
+
+
+
+44
+45
+46
+
+
# File 'oa-core/lib/omniauth/core.rb', line 44
+
+def form_css
+  @form_css
+end
+
+
+
+ + + + +
+

+ + - (Object) on_failure(&block) + + + +

+ + + + +
+
+
+
+35
+36
+37
+38
+39
+40
+41
+
+
# File 'oa-core/lib/omniauth/core.rb', line 35
+
+def on_failure(&block)
+  if block_given?
+    @on_failure = block
+  else
+    @on_failure
+  end
+end
+
+
+
+ + + + +
+

+ + - (Object) path_prefix + + + +

+
+

+Returns the value of attribute path_prefix +

+ + +
+
+
+ +
+ + + + +
+
+
+
+44
+45
+46
+
+
# File 'oa-core/lib/omniauth/core.rb', line 44
+
+def path_prefix
+  @path_prefix
+end
+
+
+
+ +
+ + +
+

Class Method Details

+ + +
+

+ + + (Object) defaults + + + +

+ + + + +
+
+
+
+27
+28
+29
+
+
# File 'oa-core/lib/omniauth/core.rb', line 27
+
+def self.defaults
+  @@defaults
+end
+
+
+
+ +
+ +
+ + + + + \ No newline at end of file diff --git a/OmniAuth/Form.html b/OmniAuth/Form.html new file mode 100644 index 000000000..b0e9a4003 --- /dev/null +++ b/OmniAuth/Form.html @@ -0,0 +1,691 @@ + + + + +Class: OmniAuth::Form + + + + + + + + + + + + + + + +

Class: OmniAuth::Form + + + +

+ +
+ +
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+ + + + + + + + + +
Defined in:
+
oa-core/lib/omniauth/form.rb
+ +
+
+ + +

Constant Summary

+ +
+ +
DEFAULT_CSS = + +
+
"body {\nbackground: #ccc;\nfont-family: \"Lucida Grande\", \"Lucida Sans\", Helvetica, Arial, sans-serif;\n}\n\nh1 {\ntext-align: center;\nmargin: 30px auto 0px;\nfont-size: 18px;\npadding: 10px 10px 15px;\nbackground: #555;\ncolor: white;\nwidth: 320px;\nborder: 10px solid #444;\nborder-bottom: 0;\n-moz-border-radius-topleft: 10px;\n-moz-border-radius-topright: 10px;\n-webkit-border-top-left-radius: 10px;\n-webkit-border-top-right-radius: 10px;\nborder-top-left-radius: 10px;\nborder-top-right-radius: 10px;\n}\n\nh1, form {\n-moz-box-shadow: 2px 2px 7px rgba(0,0,0,0.3);\n-webkit-box-shadow: 2px 2px 7px rgba(0,0,0,0.3);\n}\n\nform {\nbackground: white;\nborder: 10px solid #eee;\nborder-top: 0;\npadding: 20px;\nmargin: 0px auto 40px;\nwidth: 300px;\n-moz-border-radius-bottomleft: 10px;\n-moz-border-radius-bottomright: 10px;\n-webkit-border-bottom-left-radius: 10px;\n-webkit-border-bottom-right-radius: 10px;\nborder-bottom-left-radius: 10px;\nborder-bottom-right-radius: 10px;\n}\n\nlabel {\ndisplay: block;\nfont-weight: bold;\nmargin-bottom: 5px;\n}\n\ninput {\nfont-size: 18px;\npadding: 4px 8px;\ndisplay: block;\nmargin-bottom: 10px;\nwidth: 280px;\n}\n\ninput#identifier, input#openid_url {\nbackground: url(http://openid.net/login-bg.gif) no-repeat;\nbackground-position: 0 50%;\npadding-left: 18px;\n}\n\nbutton {\nfont-size: 22px;\npadding: 4px 8px;\ndisplay: block;\nmargin: 20px auto 0;\n}\n"
+
+ +
+ + + + + +

+ Class Method Summary + (collapse) +

+ + + +

+ Instance Method Summary + (collapse) +

+ + + + +
+

Constructor Details

+ +
+

+ + - (Form) initialize(title = nil) + + + +

+
+

+A new instance of Form +

+ + +
+
+
+ +
+ + + + +
+
+
+
+78
+79
+80
+81
+82
+
+
# File 'oa-core/lib/omniauth/form.rb', line 78
+
+def initialize(title=nil)
+  title ||= "Authentication Info Required"
+  @html = ""
+  header(title)
+end
+
+
+
+ +
+ + +
+

Class Method Details

+ + +
+

+ + + (Object) build(title = nil, &block) + + + +

+ + + + +
+
+
+
+84
+85
+86
+87
+
+
# File 'oa-core/lib/omniauth/form.rb', line 84
+
+def self.build(title=nil, &block)
+  form = OmniAuth::Form.new(title)
+  form.instance_eval(&block)
+end
+
+
+
+ +
+ +
+

Instance Method Details

+ + +
+ + + + + +
+
+
+
+127
+128
+129
+130
+131
+132
+
+
# File 'oa-core/lib/omniauth/form.rb', line 127
+
+def footer
+  return self if @footer
+  @html << "<button type='submit'>Connect</button>\n</form>\n</body>\n</html>\n"
+  @footer = true
+  self
+end
+
+
+
+ +
+

+ + - (Object) header(title) + + + +

+ + + + +
+
+
+
+111
+112
+113
+114
+
+
# File 'oa-core/lib/omniauth/form.rb', line 111
+
+def header(title)
+  @html << "<!DOCTYPE html>\n<html>\n<head>\n<title>\#{title}</title>\n\#{css}\n</head>\n<body>\n<h1>\#{title}</h1>\n<form method='post'>\n"
+  self
+end
+
+
+
+ +
+

+ + - (Object) input_field(type, name) + + + +

+ + + + +
+
+
+
+94
+95
+96
+97
+
+
# File 'oa-core/lib/omniauth/form.rb', line 94
+
+def input_field(type, name)
+  @html << "\n<input type='#{type}' id='#{name}' name='#{name}'/>"
+  self
+end
+
+
+
+ +
+

+ + - (Object) label_field(text, target) + + + +

+ + + + +
+
+
+
+89
+90
+91
+92
+
+
# File 'oa-core/lib/omniauth/form.rb', line 89
+
+def label_field(text, target)
+  @html << "\n<label for='#{target}'>#{text}:</label>"
+  self
+end
+
+
+
+ +
+

+ + - (Object) password_field(label, name) + + + +

+ + + + +
+
+
+
+105
+106
+107
+108
+109
+
+
# File 'oa-core/lib/omniauth/form.rb', line 105
+
+def password_field(label, name)
+  label_field(label, name)
+  input_field('password', name)
+  self
+end
+
+
+
+ +
+

+ + - (Object) text_field(label, name) + + + +

+ + + + +
+
+
+
+99
+100
+101
+102
+103
+
+
# File 'oa-core/lib/omniauth/form.rb', line 99
+
+def text_field(label, name)
+  label_field(label, name)
+  input_field('text', name)
+  self
+end
+
+
+
+ +
+

+ + - (Object) to_html + + + +

+ + + + +
+
+
+
+140
+141
+142
+143
+
+
# File 'oa-core/lib/omniauth/form.rb', line 140
+
+def to_html
+  footer
+  @html
+end
+
+
+
+ +
+

+ + - (Object) to_response + + + +

+ + + + +
+
+
+
+145
+146
+147
+148
+
+
# File 'oa-core/lib/omniauth/form.rb', line 145
+
+def to_response
+  footer
+  Rack::Response.new(@html).finish
+end
+
+
+
+ +
+ +
+ + + + + \ No newline at end of file diff --git a/OmniAuth/Strategies.html b/OmniAuth/Strategies.html new file mode 100644 index 000000000..60e8eec80 --- /dev/null +++ b/OmniAuth/Strategies.html @@ -0,0 +1,93 @@ + + + + +Module: OmniAuth::Strategies + + + + + + + + + + + + + + + +

Module: OmniAuth::Strategies + + + +

+ +
+ + + + + + + + +
Defined in:
+
oa-core/lib/omniauth/core.rb,
+ oa-oauth/lib/omniauth/oauth.rb,
oa-basic/lib/omniauth/basic.rb,
oa-openid/lib/omniauth/openid.rb,
oa-enterprise/lib/omniauth/enterprise.rb,
oa-oauth/lib/omniauth/strategies/oauth.rb,
oa-oauth/lib/omniauth/strategies/github.rb,
oa-oauth/lib/omniauth/strategies/oauth2.rb,
oa-oauth/lib/omniauth/strategies/gowalla.rb,
oa-core/lib/omniauth/strategies/password.rb,
oa-oauth/lib/omniauth/strategies/twitter.rb,
oa-oauth/lib/omniauth/strategies/identica.rb,
oa-openid/lib/omniauth/strategies/open_id.rb,
oa-oauth/lib/omniauth/strategies/facebook.rb,
oa-enterprise/lib/omniauth/strategies/cas.rb,
oa-oauth/lib/omniauth/strategies/linked_in.rb,
oa-enterprise/lib/omniauth/strategies/ldap.rb,
oa-oauth/lib/omniauth/strategies/foursquare.rb,
oa-basic/lib/omniauth/strategies/http_basic.rb,
oa-openid/lib/omniauth/strategies/google_apps.rb,
oa-enterprise/lib/omniauth/strategies/ldap/adaptor.rb,
oa-oauth/lib/omniauth/strategies/thirty_seven_signals.rb,
oa-enterprise/lib/omniauth/strategies/cas/configuration.rb,
oa-enterprise/lib/omniauth/strategies/cas/service_ticket_validator.rb
+
+ +
+
+ +

Defined Under Namespace

+

+ + + + + Classes: CAS, Facebook, Foursquare, GitHub, GoogleApps, Gowalla, HttpBasic, Identica, LDAP, LinkedIn, OAuth, OAuth2, OpenID, Password, ThirtySevenSignals, Twitter + + +

+ + + + + +
+ + + + + \ No newline at end of file diff --git a/OmniAuth/Strategies/CAS.html b/OmniAuth/Strategies/CAS.html new file mode 100644 index 000000000..f7c1c6b66 --- /dev/null +++ b/OmniAuth/Strategies/CAS.html @@ -0,0 +1,209 @@ + + + + +Class: OmniAuth::Strategies::CAS + + + + + + + + + + + + + + + +

Class: OmniAuth::Strategies::CAS + + + +

+ +
+ +
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+ + + + + + +
Includes:
+
OmniAuth::Strategy
+ + + + + +
Defined in:
+
oa-enterprise/lib/omniauth/strategies/cas.rb,
+ oa-enterprise/lib/omniauth/strategies/cas/configuration.rb,
oa-enterprise/lib/omniauth/strategies/cas/service_ticket_validator.rb
+
+ +
+
+ +

Defined Under Namespace

+

+ + + + + Classes: Configuration, ServiceTicketValidator + + +

+ + + + + + + + +

+ Instance Method Summary + (collapse) +

+ + + + + + + + + + + + +

Methods included from OmniAuth::Strategy

+

#call, #call!, #call_app!, #callback_url, #fail!, #full_host, included, #redirect, #request, #session, #user_info

+
+

Constructor Details

+ +
+

+ + - (CAS) initialize(app, options = {}) + + + +

+
+

+A new instance of CAS +

+ + +
+
+
+ +
+ + + + +
+
+
+
+11
+12
+13
+14
+
+
# File 'oa-enterprise/lib/omniauth/strategies/cas.rb', line 11
+
+def initialize(app, options = {})
+  super(app, options.delete(:name) || :cas)
+  @configuration = OmniAuth::Strategies::CAS::Configuration.new(options)
+end
+
+
+
+ +
+ + +
+ + + + + \ No newline at end of file diff --git a/OmniAuth/Strategies/CAS/Configuration.html b/OmniAuth/Strategies/CAS/Configuration.html new file mode 100644 index 000000000..c863aba1d --- /dev/null +++ b/OmniAuth/Strategies/CAS/Configuration.html @@ -0,0 +1,522 @@ + + + + +Class: OmniAuth::Strategies::CAS::Configuration + + + + + + + + + + + + + + + +

Class: OmniAuth::Strategies::CAS::Configuration + + + +

+ +
+ +
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+ + + + + + + + + +
Defined in:
+
oa-enterprise/lib/omniauth/strategies/cas/configuration.rb
+ +
+
+ + +

Constant Summary

+ +
+ +
DEFAULT_LOGIN_URL = + +
+
"%s/login"
+
+ +
DEFAULT_SERVICE_VALIDATE_URL = + +
+
"%s/serviceValidate"
+
+ +
IS_NOT_URL_ERROR_MESSAGE = + +
+
"%s is not a valid URL"
+
+ +
+ + + + + +

+ Instance Method Summary + (collapse) +

+ + + + +
+

Constructor Details

+ +
+

+ + - (Configuration) initialize(params) + + + +

+
+

+A new instance of Configuration +

+ + +
+
+
+

Parameters:

+
    + +
  • + + (Hash) + + + params + + + + — +

    +configuration options +

    +
    + +
  • + +
+ + + + +

Options Hash (params):

+
    + +
  • + (String, nil) + :cas_server + + + N/A + + + —

    +the CAS server root URL; probably something like ‘cas.mycompany.com’ or ‘cas.mycompany.com/cas’; +optional. +

    +
    + + +
  • + (String, nil) + :cas_login_url + + + — default: + :cas_server + '/login' + + + —

    +the URL to which to redirect for logins; options if :cas_server is +specified, required otherwise. +

    +
    + + +
  • + (String, nil) + :cas_service_validate_url + + + — default: + :cas_server + '/serviceValidate' + + + —

    +the URL to use for validating service tickets; optional if +:cas_server is specified, requred otherwise. +

    +
    + + +
+ + +
+ + + + +
+
+
+
+21
+22
+23
+
+
# File 'oa-enterprise/lib/omniauth/strategies/cas/configuration.rb', line 21
+
+def initialize(params)
+  parse_params params
+end
+
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + - (String) login_url(service) + + + +

+
+

+Build a CAS login URL from service. +

+

+“cas.mycompany.com/login?service=…“ +

+ + +
+
+
+

Parameters:

+
    + +
  • + + (String) + + + service + + + + — +

    +the service (a.k.a. return-to) URL +

    +
    + +
  • + +
+

Returns:

+
    + +
  • + + (String) + + + + + — +

    +a URL like +

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+31
+32
+33
+
+
# File 'oa-enterprise/lib/omniauth/strategies/cas/configuration.rb', line 31
+
+def (service)
+  append_service @login_url, service
+end
+
+
+
+ +
+

+ + - (String) service_validate_url(service, ticket) + + + +

+
+

+Build a service-validation URL from service and ticket. +

+

+“cas.mycompany.com/serviceValidate?service=...&ticket=…“ +

+ + +
+
+
+

Parameters:

+
    + +
  • + + (String) + + + service + + + + — +

    +the service (a.k.a. return-to) URL +

    +
    + +
  • + +
  • + + (String) + + + ticket + + + + — +

    +the ticket to validate +

    +
    + +
  • + +
+

Returns:

+
    + +
  • + + (String) + + + + + — +

    +a URL like +

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+42
+43
+44
+45
+
+
# File 'oa-enterprise/lib/omniauth/strategies/cas/configuration.rb', line 42
+
+def service_validate_url(service, ticket)
+  url = append_service @service_validate_url, service
+  url << '&ticket=' << Rack::Utils.escape(ticket)
+end
+
+
+
+ +
+ +
+ + + + + \ No newline at end of file diff --git a/OmniAuth/Strategies/CAS/ServiceTicketValidator.html b/OmniAuth/Strategies/CAS/ServiceTicketValidator.html new file mode 100644 index 000000000..b0c152ce0 --- /dev/null +++ b/OmniAuth/Strategies/CAS/ServiceTicketValidator.html @@ -0,0 +1,360 @@ + + + + +Class: OmniAuth::Strategies::CAS::ServiceTicketValidator + + + + + + + + + + + + + + + +

Class: OmniAuth::Strategies::CAS::ServiceTicketValidator + + + +

+ +
+ +
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+ + + + + + + + + +
Defined in:
+
oa-enterprise/lib/omniauth/strategies/cas/service_ticket_validator.rb
+ +
+
+ + +

Constant Summary

+ +
+ +
VALIDATION_REQUEST_HEADERS = + +
+
{ 'Accept' => '*/*' }
+
+ +
+ + + + + +

+ Instance Method Summary + (collapse) +

+ + + + +
+

Constructor Details

+ +
+

+ + - (ServiceTicketValidator) initialize(configuration, return_to_url, ticket) + + + +

+
+

+Build a validator from a configuration, a return_to URL, +and a ticket. +

+ + +
+
+
+

Parameters:

+
    + +
  • + + (OmniAuth::Strategies::CAS::Configuration) + + + configuration + + + + — +

    +the CAS configuration +

    +
    + +
  • + +
  • + + (String) + + + return_to_url + + + + — +

    +the URL of this CAS client service +

    +
    + +
  • + +
  • + + (String) + + + ticket + + + + — +

    +the service ticket to validate +

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+16
+17
+18
+
+
# File 'oa-enterprise/lib/omniauth/strategies/cas/service_ticket_validator.rb', line 16
+
+def initialize(configuration, return_to_url, ticket)
+  @uri = URI.parse(configuration.service_validate_url(return_to_url, ticket))
+end
+
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + - (Hash?) user_info + + + +

+
+

+Request validation of the ticket from the CAS server’s +serviceValidate (CAS 2.0) function. +

+

+Swallows all XML parsing errors (and returns nil in those cases). +

+ + +
+
+
+

Returns:

+
    + +
  • + + (Hash, nil) + + + + + — +

    +a user information hash if the response is valid; nil otherwise. +

    +
    + +
  • + +
+

Raises:

+
    + +
  • + + + + + + + +

    +any connection errors encountered. +

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+28
+29
+30
+
+
# File 'oa-enterprise/lib/omniauth/strategies/cas/service_ticket_validator.rb', line 28
+
+def 
+  (find_authentication_success(get_service_response_body))
+end
+
+
+
+ +
+ +
+ + + + + \ No newline at end of file diff --git a/OmniAuth/Strategies/Facebook.html b/OmniAuth/Strategies/Facebook.html new file mode 100644 index 000000000..4ab78d916 --- /dev/null +++ b/OmniAuth/Strategies/Facebook.html @@ -0,0 +1,466 @@ + + + + +Class: OmniAuth::Strategies::Facebook + + + + + + + + + + + + + + + +

Class: OmniAuth::Strategies::Facebook + + + +

+ +
+ +
Inherits:
+
+ OAuth2 + +
    +
  • Object
  • + + + + + +
+ show all + +
+ + + + + + + + + +
Defined in:
+
oa-oauth/lib/omniauth/strategies/facebook.rb
+ +
+
+ +

Overview

+
+

+Authenticate to Facebook utilizing OAuth 2.0 and retrieve basic user +information. +

+

+Usage: +

+
+   use OmniAuth::Strategies::, 'app_id', 'app_secret'
+
+

+Options: +

+ + +
:scope

+Extended permissions such as email and offline_access +(which are the defaults). +

+
+ + +
+
+
+ +
+ + + + + + + + + + + +

+ Instance Method Summary + (collapse) +

+ + + + + + + + + + + + + + + + + +

Methods included from OmniAuth::Strategy

+

#call, #call!, #call_app!, #callback_phase, #callback_url, #fail!, #full_host, included, #redirect, #request, #session

+
+

Constructor Details

+ +
+

+ + - (Facebook) initialize(app, app_id, app_secret, options = {}) + + + +

+
+

+A new instance of Facebook +

+ + +
+
+
+ +
+ + + + +
+
+
+
+18
+19
+20
+21
+
+
# File 'oa-oauth/lib/omniauth/strategies/facebook.rb', line 18
+
+def initialize(app, app_id, app_secret, options = {})
+  options[:site] = 'https://graph.facebook.com/'
+  super(app, :facebook, app_id, app_secret, options)
+end
+
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + - (Object) auth_hash + + + +

+ + + + +
+
+
+
+45
+46
+47
+48
+49
+50
+51
+
+
# File 'oa-oauth/lib/omniauth/strategies/facebook.rb', line 45
+
+def auth_hash
+  OmniAuth::Utils.deep_merge(super, {
+    'uid' => user_data['id'],
+    'user_info' => ,
+    'extra' => {'user_hash' => user_data}
+  })
+end
+
+
+
+ +
+

+ + - (Object) request_phase + + + +

+ + + + +
+
+
+
+27
+28
+29
+30
+
+
# File 'oa-oauth/lib/omniauth/strategies/facebook.rb', line 27
+
+def request_phase
+  options[:scope] ||= "email,offline_access"
+  super
+end
+
+
+
+ +
+

+ + - (Object) user_data + + + +

+ + + + +
+
+
+
+23
+24
+25
+
+
# File 'oa-oauth/lib/omniauth/strategies/facebook.rb', line 23
+
+def user_data
+  @data ||= MultiJson.decode(@access_token.get('/me'))
+end
+
+
+
+ +
+

+ + - (Object) user_info + + + +

+ + + + +
+
+
+
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+
+
# File 'oa-oauth/lib/omniauth/strategies/facebook.rb', line 32
+
+def 
+  {
+    'nickname' => user_data["link"].split('/').last,
+    'first_name' => user_data["first_name"],
+    'last_name' => user_data["last_name"],
+    'name' => "#{user_data['first_name']} #{user_data['last_name']}",
+    'urls' => {
+      'Facebook' => user_data["link"],
+      'Website' => user_data["website"],
+    }
+  }
+end
+
+
+
+ +
+ +
+ + + + + \ No newline at end of file diff --git a/OmniAuth/Strategies/Foursquare.html b/OmniAuth/Strategies/Foursquare.html new file mode 100644 index 000000000..2371219e6 --- /dev/null +++ b/OmniAuth/Strategies/Foursquare.html @@ -0,0 +1,399 @@ + + + + +Class: OmniAuth::Strategies::Foursquare + + + + + + + + + + + + + + + +

Class: OmniAuth::Strategies::Foursquare + + + +

+ +
+ +
Inherits:
+
+ OAuth + +
    +
  • Object
  • + + + + + +
+ show all + +
+ + + + + + + + + +
Defined in:
+
oa-oauth/lib/omniauth/strategies/foursquare.rb
+ +
+
+ + + + + + + + + + + + + +

+ Instance Method Summary + (collapse) +

+ + + + + + + + + + + + +

Methods inherited from OAuth

+

#callback_phase, #request_phase, #unique_id

+ + + + + + + + +

Methods included from OmniAuth::Strategy

+

#call, #call!, #call_app!, #callback_phase, #callback_url, #fail!, #full_host, included, #redirect, #request, #request_phase, #session

+
+

Constructor Details

+ +
+

+ + - (Foursquare) initialize(app, consumer_key, consumer_secret) + + + +

+
+

+A new instance of Foursquare +

+ + +
+
+
+ +
+ + + + +
+
+
+
+4
+5
+6
+7
+
+
# File 'oa-oauth/lib/omniauth/strategies/foursquare.rb', line 4
+
+def initialize(app, consumer_key, consumer_secret)
+  super(app, :foursquare, consumer_key, consumer_secret,
+          :site => 'http://foursquare.com')
+end
+
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + - (Object) auth_hash + + + +

+ + + + +
+
+
+
+9
+10
+11
+12
+13
+14
+15
+
+
# File 'oa-oauth/lib/omniauth/strategies/foursquare.rb', line 9
+
+def auth_hash
+  OmniAuth::Utils.deep_merge(super, {
+    'uid' => user_hash['id'],
+    'user_info' => ,
+    'extra' => {'user_hash' => user_hash}
+  })
+end
+
+
+
+ +
+

+ + - (Object) user_hash + + + +

+ + + + +
+
+
+
+34
+35
+36
+
+
# File 'oa-oauth/lib/omniauth/strategies/foursquare.rb', line 34
+
+def user_hash
+  @user_hash ||= MultiJson.decode(@access_token.get('http://api.foursquare.com/v1/user.json').body)['user']
+end
+
+
+
+ +
+

+ + - (Object) user_info + + + +

+ + + + +
+
+
+
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+
+
# File 'oa-oauth/lib/omniauth/strategies/foursquare.rb', line 17
+
+def 
+  user_hash = self.user_hash
+  
+  {
+    'nickname' => user_hash['twitter'],
+    'first_name' => user_hash['firstname'],
+    'last_name' => user_hash['lastname'],
+    'email' => user_hash['email'],
+    'name' => "#{user_hash['firstname']} #{user_hash['lastname']}".strip,
+  # 'location' => user_hash['location'],
+    'image' => user_hash['photo'],
+  # 'description' => user_hash['description'],
+    'phone' => user_hash['phone'],
+    'urls' => {}
+  }
+end
+
+
+
+ +
+ +
+ + + + + \ No newline at end of file diff --git a/OmniAuth/Strategies/GitHub.html b/OmniAuth/Strategies/GitHub.html new file mode 100644 index 000000000..719b80b3d --- /dev/null +++ b/OmniAuth/Strategies/GitHub.html @@ -0,0 +1,388 @@ + + + + +Class: OmniAuth::Strategies::GitHub + + + + + + + + + + + + + + + +

Class: OmniAuth::Strategies::GitHub + + + +

+ +
+ +
Inherits:
+
+ OAuth2 + +
    +
  • Object
  • + + + + + +
+ show all + +
+ + + + + + + + + +
Defined in:
+
oa-oauth/lib/omniauth/strategies/github.rb
+ +
+
+ + + + + + + + + + + + + +

+ Instance Method Summary + (collapse) +

+ + + + + + + + + + + + + + + + + +

Methods included from OmniAuth::Strategy

+

#call, #call!, #call_app!, #callback_phase, #callback_url, #fail!, #full_host, included, #redirect, #request, #request_phase, #session

+
+

Constructor Details

+ +
+

+ + - (GitHub) initialize(app, app_id, app_secret, options = {}) + + + +

+
+

+A new instance of GitHub +

+ + +
+
+
+ +
+ + + + +
+
+
+
+7
+8
+9
+10
+11
+12
+
+
# File 'oa-oauth/lib/omniauth/strategies/github.rb', line 7
+
+def initialize(app, app_id, app_secret, options = {})
+  options[:site] = 'https://github.com/'
+  options[:authorize_path] = '/login/oauth/authorize'
+  options[:access_token_path] = '/login/oauth/access_token'
+  super(app, :github, app_id, app_secret, options)
+end
+
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + - (Object) auth_hash + + + +

+ + + + +
+
+
+
+30
+31
+32
+33
+34
+35
+36
+
+
# File 'oa-oauth/lib/omniauth/strategies/github.rb', line 30
+
+def auth_hash
+  OmniAuth::Utils.deep_merge(super, {
+    'uid' => user_data['id'],
+    'user_info' => ,
+    'extra' => {'user_hash' => user_data}
+  })
+end
+
+
+
+ +
+

+ + - (Object) user_data + + + +

+ + + + +
+
+
+
+14
+15
+16
+
+
# File 'oa-oauth/lib/omniauth/strategies/github.rb', line 14
+
+def user_data
+  @data ||= MultiJson.decode(@access_token.get('/api/v2/json/user/show'))['user']
+end
+
+
+
+ +
+

+ + - (Object) user_info + + + +

+ + + + +
+
+
+
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+
+
# File 'oa-oauth/lib/omniauth/strategies/github.rb', line 18
+
+def 
+  {
+    'nickname' => user_data["login"],
+    'email' => user_data['email'],
+    'name' => user_data['name'],
+    'urls' => {
+      'GitHub' => "http://github.com/#{user_data['login']}",
+      'Blog' => user_data["blog"],
+    }
+  }
+end
+
+
+
+ +
+ +
+ + + + + \ No newline at end of file diff --git a/OmniAuth/Strategies/GoogleApps.html b/OmniAuth/Strategies/GoogleApps.html new file mode 100644 index 000000000..e662dcb6e --- /dev/null +++ b/OmniAuth/Strategies/GoogleApps.html @@ -0,0 +1,327 @@ + + + + +Class: OmniAuth::Strategies::GoogleApps + + + + + + + + + + + + + + + +

Class: OmniAuth::Strategies::GoogleApps + + + +

+ +
+ +
Inherits:
+
+ OpenID + +
    +
  • Object
  • + + + + + +
+ show all + +
+ + + + + + + + + +
Defined in:
+
oa-openid/lib/omniauth/strategies/google_apps.rb
+ +
+
+ + +

Constant Summary

+ + + + + + + +

Constants inherited from OpenID

+

AX, IDENTIFIER_URL_PARAMETER

+ + + + + + + +

+ Instance Method Summary + (collapse) +

+ + + + + + + + + + + + +

Methods inherited from OpenID

+

#auth_hash, #ax_user_info, #callback_phase, #callback_url, #dummy_app, #request_phase, #sreg_user_info, #start, #user_info

+ + + + + + + + +

Methods included from OmniAuth::Strategy

+

#auth_hash, #call, #call!, #call_app!, #callback_phase, #callback_url, #fail!, #full_host, included, #redirect, #request, #request_phase, #session, #user_info

+
+

Constructor Details

+ +
+

+ + - (GoogleApps) initialize(app, store = nil, options = {}) + + + +

+
+

+A new instance of GoogleApps +

+ + +
+
+
+ +
+ + + + +
+
+
+
+6
+7
+8
+9
+
+
# File 'oa-openid/lib/omniauth/strategies/google_apps.rb', line 6
+
+def initialize(app, store = nil, options = {})
+  options[:name] ||= 'google_apps'
+  super(app, store, options)
+end
+
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + - (Object) get_identifier + + + +

+ + + + +
+
+
+
+11
+12
+13
+14
+15
+16
+
+
# File 'oa-openid/lib/omniauth/strategies/google_apps.rb', line 11
+
+def get_identifier
+  OmniAuth::Form.build('Google Apps Authentication') do
+    label_field('Google Apps Domain', 'domain')
+    input_field('url', 'domain')
+  end.to_response
+end
+
+
+
+ +
+

+ + - (Object) identifier + + + +

+ + + + +
+
+
+
+18
+19
+20
+
+
# File 'oa-openid/lib/omniauth/strategies/google_apps.rb', line 18
+
+def identifier
+  options[:domain] || request['domain']
+end
+
+
+
+ +
+ +
+ + + + + \ No newline at end of file diff --git a/OmniAuth/Strategies/Gowalla.html b/OmniAuth/Strategies/Gowalla.html new file mode 100644 index 000000000..431781877 --- /dev/null +++ b/OmniAuth/Strategies/Gowalla.html @@ -0,0 +1,478 @@ + + + + +Class: OmniAuth::Strategies::Gowalla + + + + + + + + + + + + + + + +

Class: OmniAuth::Strategies::Gowalla + + + +

+ +
+ +
Inherits:
+
+ OAuth2 + +
    +
  • Object
  • + + + + + +
+ show all + +
+ + + + + + + + + +
Defined in:
+
oa-oauth/lib/omniauth/strategies/gowalla.rb
+ +
+
+ +

Overview

+
+

+Authenticate to Gowalla utilizing OAuth 2.0 and retrieve basic user +information. +

+

+Usage: +

+
+   use OmniAuth::Strategies::Gowalla, 'API Key', 'Secret Key'
+
+

+Options: +

+ + +
:scope

+Extended permissions such as email and offline_access +(which are the defaults). +

+
+ + +
+
+
+ +
+ + + + + + + + + + + +

+ Instance Method Summary + (collapse) +

+ + + + + + + + + + + + + + + + + +

Methods included from OmniAuth::Strategy

+

#call, #call!, #call_app!, #callback_phase, #callback_url, #fail!, #full_host, included, #redirect, #request, #session

+
+

Constructor Details

+ +
+

+ + - (Gowalla) initialize(app, api_key, secret_key, options = {}) + + + +

+
+

+A new instance of Gowalla +

+ + +
+
+
+ +
+ + + + +
+
+
+
+18
+19
+20
+21
+22
+23
+
+
# File 'oa-oauth/lib/omniauth/strategies/gowalla.rb', line 18
+
+def initialize(app, api_key, secret_key, options = {})
+  options[:site] = 'https://api.gowalla.com/api/oauth'
+  options[:authorize_url] = 'https://gowalla.com/api/oauth/new'
+  options[:access_token_url] = 'https://api.gowalla.com/api/oauth/token'
+  super(app, :gowalla, api_key, secret_key, options)
+end
+
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + - (Object) auth_hash + + + +

+ + + + +
+
+
+
+51
+52
+53
+54
+55
+56
+57
+
+
# File 'oa-oauth/lib/omniauth/strategies/gowalla.rb', line 51
+
+def auth_hash
+  OmniAuth::Utils.deep_merge(super, {
+    'uid' => user_data["url"].split('/').last,
+    'user_info' => ,
+    'extra' => {'user_hash' => user_data}
+  })
+end
+
+
+
+ +
+

+ + - (Object) request_phase + + + +

+ + + + +
+
+
+
+29
+30
+31
+32
+
+
# File 'oa-oauth/lib/omniauth/strategies/gowalla.rb', line 29
+
+def request_phase
+  options[:scope] ||= "email,offline_access"
+  super
+end
+
+
+
+ +
+

+ + - (Object) user_data + + + +

+ + + + +
+
+
+
+25
+26
+27
+
+
# File 'oa-oauth/lib/omniauth/strategies/gowalla.rb', line 25
+
+def user_data
+  @data ||= MultiJson.decode(@access_token.get("/users/me.json"))
+end
+
+
+
+ +
+

+ + - (Object) user_info + + + +

+ + + + +
+
+
+
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+
+
# File 'oa-oauth/lib/omniauth/strategies/gowalla.rb', line 34
+
+def 
+  {
+    'name' => "#{user_data['first_name']} #{user_data['last_name']}",
+    'nickname' => user_data["username"],
+    'first_name' => user_data["first_name"],
+    'last_name' => user_data["last_name"],
+    'location' => user_data["hometown"],
+    'description' => user_data["bio"],
+    'image' => user_data["image_url"],
+    'phone' => nil,
+    'urls' => {
+      'Gowalla' => "http://www.gowalla.com#{user_data['url']}",
+      'Website' => user_data["website"]
+    }
+  }
+end
+
+
+
+ +
+ +
+ + + + + \ No newline at end of file diff --git a/OmniAuth/Strategies/HttpBasic.html b/OmniAuth/Strategies/HttpBasic.html new file mode 100644 index 000000000..ff07c69be --- /dev/null +++ b/OmniAuth/Strategies/HttpBasic.html @@ -0,0 +1,683 @@ + + + + +Class: OmniAuth::Strategies::HttpBasic + + + + + + + + + + + + + + + +

Class: OmniAuth::Strategies::HttpBasic + + + +

+ +
+ +
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+ + + + + + +
Includes:
+
OmniAuth::Strategy
+ + + + + +
Defined in:
+
oa-basic/lib/omniauth/strategies/http_basic.rb
+ +
+
+ + + + + + + +

Instance Attribute Summary (collapse)

+ + + + +

+ Instance Method Summary + (collapse) +

+ + + + + + + + + + + + +

Methods included from OmniAuth::Strategy

+

#auth_hash, #call, #call!, #call_app!, #callback_url, #fail!, #full_host, included, #redirect, #request, #session, #user_info

+
+

Constructor Details

+ +
+

+ + - (HttpBasic) initialize(app, name, endpoint, headers = {}) + + + +

+
+

+A new instance of HttpBasic +

+ + +
+
+
+ +
+ + + + +
+
+
+
+9
+10
+11
+12
+13
+
+
# File 'oa-basic/lib/omniauth/strategies/http_basic.rb', line 9
+
+def initialize(app, name, endpoint, headers = {})
+  super
+  @endpoint = endpoint
+  @request_headers = headers
+end
+
+
+
+ +
+ +
+

Instance Attribute Details

+ + + + +
+

+ + - (Object) endpoint (readonly) + + + +

+
+

+Returns the value of attribute endpoint +

+ + +
+
+
+ +
+ + + + +
+
+
+
+15
+16
+17
+
+
# File 'oa-basic/lib/omniauth/strategies/http_basic.rb', line 15
+
+def endpoint
+  @endpoint
+end
+
+
+
+ + + + +
+

+ + - (Object) request_headers (readonly) + + + +

+
+

+Returns the value of attribute request_headers +

+ + +
+
+
+ +
+ + + + +
+
+
+
+15
+16
+17
+
+
# File 'oa-basic/lib/omniauth/strategies/http_basic.rb', line 15
+
+def request_headers
+  @request_headers
+end
+
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + - (Object) callback_phase + + + +

+ + + + +
+
+
+
+51
+52
+53
+
+
# File 'oa-basic/lib/omniauth/strategies/http_basic.rb', line 51
+
+def callback_phase
+  fail!(:invalid_credentials)
+end
+
+
+
+ +
+

+ + - (Object) get_credentials + + + +

+ + + + +
+
+
+
+29
+30
+31
+32
+33
+34
+
+
# File 'oa-basic/lib/omniauth/strategies/http_basic.rb', line 29
+
+def get_credentials
+  OmniAuth::Form.build(title) do
+    text_field 'Username', 'username'
+    password_field 'Password', 'password'
+  end.to_response
+end
+
+
+
+ +
+

+ + - (Object) perform + + + +

+ + + + +
+
+
+
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+
+
# File 'oa-basic/lib/omniauth/strategies/http_basic.rb', line 36
+
+def perform
+  @response = perform_authentication(endpoint)
+  @env['omniauth.auth'] = auth_hash
+  @env['REQUEST_METHOD'] = 'GET'
+  @env['PATH_INFO'] = "#{OmniAuth.config.path_prefix}/#{name}/callback"
+  
+  call_app!
+rescue RestClient::Request::Unauthorized => e
+  fail!(:invalid_credentials, e)
+end
+
+
+
+ +
+

+ + - (Object) perform_authentication(uri, headers = request_headers) + + + +

+ + + + +
+
+
+
+47
+48
+49
+
+
# File 'oa-basic/lib/omniauth/strategies/http_basic.rb', line 47
+
+def perform_authentication(uri, headers = request_headers)
+  RestClient.get(uri, headers)
+end
+
+
+
+ +
+

+ + - (Object) request_phase + + + +

+ + + + +
+
+
+
+17
+18
+19
+20
+21
+22
+23
+
+
# File 'oa-basic/lib/omniauth/strategies/http_basic.rb', line 17
+
+def request_phase
+  if env['REQUEST_METHOD'] == 'GET'
+    get_credentials
+  else
+    perform
+  end
+end
+
+
+
+ +
+

+ + - (Object) title + + + +

+ + + + +
+
+
+
+25
+26
+27
+
+
# File 'oa-basic/lib/omniauth/strategies/http_basic.rb', line 25
+
+def title
+  name.split('_').map{|s| s.capitalize}.join(' ')
+end
+
+
+
+ +
+ +
+ + + + + \ No newline at end of file diff --git a/OmniAuth/Strategies/Identica.html b/OmniAuth/Strategies/Identica.html new file mode 100644 index 000000000..aff593386 --- /dev/null +++ b/OmniAuth/Strategies/Identica.html @@ -0,0 +1,414 @@ + + + + +Class: OmniAuth::Strategies::Identica + + + + + + + + + + + + + + + +

Class: OmniAuth::Strategies::Identica + + + +

+ +
+ +
Inherits:
+
+ OAuth + +
    +
  • Object
  • + + + + + +
+ show all + +
+ + + + + + + + + +
Defined in:
+
oa-oauth/lib/omniauth/strategies/identica.rb
+ +
+
+ +

Overview

+
+

+Authenticate to Identica via OAuth and retrieve basic user information. +

+

+Usage: +

+
+   use OmniAuth::Strategies::Identica, 'consumerkey', 'consumersecret'
+
+ + +
+
+
+ +
+ + + + + + + + + + + +

+ Instance Method Summary + (collapse) +

+ + + + + + + + + + + + +

Methods inherited from OAuth

+

#callback_phase, #request_phase, #unique_id

+ + + + + + + + +

Methods included from OmniAuth::Strategy

+

#call, #call!, #call_app!, #callback_phase, #callback_url, #fail!, #full_host, included, #redirect, #request, #request_phase, #session

+
+

Constructor Details

+ +
+

+ + - (Identica) initialize(app, consumer_key, consumer_secret) + + + +

+
+

+A new instance of Identica +

+ + +
+
+
+ +
+ + + + +
+
+
+
+15
+16
+17
+18
+19
+20
+21
+
+
# File 'oa-oauth/lib/omniauth/strategies/identica.rb', line 15
+
+def initialize(app, consumer_key, consumer_secret)
+  super(app, :identica, consumer_key, consumer_secret,
+          :site => 'http://identi.ca',
+          :request_token_path => "/api/oauth/request_token",
+          :access_token_path  => "/api/oauth/access_token",
+          :authorize_path     => "/api/oauth/authorize")
+end
+
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + - (Object) auth_hash + + + +

+ + + + +
+
+
+
+23
+24
+25
+26
+27
+28
+29
+
+
# File 'oa-oauth/lib/omniauth/strategies/identica.rb', line 23
+
+def auth_hash
+  OmniAuth::Utils.deep_merge(super, {
+    'uid' => @access_token.params[:user_id],
+    'user_info' => ,
+    'extra' => {'user_hash' => user_hash}
+  })
+end
+
+
+
+ +
+

+ + - (Object) user_hash + + + +

+ + + + +
+
+
+
+44
+45
+46
+
+
# File 'oa-oauth/lib/omniauth/strategies/identica.rb', line 44
+
+def user_hash
+  @user_hash ||= MultiJson.decode(@access_token.get('/api/account/verify_credentials.json').body)
+end
+
+
+
+ +
+

+ + - (Object) user_info + + + +

+ + + + +
+
+
+
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+
+
# File 'oa-oauth/lib/omniauth/strategies/identica.rb', line 31
+
+def 
+  user_hash = self.user_hash
+
+  {
+    'nickname' => user_hash['screen_name'],
+    'name' => user_hash['name'],
+    'location' => user_hash['location'],
+    'image' => user_hash['profile_image_url'],
+    'description' => user_hash['description'],
+    'urls' => {'Website' => user_hash['url']}
+  }
+end
+
+
+
+ +
+ +
+ + + + + \ No newline at end of file diff --git a/OmniAuth/Strategies/LDAP.html b/OmniAuth/Strategies/LDAP.html new file mode 100644 index 000000000..b71e7a2f6 --- /dev/null +++ b/OmniAuth/Strategies/LDAP.html @@ -0,0 +1,233 @@ + + + + +Class: OmniAuth::Strategies::LDAP + + + + + + + + + + + + + + + +

Class: OmniAuth::Strategies::LDAP + + + +

+ +
+ +
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+ + + + + + +
Includes:
+
OmniAuth::Strategy
+ + + + + +
Defined in:
+
oa-enterprise/lib/omniauth/strategies/ldap.rb,
+ oa-enterprise/lib/omniauth/strategies/ldap/adaptor.rb
+
+ +
+
+ +

Defined Under Namespace

+

+ + + + + Classes: Adaptor + + +

+ +

Constant Summary

+ +
+ +
@@config = + +
+
{'name' => 'cn', 'first_name' => 'givenName', 'last_name' => 'sn', 'email' => ['mail', "email", 'userPrincipalName'],
+'phone' => ['telephoneNumber', 'homePhone', 'facsimileTelephoneNumber'],
+'mobile_number' => ['mobile', 'mobileTelephoneNumber'],
+'nickname' => ['uid', 'userid', 'sAMAccountName'],
+'title' => 'title',
+'location' => {"%0, %1, %2, %3 %4" => [['address', 'postalAddress', 'homePostalAddress', 'street', 'streetAddress'], ['l'], ['st'],['co'],['postOfficeBox']]},
+'uid' => 'dn',
+'url' => ['wwwhomepage'],
+'image' => 'jpegPhoto',
+'description' => 'description'}
+
+ +
+ + + + + + + + + +

+ Instance Method Summary + (collapse) +

+ + + + + + + + + + + + +

Methods included from OmniAuth::Strategy

+

#call, #call!, #call_app!, #callback_url, #fail!, #full_host, included, #redirect, #request, #session, #user_info

+
+

Constructor Details

+ +
+

+ + - (LDAP) initialize(app, title, options = {}) + + + +

+
+

+A new instance of LDAP +

+ + +
+
+
+ +
+ + + + +
+
+
+
+20
+21
+22
+23
+24
+
+
# File 'oa-enterprise/lib/omniauth/strategies/ldap.rb', line 20
+
+def initialize(app, title, options = {})
+  super(app, options.delete(:name) || :ldap)
+  @title = title
+  @adaptor = OmniAuth::Strategies::LDAP::Adaptor.new(options)
+end
+
+
+
+ +
+ + +
+ + + + + \ No newline at end of file diff --git a/OmniAuth/Strategies/LDAP/Adaptor.html b/OmniAuth/Strategies/LDAP/Adaptor.html new file mode 100644 index 000000000..e773bfdfc --- /dev/null +++ b/OmniAuth/Strategies/LDAP/Adaptor.html @@ -0,0 +1,1192 @@ + + + + +Class: OmniAuth::Strategies::LDAP::Adaptor + + + + + + + + + + + + + + + +

Class: OmniAuth::Strategies::LDAP::Adaptor + + + +

+ +
+ +
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+ + + + + + + + + +
Defined in:
+
oa-enterprise/lib/omniauth/strategies/ldap/adaptor.rb
+ +
+
+ +

Defined Under Namespace

+

+ + + + + Classes: AuthenticationError, ConfigurationError, ConnectionError, LdapError + + +

+ +

Constant Summary

+ +
+ +
VALID_ADAPTER_CONFIGURATION_KEYS = + +
+
[:host, :port, :method, :bind_dn, :password,
+:try_sasl, :sasl_mechanisms, :uid, :base]
+
+ +
MUST_HAVE_KEYS = + +
+
[:host, :port, :method, :uid, :base]
+
+ +
METHOD = + +
+
{
+  :ssl => :simple_tls,
+  :tls => :start_tls,
+  :plain => nil
+}
+
+ +
CHARS = + +
+
("a".."z").to_a + ("A".."Z").to_a + ("0".."9").to_a
+
+ +
+ + + +

Instance Attribute Summary (collapse)

+ + + + +

+ Instance Method Summary + (collapse) +

+ + + + +
+

Constructor Details

+ +
+

+ + - (Adaptor) initialize(configuration = {}) + + + +

+
+

+A new instance of Adaptor +

+ + +
+
+
+

Raises:

+
    + +
  • + + (ArgumentError) + + + + +
  • + +
+ +
+ + + + +
+
+
+
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+
+
# File 'oa-enterprise/lib/omniauth/strategies/ldap/adaptor.rb', line 24
+
+def initialize(configuration={})
+  @connection = nil
+  @disconnected = false
+  @bound = false
+  @configuration = configuration.dup
+  @logger = @configuration.delete(:logger)
+  message = []
+  MUST_HAVE_KEYS.each do |name|
+   message << name if configuration[name].nil? 
+  end
+  raise ArgumentError.new(message.join(",") +" MUST be provided") unless message.empty?
+  VALID_ADAPTER_CONFIGURATION_KEYS.each do |name|
+    instance_variable_set("@#{name}", configuration[name])
+  end
+end
+
+
+
+ +
+ +
+

Instance Attribute Details

+ + + + +
+

+ + - (Object) base (readonly) + + + +

+
+

+Returns the value of attribute base +

+ + +
+
+
+ +
+ + + + +
+
+
+
+23
+24
+25
+
+
# File 'oa-enterprise/lib/omniauth/strategies/ldap/adaptor.rb', line 23
+
+def base
+  @base
+end
+
+
+
+ + + + +
+

+ + - (Object) bind_dn + + + +

+
+

+Returns the value of attribute bind_dn +

+ + +
+
+
+ +
+ + + + +
+
+
+
+22
+23
+24
+
+
# File 'oa-enterprise/lib/omniauth/strategies/ldap/adaptor.rb', line 22
+
+def bind_dn
+  @bind_dn
+end
+
+
+
+ + + + +
+

+ + - (Object) connection (readonly) + + + +

+
+

+Returns the value of attribute connection +

+ + +
+
+
+ +
+ + + + +
+
+
+
+23
+24
+25
+
+
# File 'oa-enterprise/lib/omniauth/strategies/ldap/adaptor.rb', line 23
+
+def connection
+  @connection
+end
+
+
+
+ + + + +
+

+ + - (Object) password + + + +

+
+

+Returns the value of attribute password +

+ + +
+
+
+ +
+ + + + +
+
+
+
+22
+23
+24
+
+
# File 'oa-enterprise/lib/omniauth/strategies/ldap/adaptor.rb', line 22
+
+def password
+  @password
+end
+
+
+
+ + + + +
+

+ + - (Object) uid (readonly) + + + +

+
+

+Returns the value of attribute uid +

+ + +
+
+
+ +
+ + + + +
+
+
+
+23
+24
+25
+
+
# File 'oa-enterprise/lib/omniauth/strategies/ldap/adaptor.rb', line 23
+
+def uid
+  @uid
+end
+
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + - (Object) bind(options = {}) + + + +

+ + + + +
+
+
+
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+
+
# File 'oa-enterprise/lib/omniauth/strategies/ldap/adaptor.rb', line 68
+
+def bind(options={})
+  connect(options) unless connecting?
+  begin
+    @bind_tried = true
+    
+    bind_dn = (options[:bind_dn] || @bind_dn).to_s
+    try_sasl = options.has_key?(:try_sasl) ? options[:try_sasl] : @try_sasl
+    
+    # Rough bind loop:
+    # Attempt 1: SASL if available
+    # Attempt 2: SIMPLE with credentials if password block
+    if try_sasl and sasl_bind(bind_dn, options)
+      puts "bind with sasl"
+    elsif simple_bind(bind_dn, options)
+      puts "bind with simple"
+    else
+      message = yield if block_given?
+      message ||= ('All authentication methods for %s exhausted.') % target
+      raise AuthenticationError, message
+    end
+    
+    @bound = true
+  rescue Net::LDAP::LdapError
+    raise AuthenticationError, $!.message
+  end
+end
+
+
+
+ +
+

+ + - (Boolean) bound? + + + +

+
+ + +
+
+
+

Returns:

+
    + +
  • + + (Boolean) + + + + +
  • + +
+ +
+ + + + +
+
+
+
+110
+111
+112
+
+
# File 'oa-enterprise/lib/omniauth/strategies/ldap/adaptor.rb', line 110
+
+def bound?
+  connecting? and @bound
+end
+
+
+
+ +
+

+ + - (Object) connect(options = {}) + + + +

+ + + + +
+
+
+
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+
+
# File 'oa-enterprise/lib/omniauth/strategies/ldap/adaptor.rb', line 40
+
+def connect(options={})
+  host = options[:host] || @host
+  method = options[:method] || @method || :plain
+  port = options[:port] || @port || ensure_port(method)
+  method = ensure_method(method)
+  @disconnected = false
+  @bound = false
+  @bind_tried = false        
+  config = {
+    :host => host,
+    :port => port,
+  }
+  config[:encryption] = {:method => method} if method
+  @connection, @uri, @with_start_tls = 
+  begin
+    uri = construct_uri(host, port, method == :simple_tls)
+    with_start_tls = method == :start_tls
+    puts ({:uri => uri, :with_start_tls => with_start_tls}).inspect
+    [Net::LDAP::Connection.new(config), uri, with_start_tls]
+  rescue Net::LDAP::LdapError
+    raise ConnectionError, $!.message
+  end
+end
+
+
+
+ +
+

+ + - (Boolean) connecting? + + + +

+
+ + +
+
+
+

Returns:

+
    + +
  • + + (Boolean) + + + + +
  • + +
+ +
+ + + + +
+
+
+
+106
+107
+108
+
+
# File 'oa-enterprise/lib/omniauth/strategies/ldap/adaptor.rb', line 106
+
+def connecting?
+  !@connection.nil? and !@disconnected
+end
+
+
+
+ +
+

+ + - (Object) disconnect!(options = {}) + + + +

+ + + + +
+
+
+
+95
+96
+97
+98
+99
+
+
# File 'oa-enterprise/lib/omniauth/strategies/ldap/adaptor.rb', line 95
+
+def disconnect!(options={})
+  unbind(options)
+  @connection = @uri = @with_start_tls = nil
+  @disconnected = true
+end
+
+
+
+ +
+

+ + - (Object) rebind(options = {}) + + + +

+ + + + +
+
+
+
+101
+102
+103
+104
+
+
# File 'oa-enterprise/lib/omniauth/strategies/ldap/adaptor.rb', line 101
+
+def rebind(options={})
+  unbind(options) if bound?
+  connect(options)
+end
+
+
+
+ +
+

+ + - (Object) search(options = {}, &block) + + + +

+ + + + +
+
+
+
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+
+
# File 'oa-enterprise/lib/omniauth/strategies/ldap/adaptor.rb', line 114
+
+def search(options={}, &block)
+    base = options[:base]
+    filter = options[:filter]
+    limit = options[:limit]
+  
+    args = {
+     :base => @base,
+      :filter => filter,
+      :size => limit
+    }
+    puts args.inspect
+    attributes = {}
+    execute(:search, args) do |entry|
+      entry.attribute_names.each do |name|
+        attributes[name] = entry[name]
+      end
+    end
+    attributes
+end
+
+
+
+ +
+

+ + - (Object) unbind(options = {}) + + + +

+ + + + +
+
+
+
+64
+65
+66
+
+
# File 'oa-enterprise/lib/omniauth/strategies/ldap/adaptor.rb', line 64
+
+def unbind(options={})
+    @connection.close # Net::LDAP doesn't implement unbind.
+end
+
+
+
+ +
+ +
+ + + + + \ No newline at end of file diff --git a/OmniAuth/Strategies/LDAP/Adaptor/AuthenticationError.html b/OmniAuth/Strategies/LDAP/Adaptor/AuthenticationError.html new file mode 100644 index 000000000..7bb2c98e0 --- /dev/null +++ b/OmniAuth/Strategies/LDAP/Adaptor/AuthenticationError.html @@ -0,0 +1,100 @@ + + + + +Exception: OmniAuth::Strategies::LDAP::Adaptor::AuthenticationError + + + + + + + + + + + + + + + +

Exception: OmniAuth::Strategies::LDAP::Adaptor::AuthenticationError + + + +

+ +
+ +
Inherits:
+
+ StandardError + +
    +
  • Object
  • + + + + + +
+ show all + +
+ + + + + + + + + +
Defined in:
+
oa-enterprise/lib/omniauth/strategies/ldap/adaptor.rb
+ +
+
+ + + + + + + + +
+ + + + + \ No newline at end of file diff --git a/OmniAuth/Strategies/LDAP/Adaptor/ConfigurationError.html b/OmniAuth/Strategies/LDAP/Adaptor/ConfigurationError.html new file mode 100644 index 000000000..0d8c31457 --- /dev/null +++ b/OmniAuth/Strategies/LDAP/Adaptor/ConfigurationError.html @@ -0,0 +1,100 @@ + + + + +Exception: OmniAuth::Strategies::LDAP::Adaptor::ConfigurationError + + + + + + + + + + + + + + + +

Exception: OmniAuth::Strategies::LDAP::Adaptor::ConfigurationError + + + +

+ +
+ +
Inherits:
+
+ StandardError + +
    +
  • Object
  • + + + + + +
+ show all + +
+ + + + + + + + + +
Defined in:
+
oa-enterprise/lib/omniauth/strategies/ldap/adaptor.rb
+ +
+
+ + + + + + + + +
+ + + + + \ No newline at end of file diff --git a/OmniAuth/Strategies/LDAP/Adaptor/ConnectionError.html b/OmniAuth/Strategies/LDAP/Adaptor/ConnectionError.html new file mode 100644 index 000000000..1a43d3b73 --- /dev/null +++ b/OmniAuth/Strategies/LDAP/Adaptor/ConnectionError.html @@ -0,0 +1,100 @@ + + + + +Exception: OmniAuth::Strategies::LDAP::Adaptor::ConnectionError + + + + + + + + + + + + + + + +

Exception: OmniAuth::Strategies::LDAP::Adaptor::ConnectionError + + + +

+ +
+ +
Inherits:
+
+ StandardError + +
    +
  • Object
  • + + + + + +
+ show all + +
+ + + + + + + + + +
Defined in:
+
oa-enterprise/lib/omniauth/strategies/ldap/adaptor.rb
+ +
+
+ + + + + + + + +
+ + + + + \ No newline at end of file diff --git a/OmniAuth/Strategies/LDAP/Adaptor/LdapError.html b/OmniAuth/Strategies/LDAP/Adaptor/LdapError.html new file mode 100644 index 000000000..93a8adb46 --- /dev/null +++ b/OmniAuth/Strategies/LDAP/Adaptor/LdapError.html @@ -0,0 +1,100 @@ + + + + +Exception: OmniAuth::Strategies::LDAP::Adaptor::LdapError + + + + + + + + + + + + + + + +

Exception: OmniAuth::Strategies::LDAP::Adaptor::LdapError + + + +

+ +
+ +
Inherits:
+
+ StandardError + +
    +
  • Object
  • + + + + + +
+ show all + +
+ + + + + + + + + +
Defined in:
+
oa-enterprise/lib/omniauth/strategies/ldap/adaptor.rb
+ +
+
+ + + + + + + + +
+ + + + + \ No newline at end of file diff --git a/OmniAuth/Strategies/LinkedIn.html b/OmniAuth/Strategies/LinkedIn.html new file mode 100644 index 000000000..5cd334fe4 --- /dev/null +++ b/OmniAuth/Strategies/LinkedIn.html @@ -0,0 +1,365 @@ + + + + +Class: OmniAuth::Strategies::LinkedIn + + + + + + + + + + + + + + + +

Class: OmniAuth::Strategies::LinkedIn + + + +

+ +
+ +
Inherits:
+
+ OAuth + +
    +
  • Object
  • + + + + + +
+ show all + +
+ + + + + + + + + +
Defined in:
+
oa-oauth/lib/omniauth/strategies/linked_in.rb
+ +
+
+ + + + + + + + + + + + + +

+ Instance Method Summary + (collapse) +

+ + + + + + + + + + + + +

Methods inherited from OAuth

+

#callback_phase, #request_phase, #unique_id

+ + + + + + + + +

Methods included from OmniAuth::Strategy

+

#call, #call!, #call_app!, #callback_phase, #callback_url, #fail!, #full_host, included, #redirect, #request, #request_phase, #session, #user_info

+
+

Constructor Details

+ +
+

+ + - (LinkedIn) initialize(app, consumer_key, consumer_secret) + + + +

+
+

+A new instance of LinkedIn +

+ + +
+
+
+ +
+ + + + +
+
+
+
+7
+8
+9
+10
+11
+12
+13
+14
+
+
# File 'oa-oauth/lib/omniauth/strategies/linked_in.rb', line 7
+
+def initialize(app, consumer_key, consumer_secret)
+  super(app, :linked_in, consumer_key, consumer_secret,
+          :site => 'https://api.linkedin.com',
+          :request_token_path => '/uas/oauth/requestToken',
+          :access_token_path => '/uas/oauth/accessToken',
+          :authorize_path => '/uas/oauth/authorize',
+          :scheme => :header)
+end
+
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + - (Object) auth_hash + + + +

+ + + + +
+
+
+
+16
+17
+18
+19
+20
+21
+22
+23
+
+
# File 'oa-oauth/lib/omniauth/strategies/linked_in.rb', line 16
+
+def auth_hash
+  hash = user_hash(@access_token)
+  
+  OmniAuth::Utils.deep_merge(super, {
+    'uid' => hash.delete('id'),
+    'user_info' => hash
+  })
+end
+
+
+
+ +
+

+ + - (Object) user_hash(access_token) + + + +

+ + + + +
+
+
+
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+
+
# File 'oa-oauth/lib/omniauth/strategies/linked_in.rb', line 25
+
+def user_hash(access_token)
+  person = Nokogiri::XML::Document.parse(@access_token.get('/v1/people/~:(id,first-name,last-name,headline,member-url-resources,picture-url,location)').body).xpath('person')
+  
+  hash = {
+    'id' => person.xpath('id').text,
+    'first_name' => person.xpath('first-name').text,
+    'last_name' => person.xpath('last-name').text,
+    'location' => person.xpath('location/name').text,
+    'image' => person.xpath('picture-url').text,
+    'description' => person.xpath('headline').text,
+    'urls' => person.css('member-url-resources member-url').inject({}) do |h,element|
+      h[element.xpath('name').text] = element.xpath('url').text
+      h
+    end
+  }
+  
+  hash[:name] = "#{hash['first_name']} #{hash['last_name']}"
+  hash
+end
+
+
+
+ +
+ +
+ + + + + \ No newline at end of file diff --git a/OmniAuth/Strategies/OAuth.html b/OmniAuth/Strategies/OAuth.html new file mode 100644 index 000000000..d1b4bbf06 --- /dev/null +++ b/OmniAuth/Strategies/OAuth.html @@ -0,0 +1,587 @@ + + + + +Class: OmniAuth::Strategies::OAuth + + + + + + + + + + + + + + + +

Class: OmniAuth::Strategies::OAuth + + + +

+ +
+ +
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+ + + + + + +
Includes:
+
OmniAuth::Strategy
+ + + + + +
Defined in:
+
oa-oauth/lib/omniauth/strategies/oauth.rb
+ +
+
+ +
+

Direct Known Subclasses

+

Foursquare, Identica, LinkedIn, Twitter

+
+ + + + + + +

Instance Attribute Summary (collapse)

+ + + + +

+ Instance Method Summary + (collapse) +

+ + + + + + + + + + + + +

Methods included from OmniAuth::Strategy

+

#call, #call!, #call_app!, #callback_url, #fail!, #full_host, included, #redirect, #request, #session, #user_info

+
+

Constructor Details

+ +
+

+ + - (OAuth) initialize(app, name, consumer_key, consumer_secret, options = {}) + + + +

+
+

+A new instance of OAuth +

+ + +
+
+
+ +
+ + + + +
+
+
+
+9
+10
+11
+12
+
+
# File 'oa-oauth/lib/omniauth/strategies/oauth.rb', line 9
+
+def initialize(app, name, consumer_key, consumer_secret, options = {})
+  super
+  @consumer = ::OAuth::Consumer.new(consumer_key, consumer_secret, options)
+end
+
+
+
+ +
+ +
+

Instance Attribute Details

+ + + + +
+

+ + - (Object) consumer (readonly) + + + +

+
+

+Returns the value of attribute consumer +

+ + +
+
+
+ +
+ + + + +
+
+
+
+13
+14
+15
+
+
# File 'oa-oauth/lib/omniauth/strategies/oauth.rb', line 13
+
+def consumer
+  @consumer
+end
+
+
+
+ + + + +
+

+ + - (Object) name (readonly) + + + +

+
+

+Returns the value of attribute name +

+ + +
+
+
+ +
+ + + + +
+
+
+
+13
+14
+15
+
+
# File 'oa-oauth/lib/omniauth/strategies/oauth.rb', line 13
+
+def name
+  @name
+end
+
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + - (Object) auth_hash + + + +

+ + + + +
+
+
+
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+
+
# File 'oa-oauth/lib/omniauth/strategies/oauth.rb', line 31
+
+def auth_hash
+  OmniAuth::Utils.deep_merge(super, {
+    'credentials' => {
+      'token' => @access_token.token, 
+      'secret' => @access_token.secret
+    }, 'extra' => {
+      'access_token' => @access_token
+    }
+  })
+end
+
+
+
+ +
+

+ + - (Object) callback_phase + + + +

+ + + + +
+
+
+
+23
+24
+25
+26
+27
+28
+29
+
+
# File 'oa-oauth/lib/omniauth/strategies/oauth.rb', line 23
+
+def callback_phase
+  request_token = ::OAuth::RequestToken.new(consumer, session[:oauth][name.to_sym].delete(:request_token), session[:oauth][name.to_sym].delete(:request_secret))
+  @access_token = request_token.get_access_token(:oauth_verifier => request.params['oauth_verifier'])
+  super
+rescue ::OAuth::Unauthorized => e
+  fail!(:invalid_credentials, e)
+end
+
+
+
+ +
+

+ + - (Object) request_phase + + + +

+ + + + +
+
+
+
+15
+16
+17
+18
+19
+20
+21
+
+
# File 'oa-oauth/lib/omniauth/strategies/oauth.rb', line 15
+
+def request_phase
+  request_token = consumer.get_request_token(:oauth_callback => callback_url)
+  (session[:oauth]||={})[name.to_sym] = {:callback_confirmed => request_token.callback_confirmed?, :request_token => request_token.token, :request_secret => request_token.secret}
+  r = Rack::Response.new
+  r.redirect request_token.authorize_url
+  r.finish
+end
+
+
+
+ +
+

+ + - (Object) unique_id + + + +

+ + + + +
+
+
+
+42
+43
+44
+
+
# File 'oa-oauth/lib/omniauth/strategies/oauth.rb', line 42
+
+def unique_id
+  nil
+end
+
+
+
+ +
+ +
+ + + + + \ No newline at end of file diff --git a/OmniAuth/Strategies/OAuth2.html b/OmniAuth/Strategies/OAuth2.html new file mode 100644 index 000000000..9a734623c --- /dev/null +++ b/OmniAuth/Strategies/OAuth2.html @@ -0,0 +1,363 @@ + + + + +Class: OmniAuth::Strategies::OAuth2 + + + + + + + + + + + + + + + +

Class: OmniAuth::Strategies::OAuth2 + + + +

+ +
+ +
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+ + + + + + +
Includes:
+
OmniAuth::Strategy
+ + + + + +
Defined in:
+
oa-oauth/lib/omniauth/strategies/oauth2.rb
+ +
+
+ +
+

Direct Known Subclasses

+

Facebook, GitHub, Gowalla, ThirtySevenSignals

+
+

Defined Under Namespace

+

+ + + + + Classes: CallbackError + + +

+ + + + + + +

Instance Attribute Summary (collapse)

+ + + + +

+ Instance Method Summary + (collapse) +

+ + + + + + + + + + + + +

Methods included from OmniAuth::Strategy

+

#call, #call!, #call_app!, #callback_url, #fail!, #full_host, included, #redirect, #request, #session, #user_info

+
+

Constructor Details

+ +
+

+ + - (OAuth2) initialize(app, name, client_id, client_secret, options = {}) + + + +

+
+

+A new instance of OAuth2 +

+ + +
+
+
+ +
+ + + + +
+
+
+
+23
+24
+25
+26
+27
+
+
# File 'oa-oauth/lib/omniauth/strategies/oauth2.rb', line 23
+
+def initialize(app, name, client_id, client_secret, options = {})
+  super(app, name)
+  self.options = options
+  self.client = ::OAuth2::Client.new(client_id, client_secret, options)
+end
+
+
+
+ +
+ +
+

Instance Attribute Details

+ + + + +
+

+ + - (Object) client + + + +

+
+

+Returns the value of attribute client +

+ + +
+
+
+ +
+ + + + +
+
+
+
+11
+12
+13
+
+
# File 'oa-oauth/lib/omniauth/strategies/oauth2.rb', line 11
+
+def client
+  @client
+end
+
+
+
+ + + + +
+

+ + - (Object) options + + + +

+
+

+Returns the value of attribute options +

+ + +
+
+
+ +
+ + + + +
+
+
+
+11
+12
+13
+
+
# File 'oa-oauth/lib/omniauth/strategies/oauth2.rb', line 11
+
+def options
+  @options
+end
+
+
+
+ +
+ + +
+ + + + + \ No newline at end of file diff --git a/OmniAuth/Strategies/OAuth2/CallbackError.html b/OmniAuth/Strategies/OAuth2/CallbackError.html new file mode 100644 index 000000000..c2221ac1b --- /dev/null +++ b/OmniAuth/Strategies/OAuth2/CallbackError.html @@ -0,0 +1,405 @@ + + + + +Exception: OmniAuth::Strategies::OAuth2::CallbackError + + + + + + + + + + + + + + + +

Exception: OmniAuth::Strategies::OAuth2::CallbackError + + + +

+ +
+ +
Inherits:
+
+ StandardError + +
    +
  • Object
  • + + + + + +
+ show all + +
+ + + + + + + + + +
Defined in:
+
oa-oauth/lib/omniauth/strategies/oauth2.rb
+ +
+
+ + + + +

Instance Attribute Summary (collapse)

+ + + + +

+ Instance Method Summary + (collapse) +

+ + + + + +
+

Constructor Details

+ +
+

+ + - (CallbackError) initialize(error, error_reason = nil, error_uri = nil) + + + +

+
+

+A new instance of CallbackError +

+ + +
+
+
+ +
+ + + + +
+
+
+
+16
+17
+18
+19
+20
+
+
# File 'oa-oauth/lib/omniauth/strategies/oauth2.rb', line 16
+
+def initialize(error, error_reason=nil, error_uri=nil)
+  self.error = error
+  self.error_reason = error_reason
+  self.error_uri = error_uri
+end
+
+
+
+ +
+ +
+

Instance Attribute Details

+ + + + +
+

+ + - (Object) error + + + +

+
+

+Returns the value of attribute error +

+ + +
+
+
+ +
+ + + + +
+
+
+
+14
+15
+16
+
+
# File 'oa-oauth/lib/omniauth/strategies/oauth2.rb', line 14
+
+def error
+  @error
+end
+
+
+
+ + + + +
+

+ + - (Object) error_reason + + + +

+
+

+Returns the value of attribute error_reason +

+ + +
+
+
+ +
+ + + + +
+
+
+
+14
+15
+16
+
+
# File 'oa-oauth/lib/omniauth/strategies/oauth2.rb', line 14
+
+def error_reason
+  @error_reason
+end
+
+
+
+ + + + +
+

+ + - (Object) error_uri + + + +

+
+

+Returns the value of attribute error_uri +

+ + +
+
+
+ +
+ + + + +
+
+
+
+14
+15
+16
+
+
# File 'oa-oauth/lib/omniauth/strategies/oauth2.rb', line 14
+
+def error_uri
+  @error_uri
+end
+
+
+
+ +
+ + +
+ + + + + \ No newline at end of file diff --git a/OmniAuth/Strategies/OpenID.html b/OmniAuth/Strategies/OpenID.html new file mode 100644 index 000000000..a279a5a57 --- /dev/null +++ b/OmniAuth/Strategies/OpenID.html @@ -0,0 +1,958 @@ + + + + +Class: OmniAuth::Strategies::OpenID + + + + + + + + + + + + + + + +

Class: OmniAuth::Strategies::OpenID + + + +

+ +
+ +
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+ + + + + + +
Includes:
+
OmniAuth::Strategy
+ + + + + +
Defined in:
+
oa-openid/lib/omniauth/strategies/open_id.rb
+ +
+
+ +
+

Direct Known Subclasses

+

GoogleApps

+
+ +

Constant Summary

+ +
+ +
IDENTIFIER_URL_PARAMETER = + +
+
'openid_url'
+
+ +
AX = + +
+
{
+  :email => 'http://axschema.org/contact/email',
+  :name => 'http://axschema.org/namePerson',
+  :nickname => 'http://axschema.org/namePerson/friendly',
+  :first_name => 'http://axschema.org/namePerson/first',
+  :last_name => 'http://axschema.org/namePerson/last',
+  :city => 'http://axschema.org/contact/city/home',
+  :state => 'http://axschema.org/contact/state/home',
+  :website => 'http://axschema.org/contact/web/default',
+  :image => 'http://axschema.org/media/image/aspect11'
+}
+
+ +
+ + + + + + + +

Instance Attribute Summary (collapse)

+ + + + +

+ Instance Method Summary + (collapse) +

+ + + + + + + + + + + + +

Methods included from OmniAuth::Strategy

+

#call, #call!, #call_app!, #fail!, #full_host, included, #redirect, #request, #session

+
+

Constructor Details

+ +
+

+ + - (OpenID) initialize(app, store = nil, options = {}) + + + +

+
+

+A new instance of OpenID +

+ + +
+
+
+ +
+ + + + +
+
+
+
+26
+27
+28
+29
+30
+31
+32
+
+
# File 'oa-openid/lib/omniauth/strategies/open_id.rb', line 26
+
+def initialize(app, store = nil, options = {})
+  super(app, options.delete(:name) || :open_id)
+  @options = options
+  @options[:required] ||= [AX[:email], AX[:first_name], AX[:last_name], 'email', 'fullname']
+  @options[:optional] ||= [AX[:nickname], AX[:city], AX[:state], AX[:website], AX[:image], 'postcode', 'nickname']
+  @store = store
+end
+
+
+
+ +
+ +
+

Instance Attribute Details

+ + + + +
+

+ + - (Object) options + + + +

+
+

+Returns the value of attribute options +

+ + +
+
+
+ +
+ + + + +
+
+
+
+10
+11
+12
+
+
# File 'oa-openid/lib/omniauth/strategies/open_id.rb', line 10
+
+def options
+  @options
+end
+
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + - (Object) auth_hash + + + +

+ + + + +
+
+
+
+87
+88
+89
+90
+91
+92
+
+
# File 'oa-openid/lib/omniauth/strategies/open_id.rb', line 87
+
+def auth_hash
+  OmniAuth::Utils.deep_merge(super(), {
+    'uid' => @openid_response.display_identifier,
+    'user_info' => (@openid_response)
+  })
+end
+
+
+
+ +
+

+ + - (Object) ax_user_info(response) + + + +

+ + + + +
+
+
+
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+
+
# File 'oa-openid/lib/omniauth/strategies/open_id.rb', line 109
+
+def (response)
+  ax = ::OpenID::AX::FetchResponse.from_success_response(response)
+  return {} unless ax
+  {
+    'email' => ax[AX[:email]],
+    'name' => ax[AX[:name]],
+    'location' => ("#{ax[AX[:city]]}, #{ax[AX[:state]]}" if Array(ax[AX[:city]]).any? && Array(ax[AX[:state]]).any?),
+    'nickname' => ax[AX[:nickname]],
+    'urls' => ({'Website' => Array(ax[AX[:website]]).first} if Array(ax[AX[:website]]).any?)
+  }.inject({}){|h,(k,v)| h[k] = Array(v).first; h}.reject{|k,v| v.nil? || v == ''}
+end
+
+
+
+ +
+

+ + - (Object) callback_phase + + + +

+ + + + +
+
+
+
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+
+
# File 'oa-openid/lib/omniauth/strategies/open_id.rb', line 75
+
+def callback_phase
+  env['REQUEST_METHOD'] = 'GET'
+  openid = Rack::OpenID.new(lambda{|env| [200,{},[]]}, @store)
+  openid.call(env)
+  @openid_response = env.delete('rack.openid.response')
+  if @openid_response && @openid_response.status == :success
+    super
+  else
+    fail!(:invalid_credentials)
+  end
+end
+
+
+
+ +
+

+ + - (Object) callback_url + + + +

+ + + + +
+
+
+
+43
+44
+45
+46
+47
+
+
# File 'oa-openid/lib/omniauth/strategies/open_id.rb', line 43
+
+def callback_url
+  uri = URI.parse(request.url)
+  uri.path += '/callback'
+  uri.to_s
+end
+
+
+
+ +
+

+ + - (Object) dummy_app + + + +

+ + + + +
+
+
+
+34
+35
+36
+37
+38
+39
+40
+41
+
+
# File 'oa-openid/lib/omniauth/strategies/open_id.rb', line 34
+
+def dummy_app
+  lambda{|env| [401, {"WWW-Authenticate" => Rack::OpenID.build_header(
+    :identifier => identifier,
+    :return_to => callback_url,
+    :required => @options[:required],
+    :optional => @options[:optional]
+  )}, []]}
+end
+
+
+
+ +
+

+ + - (Object) get_identifier + + + +

+ + + + +
+
+
+
+68
+69
+70
+71
+72
+73
+
+
# File 'oa-openid/lib/omniauth/strategies/open_id.rb', line 68
+
+def get_identifier
+  OmniAuth::Form.build('OpenID Authentication') do
+    label_field('OpenID Identifier', IDENTIFIER_URL_PARAMETER)
+    input_field('url', IDENTIFIER_URL_PARAMETER)
+  end.to_response
+end
+
+
+
+ +
+

+ + - (Object) identifier + + + +

+ + + + +
+
+
+
+49
+50
+51
+
+
# File 'oa-openid/lib/omniauth/strategies/open_id.rb', line 49
+
+def identifier
+  options[:identifier] || request[IDENTIFIER_URL_PARAMETER]
+end
+
+
+
+ +
+

+ + - (Object) request_phase + + + +

+ + + + +
+
+
+
+53
+54
+55
+
+
# File 'oa-openid/lib/omniauth/strategies/open_id.rb', line 53
+
+def request_phase
+  identifier ? start : get_identifier
+end
+
+
+
+ +
+

+ + - (Object) sreg_user_info(response) + + + +

+ + + + +
+
+
+
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+
+
# File 'oa-openid/lib/omniauth/strategies/open_id.rb', line 98
+
+def (response)
+  sreg = ::OpenID::SReg::Response.from_success_response(response)
+  return {} unless sreg
+  {
+    'email' => sreg['email'],
+    'name' => sreg['fullname'],
+    'location' => sreg['postcode'],
+    'nickname' => sreg['nickname']
+  }.reject{|k,v| v.nil? || v == ''}
+end
+
+
+
+ +
+

+ + - (Object) start + + + +

+ + + + +
+
+
+
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+
+
# File 'oa-openid/lib/omniauth/strategies/open_id.rb', line 57
+
+def start
+  openid = Rack::OpenID.new(dummy_app, @store)
+  response = openid.call(env)
+  case env['rack.openid.response']
+  when Rack::OpenID::MissingResponse, Rack::OpenID::TimeoutResponse
+    fail!(:connection_failed)
+  else
+    response
+  end
+end
+
+
+
+ +
+

+ + - (Object) user_info(response) + + + +

+ + + + +
+
+
+
+94
+95
+96
+
+
# File 'oa-openid/lib/omniauth/strategies/open_id.rb', line 94
+
+def (response)
+  (response).merge((response))
+end
+
+
+
+ +
+ +
+ + + + + \ No newline at end of file diff --git a/OmniAuth/Strategies/Password.html b/OmniAuth/Strategies/Password.html new file mode 100644 index 000000000..bcab21491 --- /dev/null +++ b/OmniAuth/Strategies/Password.html @@ -0,0 +1,505 @@ + + + + +Class: OmniAuth::Strategies::Password + + + + + + + + + + + + + + + +

Class: OmniAuth::Strategies::Password + + + +

+ +
+ +
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+ + + + + + +
Includes:
+
OmniAuth::Strategy
+ + + + + +
Defined in:
+
oa-core/lib/omniauth/strategies/password.rb
+ +
+
+ + + + + + + +

Instance Attribute Summary (collapse)

+ + + + +

+ Instance Method Summary + (collapse) +

+ + + + + + + + + + + + +

Methods included from OmniAuth::Strategy

+

#call, #call!, #call_app!, #callback_url, #fail!, #full_host, included, #redirect, #request, #session, #user_info

+
+

Constructor Details

+ +
+

+ + - (Password) initialize(app, secret = 'changethisappsecret', options = {}) + + + +

+
+

+A new instance of Password +

+ + +
+
+
+ +
+ + + + +
+
+
+
+9
+10
+11
+12
+13
+
+
# File 'oa-core/lib/omniauth/strategies/password.rb', line 9
+
+def initialize(app, secret = 'changethisappsecret', options = {})
+  @options = options
+  @secret = secret
+  super(app, :password)
+end
+
+
+
+ +
+ +
+

Instance Attribute Details

+ + + + +
+

+ + - (Object) secret (readonly) + + + +

+
+

+Returns the value of attribute secret +

+ + +
+
+
+ +
+ + + + +
+
+
+
+15
+16
+17
+
+
# File 'oa-core/lib/omniauth/strategies/password.rb', line 15
+
+def secret
+  @secret
+end
+
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + - (Object) auth_hash(crypted_password) + + + +

+ + + + +
+
+
+
+26
+27
+28
+29
+30
+31
+32
+33
+
+
# File 'oa-core/lib/omniauth/strategies/password.rb', line 26
+
+def auth_hash(crypted_password)
+  OmniAuth::Utils.deep_merge(super(), {
+    'uid' => crypted_password,
+    'user_info' => {
+      @options[:identifier_key] => request[:identifier]
+    }
+  })
+end
+
+
+
+ +
+

+ + - (Object) callback_phase + + + +

+ + + + +
+
+
+
+35
+36
+37
+
+
# File 'oa-core/lib/omniauth/strategies/password.rb', line 35
+
+def callback_phase
+  call_app!
+end
+
+
+
+ +
+

+ + - (Object) encrypt(identifier, password) + + + +

+ + + + +
+
+
+
+39
+40
+41
+
+
# File 'oa-core/lib/omniauth/strategies/password.rb', line 39
+
+def encrypt(identifier, password)
+  Digest::SHA1.hexdigest([identifier, password, secret].join('::'))
+end
+
+
+
+ +
+

+ + - (Object) request_phase + + + +

+ + + + +
+
+
+
+17
+18
+19
+20
+21
+22
+23
+24
+
+
# File 'oa-core/lib/omniauth/strategies/password.rb', line 17
+
+def request_phase
+  return fail!(:missing_information) unless request[:identifier] && request[:password]
+  return fail!(:password_mismatch) if request[:password_confirmation] && request[:password_confirmation] != '' && request[:password] != request[:password_confirmation]
+  env['REQUEST_METHOD'] = 'GET'
+  env['PATH_INFO'] = request.path + '/callback'
+  env['omniauth.auth'] = auth_hash(encrypt(request[:identifier], request[:password]))
+  call_app!
+end
+
+
+
+ +
+ +
+ + + + + \ No newline at end of file diff --git a/OmniAuth/Strategies/ThirtySevenSignals.html b/OmniAuth/Strategies/ThirtySevenSignals.html new file mode 100644 index 000000000..76bf521ef --- /dev/null +++ b/OmniAuth/Strategies/ThirtySevenSignals.html @@ -0,0 +1,386 @@ + + + + +Class: OmniAuth::Strategies::ThirtySevenSignals + + + + + + + + + + + + + + + +

Class: OmniAuth::Strategies::ThirtySevenSignals + + + +

+ +
+ +
Inherits:
+
+ OAuth2 + +
    +
  • Object
  • + + + + + +
+ show all + +
+ + + + + + + + + +
Defined in:
+
oa-oauth/lib/omniauth/strategies/thirty_seven_signals.rb
+ +
+
+ + + + + + + + + + + + + +

+ Instance Method Summary + (collapse) +

+ + + + + + + + + + + + + + + + + +

Methods included from OmniAuth::Strategy

+

#call, #call!, #call_app!, #callback_phase, #callback_url, #fail!, #full_host, included, #redirect, #request, #request_phase, #session

+
+

Constructor Details

+ +
+

+ + - (ThirtySevenSignals) initialize(app, app_id, app_secret, options = {}) + + + +

+
+

+A new instance of ThirtySevenSignals +

+ + +
+
+
+ +
+ + + + +
+
+
+
+7
+8
+9
+10
+11
+12
+
+
# File 'oa-oauth/lib/omniauth/strategies/thirty_seven_signals.rb', line 7
+
+def initialize(app, app_id, app_secret, options = {})
+  options[:site] = 'https://launchpad.37signals.com/'
+  options[:authorize_path] = '/authorization/new'
+  options[:access_token_path] = '/authorization/token'
+  super(app, :thirty_seven_signals, app_id, app_secret, options)
+end
+
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + - (Object) auth_hash + + + +

+ + + + +
+
+
+
+27
+28
+29
+30
+31
+32
+33
+34
+35
+
+
# File 'oa-oauth/lib/omniauth/strategies/thirty_seven_signals.rb', line 27
+
+def auth_hash
+  OmniAuth::Utils.deep_merge(super, {
+    'uid' => user_data['identity']['id'],
+    'user_info' => ,
+    'extra' => {
+      'accounts' => user_data['accounts']
+    }
+  })
+end
+
+
+
+ +
+

+ + - (Object) user_data + + + +

+ + + + +
+
+
+
+14
+15
+16
+
+
# File 'oa-oauth/lib/omniauth/strategies/thirty_seven_signals.rb', line 14
+
+def user_data
+  @data ||= MultiJson.decode(@access_token.get('/authorization.json'))
+end
+
+
+
+ +
+

+ + - (Object) user_info + + + +

+ + + + +
+
+
+
+18
+19
+20
+21
+22
+23
+24
+25
+
+
# File 'oa-oauth/lib/omniauth/strategies/thirty_seven_signals.rb', line 18
+
+def 
+  {
+    'email' => user_data['identity']['email_address'],
+    'first_name' => user_data['identity']['first_name'],
+    'last_name' => user_data['identity']['last_name'],
+    'name' => [user_data['identity']['first_name'], user_data['identity']['last_name']].join(' ').strip
+  }
+end
+
+
+
+ +
+ +
+ + + + + \ No newline at end of file diff --git a/OmniAuth/Strategies/Twitter.html b/OmniAuth/Strategies/Twitter.html new file mode 100644 index 000000000..6d88ec1c4 --- /dev/null +++ b/OmniAuth/Strategies/Twitter.html @@ -0,0 +1,410 @@ + + + + +Class: OmniAuth::Strategies::Twitter + + + + + + + + + + + + + + + +

Class: OmniAuth::Strategies::Twitter + + + +

+ +
+ +
Inherits:
+
+ OAuth + +
    +
  • Object
  • + + + + + +
+ show all + +
+ + + + + + + + + +
Defined in:
+
oa-oauth/lib/omniauth/strategies/twitter.rb
+ +
+
+ +

Overview

+
+

+Authenticate to Twitter via OAuth and retrieve basic user information. +

+

+Usage: +

+
+   use OmniAuth::Strategies::, 'consumerkey', 'consumersecret'
+
+ + +
+
+
+ +
+ + + + + + + + + + + +

+ Instance Method Summary + (collapse) +

+ + + + + + + + + + + + +

Methods inherited from OAuth

+

#callback_phase, #request_phase, #unique_id

+ + + + + + + + +

Methods included from OmniAuth::Strategy

+

#call, #call!, #call_app!, #callback_phase, #callback_url, #fail!, #full_host, included, #redirect, #request, #request_phase, #session

+
+

Constructor Details

+ +
+

+ + - (Twitter) initialize(app, consumer_key, consumer_secret) + + + +

+
+

+A new instance of Twitter +

+ + +
+
+
+ +
+ + + + +
+
+
+
+15
+16
+17
+18
+19
+
+
# File 'oa-oauth/lib/omniauth/strategies/twitter.rb', line 15
+
+def initialize(app, consumer_key, consumer_secret)
+  super(app, :twitter, consumer_key, consumer_secret,
+          :site => 'https://api.twitter.com',
+          :authorize_path => '/oauth/authenticate')
+end
+
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + - (Object) auth_hash + + + +

+ + + + +
+
+
+
+21
+22
+23
+24
+25
+26
+27
+
+
# File 'oa-oauth/lib/omniauth/strategies/twitter.rb', line 21
+
+def auth_hash
+  OmniAuth::Utils.deep_merge(super, {
+    'uid' => @access_token.params[:user_id],
+    'user_info' => ,
+    'extra' => {'user_hash' => user_hash}
+  })
+end
+
+
+
+ +
+

+ + - (Object) user_hash + + + +

+ + + + +
+
+
+
+42
+43
+44
+
+
# File 'oa-oauth/lib/omniauth/strategies/twitter.rb', line 42
+
+def user_hash
+  @user_hash ||= MultiJson.decode(@access_token.get('/1/account/verify_credentials.json').body)
+end
+
+
+
+ +
+

+ + - (Object) user_info + + + +

+ + + + +
+
+
+
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+
+
# File 'oa-oauth/lib/omniauth/strategies/twitter.rb', line 29
+
+def 
+  user_hash = self.user_hash
+  
+  {
+    'nickname' => user_hash['screen_name'],
+    'name' => user_hash['name'],
+    'location' => user_hash['location'],
+    'image' => user_hash['profile_image_url'],
+    'description' => user_hash['description'],
+    'urls' => {'Website' => user_hash['url']}
+  }
+end
+
+
+
+ +
+ +
+ + + + + \ No newline at end of file diff --git a/OmniAuth/Strategy.html b/OmniAuth/Strategy.html new file mode 100644 index 000000000..37c894aac --- /dev/null +++ b/OmniAuth/Strategy.html @@ -0,0 +1,952 @@ + + + + +Module: OmniAuth::Strategy + + + + + + + + + + + + + + + +

Module: OmniAuth::Strategy + + + +

+ +
+ + + + + + + +
Included in:
+
Strategies::CAS, Strategies::HttpBasic, Strategies::LDAP, Strategies::OAuth, Strategies::OAuth2, Strategies::OpenID, Strategies::Password
+ + + +
Defined in:
+
oa-core/lib/omniauth/strategy.rb
+ +
+
+ + + + + +

+ Class Method Summary + (collapse) +

+ + + +

+ Instance Method Summary + (collapse) +

+ + + + + + +
+

Class Method Details

+ + +
+

+ + + (Object) included(base) + + + +

+ + + + +
+
+
+
+7
+8
+9
+10
+11
+
+
# File 'oa-core/lib/omniauth/strategy.rb', line 7
+
+def self.included(base)
+  base.class_eval do
+    attr_reader :app, :name, :env
+  end
+end
+
+
+
+ +
+ +
+

Instance Method Details

+ + +
+

+ + - (Object) auth_hash + + + +

+ + + + +
+
+
+
+53
+54
+55
+56
+57
+58
+
+
# File 'oa-core/lib/omniauth/strategy.rb', line 53
+
+def auth_hash
+  {
+    'provider' => name.to_s,
+    'uid' => nil
+  }
+end
+
+
+
+ +
+

+ + - (Object) call(env) + + + +

+ + + + +
+
+
+
+18
+19
+20
+
+
# File 'oa-core/lib/omniauth/strategy.rb', line 18
+
+def call(env)
+  dup.call!(env)
+end
+
+
+
+ +
+

+ + - (Object) call!(env) + + + +

+ + + + +
+
+
+
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+
+
# File 'oa-core/lib/omniauth/strategy.rb', line 22
+
+def call!(env)
+  @env = env
+  if request.path == "#{OmniAuth.config.path_prefix}/#{name}"
+    request_phase
+  elsif request.path == "#{OmniAuth.config.path_prefix}/#{name}/callback"
+    callback_phase
+  else
+    if respond_to?(:other_phase)
+      other_phase
+    else
+      call_app!
+    end
+  end
+end
+
+
+
+ +
+

+ + - (Object) call_app! + + + +

+ + + + +
+
+
+
+46
+47
+48
+49
+50
+51
+
+
# File 'oa-core/lib/omniauth/strategy.rb', line 46
+
+def call_app!
+  @env['rack.auth'] = env['omniauth.auth'] if env.key?('omniauth.auth')
+  @env['rack.auth.error'] = env['omniauth.error'] if env.key?('omniauth.error')
+  
+  @app.call(@env)
+end
+
+
+
+ +
+

+ + - (Object) callback_phase + + + +

+ + + + +
+
+
+
+41
+42
+43
+44
+
+
# File 'oa-core/lib/omniauth/strategy.rb', line 41
+
+def callback_phase
+  @env['omniauth.auth'] = auth_hash
+  call_app!
+end
+
+
+
+ +
+

+ + - (Object) callback_url + + + +

+ + + + +
+
+
+
+67
+68
+69
+
+
# File 'oa-core/lib/omniauth/strategy.rb', line 67
+
+def callback_url
+  full_host + "#{OmniAuth.config.path_prefix}/#{name}/callback"
+end
+
+
+
+ +
+

+ + - (Object) fail!(message_key, exception = nil) + + + +

+ + + + +
+
+
+
+87
+88
+89
+90
+
+
# File 'oa-core/lib/omniauth/strategy.rb', line 87
+
+def fail!(message_key, exception = nil)
+  self.env['omniauth.error'] = exception
+  OmniAuth.config.on_failure.call(self.env, message_key.to_sym)
+end
+
+
+
+ +
+

+ + - (Object) full_host + + + +

+ + + + +
+
+
+
+60
+61
+62
+63
+64
+65
+
+
# File 'oa-core/lib/omniauth/strategy.rb', line 60
+
+def full_host
+  uri = URI.parse(request.url)
+  uri.path = ''
+  uri.query = nil
+  uri.to_s
+end
+
+
+
+ +
+

+ + - (Strategy) initialize(app, name, *args) + + + +

+
+

+A new instance of Strategy +

+ + +
+
+
+ +
+ + + + +
+
+
+
+13
+14
+15
+16
+
+
# File 'oa-core/lib/omniauth/strategy.rb', line 13
+
+def initialize(app, name, *args)
+  @app = app
+  @name = name.to_sym
+end
+
+
+
+ +
+

+ + - (Object) redirect(uri) + + + +

+ + + + +
+
+
+
+79
+80
+81
+82
+83
+
+
# File 'oa-core/lib/omniauth/strategy.rb', line 79
+
+def redirect(uri)
+  r = Rack::Response.new("Redirecting to #{uri}...")
+  r.redirect(uri)
+  r.finish
+end
+
+
+
+ +
+

+ + - (Object) request + + + +

+ + + + +
+
+
+
+75
+76
+77
+
+
# File 'oa-core/lib/omniauth/strategy.rb', line 75
+
+def request
+  @request ||= Rack::Request.new(@env)
+end
+
+
+
+ +
+

+ + - (Object) request_phase + + + +

+
+ + +
+
+
+

Raises:

+
    + +
  • + + (NotImplementedError) + + + + +
  • + +
+ +
+ + + + +
+
+
+
+37
+38
+39
+
+
# File 'oa-core/lib/omniauth/strategy.rb', line 37
+
+def request_phase
+  raise NotImplementedError
+end
+
+
+
+ +
+

+ + - (Object) session + + + +

+ + + + +
+
+
+
+71
+72
+73
+
+
# File 'oa-core/lib/omniauth/strategy.rb', line 71
+
+def session
+  @env['rack.session']
+end
+
+
+
+ +
+

+ + - (Object) user_info + + + +

+ + + + +
+
+
+
+85
+
+
# File 'oa-core/lib/omniauth/strategy.rb', line 85
+
+def ; {} end
+
+
+
+ +
+ +
+ + + + + \ No newline at end of file diff --git a/OmniAuth/Test.html b/OmniAuth/Test.html new file mode 100644 index 000000000..628490d3c --- /dev/null +++ b/OmniAuth/Test.html @@ -0,0 +1,106 @@ + + + + +Module: OmniAuth::Test + + + + + + + + + + + + + + + +

Module: OmniAuth::Test + + + +

+ +
+ + + + + + + + +
Defined in:
+
oa-core/lib/omniauth/test.rb,
+ oa-core/lib/omniauth/test/strategy_macros.rb,
oa-core/lib/omniauth/test/strategy_test_case.rb
+
+ +
+
+ +

Overview

+
+

+Support for testing OmniAuth strategies. +

+ + +
+
+
+ +

Defined Under Namespace

+

+ + + Modules: StrategyMacros, StrategyTestCase + + + + Classes: PhonySession + + +

+ + + + + +
+ + + + + \ No newline at end of file diff --git a/OmniAuth/Test/PhonySession.html b/OmniAuth/Test/PhonySession.html new file mode 100644 index 000000000..a30779f61 --- /dev/null +++ b/OmniAuth/Test/PhonySession.html @@ -0,0 +1,233 @@ + + + + +Class: OmniAuth::Test::PhonySession + + + + + + + + + + + + + + + +

Class: OmniAuth::Test::PhonySession + + + +

+ +
+ +
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+ + + + + + + + + +
Defined in:
+
oa-core/lib/omniauth/test/phony_session.rb
+ +
+
+ + + + + +

+ Instance Method Summary + (collapse) +

+ + + + +
+

Constructor Details

+ +
+

+ + - (PhonySession) initialize(app) + + + +

+
+

+A new instance of PhonySession +

+ + +
+
+
+ +
+ + + + +
+
+
+
+2
+
+
# File 'oa-core/lib/omniauth/test/phony_session.rb', line 2
+
+def initialize(app) @app = app end
+
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + - (Object) call(env) + + + +

+ + + + +
+
+
+
+3
+4
+5
+6
+7
+
+
# File 'oa-core/lib/omniauth/test/phony_session.rb', line 3
+
+def call(env)
+  @session ||= (env['rack.session'] || {})
+  env['rack.session'] = @session
+  @app.call(env)
+end
+
+
+
+ +
+ +
+ + + + + \ No newline at end of file diff --git a/OmniAuth/Test/StrategyMacros.html b/OmniAuth/Test/StrategyMacros.html new file mode 100644 index 000000000..583094108 --- /dev/null +++ b/OmniAuth/Test/StrategyMacros.html @@ -0,0 +1,260 @@ + + + + +Module: OmniAuth::Test::StrategyMacros + + + + + + + + + + + + + + + +

Module: OmniAuth::Test::StrategyMacros + + + +

+ +
+ + + + + + + + +
Defined in:
+
oa-core/lib/omniauth/test/strategy_macros.rb
+ +
+
+ + + + + +

+ Instance Method Summary + (collapse) +

+ + + + + + +
+

Instance Method Details

+ + +
+

+ + - (Object) sets_an_auth_hash + + + +

+ + + + +
+
+
+
+7
+8
+9
+10
+11
+
+
# File 'oa-core/lib/omniauth/test/strategy_macros.rb', line 7
+
+def sets_an_auth_hash
+  it 'should set an auth hash' do
+    last_request.env['omniauth.auth'].should be_kind_of(Hash)
+  end
+end
+
+
+
+ +
+

+ + - (Object) sets_provider_to(provider) + + + +

+ + + + +
+
+
+
+13
+14
+15
+16
+17
+
+
# File 'oa-core/lib/omniauth/test/strategy_macros.rb', line 13
+
+def sets_provider_to(provider)
+  it "should set the provider to #{provider}" do
+    (last_request.env['omniauth.auth'] || {})['provider'].should == provider
+  end
+end
+
+
+
+ +
+

+ + - (Object) sets_uid_to(uid) + + + +

+ + + + +
+
+
+
+19
+20
+21
+22
+23
+
+
# File 'oa-core/lib/omniauth/test/strategy_macros.rb', line 19
+
+def sets_uid_to(uid)
+  it "should set the UID to #{uid}" do
+    (last_request.env['omniauth.auth'] || {})['uid'].should == uid
+  end
+end
+
+
+
+ +
+ +
+ + + + + \ No newline at end of file diff --git a/OmniAuth/Test/StrategyTestCase.html b/OmniAuth/Test/StrategyTestCase.html new file mode 100644 index 000000000..d75fd3b76 --- /dev/null +++ b/OmniAuth/Test/StrategyTestCase.html @@ -0,0 +1,302 @@ + + + + +Module: OmniAuth::Test::StrategyTestCase + + + + + + + + + + + + + + + +

Module: OmniAuth::Test::StrategyTestCase + + + +

+ +
+ + + + + + + + +
Defined in:
+
oa-core/lib/omniauth/test/strategy_test_case.rb
+ +
+
+ +

Overview

+
+

+Support for testing OmniAuth strategies. Usage: +

+
+  class MyStrategyTest < Test::Unit::TestCase
+    include OmniAuth::Test::StrategyTestCase
+    def strategy
+      # return the parameters to a Rack::Builder map call:
+      [MyStrategy.new, :some, :configuration, :options => 'here']
+    end
+    setup do
+      post '/auth/my_strategy/callback', :user => { 'name' => 'Dylan', 'id' => '445' }
+    end
+  end
+
+ + +
+
+
+ +
+ + + +

+ Instance Method Summary + (collapse) +

+ + + + + + +
+

Instance Method Details

+ + +
+

+ + - (Object) app + + + +

+ + + + +
+
+
+
+22
+23
+24
+25
+26
+27
+28
+29
+
+
# File 'oa-core/lib/omniauth/test/strategy_test_case.rb', line 22
+
+def app
+  strategy = self.strategy
+  Rack::Builder.new {
+    use OmniAuth::Test::PhonySession
+    use *strategy
+    run lambda { |env| [200, {'Content-Type' => 'text/plain'}, [Rack::Request.new(env).params.key?('auth').to_s]] }
+  }.to_app
+end
+
+
+
+ +
+

+ + - (Object) session + + + +

+ + + + +
+
+
+
+31
+32
+33
+
+
# File 'oa-core/lib/omniauth/test/strategy_test_case.rb', line 31
+
+def session
+  last_request.env['rack.session']
+end
+
+
+
+ +
+

+ + - (Object) strategy + + + +

+
+ + +
+
+
+

Raises:

+
    + +
  • + + (NotImplementedError) + + + + +
  • + +
+ +
+ + + + +
+
+
+
+35
+36
+37
+
+
# File 'oa-core/lib/omniauth/test/strategy_test_case.rb', line 35
+
+def strategy
+  raise NotImplementedError.new('Including specs must define #strategy')
+end
+
+
+
+ +
+ +
+ + + + + \ No newline at end of file diff --git a/OmniAuth/Utils.html b/OmniAuth/Utils.html new file mode 100644 index 000000000..7b688884e --- /dev/null +++ b/OmniAuth/Utils.html @@ -0,0 +1,301 @@ + + + + +Module: OmniAuth::Utils + + + + + + + + + + + + + + + +

Module: OmniAuth::Utils + + + +

+ +
+ + + + + + + + +
Defined in:
+
oa-core/lib/omniauth/core.rb
+ +
+
+ + +

Constant Summary

+ +
+ +
CAMELIZE_SPECIAL = + +
+
{
+  'oauth' => 'OAuth',
+  'oauth2' => 'OAuth2',
+  'openid' => 'OpenID',
+  'open_id' => 'OpenID',
+  'github' => 'GitHub'
+}
+
+ +
+ + + + + +

+ Instance Method Summary + (collapse) +

+ + + + + + +
+

Instance Method Details

+ + +
+

+ + - (Object) camelize(word, first_letter_in_uppercase = true) + + + +

+ + + + +
+
+
+
+85
+86
+87
+88
+89
+90
+91
+92
+93
+
+
# File 'oa-core/lib/omniauth/core.rb', line 85
+
+def camelize(word, first_letter_in_uppercase = true)
+  return CAMELIZE_SPECIAL[word.to_s] if CAMELIZE_SPECIAL[word.to_s]
+
+  if first_letter_in_uppercase
+    word.to_s.gsub(/\/(.?)/) { "::" + $1.upcase }.gsub(/(^|_)(.)/) { $2.upcase }
+  else
+    word.first + camelize(word)[1..-1]
+  end
+end
+
+
+
+ +
+

+ + - (Object) deep_merge(hash, other_hash) + + + +

+ + + + +
+
+
+
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+
+
# File 'oa-core/lib/omniauth/core.rb', line 70
+
+def deep_merge(hash, other_hash)
+  target = hash.dup
+
+  other_hash.keys.each do |key|
+    if other_hash[key].is_a? ::Hash and hash[key].is_a? ::Hash
+      target[key] = deep_merge(target[key],other_hash[key])
+      next
+    end
+
+    target[key] = other_hash[key]
+  end
+
+  target
+end
+
+
+
+ +
+

+ + - (Object) form_css + + + +

+ + + + +
+
+
+
+66
+67
+68
+
+
# File 'oa-core/lib/omniauth/core.rb', line 66
+
+def form_css
+  "<style type='text/css'>#{OmniAuth.config.form_css}</style>"
+end
+
+
+
+ +
+ +
+ + + + + \ No newline at end of file diff --git a/OpenID.html b/OpenID.html new file mode 100644 index 000000000..84741fc14 --- /dev/null +++ b/OpenID.html @@ -0,0 +1,248 @@ + + + + +Module: OpenID + + + + + + + + + + + + + + + +

Module: OpenID + + + +

+ +
+ + + + + + + + +
Defined in:
+
oa-openid/lib/omniauth/openid/gapps.rb
+ +
+
+ + + + + +

+ Class Method Summary + (collapse) +

+ + + + + + +
+

Class Method Details

+ + +
+

+ + + (Object) discover(uri) + + + +

+
+

+Because gapps_openid changes the discovery order (looking first for Google +Apps, then anything else), we need to monkeypatch it to make it play nicely +with others. +

+ + +
+
+
+ +
+ + + + +
+
+
+
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+
+
# File 'oa-openid/lib/omniauth/openid/gapps.rb', line 9
+
+def self.discover(uri)
+  discovered = self.default_discover(uri)
+  
+  if discovered.last.empty?
+    info = discover_google_apps(uri) 
+    return info if info
+  end
+  
+  return discovered
+rescue OpenID::DiscoveryFailure => e
+  info = discover_google_apps(uri)
+  
+  if info.nil?
+    raise e
+  else
+    return info
+  end
+end
+
+
+
+ +
+

+ + + (Object) discover_google_apps(uri) + + + +

+ + + + +
+
+
+
+28
+29
+30
+31
+
+
# File 'oa-openid/lib/omniauth/openid/gapps.rb', line 28
+
+def self.discover_google_apps(uri)
+  discovery = GoogleDiscovery.new
+  discovery.perform_discovery(uri)
+end
+
+
+
+ +
+ +
+ + + + + \ No newline at end of file diff --git a/_index.html b/_index.html new file mode 100644 index 000000000..9c322feab --- /dev/null +++ b/_index.html @@ -0,0 +1,436 @@ + + + + +Documentation by YARD 0.6.1 + + + + + + + + + + + + + + + +
+

Documentation by YARD 0.6.1

+

Alphabetic Index

+ + +

File Listing

+ + +
+ +

Namespace Listing A-Z

+ + + + + + + + +
+ + +
    +
  • A
  • + +
+ + +
    +
  • B
  • +
      + +
    • + Builder + + (OmniAuth) + +
    • + +
    +
+ + + + + +
    +
  • F
  • +
      + +
    • + Facebook + + (OmniAuth::Strategies) + +
    • + +
    • + Form + + (OmniAuth) + +
    • + +
    • + Foursquare + + (OmniAuth::Strategies) + +
    • + +
    +
+ + +
    +
  • G
  • +
      + +
    • + GitHub + + (OmniAuth::Strategies) + +
    • + +
    • + GoogleApps + + (OmniAuth::Strategies) + +
    • + +
    • + Gowalla + + (OmniAuth::Strategies) + +
    • + +
    +
+ + +
    +
  • H
  • +
      + +
    • + HttpBasic + + (OmniAuth::Strategies) + +
    • + +
    +
+ + +
    +
  • I
  • +
      + +
    • + Identica + + (OmniAuth::Strategies) + +
    • + +
    +
+ + +
+ + +
    +
  • L
  • +
      + +
    • + LDAP + + (OmniAuth::Strategies) + +
    • + +
    • + LdapError + + (OmniAuth::Strategies::LDAP::Adaptor) + +
    • + +
    • + LinkedIn + + (OmniAuth::Strategies) + +
    • + +
    +
+ + +
    +
  • O
  • +
      + +
    • + OAuth + + (OmniAuth::Strategies) + +
    • + +
    • + OAuth2 + + (OmniAuth::Strategies) + +
    • + +
    • + OmniAuth + +
    • + +
    • + OpenID + +
    • + +
    • + OpenID + + (OmniAuth::Strategies) + +
    • + +
    +
+ + +
    +
  • P
  • + +
+ + + + + + + + +
    +
  • U
  • +
      + +
    • + Utils + + (OmniAuth) + +
    • + +
    +
+ +
+
+ + + + + \ No newline at end of file diff --git a/class_list.html b/class_list.html new file mode 100644 index 000000000..77faec94c --- /dev/null +++ b/class_list.html @@ -0,0 +1,36 @@ + + + + + + + + + + + + +
+

Class List

+ + + + +
+ + + diff --git a/css/common.css b/css/common.css new file mode 100644 index 000000000..cf25c4523 --- /dev/null +++ b/css/common.css @@ -0,0 +1 @@ +/* Override this file with custom rules */ \ No newline at end of file diff --git a/css/full_list.css b/css/full_list.css new file mode 100644 index 000000000..f95e4e68e --- /dev/null +++ b/css/full_list.css @@ -0,0 +1,53 @@ +body { + margin: 0; + font-family: "Lucida Sans", "Lucida Grande", Verdana, Arial, sans-serif; + font-size: 13px; + height: 101%; + overflow-x: hidden; +} + +h1 { padding: 12px 10px; padding-bottom: 0; margin: 0; font-size: 1.4em; } +.clear { clear: both; } +#search { position: absolute; right: 5px; top: 9px; padding-left: 24px; } +#content.insearch #search, #content.insearch #noresults { background: url(data:image/gif;base64,R0lGODlhEAAQAPYAAP///wAAAPr6+pKSkoiIiO7u7sjIyNjY2J6engAAAI6OjsbGxjIyMlJSUuzs7KamppSUlPLy8oKCghwcHLKysqSkpJqamvT09Pj4+KioqM7OzkRERAwMDGBgYN7e3ujo6Ly8vCoqKjY2NkZGRtTU1MTExDw8PE5OTj4+PkhISNDQ0MrKylpaWrS0tOrq6nBwcKysrLi4uLq6ul5eXlxcXGJiYoaGhuDg4H5+fvz8/KKiohgYGCwsLFZWVgQEBFBQUMzMzDg4OFhYWBoaGvDw8NbW1pycnOLi4ubm5kBAQKqqqiQkJCAgIK6urnJyckpKSjQ0NGpqatLS0sDAwCYmJnx8fEJCQlRUVAoKCggICLCwsOTk5ExMTPb29ra2tmZmZmhoaNzc3KCgoBISEiIiIgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH/C05FVFNDQVBFMi4wAwEAAAAh/hpDcmVhdGVkIHdpdGggYWpheGxvYWQuaW5mbwAh+QQJCAAAACwAAAAAEAAQAAAHaIAAgoMgIiYlg4kACxIaACEJCSiKggYMCRselwkpghGJBJEcFgsjJyoAGBmfggcNEx0flBiKDhQFlIoCCA+5lAORFb4AJIihCRbDxQAFChAXw9HSqb60iREZ1omqrIPdJCTe0SWI09GBACH5BAkIAAAALAAAAAAQABAAAAdrgACCgwc0NTeDiYozCQkvOTo9GTmDKy8aFy+NOBA7CTswgywJDTIuEjYFIY0JNYMtKTEFiRU8Pjwygy4ws4owPyCKwsMAJSTEgiQlgsbIAMrO0dKDGMTViREZ14kYGRGK38nHguHEJcvTyIEAIfkECQgAAAAsAAAAABAAEAAAB2iAAIKDAggPg4iJAAMJCRUAJRIqiRGCBI0WQEEJJkWDERkYAAUKEBc4Po1GiKKJHkJDNEeKig4URLS0ICImJZAkuQAhjSi/wQyNKcGDCyMnk8u5rYrTgqDVghgZlYjcACTA1sslvtHRgQAh+QQJCAAAACwAAAAAEAAQAAAHZ4AAgoOEhYaCJSWHgxGDJCQARAtOUoQRGRiFD0kJUYWZhUhKT1OLhR8wBaaFBzQ1NwAlkIszCQkvsbOHL7Y4q4IuEjaqq0ZQD5+GEEsJTDCMmIUhtgk1lo6QFUwJVDKLiYJNUd6/hoEAIfkECQgAAAAsAAAAABAAEAAAB2iAAIKDhIWGgiUlh4MRgyQkjIURGRiGGBmNhJWHm4uen4ICCA+IkIsDCQkVACWmhwSpFqAABQoQF6ALTkWFnYMrVlhWvIKTlSAiJiVVPqlGhJkhqShHV1lCW4cMqSkAR1ofiwsjJyqGgQAh+QQJCAAAACwAAAAAEAAQAAAHZ4AAgoOEhYaCJSWHgxGDJCSMhREZGIYYGY2ElYebi56fhyWQniSKAKKfpaCLFlAPhl0gXYNGEwkhGYREUywag1wJwSkHNDU3D0kJYIMZQwk8MjPBLx9eXwuETVEyAC/BOKsuEjYFhoEAIfkECQgAAAAsAAAAABAAEAAAB2eAAIKDhIWGgiUlh4MRgyQkjIURGRiGGBmNhJWHm4ueICImip6CIQkJKJ4kigynKaqKCyMnKqSEK05StgAGQRxPYZaENqccFgIID4KXmQBhXFkzDgOnFYLNgltaSAAEpxa7BQoQF4aBACH5BAkIAAAALAAAAAAQABAAAAdogACCg4SFggJiPUqCJSWGgkZjCUwZACQkgxGEXAmdT4UYGZqCGWQ+IjKGGIUwPzGPhAc0NTewhDOdL7Ykji+dOLuOLhI2BbaFETICx4MlQitdqoUsCQ2vhKGjglNfU0SWmILaj43M5oEAOwAAAAAAAAAAAA==) no-repeat center left; } +#full_list { padding: 0; list-style: none; margin-left: 0; } +#full_list ul { padding: 0; } +#full_list li { padding: 5px; padding-left: 12px; margin: 0; font-size: 1.1em; list-style: none; } +#noresults { padding: 7px 12px; } +#content.insearch #noresults { margin-left: 7px; } +ul.collapsed ul, ul.collapsed li { display: none; } +li a.toggle { cursor: default; position: relative; left: -5px; top: 4px; text-indent: -999px; width: 10px; height: 9px; margin-left: -10px; display: block; float: left; background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAASCAYAAABb0P4QAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAK8AAACvABQqw0mAAAABx0RVh0U29mdHdhcmUAQWRvYmUgRmlyZXdvcmtzIENTM5jWRgMAAAAVdEVYdENyZWF0aW9uIFRpbWUAMy8xNC8wOeNZPpQAAAE2SURBVDiNrZTBccIwEEXfelIAHUA6CZ24BGaWO+FuzZAK4k6gg5QAdGAq+Bxs2Yqx7BzyL7Llp/VfzZeQhCTc/ezuGzKKnKSzpCxXJM8fwNXda3df5RZETlIt6YUzSQDs93sl8w3wBZxCCE10GM1OcWbWjB2mWgEH4Mfdyxm3PSepBHibgQE2wLe7r4HjEidpnXMYdQPKEMJcsZ4zs2POYQOcaPfwMVOo58zsAdMt18BuoVDPxUJRacELbXv3hUIX2vYmOUvi8C8ydz/ThjXrqKqqLbDIAdsCKBd+Wo7GWa7o9qzOQHVVVXeAbs+yHHCH4aTsaCOQqunmUy1yBUAXkdMIfMlgF5EXLo2OpV/c/Up7jG4hhHcYLgWzAZXUc2b2ixsfvc/RmNNfOXD3Q/oeL9axJE1yT9IOoUu6MGUkAAAAAElFTkSuQmCC) no-repeat bottom left; } +li.collapsed a.toggle { opacity: 0.5; cursor: default; background-position: top left; } +li { color: #888; cursor: pointer; } +li.deprecated { text-decoration: line-through; font-style: italic; } +li.r1 { background: #f0f0f0; } +li.r2 { background: #fafafa; } +li:hover { background: #ddd; } +li small:before { content: "("; } +li small:after { content: ")"; } +li small.search_info { display: none; } +a:link, a:visited { text-decoration: none; color: #05a; } +li.clicked { background: #05a; color: #ccc; } +li.clicked a:link, li.clicked a:visited { color: #eee; } +li.clicked a.toggle { opacity: 0.5; background-position: bottom right; } +li.collapsed.clicked a.toggle { background-position: top right; } +#search input { border: 1px solid #bbb; -moz-border-radius: 3px; -webkit-border-radius: 3px; } +#nav { margin-left: 10px; font-size: 0.9em; display: none; color: #aaa; } +#nav a:link, #nav a:visited { color: #358; } +#nav a:hover { background: transparent; color: #5af; } + +.frames #content h1 { margin-top: 0; } +.frames li { white-space: nowrap; cursor: normal; } +.frames li small { display: block; font-size: 0.8em; } +.frames li small:before { content: ""; } +.frames li small:after { content: ""; } +.frames li small.search_info { display: none; } +.frames #search { width: 170px; position: static; margin: 3px; margin-left: 10px; font-size: 0.9em; color: #888; padding-left: 0; padding-right: 24px; } +.frames #content.insearch #search { background-position: center right; } +.frames #search input { width: 110px; } +.frames #nav { display: block; } + +#full_list.insearch li { display: none; } +#full_list.insearch li.found { display: list-item; padding-left: 10px; } +#full_list.insearch li a.toggle { display: none; } +#full_list.insearch li small.search_info { display: block; } diff --git a/css/style.css b/css/style.css new file mode 100644 index 000000000..c752b1107 --- /dev/null +++ b/css/style.css @@ -0,0 +1,307 @@ +body { + padding: 0 20px; + font-family: "Lucida Sans", "Lucida Grande", Verdana, Arial, sans-serif; + font-size: 13px; +} +body.frames { padding: 0 5px; } +h1 { font-size: 25px; margin: 1em 0 0.5em; padding-top: 4px; border-top: 1px dotted #d5d5d5; } +h1.noborder { border-top: 0px; margin-top: 0; padding-top: 4px; } +h1.title { margin-bottom: 10px; } +h1.alphaindex { margin-top: 0; font-size: 22px; } +h2 { + padding: 0; + padding-bottom: 3px; + border-bottom: 1px #aaa solid; + font-size: 1.4em; + margin: 1.8em 0 0.5em; +} +h2 small { font-weight: normal; font-size: 0.7em; display: block; float: right; } +.clear { clear: both; } +.inline { display: inline; } +.inline p:first-child { display: inline; } +.docstring h1, .docstring h2, .docstring h3, .docstring h4 { padding: 0; border: 0; border-bottom: 1px dotted #bbb; } +.docstring h1 { font-size: 1.2em; } +.docstring h2 { font-size: 1.1em; } +.docstring h3, .docstring h4 { font-size: 1em; border-bottom: 0; padding-top: 10px; } +.docstring .object_link { font-family: monospace; } + +.note { + color: #222; + -moz-border-radius: 3px; -webkit-border-radius: 3px; + background: #e3e4e3; border: 1px solid #d5d5d5; padding: 7px 10px; + display: block; +} +.note.todo { background: #ffffc5; border-color: #ececaa; } +.note.returns_void { background: #efefef; } +.note.deprecated { background: #ffe5e5; border-color: #e9dada; } +.note.private { background: #ffffc5; border-color: #ececaa; } +.note.title { text-transform: lowercase; padding: 1px 5px; margin-left: 5px; font-size: 0.9em; font-family: "Lucida Sans", "Lucida Grande", Verdana, Arial, sans-serif; display: inline; } +h1 .note.title { font-size: 0.5em; font-weight: normal; padding: 3px 5px; position: relative; top: -3px; text-transform: capitalize; } +.note.title.constructor { color: #fff; background: #6a98d6; border-color: #6689d6; } +.note.title.writeonly { color: #fff; background: #45a638; border-color: #2da31d; } +.note.title.readonly { color: #fff; background: #6a98d6; border-color: #6689d6; } +.note.title.private { background: #d5d5d5; border-color: #c5c5c5; } + +h3.inherited { + font-style: italic; + font-family: "Lucida Sans", "Lucida Grande", Verdana, Arial, sans-serif; + font-weight: normal; + padding: 0; + margin: 0; + margin-top: 12px; + margin-bottom: 3px; + font-size: 13px; +} +p.inherited { + padding: 0; + margin: 0; + margin-left: 25px; +} + +dl.box { + width: 520px; + font-size: 1em; +} +dl.box dt { + float: left; + display: block; + width: 100px; + margin: 0; + text-align: right; + font-weight: bold; + border: 1px solid #aaa; + border-width: 1px 0px 0px 1px; + padding: 6px 0; + padding-right: 10px; +} +dl.box dd { + float: left; + display: block; + width: 380px; + margin: 0; + padding: 6px 0; + padding-right: 20px; + border: 1px solid #aaa; + border-width: 1px 1px 0 0; +} +dl.box .last { + border-bottom: 1px solid #aaa; +} +dl.box .r1 { background: #eee; } + +ul.toplevel { list-style: none; padding-left: 0; font-size: 1.1em; } +#files { padding-left: 15px; font-size: 1.1em; } + +#files { padding: 0; } +#files li { list-style: none; display: inline; padding: 7px 12px; line-height: 35px; } + +dl.constants { margin-left: 40px; } +dl.constants dt { font-weight: bold; font-size: 1.1em; margin-bottom: 5px; } +dl.constants dd { width: 75%; white-space: pre; font-family: monospace; margin-bottom: 18px; } + +.summary_desc { margin-left: 32px; display: block; font-family: sans-serif; } +.summary_desc tt { font-size: 0.9em; } +dl.constants .note { padding: 2px 6px; padding-right: 12px; margin-top: 6px; } +dl.constants .docstring { margin-left: 32px; font-size: 0.9em; font-weight: normal; } +dl.constants .tags { padding-left: 32px; font-size: 0.9em; line-height: 0.8em; } +dl.constants .discussion *:first-child { margin-top: 0; } +dl.constants .discussion *:last-child { margin-bottom: 0; } + +.method_details { border-top: 1px dotted #aaa; margin-top: 15px; padding-top: 0; } +.method_details.first { border: 0; } +p.signature { + font-size: 1.1em; font-weight: normal; font-family: Monaco, Consolas, Courier, monospace; + padding: 6px 10px; margin-top: 18px; + background: #e5e8ff; border: 1px solid #d8d8e5; -moz-border-radius: 3px; -webkit-border-radius: 3px; +} +p.signature tt { font-family: Monaco, Consolas, Courier, monospace; } +p.signature .overload { display: block; } +p.signature .extras { font-weight: normal; font-family: sans-serif; color: #444; font-size: 1em; } +p.signature .aliases { display: block; font-weight: normal; font-size: 0.9em; font-family: sans-serif; margin-top: 0px; color: #555; } +p.signature .aliases .names { font-family: Monaco, Consolas, Courier, monospace; font-weight: bold; color: #000; font-size: 1.2em; } + +.tags h3 { font-size: 1em; margin-bottom: 0; } +.tags ul { margin-top: 5px; padding-left: 30px; list-style: square; } +.tags ul li { margin-bottom: 3px; } +.tags ul .name { font-family: monospace; font-weight: bold; } +.tags ul .note { padding: 3px 6px; } +.tags { margin-bottom: 12px; } + +.tags .examples h3 { margin-bottom: 10px; } +.tags .examples h4 { padding: 0; margin: 0; margin-left: 15px; font-weight: bold; font-size: 0.9em; } + +.tags .overload .overload_item { list-style: none; margin-bottom: 25px; } +.tags .overload .overload_item .signature { + padding: 2px 8px; + background: #e5e8ff; border: 1px solid #d8d8e5; -moz-border-radius: 3px; -webkit-border-radius: 3px; +} +.tags .overload .signature { margin-left: -15px; font-family: monospace; display: block; font-size: 1.1em; } +.tags .overload .docstring { margin-top: 15px; } + +.defines { display: none; } + +#method_missing_details .notice.this { position: relative; top: -8px; color: #888; padding: 0; margin: 0; } + +.showSource { font-size: 0.9em; } +.showSource a:link, .showSource a:visited { text-decoration: none; color: #666; } + +#content a:link, #content a:visited { text-decoration: none; color: #05a; } +#content a:hover { background: #ffffa5; } +.docstring { margin-right: 6em; } + +ul.summary { + list-style: none; + font-family: monospace; + font-size: 1em; + line-height: 1.5em; +} +ul.summary a:link, ul.summary a:visited { + text-decoration: none; font-size: 1.1em; +} +ul.summary li { margin-bottom: 5px; } +.summary .summary_signature { + padding: 1px 10px; + background: #eaeaff; border: 1px solid #dfdfe5; + -moz-border-radius: 3px; -webkit-border-radius: 3px; +} +.summary_signature:hover { background: #eeeeff; cursor: pointer; } +ul.summary.compact li { display: inline; margin-right: 5px; line-height: 2.6em;} +ul.summary.compact .summary_signature { padding: 5px 7px; padding-right: 4px; } +#content .summary_signature:hover a:link, +#content .summary_signature:hover a:visited { + background: transparent; + color: #48f; +} + +p.inherited a { font-family: monospace; font-size: 0.9em; } +p.inherited { word-spacing: 5px; font-size: 1.2em; } + +p.children { font-size: 1.2em; } +p.children a { font-size: 0.9em; } +p.children strong { font-size: 0.8em; } +p.children strong.modules { padding-left: 5px; } + +ul.fullTree { display: none; padding-left: 0; list-style: none; margin-left: 0; margin-bottom: 10px; } +ul.fullTree ul { margin-left: 0; padding-left: 0; list-style: none; } +ul.fullTree li { text-align: center; padding-top: 18px; padding-bottom: 12px; background: url(data:image/gif;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAACXBIWXMAAAsTAAALEwEAmpwYAAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgABeNMLCADATZvAMByH/w/qQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAFAtAGAnf+bTAICd+Jl7AQBblCEVAaCRACATZYhEAGg7AKzPVopFAFgwABRmS8Q5ANgtADBJV2ZIALC3AMDOEAuyAAgMADBRiIUpAAR7AGDIIyN4AISZABRG8lc88SuuEOcqAAB4mbI8uSQ5RYFbCC1xB1dXLh4ozkkXKxQ2YQJhmkAuwnmZGTKBNA/g88wAAKCRFRHgg/P9eM4Ors7ONo62Dl8t6r8G/yJiYuP+5c+rcEAAAOF0ftH+LC+zGoA7BoBt/qIl7gRoXgugdfeLZrIPQLUAoOnaV/Nw+H48PEWhkLnZ2eXk5NhKxEJbYcpXff5nwl/AV/1s+X48/Pf14L7iJIEyXYFHBPjgwsz0TKUcz5IJhGLc5o9H/LcL//wd0yLESWK5WCoU41EScY5EmozzMqUiiUKSKcUl0v9k4t8s+wM+3zUAsGo+AXuRLahdYwP2SycQWHTA4vcAAPK7b8HUKAgDgGiD4c93/+8//UegJQCAZkmScQAAXkQkLlTKsz/HCAAARKCBKrBBG/TBGCzABhzBBdzBC/xgNoRCJMTCQhBCCmSAHHJgKayCQiiGzbAdKmAv1EAdNMBRaIaTcA4uwlW4Dj1wD/phCJ7BKLyBCQRByAgTYSHaiAFiilgjjggXmYX4IcFIBBKLJCDJiBRRIkuRNUgxUopUIFVIHfI9cgI5h1xGupE7yAAygvyGvEcxlIGyUT3UDLVDuag3GoRGogvQZHQxmo8WoJvQcrQaPYw2oefQq2gP2o8+Q8cwwOgYBzPEbDAuxsNCsTgsCZNjy7EirAyrxhqwVqwDu4n1Y8+xdwQSgUXACTYEd0IgYR5BSFhMWE7YSKggHCQ0EdoJNwkDhFHCJyKTqEu0JroR+cQYYjIxh1hILCPWEo8TLxB7iEPENyQSiUMyJ7mQAkmxpFTSEtJG0m5SI+ksqZs0SBojk8naZGuyBzmULCAryIXkneTD5DPkG+Qh8lsKnWJAcaT4U+IoUspqShnlEOU05QZlmDJBVaOaUt2ooVQRNY9aQq2htlKvUYeoEzR1mjnNgxZJS6WtopXTGmgXaPdpr+h0uhHdlR5Ol9BX0svpR+iX6AP0dwwNhhWDx4hnKBmbGAcYZxl3GK+YTKYZ04sZx1QwNzHrmOeZD5lvVVgqtip8FZHKCpVKlSaVGyovVKmqpqreqgtV81XLVI+pXlN9rkZVM1PjqQnUlqtVqp1Q61MbU2epO6iHqmeob1Q/pH5Z/YkGWcNMw09DpFGgsV/jvMYgC2MZs3gsIWsNq4Z1gTXEJrHN2Xx2KruY/R27iz2qqaE5QzNKM1ezUvOUZj8H45hx+Jx0TgnnKKeX836K3hTvKeIpG6Y0TLkxZVxrqpaXllirSKtRq0frvTau7aedpr1Fu1n7gQ5Bx0onXCdHZ4/OBZ3nU9lT3acKpxZNPTr1ri6qa6UbobtEd79up+6Ynr5egJ5Mb6feeb3n+hx9L/1U/W36p/VHDFgGswwkBtsMzhg8xTVxbzwdL8fb8VFDXcNAQ6VhlWGX4YSRudE8o9VGjUYPjGnGXOMk423GbcajJgYmISZLTepN7ppSTbmmKaY7TDtMx83MzaLN1pk1mz0x1zLnm+eb15vft2BaeFostqi2uGVJsuRaplnutrxuhVo5WaVYVVpds0atna0l1rutu6cRp7lOk06rntZnw7Dxtsm2qbcZsOXYBtuutm22fWFnYhdnt8Wuw+6TvZN9un2N/T0HDYfZDqsdWh1+c7RyFDpWOt6azpzuP33F9JbpL2dYzxDP2DPjthPLKcRpnVOb00dnF2e5c4PziIuJS4LLLpc+Lpsbxt3IveRKdPVxXeF60vWdm7Obwu2o26/uNu5p7ofcn8w0nymeWTNz0MPIQ+BR5dE/C5+VMGvfrH5PQ0+BZ7XnIy9jL5FXrdewt6V3qvdh7xc+9j5yn+M+4zw33jLeWV/MN8C3yLfLT8Nvnl+F30N/I/9k/3r/0QCngCUBZwOJgUGBWwL7+Hp8Ib+OPzrbZfay2e1BjKC5QRVBj4KtguXBrSFoyOyQrSH355jOkc5pDoVQfujW0Adh5mGLw34MJ4WHhVeGP45wiFga0TGXNXfR3ENz30T6RJZE3ptnMU85ry1KNSo+qi5qPNo3ujS6P8YuZlnM1VidWElsSxw5LiquNm5svt/87fOH4p3iC+N7F5gvyF1weaHOwvSFpxapLhIsOpZATIhOOJTwQRAqqBaMJfITdyWOCnnCHcJnIi/RNtGI2ENcKh5O8kgqTXqS7JG8NXkkxTOlLOW5hCepkLxMDUzdmzqeFpp2IG0yPTq9MYOSkZBxQqohTZO2Z+pn5mZ2y6xlhbL+xW6Lty8elQfJa7OQrAVZLQq2QqboVFoo1yoHsmdlV2a/zYnKOZarnivN7cyzytuQN5zvn//tEsIS4ZK2pYZLVy0dWOa9rGo5sjxxedsK4xUFK4ZWBqw8uIq2Km3VT6vtV5eufr0mek1rgV7ByoLBtQFr6wtVCuWFfevc1+1dT1gvWd+1YfqGnRs+FYmKrhTbF5cVf9go3HjlG4dvyr+Z3JS0qavEuWTPZtJm6ebeLZ5bDpaql+aXDm4N2dq0Dd9WtO319kXbL5fNKNu7g7ZDuaO/PLi8ZafJzs07P1SkVPRU+lQ27tLdtWHX+G7R7ht7vPY07NXbW7z3/T7JvttVAVVN1WbVZftJ+7P3P66Jqun4lvttXa1ObXHtxwPSA/0HIw6217nU1R3SPVRSj9Yr60cOxx++/p3vdy0NNg1VjZzG4iNwRHnk6fcJ3/ceDTradox7rOEH0x92HWcdL2pCmvKaRptTmvtbYlu6T8w+0dbq3nr8R9sfD5w0PFl5SvNUyWna6YLTk2fyz4ydlZ19fi753GDborZ752PO32oPb++6EHTh0kX/i+c7vDvOXPK4dPKy2+UTV7hXmq86X23qdOo8/pPTT8e7nLuarrlca7nuer21e2b36RueN87d9L158Rb/1tWeOT3dvfN6b/fF9/XfFt1+cif9zsu72Xcn7q28T7xf9EDtQdlD3YfVP1v+3Njv3H9qwHeg89HcR/cGhYPP/pH1jw9DBY+Zj8uGDYbrnjg+OTniP3L96fynQ89kzyaeF/6i/suuFxYvfvjV69fO0ZjRoZfyl5O/bXyl/erA6xmv28bCxh6+yXgzMV70VvvtwXfcdx3vo98PT+R8IH8o/2j5sfVT0Kf7kxmTk/8EA5jz/GMzLdsAAAAgY0hSTQAAeiUAAICDAAD5/wAAgOkAAHUwAADqYAAAOpgAABdvkl/FRgAAAHtJREFUeNqMzrEJAkEURdGzuhgZbSoYWcAWoBVsB4JgZAGmphsZCZYzTQgWNCYrDN9RvMmHx+X916SUBFbo8CzD1idXrLErw1mQttgXtyrOcQ/Ny5p4Qh+2XqLYYazsPWNTiuMkRxa4vcV+evuNAUOLIx5+c2hyzv7hNQC67Q+/HHmlEwAAAABJRU5ErkJggg==) no-repeat top center; } +ul.fullTree li:first-child { padding-top: 0; background: transparent; } +ul.fullTree li:last-child { padding-bottom: 0; } +.showAll ul.fullTree { display: block; } +.showAll .inheritName { display: none; } + +#search { position: absolute; right: 14px; top: 0px; } +#search a:link, #search a:visited { + display: block; float: left; margin-right: 4px; + padding: 8px 10px; text-decoration: none; color: #05a; + border: 1px solid #d8d8e5; + -moz-border-radius-bottomleft: 3px; -moz-border-radius-bottomright: 3px; + -webkit-border-bottom-left-radius: 3px; -webkit-border-bottom-right-radius: 3px; + background: #eaf0ff; + -webkit-box-shadow: -1px 1px 3px #ddd; +} +#search a:hover { background: #f5faff; color: #06b; } +#search a.active { + background: #568; padding-bottom: 20px; color: #fff; border: 1px solid #457; + -moz-border-radius-topleft: 5px; -moz-border-radius-topright: 5px; + -webkit-border-top-left-radius: 5px; -webkit-border-top-right-radius: 5px; +} +#search a.inactive { color: #999; } +.frames #search { display: none; } +.inheritanceTree, .toggleDefines { float: right; } + +#menu { font-size: 1.3em; color: #bbb; top: -5px; position: relative; } +#menu .title, #menu a { font-size: 0.7em; } +#menu .title a { font-size: 1em; } +#menu .title { color: #555; } +#menu a:link, #menu a:visited { color: #333; text-decoration: none; border-bottom: 1px dotted #bbd; } +#menu a:hover { color: #05a; } +#menu .noframes { display: none; } +.frames #menu .noframes { display: inline; float: right; } + +#footer { margin-top: 15px; border-top: 1px solid #ccc; text-align: center; padding: 7px 0; color: #999; } +#footer a:link, #footer a:visited { color: #444; text-decoration: none; border-bottom: 1px dotted #bbd; } +#footer a:hover { color: #05a; } + +#listing ul.alpha { font-size: 1.1em; } +#listing ul.alpha { margin: 0; padding: 0; padding-bottom: 10px; list-style: none; } +#listing ul.alpha li.letter { font-size: 1.4em; padding-bottom: 10px; } +#listing ul.alpha ul { margin: 0; padding-left: 15px; } +#listing ul small { color: #666; font-size: 0.7em; } + +li.r1 { background: #f0f0f0; } +li.r2 { background: #fafafa; } + +#search_frame { + z-index: 9999; + background: #fff; + display: none; + position: absolute; + top: 36px; + right: 18px; + width: 500px; + height: 80%; + overflow-y: scroll; + border: 1px solid #999; + border-collapse: collapse; + -webkit-box-shadow: -7px 5px 25px #aaa; + -moz-box-shadow: -7px 5px 25px #aaa; + -moz-border-radius: 2px; + -webkit-border-radius: 2px; +} + +#content ul.summary li.deprecated a:link, +#content ul.summary li.deprecated a:visited { text-decoration: line-through; font-style: italic; } + +#toc { + padding: 20px; padding-right: 30px; border: 1px solid #ddd; float: right; background: #fff; margin-left: 20px; margin-bottom: 20px; + max-width: 300px; + -webkit-box-shadow: -2px 2px 6px #bbb; + -moz-box-shadow: -2px 2px 6px #bbb; + z-index: 5000; + position: relative; +} +#toc.nofloat { float: none; max-width: none; border: none; padding: 0; margin: 20px 0; -webkit-box-shadow: none; -moz-box-shadow: none; } +#toc.nofloat.hidden { padding: 0; background: 0; margin-bottom: 5px; } +#toc .title { margin: 0; } +#toc ol { padding-left: 1.8em; } +#toc li { font-size: 1.1em; line-height: 1.7em; } +#toc > ol > li { font-size: 1.1em; font-weight: bold; } +#toc ol > ol { font-size: 0.9em; } +#toc ol ol > ol { padding-left: 2.3em; } +#toc ol + li { margin-top: 0.3em; } +#toc.hidden { padding: 10px; background: #f6f6f6; -webkit-box-shadow: none; -moz-box-shadow: none; } +#filecontents h1 + #toc.nofloat { margin-top: 0; } + +/* syntax highlighting */ +.source_code { display: none; padding: 3px 8px; border-left: 8px solid #ddd; margin-top: 5px; } +#filecontents pre.code, .docstring pre.code, .source_code pre { font-family: monospace; } +#filecontents pre.code, .docstring pre.code { display: block; } +.source_code .lines { padding-right: 12px; color: #555; text-align: right; } +#filecontents pre.code, .docstring pre.code, +.tags .example { padding: 5px 12px; margin-top: 4px; border: 1px solid #eef; background: #f5f5ff; } +pre.code { color: #000; } +pre.code .info.file { color: #555; } +pre.code .val { color: #036A07; } +pre.code .tstring_content, +pre.code .heredoc_beg, pre.code .heredoc_end, +pre.code .qwords_beg, pre.code .qwords_end, +pre.code .tstring, pre.code .dstring { color: #036A07; } +pre.code .fid, pre.code .id.new, pre.code .id.to_s, +pre.code .id.to_sym, pre.code .id.to_f, +pre.code .dot + pre.code .id, +pre.code .id.to_i pre.code .id.each { color: #0085FF; } +pre.code .comment { color: #0066FF; } +pre.code .const, pre.code .constant { color: #585CF6; } +pre.code .symbol { color: #C5060B; } +pre.code .kw, +pre.code .label, +pre.code .id.require, +pre.code .id.extend, +pre.code .id.include { color: #0000FF; } +pre.code .ivar { color: #318495; } +pre.code .gvar, +pre.code .id.backref, +pre.code .id.nth_ref { color: #6D79DE; } +pre.code .regexp, .dregexp { color: #036A07; } +pre.code a { border-bottom: 1px dotted #bbf; } + diff --git a/file.README.html b/file.README.html new file mode 100644 index 000000000..ab70705e4 --- /dev/null +++ b/file.README.html @@ -0,0 +1,156 @@ + + + + +Documentation by YARD 0.6.1 + + + + + + + + + + + + + + + +

OmniAuth: Standardized Multi-Provider Authentication

+ +

OmniAuth is a new Rack-based authentication system for multi-provider external authentcation. OmniAuth is built from the ground up on the philosophy that authentication is not the same as identity, and is based on two observations:

+ +
    +
  1. The traditional ‘sign up using a login and password’ model is becoming the exception, not the rule. Modern web applications offer external authentication via OpenID, Facebook, and/or OAuth.
  2. + +
  3. The interconnectable web is no longer a dream, it is a necessity. It is not unreasonable to expect that one application may need to be able to connect to one, three, or twelve other services. Modern authentication systems should allow a user’s identity to be associated with many authentications.
  4. +
+ +

Installation

+ +

To install OmniAuth, simply install the gem:

+ +
gem install omniauth
+
+ +

Providers

+ +

OmniAuth currently supports the following external providers:

+ + + +

Usage

+ +

OmniAuth is a collection of Rack middleware. To use a single strategy, you simply need to add the middleware:

+ +
require 'oa-oauth'
+use OmniAuth::Strategies::, 'CONSUMER_KEY', 'CONSUMER_SECRET'
+
+ +

Now to initiate authentication you merely need to redirect the user to /auth/twitter via a link or other means. Once the user has authenticated to Twitter, they will be redirected to /auth/twitter/callback. You should build an endpoint that handles this URL, at which point you will will have access to the authentication information through the omniauth.auth parameter of the Rack environment. For example, in Sinatra you would do something like this:

+ +
get '/auth/twitter/callback' do
+  auth_hash = request.env['omniauth.auth']
+end
+
+ +

The hash in question will look something like this:

+ +
{
+  'uid' => '12356',
+  'provider' => 'twitter',
+  'user_info' => {
+    'name' => 'User Name',
+    'nickname' => 'username',
+    # ...
+  }
+}
+
+ +

The user_info hash will automatically be populated with as much information about the user as OmniAuth was able to pull from the given API or authentication provider.

+ +

Resources

+ +

The best place to find more information is the OmniAuth Wiki. Some specific information you might be interested in:

+ +
+ + + + + \ No newline at end of file diff --git a/file_list.html b/file_list.html new file mode 100644 index 000000000..7115ba13e --- /dev/null +++ b/file_list.html @@ -0,0 +1,38 @@ + + + + + + + + + + + + +
+

File List

+ + + + +
+ + + diff --git a/frames.html b/frames.html new file mode 100644 index 000000000..01feb1292 --- /dev/null +++ b/frames.html @@ -0,0 +1,13 @@ + + + + + + Documentation by YARD 0.6.1 + + + + + + diff --git a/index.html b/index.html new file mode 100644 index 000000000..ab70705e4 --- /dev/null +++ b/index.html @@ -0,0 +1,156 @@ + + + + +Documentation by YARD 0.6.1 + + + + + + + + + + + + + + + +

OmniAuth: Standardized Multi-Provider Authentication

+ +

OmniAuth is a new Rack-based authentication system for multi-provider external authentcation. OmniAuth is built from the ground up on the philosophy that authentication is not the same as identity, and is based on two observations:

+ +
    +
  1. The traditional ‘sign up using a login and password’ model is becoming the exception, not the rule. Modern web applications offer external authentication via OpenID, Facebook, and/or OAuth.
  2. + +
  3. The interconnectable web is no longer a dream, it is a necessity. It is not unreasonable to expect that one application may need to be able to connect to one, three, or twelve other services. Modern authentication systems should allow a user’s identity to be associated with many authentications.
  4. +
+ +

Installation

+ +

To install OmniAuth, simply install the gem:

+ +
gem install omniauth
+
+ +

Providers

+ +

OmniAuth currently supports the following external providers:

+ + + +

Usage

+ +

OmniAuth is a collection of Rack middleware. To use a single strategy, you simply need to add the middleware:

+ +
require 'oa-oauth'
+use OmniAuth::Strategies::, 'CONSUMER_KEY', 'CONSUMER_SECRET'
+
+ +

Now to initiate authentication you merely need to redirect the user to /auth/twitter via a link or other means. Once the user has authenticated to Twitter, they will be redirected to /auth/twitter/callback. You should build an endpoint that handles this URL, at which point you will will have access to the authentication information through the omniauth.auth parameter of the Rack environment. For example, in Sinatra you would do something like this:

+ +
get '/auth/twitter/callback' do
+  auth_hash = request.env['omniauth.auth']
+end
+
+ +

The hash in question will look something like this:

+ +
{
+  'uid' => '12356',
+  'provider' => 'twitter',
+  'user_info' => {
+    'name' => 'User Name',
+    'nickname' => 'username',
+    # ...
+  }
+}
+
+ +

The user_info hash will automatically be populated with as much information about the user as OmniAuth was able to pull from the given API or authentication provider.

+ +

Resources

+ +

The best place to find more information is the OmniAuth Wiki. Some specific information you might be interested in:

+ +
+ + + + + \ No newline at end of file diff --git a/js/app.js b/js/app.js new file mode 100644 index 000000000..262ba9603 --- /dev/null +++ b/js/app.js @@ -0,0 +1,202 @@ +function createSourceLinks() { + $('.method_details_list .source_code'). + before("[View source]"); + $('.toggleSource').toggle(function() { + $(this).parent().next().slideDown(100); + $(this).text("Hide source"); + }, + function() { + $(this).parent().next().slideUp(100); + $(this).text("View source"); + }); +} + +function createDefineLinks() { + var tHeight = 0; + $('.defines').after(" more..."); + $('.toggleDefines').toggle(function() { + tHeight = $(this).parent().prev().height(); + $(this).prev().show(); + $(this).parent().prev().height($(this).parent().height()); + $(this).text("(less)"); + }, + function() { + $(this).prev().hide(); + $(this).parent().prev().height(tHeight); + $(this).text("more...") + }); +} + +function createFullTreeLinks() { + var tHeight = 0; + $('.inheritanceTree').toggle(function() { + tHeight = $(this).parent().prev().height(); + $(this).parent().toggleClass('showAll'); + $(this).text("(hide)"); + $(this).parent().prev().height($(this).parent().height()); + }, + function() { + $(this).parent().toggleClass('showAll'); + $(this).parent().prev().height(tHeight); + $(this).text("show all") + }); +} + +function fixBoxInfoHeights() { + $('dl.box dd.r1, dl.box dd.r2').each(function() { + $(this).prev().height($(this).height()); + }); +} + +function searchFrameLinks() { + $('#method_list_link').click(function() { + toggleSearchFrame(this, relpath + 'method_list.html'); + }); + + $('#class_list_link').click(function() { + toggleSearchFrame(this, relpath + 'class_list.html'); + }); + + $('#file_list_link').click(function() { + toggleSearchFrame(this, relpath + 'file_list.html'); + }); +} + +function toggleSearchFrame(id, link) { + var frame = $('#search_frame'); + $('#search a').removeClass('active').addClass('inactive'); + if (frame.attr('src') == link && frame.css('display') != "none") { + frame.slideUp(100); + $('#search a').removeClass('active inactive'); + } + else { + $(id).addClass('active').removeClass('inactive'); + frame.attr('src', link).slideDown(100); + } +} + +function linkSummaries() { + $('.summary_signature').click(function() { + document.location = $(this).find('a').attr('href'); + }); +} + +function framesInit() { + if (window.top.frames.main) { + document.body.className = 'frames'; + $('#menu .noframes a').attr('href', document.location); + $('html head title', window.parent.document).text($('html head title').text()); + } +} + +function keyboardShortcuts() { + if (window.top.frames.main) return; + $(document).keypress(function(evt) { + if (evt.altKey || evt.ctrlKey || evt.metaKey || evt.shiftKey) return; + if (evt.originalTarget.nodeName == "INPUT" || + evt.originalTarget.nodeName == "TEXTAREA") return; + switch (evt.charCode) { + case 67: case 99: $('#class_list_link').click(); break; // 'c' + case 77: case 109: $('#method_list_link').click(); break; // 'm' + case 70: case 102: $('#file_list_link').click(); break; // 'f' + } + }); +} + +function summaryToggle() { + $('.summary_toggle').click(function() { + localStorage.summaryCollapsed = $(this).text(); + $(this).text($(this).text() == "collapse" ? "expand" : "collapse"); + var next = $(this).parent().parent().next(); + if (next.hasClass('compact')) { + next.toggle(); + next.next().toggle(); + } + else if (next.hasClass('summary')) { + var list = $('