mongo_kerberos 2.1.1 → 2.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0e6ada2e4a0ddcaf0c1bb4c4a64ca232977bfaca7cd70116179d93dd48852975
4
- data.tar.gz: ff2b0390d7937b433e0a8c2fed0f8823ec290b542f01b7c54bc7e2f241af5854
3
+ metadata.gz: ce9257ac8238a5bd7549c9ff4c38088236b8a1f48205d501d557755d4d7a143d
4
+ data.tar.gz: f96d3525f760c37ac7349d6faf1f14420c57f5279004388ebfa508f0dad4a307
5
5
  SHA512:
6
- metadata.gz: 2b93ad2ab566e16181b640217af56ef0e9d865230250bd673b10191b518f613c4b6aad07654650ab721c0a6a9807ac7de92e94d6a7a73fe5577d211158c631e6
7
- data.tar.gz: 13cb346db91f3a813a97c3612a5f43650db61993f6390128398c98942f7e6b709f1df178ef4e4bac181fa32f1474048fdc0c8c4408e7ad0a936a9ba74bec4c0e
6
+ metadata.gz: 00d80f43916a7b676ed14a456f3aecf4627b003f1a40e349ac25dc8d28f4ea1491e7c8896b93d2d59142b757d03b0cf114940a9e9e42cd4ed4c9a809f3fc99ea
7
+ data.tar.gz: 9a9c72ae5b05c7cf95e6e829a5870689f75128c844a5fd262dc35ff5268f1e12da2a5d18b7020c55e19939e11dfe906e161c1d9d5ac9903e40108721b92df8da
data/CONTRIBUTING.md CHANGED
@@ -21,8 +21,6 @@ specs should follow the following guidelines:
21
21
  - Use `context` blocks to set up conditions.
22
22
  - Always provide descriptive specifications via `it`.
23
23
 
24
- Specs can be automatically run with Guard, via `bundle exec guard`
25
-
26
24
  Before commiting, run `rake` to ensure all specs pass with both pure Ruby and
27
25
  the native extensions.
28
26
 
data/README.md CHANGED
@@ -1,11 +1,11 @@
1
- # Mongo Kerberos [![Build Status](https://secure.travis-ci.org/mongodb/mongo-ruby-kerberos.png?branch=master&.png)](http://travis-ci.org/mongodb/mongo-ruby-kerberos) [![Code Climate](https://codeclimate.com/github/mongodb/mongo-ruby-kerberos.png)](https://codeclimate.com/github/mongodb/mongo-ruby-kerberos) [![Coverage Status](https://coveralls.io/repos/mongodb/mongo-ruby-kerberos/badge.png?branch=master)](https://coveralls.io/r/mongodb/mongo-ruby-kerberos?branch=master)
1
+ # Mongo Kerberos
2
2
 
3
3
  Provides Kerberos authentication support to the Mongo Ruby Driver.
4
4
 
5
5
 
6
6
  ## Compatibility
7
7
 
8
- mongo_kerberos is tested against MRI (1.9.3+) and JRuby (9.1+).
8
+ mongo_kerberos is tested against MRI (2.7+) and JRuby (9.3+).
9
9
 
10
10
  ### JRuby
11
11
 
@@ -33,11 +33,36 @@ Require the `mongo_kerberos` gem in your application.
33
33
  require "mongo_kerberos"
