conjur-api 5.3.0 → 5.3.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (63) hide show
  1. checksums.yaml +4 -4
  2. data/.codeclimate.yml +10 -0
  3. data/.github/CODEOWNERS +10 -0
  4. data/.github/ISSUE_TEMPLATE/bug.md +42 -0
  5. data/.github/ISSUE_TEMPLATE/feature_request.md +27 -0
  6. data/.github/PULL_REQUEST_TEMPLATE.md +21 -0
  7. data/.gitignore +1 -0
  8. data/.gitleaks.toml +219 -0
  9. data/.overcommit.yml +16 -0
  10. data/.rubocop.yml +3 -0
  11. data/.rubocop_settings.yml +86 -0
  12. data/.rubocop_todo.yml +709 -0
  13. data/CHANGELOG.md +373 -181
  14. data/CONTRIBUTING.md +141 -0
  15. data/Gemfile +1 -1
  16. data/Jenkinsfile +27 -29
  17. data/LICENSE +202 -0
  18. data/README.md +34 -117
  19. data/SECURITY.md +42 -0
  20. data/bin/parse-changelog.sh +12 -0
  21. data/ci/codeclimate.dockerfile +6 -0
  22. data/conjur-api.gemspec +4 -1
  23. data/docker-compose.yml +2 -0
  24. data/features/authenticators.feature +33 -0
  25. data/features/host.feature +39 -9
  26. data/features/step_definitions/api_steps.rb +14 -3
  27. data/features/step_definitions/policy_steps.rb +40 -0
  28. data/features/support/env.rb +2 -0
  29. data/features/update_password.feature +2 -2
  30. data/features/user.feature +47 -6
  31. data/features_v4/support/env.rb +2 -0
  32. data/lib/conjur-api/version.rb +2 -2
  33. data/lib/conjur/acts_as_role.rb +15 -19
  34. data/lib/conjur/acts_as_user.rb +5 -1
  35. data/lib/conjur/api.rb +1 -18
  36. data/lib/conjur/api/authenticators.rb +35 -0
  37. data/lib/conjur/api/authn.rb +3 -3
  38. data/lib/conjur/api/host_factories.rb +20 -19
  39. data/lib/conjur/api/resources.rb +17 -21
  40. data/lib/conjur/api/router/v4.rb +80 -23
  41. data/lib/conjur/api/router/v5.rb +117 -23
  42. data/lib/conjur/base.rb +19 -5
  43. data/lib/conjur/base_object.rb +31 -26
  44. data/lib/conjur/build_object.rb +13 -20
  45. data/lib/conjur/cert_utils.rb +14 -0
  46. data/lib/conjur/configuration.rb +46 -24
  47. data/lib/conjur/id.rb +22 -19
  48. data/lib/conjur/role_grant.rb +13 -18
  49. data/spec/api/host_factories_spec.rb +34 -0
  50. data/spec/api_spec.rb +55 -6
  51. data/spec/base_object_spec.rb +13 -0
  52. data/spec/cert_utils_spec.rb +92 -0
  53. data/spec/configuration_spec.rb +25 -3
  54. data/spec/id_spec.rb +29 -0
  55. data/spec/spec_helper.rb +4 -1
  56. data/spec/ssl_spec.rb +50 -26
  57. data/spec/uri_escape_spec.rb +14 -2
  58. data/test.sh +23 -1
  59. metadata +31 -14
  60. data/LICENSE.md +0 -195
  61. data/lib/conjur/cast.rb +0 -41
  62. data/spec/cast_spec.rb +0 -21
  63. data/spec/vendor/rest_client_spec.rb +0 -41
data/spec/cast_spec.rb DELETED
@@ -1,21 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe Conjur::Cast do
4
- let!(:object) {
5
- Object.new.tap do |obj|
6
- class << obj
7
- include Conjur::Cast
8
- end
9
- end
10
- }
11
-
12
- it 'String casts to itself' do
13
- expect(object.send(:cast_to_id, "foo")).to eq("foo")
14
- end
15
- it 'Id casts to to_s' do
16
- expect(object.send(:cast_to_id, "foo")).to eq("foo")
17
- end
18
- it 'Array casts via #join' do
19
- expect(object.send(:cast_to_id, [ "foo", "bar" ])).to eq("foo:bar")
20
- end
21
- end
@@ -1,41 +0,0 @@
1
- # Copyright (C) 2014 Conjur Inc
2
- #
3
- # Permission is hereby granted, free of charge, to any person obtaining a copy of
4
- # this software and associated documentation files (the "Software"), to deal in
5
- # the Software without restriction, including without limitation the rights to
6
- # use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
7
- # the Software, and to permit persons to whom the Software is furnished to do so,
8
- # subject to the following conditions:
9
- #
10
- # The above copyright notice and this permission notice shall be included in all
11
- # copies or substantial portions of the Software.
12
- #
13
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
15
- # FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
16
- # COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
17
- # IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
18
- # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
19
-
20
- require 'spec_helper'
21
- require 'tempfile'
22
-
23
- # RestClient monkey patches MIME::Types, breaking it in certain situations.
24
- # Let's make sure we monkey patch the monkey patch if necessary.
25
-
26
- describe RestClient::Request do
27
- shared_examples :restclient do
28
- it "can be initialized" do
29
- expect { RestClient::Request.new method: 'GET', url: 'http://example.com' }.to_not raise_error
30
- end
31
- end
32
-
33
- context 'default arguments' do
34
- let(:cache) { nil }
35
- let(:lazy) { false }
36
- it "sets cert_store to OpenSSL's default cert store" do
37
- request = RestClient::Request.new(method: 'GET', url: 'http://example.com')
38
- expect(request.ssl_opts[:cert_store]).to eq(OpenSSL::SSL::SSLContext::DEFAULT_CERT_STORE)
39
- end
40
- end
41
- end