net-http-ntlm 0.1.0 → 0.2.0
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.
- checksums.yaml +4 -4
- data/.github/workflows/ci.yml +17 -20
- data/.github/workflows/release.yml +39 -0
- data/.gitignore +3 -1
- data/.simplecov +5 -0
- data/CHANGELOG.md +8 -0
- data/README.md +18 -10
- data/lib/net/http/ntlm/transport.rb +1 -1
- data/lib/net/http/ntlm/version.rb +1 -1
- data/net-http-ntlm.gemspec +6 -5
- metadata +22 -23
- data/.rubocop.yml +0 -15
- data/Gemfile.lock +0 -70
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d17690754e29faf36ce1bdb21ec366a0be3ff33340c68cf5c912ff2c8229cf03
|
4
|
+
data.tar.gz: c9a048d0a4867e6497bad06f7fe29efd4d8024ec2af235f2078469d10ba64228
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9705c91a52c549047ac737a433f56882b2334226a68e5c01e512766f1abbcd21665b46ba55f825a95974dcaa36359c0a81d700c8d3586fba9495d0e8cb1c5055
|
7
|
+
data.tar.gz: 282522d98b79f2b87cd933ca49b57b531c3d72a3d7e5a2800ffd522fd641d614304f9d245410d19a47f8c6c9faec9b0ecf4692bbc40e89dc503295e32222632c
|
data/.github/workflows/ci.yml
CHANGED
@@ -1,14 +1,5 @@
|
|
1
1
|
name: CI
|
2
|
-
|
3
|
-
on:
|
4
|
-
push:
|
5
|
-
branches:
|
6
|
-
- main
|
7
|
-
pull_request:
|
8
|
-
pull_request_target:
|
9
|
-
branches:
|
10
|
-
- main
|
11
|
-
|
2
|
+
on: [push, pull_request]
|
12
3
|
jobs:
|
13
4
|
ci:
|
14
5
|
name: CI
|
@@ -16,17 +7,22 @@ jobs:
|
|
16
7
|
matrix:
|
17
8
|
os-version: [ 'ubuntu-latest' ]
|
18
9
|
ruby-version:
|
19
|
-
- 2.5
|
20
|
-
- 2.6
|
21
|
-
- 2.7
|
22
10
|
- 3.0
|
23
|
-
|
11
|
+
- 3.1
|
12
|
+
- 3.2
|
13
|
+
include:
|
14
|
+
- ruby-version: '3.1'
|
15
|
+
coverage: 'true'
|
16
|
+
fail-fast: false
|
24
17
|
|
25
18
|
runs-on: ${{ matrix.os-version }}
|
26
19
|
|
20
|
+
env:
|
21
|
+
COVERAGE: "${{matrix.coverage}}"
|
22
|
+
|
27
23
|
steps:
|
28
24
|
- name: Checkout code
|
29
|
-
uses: actions/checkout@
|
25
|
+
uses: actions/checkout@v3
|
30
26
|
|
31
27
|
- name: Set up Ruby
|
32
28
|
uses: ruby/setup-ruby@v1
|
@@ -35,10 +31,11 @@ jobs:
|
|
35
31
|
bundler-cache: true
|
36
32
|
|
37
33
|
- name: Run bundler-audit
|
38
|
-
run:
|
39
|
-
|
40
|
-
|
41
|
-
# run: bundle exec rubocop
|
34
|
+
run: |
|
35
|
+
bundle exec bundler-audit update
|
36
|
+
bundle exec bundler-audit
|
42
37
|
|
43
38
|
- name: Run rspec
|
44
|
-
|
39
|
+
env:
|
40
|
+
OPENSSL_CONF: etc/openssl.cnf
|
41
|
+
run: bundle exec rspec
|
@@ -0,0 +1,39 @@
|
|
1
|
+
name: Release
|
2
|
+
on:
|
3
|
+
push:
|
4
|
+
branches:
|
5
|
+
- main
|
6
|
+
jobs:
|
7
|
+
release-please:
|
8
|
+
runs-on: ubuntu-latest
|
9
|
+
steps:
|
10
|
+
- uses: GoogleCloudPlatform/release-please-action@v2
|
11
|
+
id: release
|
12
|
+
with:
|
13
|
+
release-type: ruby
|
14
|
+
package-name: release-please-demo
|
15
|
+
bump-minor-pre-major: true
|
16
|
+
version-file: "lib/net/http/ntlm/version.rb"
|
17
|
+
# Checkout code if release was created
|
18
|
+
- uses: actions/checkout@v2
|
19
|
+
if: ${{ steps.release.outputs.release_created }}
|
20
|
+
# Setup ruby if a release was created
|
21
|
+
- uses: ruby/setup-ruby@v1
|
22
|
+
with:
|
23
|
+
ruby-version: 3.1
|
24
|
+
if: ${{ steps.release.outputs.release_created }}
|
25
|
+
# Bundle install
|
26
|
+
- run: bundle install
|
27
|
+
if: ${{ steps.release.outputs.release_created }}
|
28
|
+
# Publish
|
29
|
+
- name: publish gem
|
30
|
+
env:
|
31
|
+
RUBYGEMS_API_KEY: ${{ secrets.RUBYGEMS_API_KEY }}
|
32
|
+
run: |
|
33
|
+
mkdir -p $HOME/.gem
|
34
|
+
touch $HOME/.gem/credentials
|
35
|
+
chmod 0600 $HOME/.gem/credentials
|
36
|
+
printf -- "---\n:rubygems_api_key: ${RUBYGEMS_API_KEY}\n" > $HOME/.gem/credentials
|
37
|
+
gem build *.gemspec
|
38
|
+
gem push *.gem
|
39
|
+
if: ${{ steps.release.outputs.release_created }}
|
data/.gitignore
CHANGED
data/.simplecov
CHANGED
data/CHANGELOG.md
ADDED
data/README.md
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
# net-http-ntlm
|
2
2
|
[](https://github.com/at-point/net-http-ntlm/actions/workflows/ci.yml)
|
3
|
+
[](https://codecov.io/gh/at-point/net-http-ntlm)
|
4
|
+
[](https://badge.fury.io/rb/net-http-ntlm)
|
3
5
|
|
4
6
|
Adds NTLM authentication to HTTP requests using the rubyntlm gem.
|
5
7
|
A drop-in replacement for ruby-ntlm with NTLMv2 support.
|
@@ -7,11 +9,10 @@ A drop-in replacement for ruby-ntlm with NTLMv2 support.
|
|
7
9
|
NTLM authentication is used in Microsoft's server products,
|
8
10
|
such as MS Exchange Server and IIS.
|
9
11
|
|
10
|
-
Install
|
11
|
-
-------
|
12
|
+
## Install
|
12
13
|
|
13
14
|
```sh
|
14
|
-
|
15
|
+
gem install net-http-ntlm
|
15
16
|
```
|
16
17
|
|
17
18
|
If you'd rather install net-http-ntlm using `bundler`, add a line for it in your Gemfile:
|
@@ -20,19 +21,26 @@ If you'd rather install net-http-ntlm using `bundler`, add a line for it in your
|
|
20
21
|
gem 'net-http-ntlm'
|
21
22
|
```
|
22
23
|
|
23
|
-
|
24
|
-
|
24
|
+
## Note about Ruby 3 and OpenSSL 3
|
25
|
+
|
26
|
+
NTLM potentially uses legacy ciphers, which need to be enabled explicitly.
|
27
|
+
|
28
|
+
You can either create a custom OpenSSL profile in Ruby or load a custom SSL
|
29
|
+
configuration by setting `OPENSSL_CONF=` before Ruby loads.
|
30
|
+
|
31
|
+
There's an example in the [Github Actions][.github/workflows/ci.yml]
|
32
|
+
|
33
|
+
## Usage
|
25
34
|
|
26
35
|
```rb
|
27
|
-
require '
|
36
|
+
require 'net/http/ntlm'
|
28
37
|
http = Net::HTTP.new('www.example.com')
|
29
38
|
request = Net::HTTP::Get.new('/')
|
30
39
|
request.ntlm_auth('User', 'Domain', 'Password')
|
31
40
|
response = http.request(request)
|
32
41
|
```
|
33
42
|
|
34
|
-
References
|
35
|
-
----------
|
43
|
+
## References
|
36
44
|
|
37
|
-
|
38
|
-
|
45
|
+
* rubyntlm: https://github.com/WinRb/rubyntlm
|
46
|
+
* ruby-ntlm: https://github.com/macks/ruby-ntlm
|
@@ -13,7 +13,7 @@ module Net::HTTP::NTLM::Transport
|
|
13
13
|
# @param body [String] Request body
|
14
14
|
# @yield [Net::HTTPResponse] Passes the HTTP response object to the block
|
15
15
|
# @return [Net::HTTPResponse] The HTTP response object
|
16
|
-
def request_with_ntlm(req, body = nil, &block)
|
16
|
+
def request_with_ntlm(req, body = nil, &block)
|
17
17
|
# If we don't have NTLM credentials, handle as regular request
|
18
18
|
return request_without_ntlm_auth(req, body, &block) unless req.ntlm_auth_user
|
19
19
|
|
data/net-http-ntlm.gemspec
CHANGED
@@ -11,7 +11,7 @@ Gem::Specification.new do |spec|
|
|
11
11
|
spec.summary = 'NTLM authentication for Net::HTTP'
|
12
12
|
spec.description = 'Adds NTLM authentication support for Net::HTTP using rubyntlm'
|
13
13
|
spec.homepage = 'https://github.com/at-point/net-http-ntlm'
|
14
|
-
spec.required_ruby_version = Gem::Requirement.new('>=
|
14
|
+
spec.required_ruby_version = Gem::Requirement.new('>= 3.0.0')
|
15
15
|
|
16
16
|
spec.metadata['homepage_uri'] = spec.homepage
|
17
17
|
spec.metadata['source_code_uri'] = 'https://github.com/at-point/net-http-ntlm'
|
@@ -20,7 +20,7 @@ Gem::Specification.new do |spec|
|
|
20
20
|
# Specify which files should be added to the gem when it is released.
|
21
21
|
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
22
22
|
spec.files = Dir.chdir(File.expand_path(__dir__)) do
|
23
|
-
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
23
|
+
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features|etc)/}) }
|
24
24
|
end
|
25
25
|
spec.bindir = 'exe'
|
26
26
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
@@ -28,9 +28,10 @@ Gem::Specification.new do |spec|
|
|
28
28
|
|
29
29
|
spec.add_dependency 'rubyntlm', '~> 0.6'
|
30
30
|
|
31
|
-
spec.add_development_dependency 'bundler-audit', '~> 0.
|
32
|
-
spec.add_development_dependency '
|
31
|
+
spec.add_development_dependency 'bundler-audit', '~> 0.9'
|
32
|
+
spec.add_development_dependency 'codecov'
|
33
|
+
spec.add_development_dependency 'rake', '~> 13.0'
|
33
34
|
spec.add_development_dependency 'rspec', '~> 3.0'
|
34
|
-
spec.add_development_dependency 'rubocop', '~> 1.0'
|
35
35
|
spec.add_development_dependency 'simplecov'
|
36
|
+
|
36
37
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: net-http-ntlm
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Simon Schmid
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-12-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rubyntlm
|
@@ -30,56 +30,56 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '0.
|
33
|
+
version: '0.9'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '0.
|
40
|
+
version: '0.9'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
|
-
name:
|
42
|
+
name: codecov
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- - "
|
45
|
+
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '
|
47
|
+
version: '0'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- - "
|
52
|
+
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: '
|
54
|
+
version: '0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
|
-
name:
|
56
|
+
name: rake
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
59
|
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: '
|
61
|
+
version: '13.0'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: '
|
68
|
+
version: '13.0'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
|
-
name:
|
70
|
+
name: rspec
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
73
|
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: '
|
75
|
+
version: '3.0'
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
80
|
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: '
|
82
|
+
version: '3.0'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: simplecov
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
@@ -102,12 +102,12 @@ extensions: []
|
|
102
102
|
extra_rdoc_files: []
|
103
103
|
files:
|
104
104
|
- ".github/workflows/ci.yml"
|
105
|
+
- ".github/workflows/release.yml"
|
105
106
|
- ".gitignore"
|
106
107
|
- ".rspec"
|
107
|
-
- ".rubocop.yml"
|
108
108
|
- ".simplecov"
|
109
|
+
- CHANGELOG.md
|
109
110
|
- Gemfile
|
110
|
-
- Gemfile.lock
|
111
111
|
- LICENSE
|
112
112
|
- README.md
|
113
113
|
- Rakefile
|
@@ -127,7 +127,7 @@ metadata:
|
|
127
127
|
homepage_uri: https://github.com/at-point/net-http-ntlm
|
128
128
|
source_code_uri: https://github.com/at-point/net-http-ntlm
|
129
129
|
changelog_uri: https://github.com/at-point/net-http-ntlm/blob/main/CHANGELOG.md
|
130
|
-
post_install_message:
|
130
|
+
post_install_message:
|
131
131
|
rdoc_options: []
|
132
132
|
require_paths:
|
133
133
|
- lib
|
@@ -135,16 +135,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
135
135
|
requirements:
|
136
136
|
- - ">="
|
137
137
|
- !ruby/object:Gem::Version
|
138
|
-
version:
|
138
|
+
version: 3.0.0
|
139
139
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
140
140
|
requirements:
|
141
141
|
- - ">="
|
142
142
|
- !ruby/object:Gem::Version
|
143
143
|
version: '0'
|
144
144
|
requirements: []
|
145
|
-
|
146
|
-
|
147
|
-
signing_key:
|
145
|
+
rubygems_version: 3.3.26
|
146
|
+
signing_key:
|
148
147
|
specification_version: 4
|
149
148
|
summary: NTLM authentication for Net::HTTP
|
150
149
|
test_files: []
|
data/.rubocop.yml
DELETED
data/Gemfile.lock
DELETED
@@ -1,70 +0,0 @@
|
|
1
|
-
PATH
|
2
|
-
remote: .
|
3
|
-
specs:
|
4
|
-
net-http-ntlm (0.1.0)
|
5
|
-
rubyntlm (~> 0.6)
|
6
|
-
|
7
|
-
GEM
|
8
|
-
remote: https://rubygems.org/
|
9
|
-
specs:
|
10
|
-
ast (2.4.2)
|
11
|
-
bundler-audit (0.8.0)
|
12
|
-
bundler (>= 1.2.0, < 3)
|
13
|
-
thor (~> 1.0)
|
14
|
-
diff-lcs (1.4.4)
|
15
|
-
docile (1.4.0)
|
16
|
-
parallel (1.20.1)
|
17
|
-
parser (3.0.1.1)
|
18
|
-
ast (~> 2.4.1)
|
19
|
-
rainbow (3.0.0)
|
20
|
-
rake (12.3.3)
|
21
|
-
regexp_parser (2.1.1)
|
22
|
-
rexml (3.2.5)
|
23
|
-
rspec (3.10.0)
|
24
|
-
rspec-core (~> 3.10.0)
|
25
|
-
rspec-expectations (~> 3.10.0)
|
26
|
-
rspec-mocks (~> 3.10.0)
|
27
|
-
rspec-core (3.10.1)
|
28
|
-
rspec-support (~> 3.10.0)
|
29
|
-
rspec-expectations (3.10.1)
|
30
|
-
diff-lcs (>= 1.2.0, < 2.0)
|
31
|
-
rspec-support (~> 3.10.0)
|
32
|
-
rspec-mocks (3.10.2)
|
33
|
-
diff-lcs (>= 1.2.0, < 2.0)
|
34
|
-
rspec-support (~> 3.10.0)
|
35
|
-
rspec-support (3.10.2)
|
36
|
-
rubocop (1.15.0)
|
37
|
-
parallel (~> 1.10)
|
38
|
-
parser (>= 3.0.0.0)
|
39
|
-
rainbow (>= 2.2.2, < 4.0)
|
40
|
-
regexp_parser (>= 1.8, < 3.0)
|
41
|
-
rexml
|
42
|
-
rubocop-ast (>= 1.5.0, < 2.0)
|
43
|
-
ruby-progressbar (~> 1.7)
|
44
|
-
unicode-display_width (>= 1.4.0, < 3.0)
|
45
|
-
rubocop-ast (1.6.0)
|
46
|
-
parser (>= 3.0.1.1)
|
47
|
-
ruby-progressbar (1.11.0)
|
48
|
-
rubyntlm (0.6.3)
|
49
|
-
simplecov (0.21.2)
|
50
|
-
docile (~> 1.1)
|
51
|
-
simplecov-html (~> 0.11)
|
52
|
-
simplecov_json_formatter (~> 0.1)
|
53
|
-
simplecov-html (0.12.3)
|
54
|
-
simplecov_json_formatter (0.1.3)
|
55
|
-
thor (1.1.0)
|
56
|
-
unicode-display_width (2.0.0)
|
57
|
-
|
58
|
-
PLATFORMS
|
59
|
-
ruby
|
60
|
-
|
61
|
-
DEPENDENCIES
|
62
|
-
bundler-audit (~> 0.8)
|
63
|
-
net-http-ntlm!
|
64
|
-
rake (~> 12.0)
|
65
|
-
rspec (~> 3.0)
|
66
|
-
rubocop (~> 1.0)
|
67
|
-
simplecov
|
68
|
-
|
69
|
-
BUNDLED WITH
|
70
|
-
2.1.4
|