34
34
  ```
35
35
 
36
+ ### Release Integrity
37
+
38
+ Each release of this Kerberos authentication module after version 2.1.1 has been automatically built and signed using the team's GPG key.
39
+
40
+ To verify the module's gem file:
41
+
42
+ 1. [Download the GPG key](https://pgp.mongodb.com/ruby-driver.asc).
43
+ 2. Import the key into your GPG keyring with `gpg --import ruby-driver.asc`.
44
+ 3. Download the gem file (if you don't already have it). You can download it from RubyGems with `gem fetch mongo_kerberos`, or you can download it from the [releases page](https://github.com/mongodb/mongo-ruby-kerberos/releases) on GitHub.
45
+ 4. Download the corresponding detached signature file from the [same release](https://github.com/mongodb/mongo-ruby-kerberos/releases). Look at the bottom of the release that corresponds to the gem file, under the 'Assets' list, for a `.sig` file with the same version number as the gem you wish to install.
46
+ 5. Verify the gem with `gpg --verify mongo_kerberos-X.Y.Z.gem.sig mongo_kerberos-X.Y.Z.gem` (replacing `X.Y.Z` with the actual version number).
47
+
48
+ You are looking for text like "Good signature from "MongoDB Ruby Driver Release Signing Key <packaging@mongodb.com>" in the output. If you see that, the signature was found to correspond to the given gem file.
49
+
50
+ (Note that other output, like "This key is not certified with a trusted signature!", is related to *web of trust* and depends on how strongly you, personally, trust the `ruby-driver.asc` key that you downloaded from us. To learn more, see https://www.gnupg.org/gph/en/manual/x334.html)
51
+
52
+ ### Why not use RubyGems' gem-signing functionality?
53
+
54
+ RubyGems' own gem signing is problematic, most significantly because there is no established chain of trust related to the keys used to sign gems. RubyGems' own documentation admits that "this method of signing gems is not widely used" (see https://guides.rubygems.org/security/). Discussions about this in the RubyGems community have been off-and-on for more than a decade, and while a solution will eventually arrive, we have settled on using GPG instead for the following reasons:
55
+
56
+ 1. Many of the other driver teams at MongoDB are using GPG to sign their product releases. Consistency with the other teams means that we can reuse existing tooling for our own product releases.
57
+ 2. GPG is widely available and has existing tools and procedures for dealing with web of trust (though they are admittedly quite arcane and intimidating to the uninitiated, unfortunately).
58
+
59
+ Ultimately, most users do not bother to verify gems, and will not be impacted by our choice of GPG over RubyGems' native method.
60
+
36
61
 
37
62
  ## API Documentation
38
63
 
39
- The [API Documentation](http://rdoc.info/github/mongodb/mongo-ruby-kerberos/master/frames) is
40
- located at rdoc.info.
64
+ Please see the [Kerberos authentication section](https://www.mongodb.com/docs/ruby-driver/current/reference/authentication/#kerberos--gssapi-)
65
+ of the Ruby driver documentation for high level documentation of this library.
41
66
 
42
67
  ## Versioning
43
68
 
data/Rakefile CHANGED
@@ -31,6 +31,7 @@ if jruby?
31
31
  ext.name = "native"
32
32
  ext.ext_dir = "src"
33
33
  ext.lib_dir = "lib/mongo/auth/kerberos"
34
+ ext.release = ENV['JAVA_RELEASE'].to_i if ENV['JAVA_RELEASE']
34
35
  end
35
36
  else
36
37
  require "rake/extensiontask"
@@ -41,28 +42,73 @@ else
41
42
  end
42
43
  end
43
44
 
44
- require "mongo/auth/kerberos/version"
45
+ desc "[INTERNAL] Loads the library's version"
46
+ task :load_version do
47
+ require 'mongo/auth/kerberos/version'
48
+ end
45
49
 
46
- def extension
47
- RUBY_PLATFORM =~ /darwin/ ? "bundle" : "so"
50
+ desc 'Print the current version (used for releases)'
51
+ task version: :load_version do
52
+ puts Mongo::Auth::Kerberos::VERSION
48
53
  end
49
54
 
50
55
  RSpec::Core::RakeTask.new(:rspec)
51
56
 
52
- if jruby?
53
- task :build => [ :clean_all, :compile ] do
54
- system "gem build mongo_kerberos.gemspec"
57
+ # `rake version` is used by the deployment system so get the release version
58
+ # of the product beng deployed. It must do nothing more than just print the
59
+ # product version number.
60
+ desc 'Print the current version'
61
+ task :build => [ :clean_all, *(jruby? ? :compile : nil) ] do
62
+ output = "--output=#{ENV['GEM_FILE_NAME']}" if ENV['GEM_FILE_NAME']
63
+ system "gem build #{output} mongo_kerberos.gemspec"
64
+ end
65
+
66
+ # `rake gem_file_name` is used by the deployment system so get the name of
67
+ # the gem file to be generated. It must do nothing more than just print the
68
+ # name of the gem file to generate.
69
+ desc 'Print the name of the gem file to generate.'
70
+ task gem_file_name: :load_version do
71
+ base = "mongo_kerberos-#{Mongo::Auth::Kerberos::VERSION}"
72
+ base << '-java' if jruby?
73
+ puts "#{base}.gem"
74
+ end
75
+
76
+ # overrides the default Bundler-provided `release` task, which also
77
+ # builds the gems. Our release process assumes the gems have already
78
+ # been built (and signed via GPG), so we just need `rake release` to
79
+ # push the gems to rubygems.
80
+ desc 'Push the generated gems to RubyGems'
81
+ task :release do
82
+ # confirm: there ought to be two gems, one for MRI, and one for Java. These
83
+ # will have been previously generated by the 'Release' GitHub action.
84
+ gems = Dir['*.gem']
85
+ if gems.length != 2
86
+ abort "Expected two gem files to be ready to release; got #{gems.length}"
55
87
  end
56
- else
57
- task :build => :clean_all do
58
- system "gem build mongo_kerberos.gemspec"
88
+
89
+ if ENV['GITHUB_ACTION'].nil?
90
+ abort <<~WARNING
91
+ `rake release` must be invoked from the `Release` GitHub action,
92
+ and must not be invoked locally. This ensures the gem is properly signed
93
+ and distributed by the appropriate user.
94
+
95
+ Note that it is the `rubygems/release-gem@v1` step in the `Release`
96
+ action that invokes this task. Do not rename or remove this task, or the
97
+ release-gem step will fail. Reimplement this task with caution.
98
+
99
+ NO GEMS were pushed to RubyGems.
100
+ WARNING
101
+ end
102
+
103
+ gems.each do |gem|
104
+ system 'gem', 'push', gem
59
105
  end
60
106
  end
61
107
 
62
108
  task :clean_all => :clean do
63
109
  begin
64
110
  Dir.chdir(Pathname(__FILE__).dirname + "lib") do
65
- ["o", extension, "jar"].each do |e|
111
+ %w[ o bundle so jar ].each do |e|
66
112
  Dir.glob(File.join("**", "*.#{e}")).each do |f|
67
113
  `rm #{f}`
