mongo_kerberos 2.1.0-java → 2.1.2-java

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: e2de6f8cfaa9c165d303a911706ee37976ecfdfbb8852d0ad5c3076b94328241
4
- data.tar.gz: 5158702d11b6f56273b8b6b89309ca251d11fea149e4bdde96357a8f9b029240
3
+ metadata.gz: 8cf3700bd35015425989ab2f24c440185980fdab1ca76c18ee60f388405ffe52
4
+ data.tar.gz: 69303947c3276f695b3031c372a50bc349ba5ea41de6233bc5f6b815cb811b92
5
5
  SHA512:
6
- metadata.gz: ee973800a891b7638d576bb6351cd5158770556e382cab9aeb790de242f00fe4afe85c65d4de6527ba458f6f449f938c8fafd8a864f4e230bdd239126aef77a4
7
- data.tar.gz: 7a5590b7b83ec1f1abb4bf936d4fde8bc6ae1edff557188b5c870485368e914f70a52ed0d98ed010a39663deed869c2ff479bca8ba993d7d45ff393f43b85141
6
+ metadata.gz: fcdb67c5716208cdd86127d174144728c055c312b67ad5d8a4000ef1af802346c78e03b22fbc63e50cee9137aa97e49bbef1d88f74b6492e8cf9f1d6cb3f28a3
7
+ data.tar.gz: 01fcf1114072578921d276db0f48608be25b4de9436c20112f20055bf498a38f7b682a37336109b8dea00f869d0baa48fc372e4bf0eaf8650b997fefb2418147
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
Binary file
@@ -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.0'.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,36 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mongo_kerberos
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.0
4
+ version: 2.1.2
5
5
  platform: java
6
6
  authors:
7
- - Emily Stolfo
8
- - Durran Jordan
7
+ - The MongoDB Ruby Team
9
8
  autorequire:
10
9
  bindir: bin
11
- cert_chain:
12
- - |
13
- -----BEGIN CERTIFICATE-----
14
- MIIDRDCCAiygAwIBAgIBATANBgkqhkiG9w0BAQsFADAmMSQwIgYDVQQDDBtkcml2
15
- ZXItcnVieS9EQz0xMGdlbi9EQz1jb20wHhcNMTgxMDA0MTczODA5WhcNMTkxMDA0
16
- MTczODA5WjAmMSQwIgYDVQQDDBtkcml2ZXItcnVieS9EQz0xMGdlbi9EQz1jb20w
17
- ggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDRXUgGvH0ZtWwDPc2umdHw
18
- B+INNm6jNTRp8PMyUKxPzxaxX2OiBQk9gLC3zsK9ZmlZu4lNfpHVSCEPoiP/fhPg
19
- Kyfq2xld3Qz0Pki5d5i0/r14343MTKiNiFulLlbbdlN0cXeEFNJHUycZnD2LOXwz
20
- egYGHOl14FI8t5visIWtqRnLXXIlDsBHzmeEZjUZRGSgjC0R3RT/I+Fk5yUhn1w4
21
- rqFyAiW+cjjzmT7mmqT0jV6fd0JFHbKnSgt9iPijKSimBgUOsorHwOTMlTzwsy0d
22
- ZT+al1RiT5zqlAJLxFHwmoYOxD/bSNtKsYl60ek0hK2mISBVy9BBmLvCgHDx5uSp
23
- AgMBAAGjfTB7MAkGA1UdEwQCMAAwCwYDVR0PBAQDAgSwMB0GA1UdDgQWBBRbd1mx
24
- fvSaVIwKI+tnEAYDW/B81zAgBgNVHREEGTAXgRVkcml2ZXItcnVieUAxMGdlbi5j
25
- b20wIAYDVR0SBBkwF4EVZHJpdmVyLXJ1YnlAMTBnZW4uY29tMA0GCSqGSIb3DQEB
26
- CwUAA4IBAQAaVV3xYYK7qtbnTzctqafLFN4d6amxzWGs4KYpnCSr1BRJQYIiq8Zp
27
- hjTZoOQlEiUP/4TlNg81sO4TY8RPbE3SAeIEfPWTiQYT7bD51KwOdOtegXSbhn5a
28
- hEjUXYxYpVJdAqh4BGT78TY/3M1oPpOLnWRUI5TQ8S1BT5C+dqJG8fZW04C50LdL
29
- P3JIZhI5pIae1pnGh/lS4oxAUxMVuILPJwHbtK7RkiIUOv3PA0JkPDnKLlKVSMks
30
- oJ3hhwXc2QCuggX+vYTfFkm49uIb1jzivtRTIDwRWCfp3KKtV85BCM0UDTJqZBDe
31
- JvwE2HAT8fOpY1c60+KRpfRKddtgMo7R
32
- -----END CERTIFICATE-----
33
- date: 2019-01-11 00:00:00.000000000 Z
10
+ cert_chain: []
11
+ date: 2024-11-08 00:00:00.000000000 Z
34
12
  dependencies:
