Skip to content

Commit 84c3a6f

Browse files
LordnibblerLordnibbler
authored andcommitted
Merge pull request #111 from onelogin/namespacing-issue
Onelogin:: is OneLogin::
2 parents e9a91c1 + a0af20e commit 84c3a6f

20 files changed

+140
-140
lines changed

README.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Ruby SAML [![Build Status](https://secure.travis-ci.org/onelogin/ruby-saml.png)](http://travis-ci.org/onelogin/ruby-saml)
22

33
## Updating from 0.7.x to 0.8.x
4-
Version `0.8.0` changes the namespace of the gem from `Onelogin::Saml` to `Onelogin::RubySaml`. Please update your implementations of the gem accordingly.
4+
Version `0.8.x` changes the namespace of the gem from `OneLogin::Saml` to `OneLogin::RubySaml`. Please update your implementations of the gem accordingly.
55

66
## Overview
77

@@ -15,7 +15,7 @@ This is the first request you will get from the identity provider. It will hit y
1515

1616
```ruby
1717
def init
18-
request = Onelogin::RubySaml::Authrequest.new
18+
request = OneLogin::RubySaml::Authrequest.new
1919
redirect_to(request.create(saml_settings))
2020
end
2121
```
@@ -24,7 +24,7 @@ Once you've redirected back to the identity provider, it will ensure that the us
2424

2525
```ruby
2626
def consume
27-
response = Onelogin::RubySaml::Response.new(params[:SAMLResponse])
27+
response = OneLogin::RubySaml::Response.new(params[:SAMLResponse])
2828
response.settings = saml_settings
2929

3030
if response.is_valid? && user = current_account.users.find_by_email(response.name_id)
@@ -39,7 +39,7 @@ In the above there are a few assumptions in place, one being that the response.n
3939

4040
```ruby
4141
def saml_settings
42-
settings = Onelogin::RubySaml::Settings.new
42+
settings = OneLogin::RubySaml::Settings.new
4343

4444
settings.assertion_consumer_service_url = "http://#{request.host}/saml/finalize"
4545
settings.issuer = request.host
@@ -59,12 +59,12 @@ What's left at this point, is to wrap it all up in a controller and point the in
5959
# This controller expects you to use the URLs /saml/init and /saml/consume in your OneLogin application.
6060
class SamlController < ApplicationController
6161
def init
62-
request = Onelogin::RubySaml::Authrequest.new
62+
request = OneLogin::RubySaml::Authrequest.new
6363
redirect_to(request.create(saml_settings))
6464
end
6565

6666
def consume
67-
response = Onelogin::RubySaml::Response.new(params[:SAMLResponse])
67+
response = OneLogin::RubySaml::Response.new(params[:SAMLResponse])
6868
response.settings = saml_settings
6969

7070
if response.is_valid? && user = current_account.users.find_by_email(response.name_id)
@@ -77,7 +77,7 @@ class SamlController < ApplicationController
7777
private
7878

7979
def saml_settings
80-
settings = Onelogin::RubySaml::Settings.new
80+
settings = OneLogin::RubySaml::Settings.new
8181

8282
settings.assertion_consumer_service_url = "http://#{request.host}/saml/consume"
8383
settings.issuer = request.host
@@ -96,7 +96,7 @@ If are using saml:AttributeStatement to transfare metadata, like the user name,
9696
contains all the saml:AttributeStatement with its 'Name' as a indifferent key and the one saml:AttributeValue as value.
9797

9898
```ruby
99-
response = Onelogin::RubySaml::Response.new(params[:SAMLResponse])
99+
response = OneLogin::RubySaml::Response.new(params[:SAMLResponse])
100100
response.settings = saml_settings
101101

102102
response.attributes[:username]
@@ -107,7 +107,7 @@ response.attributes[:username]
107107
To form a trusted pair relationship with the IdP, the SP (you) need to provide metadata XML
108108
to the IdP for various good reasons. (Caching, certificate lookups, relaying party permissions, etc)
109109

110-
The class Onelogin::RubySaml::Metadata takes care of this by reading the Settings and returning XML. All
110+
The class OneLogin::RubySaml::Metadata takes care of this by reading the Settings and returning XML. All
111111
you have to do is add a controller to return the data, then give this URL to the IdP administrator.
112112
The metdata will be polled by the IdP every few minutes, so updating your settings should propagate
113113
to the IdP settings.
@@ -117,7 +117,7 @@ class SamlController < ApplicationController
117117
# ... the rest of your controller definitions ...
118118
def metadata
119119
settings = Account.get_saml_settings
120-
meta = Onelogin::RubySaml::Metadata.new
120+
meta = OneLogin::RubySaml::Metadata.new
121121
render :xml => meta.generate(settings)
122122
end
123123
end
@@ -132,7 +132,7 @@ First, ensure that both systems synchronize their clocks, using for example the
132132
Even then you may experience intermittent issues though, because the clock of the Identity Provider may drift slightly ahead of your system clocks. To allow for a small amount of clock drift you can initialize the response passing in an option named `:allowed_clock_drift`. Its value must be given in a number (and/or fraction) of seconds. The value given is added to the current time at which the response is validated before it's tested against the `NotBefore` assertion. For example:
133133

134134
```ruby
135-
response = Onelogin::RubySaml::Response.new(params[:SAMLResponse], :allowed_clock_drift => 1)
135+
response = OneLogin::RubySaml::Response.new(params[:SAMLResponse], :allowed_clock_drift => 1)
136136
```
137137

138138
Make sure to keep the value as comfortably small as possible to keep security risks to a minimum.

changelog.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# RubySaml Changelog
22

33
### 0.8.0 (Feb 21, 2014)
4-
Changed namespace of the gem from `Onelogin::Saml` to `Onelogin::RubySaml`. Please update your implementations of the gem accordingly.
4+
Changed namespace of the gem from `OneLogin::Saml` to `OneLogin::RubySaml`. Please update your implementations of the gem accordingly.
55

66
### 0.7.3 (Feb 20, 2014)
77
Updated gem dependencies to be compatible with Ruby 1.8.7-p374 and 1.9.3-p448. Removed unnecessary `canonix` gem dependency.

lib/onelogin/ruby-saml/authrequest.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
require "rexml/document"
66
require "rexml/xpath"
77

8-
module Onelogin
8+
module OneLogin
99
module RubySaml
1010
include REXML
1111
class Authrequest

lib/onelogin/ruby-saml/logging.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Simplistic log class when we're running in Rails
2-
module Onelogin
2+
module OneLogin
33
module RubySaml
44
class Logging
55
def self.debug(message)

lib/onelogin/ruby-saml/logoutrequest.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
require "zlib"
44
require "cgi"
55

6-
module Onelogin
6+
module OneLogin
77
module RubySaml
88
include REXML
99
class Logoutrequest

lib/onelogin/ruby-saml/logoutresponse.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
require "base64"
44
require "zlib"
55

6-
module Onelogin
6+
module OneLogin
77
module RubySaml
88
class Logoutresponse
99

lib/onelogin/ruby-saml/metadata.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# Return this XML in a controller, then give that URL to the the
77
# IdP administrator. The IdP will poll the URL and your settings
88
# will be updated automatically
9-
module Onelogin
9+
module OneLogin
1010
module RubySaml
1111
include REXML
1212
class Metadata

lib/onelogin/ruby-saml/response.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
require "nokogiri"
44

55
# Only supports SAML 2.0
6-
module Onelogin
6+
module OneLogin
77
module RubySaml
88

99
class Response

lib/onelogin/ruby-saml/settings.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module Onelogin
1+
module OneLogin
22
module RubySaml
33
class Settings
44
def initialize(overrides = {})

lib/onelogin/ruby-saml/validation_error.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module Onelogin
1+
module OneLogin
22
module RubySaml
33
class ValidationError < StandardError
44
end

0 commit comments

Comments
 (0)