68
114
  end
@@ -77,24 +123,6 @@ task :spec => :compile do
77
123
  Rake::Task["rspec"].invoke
78
124
  end
79
125
 
80
- # Run bundle exec rake release with mri and jruby. Ex:
81
- #
82
- # rvm use 2.1.0@mongo_kerberos
83
- # bundle exec rake release
84
- # rvm use jruby@mongo_kerberos
85
- # bundle exec rake release
86
- task :release => :build do
87
- system "git tag -a #{Mongo::Auth::Kerberos::VERSION} -m 'Tagging release: #{Mongo::Auth::Kerberos::VERSION}'"
88
- system "git push --tags"
89
- if jruby?
90
- system "gem push mongo_kerberos-#{Mongo::Auth::Kerberos::VERSION}-java.gem"
91
- system "rm mongo_kerberos-#{Mongo::Auth::Kerberos::VERSION}-java.gem"
92
- else
93
- system "gem push mongo_kerberos-#{Mongo::Auth::Kerberos::VERSION}.gem"
94
- system "rm mongo_kerberos-#{Mongo::Auth::Kerberos::VERSION}.gem"
95
- end
96
- end
97
-
98
126
  task :default => [ :clean_all, :spec ]
99
127
 
100
128
  desc "Generate all documentation"
@@ -102,7 +130,7 @@ task :docs => 'docs:yard'
102
130
 
103
131
  namespace :docs do
104
132
  desc "Generate yard documention"
105
- task :yard do
133
+ task yard: :load_version do
106
134
  out = File.join('yard-docs', Mongo::Auth::Kerberos::VERSION)
107
135
  FileUtils.rm_rf(out)
108
136
  system "yardoc -o #{out} --title mongo-ruby-kerberos-#{Mongo::Auth::Kerberos::VERSION}"
@@ -127,25 +127,12 @@ module Mongo
127
127
 
128
128
  private
129
129
 
