devise_ichain_authenticatable 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ Y2RmMzFkMDdkZjIyMjYzZmQ5MjNjNzgxOTliNTk0NjhlM2U0Y2FmNA==
5
+ data.tar.gz: !binary |-
6
+ MDI2MjhhZTBkMTBjMTcwMGQwM2RkODU4NzIyOTViZjQ5ZmNjMWM4Yg==
7
+ !binary "U0hBNTEy":
8
+ metadata.gz: !binary |-
9
+ MzA1YTE4MDA5NTBhNDJmNmRmNGUzNzZhMTNiODJmMGI3MGIxMDIzZmZkMzVj
10
+ YTJkYTBmMTg1YjcyZGNhYjRjMWJmYWFkZmEwZjk1N2MxNWRlZjY4ZmJlM2I4
11
+ MWZlNTJlYTc1MGZjODY1YjdhYjNiOThkZjU3NzMzNDBjNTM5ODM=
12
+ data.tar.gz: !binary |-
13
+ NmIwZjg1ZTNhZjUwODlkMDgwZDNhMTM0N2M4NTRkZjA0MTU4OTEyOTA1YmYy
14
+ Mzk4YmE0NWUwZjg2ZGQwYzVjYjFlZDI3Njc1NGI4ZmRhMDc4ZjE2YjU2NjBi
15
+ NTQ2ZTM2MTdmOGM0NzQzMmNjZTc1OTMwM2VmMjVmYzYzZThjM2U=
data/README.md CHANGED
@@ -1,5 +1,120 @@
1
1
  Devise iChain Authenticatable
2
2
  =============================
3
3
 
