iauthu 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,3 +1,8 @@
1
+ === 0.0.2
2
+
3
+ * Changed all instances of "iTunesU" to "iTunes U" per Apple
4
+ * Added IAuthU::Authenticator::Open for easy authentication of all users.
5
+
1
6
  === 0.0.1
2
7
 
3
8
  * Initial release
data/README.txt CHANGED
@@ -4,12 +4,12 @@
4
4
 
5
5
  == DESCRIPTION:
6
6
 
7
- IAuthU provides a basic iTunesU authentication server, along with libraries for building iTunesU authentication servers into your own application.
7
+ IAuthU provides a basic iTunes U authentication server, along with libraries for building iTunes U authentication servers into your own application.
8
8
 
9
9
  == FEATURES/PROBLEMS:
10
10
 
11
11
  * Features
12
- * Support for iTunesU authentication system.
12
+ * Support for iTunes U authentication system.
13
13
  * Plug-able authentication back-ends.
14
14
  * Includes authentication back-ends for basic LDAP and chained authentication sources.
15
15
  * Supports running as CGI, FastCGI, WEBrick, Mongrel, etc using Rack
@@ -20,7 +20,7 @@ IAuthU provides a basic iTunesU authentication server, along with libraries for
20
20
 
21
21
  $ sudo iauthu -g
22
22
 
23
- * Edit /etc/iauthu/iauth.conf and fill in your iTunesU authentication settings.
23
+ * Edit /etc/iauthu/iauth.conf and fill in your iTunes U authentication settings.
24
24
 
25
25
  * To run as a standalone server:
26
26
 
data/bin/iauthu CHANGED
@@ -109,15 +109,15 @@ module IAuthU
109
109
  config["force"] = force
110
110
  end
111
111
 
112
- opts.on("--url [URL]", "Set the iTunesU authentication url.") do |url|
112
+ opts.on("--url [URL]", "Set the iTunes U authentication url.") do |url|
113
113
  config["url"] = url
114
114
  end
115
115
 
116
- opts.on("--debug-suffix [SUFFIX]", "Set the iTunesU debug suffix.") do |str|
116
+ opts.on("--debug-suffix [SUFFIX]", "Set the iTunes U debug suffix.") do |str|
117
117
  config["debug_suffix"] = str
118
118
  end
119
119
 
120
- cred_help = "Set the iTunesU credentials. Format: shortName1::LongCred1;shortName2::LongCred2"
120
+ cred_help = "Set the iTunes U credentials. Format: shortName1::LongCred1;shortName2::LongCred2"
121
121
  opts.on("--cred [CREDSTR]", cred_help) do |str|
122
122
  creds = {}
123
123
  str.split(",").each do |pair|
@@ -129,7 +129,7 @@ module IAuthU
129
129
  config["creds"] = creds
130
130
  end
131
131
 
132
- opts.on("--secret [SECRET]", "Set the iTunesU shared secret.") do |str|
132
+ opts.on("--secret [SECRET]", "Set the iTunes U shared secret.") do |str|
133
133
  config["shared_secret"] = str
134
134
  end
135
135
 
@@ -4,6 +4,6 @@ $:.unshift(File.dirname(__FILE__)) unless
4
4
  require 'iauthu/server'
5
5
  require 'logger'
6
6
  module IAuthU
7
- VERSION = '0.0.1'
7
+ VERSION = '0.0.2'
8
8
  CONFIG = {:logger => Logger.new(STDERR)}
9
9
  end
@@ -59,5 +59,14 @@ module IAuthU
59
59
  @sufficient = !!bool
60
60
  end
61
61
  end
62
+
63
+ # Simple Authenticator for allowing all users. Useful for testing.
64
+ class Open
65
+ def self.call(user,pass)
66
+ { "display_name" => user,
67
+ "username" => user,
68
+ "credentials" => [] }
69
+ end
70
+ end
62
71
  end
63
72
  end
@@ -10,6 +10,22 @@ require 'logger'
10
10
 
11
11
  module IAuthU
12
12
 
