frostale 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/.document ADDED
@@ -0,0 +1,5 @@
1
+ README.rdoc
2
+ lib/**/*.rb
3
+ bin/*
4
+ features/**/*.feature
5
+ LICENSE
data/.gitignore ADDED
@@ -0,0 +1,21 @@
1
+ ## MAC OS
2
+ .DS_Store
3
+
4
+ ## TEXTMATE
5
+ *.tmproj
6
+ tmtags
7
+
8
+ ## EMACS
9
+ *~
10
+ \#*
11
+ .\#*
12
+
13
+ ## VIM
14
+ *.swp
15
+
16
+ ## PROJECT::GENERAL
17
+ coverage
18
+ rdoc
19
+ pkg
20
+
21
+ ## PROJECT::SPECIFIC
data/LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2009 barce
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.rdoc ADDED
@@ -0,0 +1,26 @@
1
+ = frostale
2
+
3
+ Frostale is an Active Directory Login for the Enterprise.
4
+
5
+ To use it's quite simple:
6
+
7
+ user = Frostale.new('user@example.com','pass',
8
+ 'domain\group Global Admins',
9
+ 'http://example.com/WPAuth.asmx?WSDL')
10
+ user.authenticate
11
+ puts "authenticated" if user.isAuth == 'true'
12
+
13
+
14
+ == Note on Patches/Pull Requests
15
+
16
+ * Fork the project.
17
+ * Make your feature addition or bug fix.
18
+ * Add tests for it. This is important so I don't break it in a
19
+ future version unintentionally.
20
+ * Commit, do not mess with rakefile, version, or history.
21
+ (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
22
+ * Send me a pull request. Bonus points for topic branches.
23
+
24
+ == Copyright
25
+
26
+ Copyright (c) 2009 barce. See LICENSE for details.
data/Rakefile ADDED
@@ -0,0 +1,65 @@
1
+ require 'rubygems'
2
+ require 'rake'
3
+
4
+ begin
5
+ require 'jeweler'
6
+ Jeweler::Tasks.new do |gem|
7
+ gem.name = "frostale"
8
+ gem.summary = %Q{Active Directory Login for the Enterprise}
9
+ gem.description = %Q{Frostale allows active directory login through a ruby gem.}
10
+ gem.email = "jbarcelona@gmail.com"
11
+ gem.homepage = "http://github.com/barce/frostale"
12
+ gem.authors = ["barce"]
13
+ # gem.add_development_dependency "thoughtbot-shoulda", ">= 0"
14
+ gem.add_dependency 'aws-s3','0.6.2'
15
+
16
+
17
+ gem.post_install_message = <<-POST_INSTALL_MESSAGE
18
+
19
+
20
+ Thank you for installing frostale - more infor is at
21
+ http://github.com/barce/frostale
22
+
23
+
24
+ POST_INSTALL_MESSAGE
25
+ # gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
26
+
27
+ end
28
+ Jeweler::GemcutterTasks.new
29
+ rescue LoadError
30
+ puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
31
+ end
32
+
33
+ require 'rake/testtask'
34
+ Rake::TestTask.new(:test) do |test|
35
+ test.libs << 'lib' << 'test'
36
+ test.pattern = 'test/**/test_*.rb'
37
+ test.verbose = true
38
+ end
39
+
40
+ begin
41
+ require 'rcov/rcovtask'
42
+ Rcov::RcovTask.new do |test|
43
+ test.libs << 'test'
44
+ test.pattern = 'test/**/test_*.rb'
45
+ test.verbose = true
46
+ end
47
+ rescue LoadError
48
+ task :rcov do
49
+ abort "RCov is not available. In order to run rcov, you must: sudo gem install spicycode-rcov"
50
+ end
51
+ end
52
+
53
+ task :test => :check_dependencies
54
+
55
+ task :default => :test
56
+
57
+ require 'rake/rdoctask'
58
+ Rake::RDocTask.new do |rdoc|
59
+ version = File.exist?('VERSION') ? File.read('VERSION') : ""
60
+
61
+ rdoc.rdoc_dir = 'rdoc'
62
+ rdoc.title = "frostale #{version}"
63
+ rdoc.rdoc_files.include('README*')
64
+ rdoc.rdoc_files.include('lib/**/*.rb')
65
+ end
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 0.0.2
data/lib/frostale.rb ADDED
@@ -0,0 +1,38 @@
1
+ require 'rubygems'
2
+ require 'soap/wsdlDriver'
3
+ require 'pp'
4
+ # require 'aws/s3' # will add in later version
5
+ require 'yaml'
6
+
7
+ class Frostale
8
+
9
+ attr_accessor :emailaddress, :password, :role, :groups, :wdsl, :isAuth
10
+
11
+ def initialize(emailaddress, password, group, ldap_uri)
12
+ @mldap_uri = ldap_uri
13
+ @wdsl = SOAP::WSDLDriverFactory.new(@mldap_uri)
14
+ @emailaddress = emailaddress
15
+ @password = password
16
+ @groups = group
17
+ end
18
+
19
+ def authenticate
20
+ soap = @wdsl.create_rpc_driver
21
+
22
+ # TODO: figure out how to make the params below dynamic
23
+ response = soap.AuthenticateUser(
24
+ :emailaddress => @emailaddress,
25
+ :password => @password,
26
+ :admins => @groups,
27
+ :editors => '',
28
+ :authors => '',
29
+ :contributors => '',
30
+ :subscribers => ''
31
+ )
32
+ soap.reset_stream
33
+
34
+ @isAuth = response.isAuthenticated
35
+ @role = response.role
36
+ end
37
+ end # end class
38
+
data/test/helper.rb ADDED
@@ -0,0 +1,10 @@
1
+ require 'rubygems'
2
+ require 'test/unit'
3
+ require 'shoulda'
4
+
5
+ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
6
+ $LOAD_PATH.unshift(File.dirname(__FILE__))
7
+ require 'frostale'
8
+
9
+ class Test::Unit::TestCase
10
+ end
@@ -0,0 +1,7 @@
1
+ require 'helper'
2
+
3
+ class TestFrostale < Test::Unit::TestCase
4
+ should "probably rename this file and start testing for real" do
5
+ flunk "hey buddy, you should probably rename this file and start testing for real"
6
+ end
7
+ end
metadata ADDED
@@ -0,0 +1,76 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: frostale
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.2
5
+ platform: ruby
6
+ authors:
7
+ - barce
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2009-12-31 00:00:00 -05:00
13
+ default_executable:
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: aws-s3
17
+ type: :runtime
18
+ version_requirement:
19
+ version_requirements: !ruby/object:Gem::Requirement
20
+ requirements:
21
+ - - "="
22
+ - !ruby/object:Gem::Version
23
+ version: 0.6.2
24
+ version:
25
+ description: Frostale allows active directory login through a ruby gem.
26
+ email: jbarcelona@gmail.com
27
+ executables: []
28
+
29
+ extensions: []
30
+
31
+ extra_rdoc_files:
32
+ - LICENSE
33
+ - README.rdoc
34
+ files:
35
+ - .document
36
+ - .gitignore
37
+ - LICENSE
38
+ - README.rdoc
39
+ - Rakefile
40
+ - VERSION
41
+ - lib/frostale.rb
42
+ - test/helper.rb
43
+ - test/test_frostale.rb
44
+ has_rdoc: true
45
+ homepage: http://github.com/barce/frostale
46
+ licenses: []
47
+
48
+ post_install_message: " \n \n\
49
+ Thank you for installing frostale - more infor is at\n\
50
+ http://github.com/barce/frostale\n \n \n"
51
+ rdoc_options:
52
+ - --charset=UTF-8
53
+ require_paths:
54
+ - lib
55
+ required_ruby_version: !ruby/object:Gem::Requirement
56
+ requirements:
57
+ - - ">="
58
+ - !ruby/object:Gem::Version
59
+ version: "0"
60
+ version:
61
+ required_rubygems_version: !ruby/object:Gem::Requirement
62
+ requirements:
63
+ - - ">="
64
+ - !ruby/object:Gem::Version
65
+ version: "0"
66
+ version:
67
+ requirements: []
68
+
69
+ rubyforge_project:
70
+ rubygems_version: 1.3.5
71
+ signing_key:
72
+ specification_version: 3
73
+ summary: Active Directory Login for the Enterprise
74
+ test_files:
75
+ - test/helper.rb
76
+ - test/test_frostale.rb