130
- if BSON::Environment.jruby?
131
-
132
- def start_token
133
- BSON::Binary.new(authenticator.initialize_challenge)
134
- end
135
-
136
- def continue_token
137
- payload = reply.documents[0][PAYLOAD]
138
- BSON::Binary.new(authenticator.evaluate_challenge(payload.data))
139
- end
140
- else
141
-
142
- def start_token
143
- authenticator.initialize_challenge
144
- end
130
+ def start_token
131
+ authenticator.initialize_challenge
132
+ end
145
133
 
146
- def continue_token
147
- authenticator.evaluate_challenge(reply.documents[0][PAYLOAD])
148
- end
134
+ def continue_token
135
+ authenticator.evaluate_challenge(reply.documents[0][PAYLOAD])
149
136
  end
150
137
 
151
138
  def validate!(reply)
@@ -13,7 +13,9 @@
13
13
  # limitations under the License.
14
14
 
15
15
  require 'java'
16
+ require 'jruby'
16
17
  require 'mongo/auth/kerberos/native.jar'
18
+ require 'forwardable'
17
19
 
18
20
  module Mongo
19
21
  module Auth
@@ -1,23 +1,11 @@
1
- # Copyright (C) 2015 MongoDB, Inc.
2
- #
3
- # Licensed under the Apache License, Version 2.0 (the "License");
4
- # you may not use this file except in compliance with the License.
5
- # You may obtain a copy of the License at
6
- #
7
- # http://www.apache.org/licenses/LICENSE-2.0
8
- #
9
- # Unless required by applicable law or agreed to in writing, software
10
- # distributed under the License is distributed on an "AS IS" BASIS,
11
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- # See the License for the specific language governing permissions and
13
- # limitations under the License.
1
+ # frozen_string_literal: true
14
2
 
15
3
  module Mongo
16
4
  module Auth
17
5
  class Kerberos
18
6
 
19
7
  # The gem version number.
20
- VERSION = '2.1.1'.freeze
8
+ VERSION = '2.1.2'
21
9
  end
22
10
  end
23
11
  end
@@ -57,13 +57,9 @@ describe Mongo::Auth::Kerberos::Conversation do
57
57
  expect(selector[:mechanism]).to eq('GSSAPI')
58
58
  end
59
59
 
60
- it 'sets the payload', unless: BSON::Environment.jruby? do
60
+ it 'sets the payload' do
61
61
  expect(selector[:payload]).to start_with('test')
62
62
  end
63
-
64
- it 'sets the payload', if: BSON::Environment.jruby? do
65
- expect(selector[:payload].data).to start_with('test')
66
- end
67
63
  end
68
64
 
69
65
  describe '#finalize' do
@@ -72,8 +68,10 @@ describe Mongo::Auth::Kerberos::Conversation do
72
68
  Mongo::Protocol::Reply.new
73
69
  end
74
70
 
71
+ let(:continue_token_contents) { 'testing' }
72
+
75
73
  let(:continue_token) do
76
- BSON::Environment.jruby? ? BSON::Binary.new('testing') : 'testing'
74
+ continue_token_contents
77
75
  end
78
76
 
79
77
  context 'when the conversation is a success' do
@@ -82,7 +80,7 @@ describe Mongo::Auth::Kerberos::Conversation do
82
80
  [{
83
81
  'conversationId' => 1,
84
82
  'done' => false,
85
- 'payload' => continue_token,
83
+ 'payload' => continue_token_contents,
86
84
  'ok' => 1.0
87
85
  }]
88
86
  end
@@ -97,7 +95,7 @@ describe Mongo::Auth::Kerberos::Conversation do
97
95
 
98
96
  before do
99
97
  expect(authenticator).to receive(:evaluate_challenge).
100
- with('testing').and_return(continue_token)
98
+ with(continue_token_contents).and_return(continue_token_contents)
101
99
  reply.instance_variable_set(:@documents, documents)
102
100
  end
103
101
 
@@ -105,14 +103,10 @@ describe Mongo::Auth::Kerberos::Conversation do
105
103
  expect(selector[:conversationId]).to eq(1)
106
104
  end
107
105
 