35
13
  - !ruby/object:Gem::Dependency
36
14
  requirement: !ruby/object:Gem::Requirement
@@ -39,8 +17,8 @@ dependencies:
39
17
  - !ruby/object:Gem::Version
40
18
  version: '2.0'
41
19
  name: mongo
42
- prerelease: false
43
20
  type: :runtime
21
+ prerelease: false
44
22
  version_requirements: !ruby/object:Gem::Requirement
45
23
  requirements:
46
24
  - - "~>"
@@ -48,8 +26,7 @@ dependencies:
48
26
  version: '2.0'
49
27
  description: Adds Kerberos authentication via libsasl to the MongoDB Ruby Driver on
50
28
  MRI and JRuby
51
- email:
52
- - mongodb-dev@googlegroups.com
29
+ email: dbx-ruby@mongodb.com
53
30
  executables: []
54
31
  extensions: []
55
32
  extra_rdoc_files: []
@@ -69,10 +46,14 @@ files:
69
46
  - spec/mongo/auth/kerberos/conversation_spec.rb
70
47
  - spec/mongo/auth/kerberos/mri/authenticator_spec.rb
71
48
  - spec/spec_helper.rb
72
- homepage: http://www.mongodb.org
49
+ homepage: https://docs.mongodb.com/ruby-driver/current/tutorials/ruby-driver-authentication/#kerberos-gssapi-mechanism
73
50
  licenses:
74
- - Apache License Version 2.0
75
- metadata: {}
51
+ - Apache-2.0
52
+ metadata:
53
+ bug_tracker_uri: https://jira.mongodb.org/projects/RUBY
54
+ changelog_uri: https://github.com/mongodb/mongo-ruby-kerberos/releases
55
+ documentation_uri: https://www.mongodb.com/docs/ruby-driver/current/reference/authentication/#kerberos--gssapi-
56
+ source_code_uri: https://github.com/mongodb/mongo-ruby-kerberos
76
57
  post_install_message:
77
58
  rdoc_options: []
78
59
  require_paths:
@@ -88,12 +69,11 @@ required_rubygems_version: !ruby/object:Gem::Requirement
88
69
  - !ruby/object:Gem::Version
89
70
  version: 1.3.6
90
71
  requirements: []
91
- rubyforge_project: mongo_kerberos
92
- rubygems_version: 2.7.6
72
+ rubygems_version: 3.3.26
93
73
  signing_key:
94
74
  specification_version: 4
95
75
  summary: Kerberos authentication support for the MongoDB Ruby driver
96
76
  test_files:
97
- - spec/spec_helper.rb
98
77
  - spec/mongo/auth/kerberos/conversation_spec.rb
99
78
  - spec/mongo/auth/kerberos/mri/authenticator_spec.rb
79
+ - spec/spec_helper.rb
checksums.yaml.gz.sig DELETED
Binary file
data.tar.gz.sig DELETED
@@ -1 +0,0 @@
1
- '��ھ�J,��`����8N�ý͆U�����ld�(%�}B��(sf�<������w���1��$�D¸�x.v�n{�������_�,�Z8W�zݘ���ho7w�}=ǏT�C��;�O��/|B�A���+b���/�Y`&�Ñc<z'b`��̅+����'��q*�tٞ:&w���~x���tg�����!�}�*�5�0`#�罳;�<��9W�xe}������- ���EE���fbh��$Pi.
metadata.gz.sig DELETED
Binary file