lawn-login 0.0.6

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.

Potentially problematic release.


This version of lawn-login might be problematic. Click here for more details.

Files changed (9) hide show
  1. data.tar.gz.sig +0 -0
  2. data/History.txt +19 -0
  3. data/Manifest.txt +6 -0
  4. data/README.txt +44 -0
  5. data/Rakefile +12 -0
  6. data/bin/lawn +50 -0
  7. data/lib/lawn.rb +22 -0
  8. metadata +102 -0
  9. metadata.gz.sig +3 -0
Binary file
@@ -0,0 +1,19 @@
1
+ === 0.0.6 / 2008-09-24
2
+ * Fixed a general build error.
3
+
4
+ === 0.0.5 / 2008-09-24
5
+ * Now using the ezcrypto library instead of Crypt
6
+
7
+ === 0.0.4 / 2008-09-24
8
+ * Separated some calls into new library.
9
+
10
+ === 0.0.3 / 2008-09-24
11
+ * Initial working copy. A bit rough though.
12
+
13
+ === 0.0.2 / 2008-09-23
14
+ * Almost working copy.
15
+
16
+ === 0.0.1 / 2008-09-22
17
+
18
+ * Initial creation.
19
+
@@ -0,0 +1,6 @@
1
+ History.txt
2
+ Manifest.txt
3
+ README.txt
4
+ Rakefile
5
+ bin/lawn
6
+ lib/lawn.rb
@@ -0,0 +1,44 @@
1
+ = lawn-login
2
+
3
+ * http://github.com/Oompa/lawn-login
4
+
5
+ == DESCRIPTION:
6
+
7
+ A small gem which provides a secure method of logging into the GATech LAWN network.
8
+
9
+ == SYNOPSIS:
10
+
11
+ lawn <password>
12
+
13
+ == REQUIREMENTS:
14
+
15
+ * EZCrypto gem
16
+
17
+ == INSTALL:
18
+
19
+ * sudo gem install lawn
20
+
21
+ == LICENSE:
22
+
23
+ (The MIT License)
24
+
25
+ Copyright (c) 2008 Mike Skalnik
26
+
27
+ Permission is hereby granted, free of charge, to any person obtaining
28
+ a copy of this software and associated documentation files (the
29
+ 'Software'), to deal in the Software without restriction, including
30
+ without limitation the rights to use, copy, modify, merge, publish,
31
+ distribute, sublicense, and/or sell copies of the Software, and to
32
+ permit persons to whom the Software is furnished to do so, subject to
33
+ the following conditions:
34
+
35
+ The above copyright notice and this permission notice shall be
36
+ included in all copies or substantial portions of the Software.
37
+
38
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
39
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
40
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
41
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
42
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
43
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
44
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,12 @@
1
+ require 'rubygems'
2
+ require 'hoe'
3
+ require 'lib/lawn.rb'
4
+
5
+ Hoe.new('lawn-login', Lawn::VERSION) do |p|
6
+ p.developer('Mike Skalnik', 'mike.skalnik@gmail.com')
7
+ p.remote_rdoc_dir = '' # Release to root
8
+ p.description = "A small gem which provides a secure method of logging into the GATech LAWN network."
9
+ p.summary = %q{A gem for easing the login to the GATech LAWN network.}
10
+ p.url = "http://github.com/Oompa/lawn-login"
11
+ p.extra_deps = ["ezcrypto"]
12
+ end
@@ -0,0 +1,50 @@
1
+ #!/usr/bin/ruby
2
+ require 'rubygems'
3
+ require 'ezcrypto'
4
+ require 'optparse'
5
+ require 'yaml'
6
+ require 'lawn'
7
+
8
+ options = Hash.new(false)
9
+
10
+ OptionParser.new do |opts|
11
+ opts.banner = "Usage: lawn [options]"
12
+ opts.on("-s", "--setup", "Re-run the interactive setup. For example, when LAWN password is changed.") do |opt|
13
+ options[:setup] = true
14
+ end
15
+ opts.on("-p", "--password", "Reset your LAWN password.") do |opt|
16
+ options[:password] = true
17
+ end
18
+ end.parse!
19
+
20
+ file = File.expand_path('~/.lawn')
21
+ info = Hash.new
22
+
23
+ if !File.exists?(file) or options[:setup] # First run or rerun setup.
24
+ print "LAWN username? "
25
+ info[:username] = gets.chomp
26
+ print "LAWN password? "
27
+ info[:encrypted_password] = Lawn.encrypt_password(Lawn.get_encryption_password(info[:username]), gets.chomp)
28
+
29
+ File.open(file, 'w') { |f|
30
+ f.write(YAML::dump(info))
31
+ }
32
+ puts "OK. Lawn-login is now setup, now attempting to login for the first time. To login next time, run `lawn`."
33
+ else # File exists, so lets get the info from there!
34
+ info = YAML.load_file(file)
35
+ end
36
+
37
+ if options[:password]
38
+ puts info[:encrypted_password]
39
+ print "New LAWN password? "
40
+ puts info[:encrypted_password] = Lawn.encrypt_password(Lawn::get_encryption_password(info[:username]), gets.chomp)
41
+
42
+ File.open(file, 'w') { |f|
43
+ f.write(YAML::dump(info))
44
+ }
45
+ end
46
+
47
+
48
+ PASSWORD = Lawn.decrypt_password(Lawn.get_encryption_password(info[:username]), info[:encrypted_password])
49
+ USERNAME = info[:username]
50
+ puts `curl -s -f -F username=\'#{USERNAME}\' -F password=\'#{PASSWORD}\' -F iss=\'false\' -F output=\'text\' https://auth.lawn.gatech.edu/index.php`
@@ -0,0 +1,22 @@
1
+ require 'rubygems'
2
+ require 'ezcrypto'
3
+ module Lawn
4
+ extend self
5
+ VERSION = "0.0.6"
6
+
7
+ def get_encryption_password(username)
8
+ if username.length < 7
9
+ username << ("!" * 7)
10
+ else
11
+ username
12
+ end
13
+ end
14
+
15
+ def encrypt_password(encryption_password, password)
16
+ EzCrypto::Key.encrypt_with_password encryption_password, "salt", password
17
+ end
18
+
19
+ def decrypt_password(encryption_password, password)
20
+ EzCrypto::Key.decrypt_with_password encryption_password, "salt", password
21
+ end
22
+ end
metadata ADDED
@@ -0,0 +1,102 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: lawn-login
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.6
5
+ platform: ruby
6
+ authors:
7
+ - Mike Skalnik
8
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WxG+NB1jOVhfu0Ca
28
+ B5H8r4SyOphCTKpS98Tow/xlKdIxMIBzPlE5v4JcQ/C9md15eou++mU1sasjqtBu
29
+ F7c6BF4ofyU8+mL+RY2ih85FC0kMlM1Yhs/ZdEIjai3I6KYQtJJNVK/7x5vJAvLo
30
+ jjVX87g40jCN9NIGt+c=
31
+ -----END CERTIFICATE-----
32
+
33
+ date: 2008-09-24 00:00:00 -04:00
34
+ default_executable:
35
+ dependencies:
36
+ - !ruby/object:Gem::Dependency
37
+ name: ezcrypto
38
+ type: :runtime
39
+ version_requirement:
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ requirements:
42
+ - - ">="
43
+ - !ruby/object:Gem::Version
44
+ version: "0"
45
+ version:
46
+ - !ruby/object:Gem::Dependency
47
+ name: hoe
48
+ type: :development
49
+ version_requirement:
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: 1.7.0
55
+ version:
56
+ description: A small gem which provides a secure method of logging into the GATech LAWN network.
57
+ email:
58
+ - mike.skalnik@gmail.com
59
+ executables:
60
+ - lawn
61
+ extensions: []
62
+
63
+ extra_rdoc_files:
64
+ - History.txt
65
+ - Manifest.txt
66
+ - README.txt
67
+ files:
68
+ - History.txt
69
+ - Manifest.txt
70
+ - README.txt
71
+ - Rakefile
72
+ - bin/lawn
73
+ - lib/lawn.rb
74
+ has_rdoc: true
75
+ homepage: http://github.com/Oompa/lawn-login
76
+ post_install_message:
77
+ rdoc_options:
78
+ - --main
79
+ - README.txt
80
+ require_paths:
81
+ - lib
82
+ required_ruby_version: !ruby/object:Gem::Requirement
83
+ requirements:
84
+ - - ">="
85
+ - !ruby/object:Gem::Version
86
+ version: "0"
87
+ version:
88
+ required_rubygems_version: !ruby/object:Gem::Requirement
89
+ requirements:
90
+ - - ">="
91
+ - !ruby/object:Gem::Version
92
+ version: "0"
93
+ version:
94
+ requirements: []
95
+
96
+ rubyforge_project: lawn-login
97
+ rubygems_version: 1.2.0
98
+ signing_key:
99
+ specification_version: 2
100
+ summary: A gem for easing the login to the GATech LAWN network.
101
+ test_files: []
102
+
@@ -0,0 +1,3 @@
1
+ ;A�r{ff�,�[�j.����e���ƫ�3,�;l>PQ���ƽ6�ٺ,�F-
2
+ �иoe��%?Tb�G��+��Dxݲ�T��P;G�F��wo���|���7-�Mn,+�PH���e��T��hx�*(u���ck�=�̀j�M�_#�F_�ڍ"�`l�P��"�g�P)����x�#�'���x_ߦ
3
+ �H��h䕫T�x<9�{QA7JCV�6��e�W�l� ���k�$qPʿ��.dǝ�i��fNT{� �5