4
- Devise extension to allow authentication via iChain. Proper documentation is on
5
- the way.
4
+ iChain based authentication for the
5
+ [Devise](http://github.com/plataformatec/devise) authentication framework.
6
+ The plugin adds two new modules to Devise: `ichain_autenticatable` and
7
+ `ichain_registerable`. This plugin is compatible with Database Authenticatable,
8
+ so users in your application can be authenticated with both mechanism if
9
+ desired.
10
+
11
+ Requirements
12
+ ------------
13
+
14
+ The plugin should be compatible with Ruby 1.8.7, 1.9.3 and 2.0, but have only be
15
+ tested in production with Ruby 1.9.3.
16
+
17
+ In the same way, it should work with any version of Devise equal or greater than 2.2
18
+ and with any version of Rails equal or greater than 3.2, but have only be tested
19
+ with Rails 3.2 and Devise 2.2.
20
+
21
+ Reporting of success stories with other setups would be highly appreciated.
22
+
23
+ Installation and basic setup
24
+ ---------------------------
25
+
26
+ First of all, install Devise following the great documentation available in
27
+ [its official website](http://github.com/plataformatec/devise). Then, just add
28
+ the following line to your Gemfile and run the bundle command.
29
+
30
+ gem "devise_ichain_authenticatable"
31
+
32
+ Only two changes are required in your user model. First, you obviously need to
33
+ add the new modules to the devise call. In the other hand, you need to provide
34
+ a way to link the iChain usernames to your application users by implementing
35
+ the `for_ichain_username` class method. For example:
36
+
37
+ ```ruby
38
+ class User < ActiveRecord::Base
39
+ devise :ichain_authenticatable, :ichain_registerable
40
+
41
+ def self.for_ichain_username(username, attributes)
42
+ find_or_create_by_login(username)
43
+ end
44
+ end
45
+ ```
46
+
47
+ After performing a valid iChain authentication, the plugin will call the
48
+ `from_ichain_username` class method of your model
49
+ passing two parameters: the username validated by iChain and a hash of
50
+ additional parameters defined in the configuration of your iChain proxy
51
+ (see `config.ichain_attributes_header` below).
52
+ The method is expected to return a valid user object. If the returned
53
+ value is evaluated to false or nil, the authentication will fail.
54
+
55
+ In the example, an ActiveRecord based model is used, but the plugin will
56
+ work with any storage backend as long as it's supported by Devise and
57
+ the `from_ichain_username` is properly implemented.
58
+
59
+ Finally, you'll need to add some configuration to your
60
+ `config/initializers/devise.rb` in order to tell your app how to talk
61
+ to your iChain proxy.
62
+
63
+ ```ruby
64
+ Devise.setup do |config|
65
+ ...
66
+ # You will always need to set this parameter.
67
+ config.ichain_base_url = "https://my.application.org"
68
+
69
+ # The header used by your iChain proxy to pass the username.
70
+ # config.ichain_username_header = "HTTP_X_USERNAME"
71
+
72
+ # Additional parameters, beyond the username, provided by the iChain proxy.
73
+ # HTTP_X_EMAIL is expected by default. Set to {} if no additional attributes
74
+ # are configured in the proxy.
75
+ # config.ichain_attributes_header = {:email => "HTTP_X_EMAIL"}
76
+
77
+ # Configuration options for requests sent to the iChain proxy
78
+ # config.ichain_context = "default"
79
+ # config.ichain_proxypath = "reverse"
80
+
81
+ # Activate the test mode, useful when no real iChain is present, like in
82
+ # testing and development environments
83
+ # config.ichain_test_mode = false
84
+ end
85
+ ```
86
+
87
+ Helpers
88
+ -------
89
+
90
+ This plugin provides the expected URL helpers, analogous to those provided by
91
+ Database Authenticable and Registerable. For example, for a model called User,
92
+ the following helpers would be available: `new_user_ichain_session_path`,
93
+ `destroy_user_ichain_session_path`, `new_ichain_registration_path`...
94
+
95
+ Test mode
96
+ ---------
97
+
98
+ If the test mode is enabled in the configuration file, anytime
99
+ authentication is required, a very simple form asking for the username and the
100
+ additional parameters will be displayed. The entered values will be completely
101
+ trusted with no check. ```ichain_registerable```will have no effect if test mode
102
+ is enabled.
103
+
104
+ This mode is extremely useful during the development phase, in which an iChain
105
+ proxy is not usually configured or even available.
106
+
107
+ Contact
108
+ -------
109
+
110
+ Ancor González Sosa
111
+
112
+ * http://github.com/ancorgs
113
+ * ancor@suse.de
114
+
115
+ License
116
+ -------
117
+
118
+ The Redmine iChain Plugin is licensed under the MIT License (MIT-LICENSE.txt).
119
+
120
+ Copyright (c) 2013 Ancor González Sosa
@@ -1,3 +1,3 @@
1
1
  module DeviseIchainAuthenticatable
2
- VERSION = "0.2.0".freeze
2
+ VERSION = "0.2.1".freeze
3
3
  end
metadata CHANGED
@@ -1,20 +1,18 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: devise_ichain_authenticatable
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
5
- prerelease:
4
+ version: 0.2.1
6
5
  platform: ruby
7
6
  authors:
8
7
  - Ancor González Sosa
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2013-09-10 00:00:00.000000000 Z
11
+ date: 2013-09-11 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: devise
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
17
  - - ! '>='
20
18
  - !ruby/object:Gem::Version
@@ -22,7 +20,6 @@ dependencies:
22
20
  type: :runtime
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
24
  - - ! '>='
28
25
  - !ruby/object:Gem::Version
@@ -54,27 +51,26 @@ files:
54
51
  homepage: https://github.com/openSUSE/devise_ichain_authenticatable
55
52
  licenses:
56
53
  - MIT
54
+ metadata: {}
57
55
  post_install_message:
58
56
  rdoc_options: []
59
57
  require_paths:
60
58
  - lib
61
59
  required_ruby_version: !ruby/object:Gem::Requirement
62
- none: false
63
60
  requirements:
64
61
  - - ! '>='
65
62
  - !ruby/object:Gem::Version
66
63
  version: '0'
67
64
  required_rubygems_version: !ruby/object:Gem::Requirement
68
- none: false
69
65
  requirements:
70
66
  - - ! '>='
71
67
  - !ruby/object:Gem::Version
72
68
  version: '0'
73
69
  requirements: []
74
70
  rubyforge_project:
75
- rubygems_version: 1.8.25
71
+ rubygems_version: 2.0.3
76
72
  signing_key:
77
- specification_version: 3
73
+ specification_version: 4
78
74
  summary: Devise extension to allow authentication via iChain
79
75
  test_files: []
80
76
  has_rdoc: