rubyntlm 0.4.0 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (36) hide show
  1. checksums.yaml +4 -4
  2. data/.rspec +2 -3
  3. data/README.md +9 -2
  4. data/Rakefile +8 -0
  5. data/examples/http.rb +1 -1
  6. data/lib/net/ntlm.rb +10 -9
  7. data/lib/net/ntlm/blob.rb +17 -6
  8. data/lib/net/ntlm/client.rb +61 -0
  9. data/lib/net/ntlm/client/session.rb +223 -0
  10. data/lib/net/ntlm/encode_util.rb +2 -2
  11. data/lib/net/ntlm/field_set.rb +9 -5
  12. data/lib/net/ntlm/message.rb +23 -9
  13. data/lib/net/ntlm/message/type1.rb +1 -26
  14. data/lib/net/ntlm/message/type2.rb +11 -37
  15. data/lib/net/ntlm/message/type3.rb +77 -14
  16. data/lib/net/ntlm/version.rb +1 -1
  17. data/rubyntlm.gemspec +3 -2
  18. data/spec/lib/net/ntlm/blob_spec.rb +1 -1
  19. data/spec/lib/net/ntlm/client/session_spec.rb +68 -0
  20. data/spec/lib/net/ntlm/client_spec.rb +64 -0
  21. data/spec/lib/net/ntlm/encode_util_spec.rb +3 -3
  22. data/spec/lib/net/ntlm/field_set_spec.rb +4 -4
  23. data/spec/lib/net/ntlm/field_spec.rb +5 -5
  24. data/spec/lib/net/ntlm/message/type1_spec.rb +99 -10
  25. data/spec/lib/net/ntlm/message/type2_spec.rb +68 -24
  26. data/spec/lib/net/ntlm/message/type3_spec.rb +207 -2
  27. data/spec/lib/net/ntlm/security_buffer_spec.rb +8 -8
  28. data/spec/lib/net/ntlm/string_spec.rb +14 -14
  29. data/spec/lib/net/ntlm/version_spec.rb +7 -6
  30. data/spec/lib/net/ntlm_spec.rb +20 -22
  31. data/spec/spec_helper.rb +1 -2
  32. data/spec/support/shared/examples/net/ntlm/field_shared.rb +3 -3
  33. data/spec/support/shared/examples/net/ntlm/fieldset_shared.rb +34 -34
  34. data/spec/support/shared/examples/net/ntlm/int_shared.rb +8 -8
  35. data/spec/support/shared/examples/net/ntlm/message_shared.rb +3 -3
  36. metadata +36 -16
@@ -9,7 +9,7 @@ shared_examples_for 'an integer field' do |values|
9
9
 
10
10
  context '#serialize' do
11
11
  it 'should serialize properly with an integer value' do
12
- subject.serialize.should == values[:default_hex]
12
+ expect(subject.serialize).to eq(values[:default_hex])
13
13
  end
14
14
 
15
15
  it 'should raise an Exception for a String' do
@@ -25,19 +25,19 @@ shared_examples_for 'an integer field' do |values|
25
25
 
26
26
  context '#parse' do
27
27
  it "should parse a raw #{values[:bits].to_s}-bit integer from a string" do
28
- subject.parse(values[:alt_hex]).should == values[:size]
29
- subject.value.should == values[:alt]
28
+ expect(subject.parse(values[:alt_hex])).to eq(values[:size])
29
+ expect(subject.value).to eq(values[:alt])
30
30
  end
31
31
 
32
32
  it "should use an offset to find the #{values[:bits].to_s}-bit integer in the string" do
33
- subject.parse("Value:#{values[:alt_hex]}",6).should == values[:size]
34
- subject.value.should == values[:alt]
33
+ expect(subject.parse("Value:#{values[:alt_hex]}",6)).to eq(values[:size])
34
+ expect(subject.value).to eq(values[:alt])
35
35
  end
36
36
 
37
37
  it 'should return 0 and not change the value if the string is not big enough' do
38
- subject.parse(values[:small]).should == 0
39
- subject.value.should == values[:default]
38
+ expect(subject.parse(values[:small])).to eq(0)
39
+ expect(subject.value).to eq(values[:default])
40
40
  end
41
41
  end
42
42
 
43
- end
43
+ end
@@ -21,15 +21,15 @@ shared_examples_for 'a message' do |flags|
21
21
 
22
22
  flags.each do |flag|
23
23
  it "should be able to check if the #{flag} flag is set" do
24
- test_message.has_flag?(flag).should == true
24
+ expect(test_message.has_flag?(flag)).to be(true)
25
25
  end
26
26
  end
27
27
 
28
28
 
29
29
  it 'should be able to set a new flag' do
30
30
  test_message.set_flag(:DOMAIN_SUPPLIED)
31
- test_message.has_flag?(:DOMAIN_SUPPLIED).should == true
31
+ expect(test_message.has_flag?(:DOMAIN_SUPPLIED)).to be(true)
32
32
  end
33
33
 
34
34
 