108
- it 'sets the payload', unless: BSON::Environment.jruby? do
106
+ it 'sets the payload' do
109
107
  expect(selector[:payload]).to eq(continue_token)
110
108
  end
111
109
 
112
- it 'sets the payload', if: BSON::Environment.jruby? do
113
- expect(selector[:payload].data).to eq(continue_token)
114
- end
115
-
116
110
  it 'sets the continue flag' do
117
111
  expect(selector[:saslContinue]).to eq(1)
118
112
  end
data/spec/spec_helper.rb CHANGED
@@ -15,15 +15,6 @@
15
15
  $LOAD_PATH.unshift(File.dirname(__FILE__))
16
16
  $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), "..", "lib"))
17
17
 
18
- if ENV["CI"] && !ENV["WITH_EXT"]
19
- require "simplecov"
20
- require "coveralls"
21
- SimpleCov.formatter = Coveralls::SimpleCov::Formatter
22
- SimpleCov.start do
23
- add_filter "spec"
24
- end
25
- end
26
-
27
18
  require "mongo_kerberos"
28
19
  require "rspec"
29
20
 
metadata CHANGED
@@ -1,42 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mongo_kerberos
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.1
4
+ version: 2.1.2
5
5
  platform: ruby
6
6
  authors:
7
- - Emily Stolfo
8
- - Durran Jordan
9
- autorequire:
7
+ - The MongoDB Ruby Team
8
+ autorequire:
10
9
  bindir: bin
11
- cert_chain:
12
- - |
13
- -----BEGIN CERTIFICATE-----
14
- MIIEeDCCAuCgAwIBAgIBATANBgkqhkiG9w0BAQsFADBBMREwDwYDVQQDDAhkYngt
15
- cnVieTEXMBUGCgmSJomT8ixkARkWB21vbmdvZGIxEzARBgoJkiaJk/IsZAEZFgNj
16
- b20wHhcNMjMwMTMxMTE1NjM1WhcNMjQwMTMxMTE1NjM1WjBBMREwDwYDVQQDDAhk
17
- YngtcnVieTEXMBUGCgmSJomT8ixkARkWB21vbmdvZGIxEzARBgoJkiaJk/IsZAEZ
18
- FgNjb20wggGiMA0GCSqGSIb3DQEBAQUAA4IBjwAwggGKAoIBgQC0/Veq9l47cTfX
19
- tQ+kHq2NOCwJuJGt1iXWQ/vH/yp7pZ/bLej7gPDl2CfIngAXRjM7r1FkR9ya7VAm
20
- IneBFcVU3HhpIXWi4ByXGjBOXFD1Dfbz4C4zedIWRk/hNzXa+rQY4KPwpOwG/hZg
21
- id+rSXWSbNlkyN97XfonweVh7JsIa9X/2JY9ADYjhCfEZF+b0+Wl7+jgwzLWb46I
22
- 0WH0bZBIZ0BbKAwUXIgvq5mQf9PzukmMVYCwnkJ/P4wrHO22HuwnbMyvJuGjVwqi
23
- j1NRp/2vjmKBFWxIfhlSXEIiqAmeEVNXzhPvTVeyo+rma+7R3Bo+4WHkcnPpXJJZ
24
- Jd63qXMvTB0GplEcMJPztWhrJOmcxIOVoQyigEPSQT8JpzFVXby4SGioizv2eT7l
25
- VYSiCHuc3yEDyq5M+98WGX2etbj6esYtzI3rDevpIAHPB6HQmtoJIA4dSl3gjFb+
26
- D+YQSuB2qYu021FI9zeY9sbZyWysEXBxhwrmTk+XUV0qz+OQZkMCAwEAAaN7MHkw
27
- CQYDVR0TBAIwADALBgNVHQ8EBAMCBLAwHQYDVR0OBBYEFH4nnr4tYlatU57RbExW
28
- jG86YM5nMB8GA1UdEQQYMBaBFGRieC1ydWJ5QG1vbmdvZGIuY29tMB8GA1UdEgQY
29
- MBaBFGRieC1ydWJ5QG1vbmdvZGIuY29tMA0GCSqGSIb3DQEBCwUAA4IBgQAVSlgM
30
- nFDWCCNLOCqG5/Lj4U62XoALkdCI+OZ30+WrA8qiRLSL9ZEziVK9AV7ylez+sriQ
31
- m8XKZKsCN5ON4+zXw1S+6Ftz/R4zDg7nTb9Wgw8ibzsoiP6e4pRW3Fls3ZdaG4pW
32
- +qMTbae9OiSrgI2bxNTII+v+1FcbQjOlMu8HPZ3ZfXnurXPgN5GxSyyclZI1QONO
33
- HbUoKHRirZu0F7JCvQQq4EkSuLWPplRJfYEeJIYm05zhhFeEyqea2B/TTlCtXa42
34
- 84vxXsxGzumuO8F2Q9m6/p95sNhqCp0B/SkKXIrRGJ7FBzupoORNRXHviS2OC3ty
35
- 4lwUzOlLTF/yO0wwYYfmtQOALQwKnW838vbYthMXvTjxB0EgVZ5PKto99WbjsXzy
36
- wkeAWhd5b+5JS0zgDL4SvGB8/W2IY+y0zELkojBMgJPyrpAWHL/WSsSBMuhyI2Pv
37
- xxaBVLklnJJ/qCCOZ3lG2MyVc/Nb0Mmq8ygWNsfwHmKKYuuWcviit0D0Tek=
38
- -----END CERTIFICATE-----
39
- date: 2023-06-12 00:00:00.000000000 Z
10
+ cert_chain: []
11
+ date: 2024-11-08 00:00:00.000000000 Z
40
12
  dependencies:
