mongo_kerberos 2.0.0-java → 2.1.0-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
- SHA1:
3
- metadata.gz: 6a9ff251151854f967f0d97901b5bd4fe2ab76a4
4
- data.tar.gz: 46530ece51a572a9269f69832bffe616d7b622aa
2
+ SHA256:
3
+ metadata.gz: e2de6f8cfaa9c165d303a911706ee37976ecfdfbb8852d0ad5c3076b94328241
4
+ data.tar.gz: 5158702d11b6f56273b8b6b89309ca251d11fea149e4bdde96357a8f9b029240
5
5
  SHA512:
6
- metadata.gz: a066415e7c71104ea962038a1a0670208b33f0177b1166c9b86ee6bac97448fda38b199667a8aeaa0dc38ec6d2c083db0f5ad435d97cc791e97b2bcbbb0bdac9
7
- data.tar.gz: d1ebdaee27fff4fea13004cf9a595ee9ef3ee9ddc75555253d51c30a0a1b475e1eeb19053491fc365d346bbefb224f8791247df17c442652ff27f07171765979
6
+ metadata.gz: ee973800a891b7638d576bb6351cd5158770556e382cab9aeb790de242f00fe4afe85c65d4de6527ba458f6f449f938c8fafd8a864f4e230bdd239126aef77a4
7
+ data.tar.gz: 7a5590b7b83ec1f1abb4bf936d4fde8bc6ae1edff557188b5c870485368e914f70a52ed0d98ed010a39663deed869c2ff479bca8ba993d7d45ff393f43b85141
checksums.yaml.gz.sig CHANGED
Binary file
data.tar.gz.sig CHANGED
Binary file
data/README.md CHANGED
@@ -1,15 +1,21 @@
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)
2
- ====
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)
3
2
 
4
3
  Provides Kerberos authentication support to the Mongo Ruby Driver.
5
4
 
6
- Compatibility
7
- -------------
8
5
 
9
- mongo_kerberos is tested against MRI (1.9.2+) and JRuby (1.7.0+)
6
+ ## Compatibility
10
7
 
11
- Installation
12
- ------------
8
+ mongo_kerberos is tested against MRI (1.9.3+) and JRuby (9.1+).
9
+
10
+ ### JRuby
11
+
12
+ In order to work with Kerberos TGTs that are in the system cache (e.g. obtained with `kinit`), the
13
+ JRuby extension sets the JVM system property "sun.security.jgss.native" to "true". Note that any
14
+ other use of the JGSS library will also be affected by this setting, meaning that any TGTs in the
15
+ system cache will be available for obtaining Kerberos credentials as well.
16
+
17
+
18
+ ## Installation
13
19
 
14
20
  libsasl is a requirement to be able to install the mongo_kerberos gem. Please see the