35
- end
35
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubyntlm
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kohei Kajimoto
@@ -9,48 +9,62 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-09-12 00:00:00.000000000 Z
12
+ date: 2015-02-22 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
- name: rake
15
+ name: pry
16
16
  requirement: !ruby/object:Gem::Requirement
17
17
  requirements:
18
- - - '>='
18
+ - - ">="
19
19
  - !ruby/object:Gem::Version
20
20
  version: '0'
21
21
  type: :development
22
22
  prerelease: false
23
23
  version_requirements: !ruby/object:Gem::Requirement
24
24
  requirements:
25
- - - '>='
25
+ - - ">="
26
26
  - !ruby/object:Gem::Version
27
27
  version: '0'
28
28
  - !ruby/object:Gem::Dependency
29
- name: rspec
29
+ name: rake
30
30
  requirement: !ruby/object:Gem::Requirement
31
31
  requirements:
32
- - - '>='
32
+ - - ">="
33
33
  - !ruby/object:Gem::Version
34
34
  version: '0'
35
35
  type: :development
36
36
  prerelease: false
37
37
  version_requirements: !ruby/object:Gem::Requirement
38
38
  requirements:
39
- - - '>='
39
+ - - ">="
40
40
  - !ruby/object:Gem::Version
41
41
  version: '0'
42
+ - !ruby/object:Gem::Dependency
43
+ name: rspec
44
+ requirement: !ruby/object:Gem::Requirement
45
+ requirements:
46
+ - - ">="
47
+ - !ruby/object:Gem::Version
48
+ version: '2.11'
49
+ type: :development
50
+ prerelease: false
51
+ version_requirements: !ruby/object:Gem::Requirement
52
+ requirements:
53
+ - - ">="
54
+ - !ruby/object:Gem::Version
55
+ version: '2.11'
42
56
  - !ruby/object:Gem::Dependency
43
57
  name: simplecov
44
58
  requirement: !ruby/object:Gem::Requirement
45
59
  requirements:
46
- - - '>='
60
+ - - ">="
47
61
  - !ruby/object:Gem::Version
48
62
  version: '0'
49
63
  type: :development
50
64
  prerelease: false
51
65
  version_requirements: !ruby/object:Gem::Requirement
52
66
  requirements:
53
- - - '>='
67
+ - - ">="
54
68
  - !ruby/object:Gem::Version
55
69
  version: '0'
56
70
  description: Ruby/NTLM provides message creator and parser for the NTLM authentication.
@@ -61,9 +75,9 @@ executables: []
61
75
  extensions: []
62
76
  extra_rdoc_files: []
63
77
  files:
64
- - .gitignore
65
- - .rspec
66
- - .travis.yml
78
+ - ".gitignore"
79
+ - ".rspec"
80
+ - ".travis.yml"
67
81
  - CHANGELOG.md
68
82
  - Gemfile
69
83
  - LICENSE
@@ -74,6 +88,8 @@ files:
74
88
  - examples/smtp.rb
75
89
  - lib/net/ntlm.rb
76
90
  - lib/net/ntlm/blob.rb
91
+ - lib/net/ntlm/client.rb
92
+ - lib/net/ntlm/client/session.rb
77
93
  - lib/net/ntlm/encode_util.rb
78
94
  - lib/net/ntlm/field.rb
79
95
  - lib/net/ntlm/field_set.rb
@@ -91,6 +107,8 @@ files:
91
107
  - lib/rubyntlm.rb
92
108
  - rubyntlm.gemspec
93
109
  - spec/lib/net/ntlm/blob_spec.rb
110
+ - spec/lib/net/ntlm/client/session_spec.rb
111
+ - spec/lib/net/ntlm/client_spec.rb
94
112
  - spec/lib/net/ntlm/encode_util_spec.rb
95
113
  - spec/lib/net/ntlm/field_set_spec.rb
96
114
  - spec/lib/net/ntlm/field_spec.rb
@@ -121,22 +139,24 @@ require_paths:
121
139
  - lib
122
140
  required_ruby_version: !ruby/object:Gem::Requirement
123
141
  requirements:
124
- - - '>='
142
+ - - ">="
125
143
  - !ruby/object:Gem::Version
126
144
  version: 1.8.7
127
145
  required_rubygems_version: !ruby/object:Gem::Requirement
128
146
  requirements:
129
- - - '>='
147
+ - - ">="
130
148
  - !ruby/object:Gem::Version
131
149
  version: '0'
132
150
  requirements: []
133
151
  rubyforge_project:
134
- rubygems_version: 2.0.3
152
+ rubygems_version: 2.4.2
135
153
  signing_key:
136
154
  specification_version: 4
137
155
  summary: Ruby/NTLM library.
138
156
  test_files:
139
157
  - spec/lib/net/ntlm/blob_spec.rb
158
+ - spec/lib/net/ntlm/client/session_spec.rb
159
+ - spec/lib/net/ntlm/client_spec.rb
140
160
  - spec/lib/net/ntlm/encode_util_spec.rb
141
161
  - spec/lib/net/ntlm/field_set_spec.rb
142
162
  - spec/lib/net/ntlm/field_spec.rb