41
13
  - !ruby/object:Gem::Dependency
42
14
  name: mongo
@@ -54,8 +26,7 @@ dependencies:
54
26
  version: '2.0'
55
27
  description: Adds Kerberos authentication via libsasl to the MongoDB Ruby Driver on
56
28
  MRI and JRuby
57
- email:
58
- - mongodb-dev@googlegroups.com
29
+ email: dbx-ruby@mongodb.com
59
30
  executables: []
60
31
  extensions:
61
32
  - ext/mongo_kerberos/extconf.rb
@@ -77,11 +48,15 @@ files:
77
48
  - spec/mongo/auth/kerberos/conversation_spec.rb
78
49
  - spec/mongo/auth/kerberos/mri/authenticator_spec.rb
79
50
  - spec/spec_helper.rb
80
- homepage: http://www.mongodb.org
51
+ homepage: https://docs.mongodb.com/ruby-driver/current/tutorials/ruby-driver-authentication/#kerberos-gssapi-mechanism
81
52
  licenses:
82
- - Apache License Version 2.0
83
- metadata: {}
84
- post_install_message:
53
+ - Apache-2.0
54
+ metadata:
55
+ bug_tracker_uri: https://jira.mongodb.org/projects/RUBY
56
+ changelog_uri: https://github.com/mongodb/mongo-ruby-kerberos/releases
57
+ documentation_uri: https://www.mongodb.com/docs/ruby-driver/current/reference/authentication/#kerberos--gssapi-
58
+ source_code_uri: https://github.com/mongodb/mongo-ruby-kerberos
59
+ post_install_message:
85
60
  rdoc_options: []
86
61
  require_paths:
87
62
  - lib
@@ -96,8 +71,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
96
71
  - !ruby/object:Gem::Version
97
72
  version: 1.3.6
98
73
  requirements: []
99
- rubygems_version: 3.4.12
100
- signing_key:
74
+ rubygems_version: 3.4.19
75
+ signing_key:
101
76
  specification_version: 4
102
77
  summary: Kerberos authentication support for the MongoDB Ruby driver
103
78
  test_files:
checksums.yaml.gz.sig DELETED
@@ -1 +0,0 @@
1
- Y:.=��1��ڌm����5�J�7W��{��}�&6���y.AO��K0cm;�[����,�Cvs����J�Sg�2���EuGZǮϙ��5��4��Jq��ll�n�v�S��c#��ά���O����V*ԏe���fo
data.tar.gz.sig DELETED
Binary file
metadata.gz.sig DELETED
Binary file