15
21
  [Cyrus documentation](http://cyrusimap.web.cmu.edu/docs/cyrus-sasl/2.1.25/) for more
@@ -18,7 +24,7 @@ information.
18
24
  With bundler, add the `mongo_kerberos` gem to your `Gemfile`.
19
25
 
20
26
  ```ruby
21
- gem "mongo_kerberos", "~> 2.0"
27
+ gem "mongo_kerberos", "~> 2.1"
22
28
  ```
23
29
 
24
30
  Require the `mongo_kerberos` gem in your application.
@@ -27,17 +33,13 @@ Require the `mongo_kerberos` gem in your application.
27
33
  require "mongo_kerberos"
28
34
  ```
29
35
 
30
- Usage
31
- -----
32
-
33
36
 
34
- API Documentation
35
- -----------------
37
+ ## API Documentation
36
38
 
37
39
  The [API Documentation](http://rdoc.info/github/mongodb/mongo-ruby-kerberos/master/frames) is
38
40
  located at rdoc.info.
39
41
 
40
- Versioning
41
- ----------
42
+ ## Versioning
42
43
 
43
- As of 2.0.0, this project adheres to the [Semantic Versioning Specification](http://semver.org/).
44
+ As of 2.1.0, this project adheres to the
45
+ [Semantic Versioning Specification](http://semver.org/).
data/Rakefile CHANGED
@@ -35,9 +35,9 @@ if jruby?
35
35
  else
36
36
  require "rake/extensiontask"
37
37
  Rake::ExtensionTask.new do |ext|
38
- ext.name = "native"
39
- ext.ext_dir = "ext/mongo/kerberos"
40
- ext.lib_dir = "lib/mongo/auth/kerberos"
38
+ ext.name = "mongo_kerberos_native"
39
+ ext.ext_dir = "ext/mongo_kerberos"
40
+ ext.lib_dir = "lib"
41
41
  end
42
42
  end
43
43
 
@@ -62,9 +62,11 @@ end
62
62
  task :clean_all => :clean do
63
63
  begin
64
64
  Dir.chdir(Pathname(__FILE__).dirname + "lib") do
65
- `rm native.#{extension}`
66
- `rm native.o`
67
- `rm native.jar`
65
+ ["o", extension, "jar"].each do |e|
66
+ Dir.glob(File.join("**", "*.#{e}")).each do |f|
67
+ `rm #{f}`
68
+ end
69
+ end
68
70
  end
69
71
  rescue Exception => e
70
72
  puts e.message
@@ -94,3 +96,15 @@ task :release => :build do
94
96
  end
95
97
 
96
98
  task :default => [ :clean_all, :spec ]
99
+
100
+ desc "Generate all documentation"
101
+ task :docs => 'docs:yard'
102
+
103
+ namespace :docs do
104
+ desc "Generate yard documention"
105
+ task :yard do
106
+ out = File.join('yard-docs', Mongo::Auth::Kerberos::VERSION)
107
+ FileUtils.rm_rf(out)
108
+ system "yardoc -o #{out} --title mongo-ruby-kerberos-#{Mongo::Auth::Kerberos::VERSION}"
109
+ end
110
+ end
@@ -22,13 +22,24 @@ module Mongo
22
22
  #
23
23
  # @since 2.0.0
24
24
  class Kerberos
25
- include Executable
26
25
 
27
- # The authentication mechinism string.
26
+ # The authentication mechanism string.
28
27
  #
29
28
  # @since 2.0.0
30
29
  MECHANISM = 'GSSAPI'.freeze
31
30
 
31
+ # Instantiate a new authenticator.
32
+ #
33
+ # example Create the authenticator.
34
+ # Mongo::Auth::Kerberos.new(user)
35
+ #
36
+ # @param [ Mongo::Auth::User ] user The user to authenticate.
37
+ #
38
+ # @since 2.0.1
39
+ def initialize(user)
40
+ @user = user
41
+ end
42
+
32
43
  # Log the user in on the given connection.
33
44
  #
34
45
  # @example Log the user in.
@@ -41,10 +52,12 @@ module Mongo
41
52
  #
42
53
  # @since 2.0.0
43
54
  def login(connection)
44
- conversation = Conversation.new(user, connection.address.host)
55
+ conversation = Conversation.new(@user, connection.address.host)
45
56
  reply = connection.dispatch([ conversation.start ])
57
+ connection.update_cluster_time(Operation::Result.new(reply))
46
58
  until reply.documents[0][Conversation::DONE]
47
59
  reply = connection.dispatch([ conversation.finalize(reply) ])
60
+ connection.update_cluster_time(Operation::Result.new(reply))
48
61
  end
49
62
  reply
50
63
  end
@@ -113,7 +113,7 @@ module Mongo
113
113
 
114
114
  # Create the new conversation.
115
115
  #
116
- # @example Create the new coversation.
116
+ # @example Create the new conversation.
117
117
  # Conversation.new(user, 'test.example.com')
118
118
  #
119
119
  # @param [ Auth::User ] user The user to converse about.
@@ -13,7 +13,6 @@
13
13
  # limitations under the License.
14
14
 
15
15
  require 'java'
16
- require 'mongo/auth/kerberos/jsasl.jar'
17
16
  require 'mongo/auth/kerberos/native.jar'
18
17
 
19
18
  module Mongo
@@ -12,7 +12,7 @@
12
12
  # See the License for the specific language governing permissions and
13
13
  # limitations under the License.
14
14
 
15
- require 'mongo/auth/kerberos/native'
15
+ require 'mongo_kerberos_native'
16
16
 
17
17
  module Mongo
18
18
  module Auth
Binary file
@@ -17,7 +17,7 @@ module Mongo
17
17
  class Kerberos
18
18
 
19
19
  # The gem version number.
20
- VERSION = '2.0.0'.freeze
20
+ VERSION = '2.1.0'.freeze
21
21
  end
22
22
  end
23
23
  end
@@ -20,6 +20,17 @@ describe Mongo::Auth::Kerberos::Conversation do
20
20
  and_return(authenticator)
21
21
  end
22
22
 
23
+ context 'when the user has a realm', if: RUBY_PLATFORM == 'java' do
24
+
25
+ let(:user) do
26
+ Mongo::Auth::User.new(user: 'user1@MYREALM.ME')
27
+ end
28
+
29
+ it 'includes the realm in the username as it was provided' do
30
+ expect(conversation.user.name).to eq(user.name)
31
+ end
32
+ end
33
+
23
34
  describe '#start' do
24
35
 
25
36
  let(:query) do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mongo_kerberos
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.1.0
5
5
  platform: java
6
6
  authors:
7
7
  - Emily Stolfo
@@ -11,43 +11,43 @@ bindir: bin
11
11
  cert_chain:
12
12
  - |
13
13
  -----BEGIN CERTIFICATE-----
14
- MIIDfDCCAmSgAwIBAgIBATANBgkqhkiG9w0BAQUFADBCMRQwEgYDVQQDDAtkcml2
15
- ZXItcnVieTEVMBMGCgmSJomT8ixkARkWBTEwZ2VuMRMwEQYKCZImiZPyLGQBGRYD
16
- Y29tMB4XDTE0MTEyMDE1NTYxOVoXDTE1MTEyMDE1NTYxOVowQjEUMBIGA1UEAwwL
17
- ZHJpdmVyLXJ1YnkxFTATBgoJkiaJk/IsZAEZFgUxMGdlbjETMBEGCgmSJomT8ixk
18
- ARkWA2NvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBANFdSAa8fRm1
19
- bAM9za6Z0fAH4g02bqM1NGnw8zJQrE/PFrFfY6IFCT2AsLfOwr1maVm7iU1+kdVI
20
- IQ+iI/9+E+ArJ+rbGV3dDPQ+SLl3mLT+vXjfjcxMqI2IW6UuVtt2U3Rxd4QU0kdT
21
- JxmcPYs5fDN6BgYc6XXgUjy3m+Kwha2pGctdciUOwEfOZ4RmNRlEZKCMLRHdFP8j
22
- 4WTnJSGfXDiuoXICJb5yOPOZPuaapPSNXp93QkUdsqdKC32I+KMpKKYGBQ6yisfA
23
- 5MyVPPCzLR1lP5qXVGJPnOqUAkvEUfCahg7EP9tI20qxiXrR6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GSgjC0R3RT/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
33
32
  -----END CERTIFICATE-----
34
- date: 2015-03-25 00:00:00.000000000 Z
33
+ date: 2019-01-11 00:00:00.000000000 Z
35
34
  dependencies:
36
35
  - !ruby/object:Gem::Dependency
37
- name: mongo
38
- version_requirements: !ruby/object:Gem::Requirement
39
- requirements:
40
- - - ~>
41
- - !ruby/object:Gem::Version
42
- version: 2.0.0
43
36
  requirement: !ruby/object:Gem::Requirement
44
37
  requirements:
45
- - - ~>
38
+ - - "~>"
46
39
  - !ruby/object:Gem::Version
47
- version: 2.0.0
40
+ version: '2.0'
41
+ name: mongo
48
42
  prerelease: false
49
43
  type: :runtime
50
- description: Adds Kerberos authentication via libsasl to the MongoDB Ruby Driver on MRI and JRuby
44
+ version_requirements: !ruby/object:Gem::Requirement
45
+ requirements:
46
+ - - "~>"
47
+ - !ruby/object:Gem::Version
48
+ version: '2.0'
49
+ description: Adds Kerberos authentication via libsasl to the MongoDB Ruby Driver on
50
+ MRI and JRuby
51
51
  email:
52
52
  - mongodb-dev@googlegroups.com
53
53
  executables: []
@@ -59,18 +59,16 @@ files:
59
59
  - NOTICE
60
60
  - README.md
61
61
  - Rakefile
62
- - lib/mongo_kerberos.rb
63
62
  - lib/mongo/auth/kerberos.rb
64
63
  - lib/mongo/auth/kerberos/conversation.rb
65
- - lib/mongo/auth/kerberos/jsasl.jar
66
- - lib/mongo/auth/kerberos/native.bundle
67
- - lib/mongo/auth/kerberos/native.jar
68
- - lib/mongo/auth/kerberos/version.rb
69
64
  - lib/mongo/auth/kerberos/jruby/authenticator.rb
70
65
  - lib/mongo/auth/kerberos/mri/authenticator.rb
71
- - spec/spec_helper.rb
66
+ - lib/mongo/auth/kerberos/native.jar
67
+ - lib/mongo/auth/kerberos/version.rb
68
+ - lib/mongo_kerberos.rb
72
69
  - spec/mongo/auth/kerberos/conversation_spec.rb
73
70
  - spec/mongo/auth/kerberos/mri/authenticator_spec.rb
71
+ - spec/spec_helper.rb
74
72
  homepage: http://www.mongodb.org
75
73
  licenses:
76
74
  - Apache License Version 2.0
@@ -81,17 +79,17 @@ require_paths:
81
79
  - lib
82
80
  required_ruby_version: !ruby/object:Gem::Requirement
83
81
  requirements:
84
- - - '>='
82
+ - - ">="
85
83
  - !ruby/object:Gem::Version
86
84
  version: 1.9.3
87
85
  required_rubygems_version: !ruby/object:Gem::Requirement
88
86
  requirements:
89
- - - '>='
87
+ - - ">="
90
88
  - !ruby/object:Gem::Version
91
89
  version: 1.3.6
92
90
  requirements: []
93
91
  rubyforge_project: mongo_kerberos
94
- rubygems_version: 2.1.9
92
+ rubygems_version: 2.7.6
95
93
  signing_key:
96
94
  specification_version: 4
97
95
  summary: Kerberos authentication support for the MongoDB Ruby driver
metadata.gz.sig CHANGED
Binary file
Binary file
Binary file