13
+
14
+ =begin rdoc
15
+ IAuthU::Server provides a ready-to-run iTunes U (tm) authentication server. You can use
16
+ Server.build {} to easily construct and configure your authentication server:
17
+
18
+ server = Server.build {
19
+ run :webrick, :port => 9292
20
+ site {
21
+ url "https://deimos.apple.com/WebObjects/Core.woa/Browse/foo.edu"
22
+ shared_secret "SHARED-SECRET"
23
+ }
24
+ auth {
25
+ use IAuthU::Authenticator::Open
26
+ }
27
+ }
28
+ =end
13
29
  class Server
14
30
  def self.build(&block)
15
31
  b = Builder.new
@@ -74,7 +90,7 @@ module IAuthU
74
90
  end
75
91
 
76
92
  def login_form
77
- page_title = "iTunesU Login"
93
+ page_title = "iTunes U Login"
78
94
  m = Markaby::Builder.new
79
95
  m.html do
80
96
  head { title page_title}
@@ -98,7 +114,6 @@ module IAuthU
98
114
 
99
115
  class Builder
100
116
  RUNNERS = { :cgi => Rack::Handler::CGI,
101
- #:fastcgi => Rack::Handler::FastCGI,
102
117
  :webrick => Rack::Handler::WEBrick,
103
118
  :mongrel => Rack::Handler::Mongrel
104
119
  }
@@ -25,20 +25,20 @@ logger :default # :default | "/var/log/iauthu.log" | Logger.new("/var/logs/i
25
25
  login_page :default
26
26
 
27
27
  site {
28
- # Specify your iTunesU url
28
+ # Specify your iTunes U url
29
29
  url "<%= url || "https://deimos.apple.com/WebObjects/Core.woa/Browse/foo.edu" %>"
30
30
 
31
- # Specify your debug suffix if you wish to use iTunesU authentication
31
+ # Specify your debug suffix if you wish to use iTunes U authentication
32
32
  # in debug mode.
33
33
  <%= "#" unless debug_suffix %> debug_suffix "<%= debug_suffix || "/debug_suffix" %>"
34
34
 
35
- # Enable iTunesU authentication debugging. Must specify the debug_suffix.
35
+ # Enable iTunes U authentication debugging. Must specify the debug_suffix.
36
36
  debug <%= debug ? "true" : "false" %>
37
37
 
38
38
  # Shared authentication secret
39
39
  shared_secret "<%= shared_secret || "SHARED-SECRET" %>"
40
40
 
41
- # Define your iTunesU login credentials. The alias you specify
41
+ # Define your iTunes U login credentials. The alias you specify
42
42
  # can be used to refer to that credential later in the authentication
43
43
  # section.
44
44
  #
@@ -54,12 +54,7 @@ site {
54
54
  auth {
55
55
 
56
56
  # Authenticate all users
57
- use {|user, pass|
58
- {"display_name" => user,
59
- "username" => user,
60
- "credentials" => []
61
- }
62
- }
57
+ use IAuthU::Authenticator::Open
63
58
 
64
59
  # # Uncomment to Authenticate Users from LDAP
65
60
  # require 'iauthu/authenticator/ldap'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: iauthu
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Heimbuch
@@ -66,7 +66,7 @@ dependencies:
66
66
  - !ruby/object:Gem::Version
67
67
  version: 1.5.3
68
68
  version:
69
- description: IAuthU provides a basic iTunesU authentication server, along with libraries for building iTunesU authentication servers into your own application.
69
+ description: IAuthU provides a basic iTunes U authentication server, along with libraries for building iTunes U authentication servers into your own application.
70
70
  email:
71
71
  - rheimbuch@gmail.com
72
72
  executables:
@@ -119,6 +119,6 @@ rubyforge_project: iauthu
119
119
  rubygems_version: 1.0.1
120
120
  signing_key:
121
121
  specification_version: 2
122
- summary: IAuthU provides a basic iTunesU authentication server, along with libraries for building iTunesU authentication servers into your own application.
122
+ summary: IAuthU provides a basic iTunes U authentication server, along with libraries for building iTunes U authentication servers into your own application.
123
123
  test_files:
124
124
  - test/test_iauthu.rb