conjur-api 6.0.1.pre.383 → 6.0.1.pre.394
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/CHANGELOG.md +1 -1
- data/Dockerfile +1 -1
- data/Jenkinsfile +5 -4
- data/VERSION +1 -1
- data/dev/Dockerfile.dev +1 -1
- data/dev/docker-compose.yml +0 -1
- data/dev/start +1 -1
- data/lib/conjur/configuration.rb +58 -2
- data/spec/configuration_spec.rb +4 -2
- data/test.sh +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: af87e0d8581ff7549934d83a5e0eb7061ce86a58d8517881350ffaf5b70848e5
|
4
|
+
data.tar.gz: 9241dff625cc8e68187973207a22a493f19b10538e421c8e4d319188c8be7ff4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6b0b8c96a12a5e40740ae1562a8dc943536326e35dff21e34abb17fc690b4df30b00f6ec63293a3f1d1d21d60f6af11fee6049bb632549556d4a1be0c3826e7e
|
7
|
+
data.tar.gz: c8475527f7db4c23abf56f35ff3bb674fe04e2311a9fbcde49822d938adbe02535faf53740da18e426fdd6f7fccb1d66b2e5ef8fc2b6bb3cf925d5cbceb29e19
|
data/CHANGELOG.md
CHANGED
@@ -9,7 +9,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
|
|
9
9
|
- Nothing should go in this section, please add to the latest unreleased version
|
10
10
|
(and update the corresponding date), or add a new version.
|
11
11
|
|
12
|
-
## [6.0.1] - 2024-
|
12
|
+
## [6.0.1] - 2024-03-25
|
13
13
|
|
14
14
|
### Fixed
|
15
15
|
- Pass valid field in #memberships to fix listing roles (CNJR-2109)
|
data/Dockerfile
CHANGED
data/Jenkinsfile
CHANGED
@@ -25,14 +25,15 @@ pipeline {
|
|
25
25
|
buildDiscarder(logRotator(numToKeepStr: '30'))
|
26
26
|
}
|
27
27
|
|
28
|
-
triggers {
|
29
|
-
cron(getDailyCronString())
|
30
|
-
}
|
31
|
-
|
32
28
|
environment {
|
33
29
|
MODE = release.canonicalizeMode()
|
34
30
|
}
|
35
31
|
|
32
|
+
triggers {
|
33
|
+
cron(getDailyCronString())
|
34
|
+
parameterizedCron(getWeeklyCronString("H(1-5)","%MODE=RELEASE"))
|
35
|
+
}
|
36
|
+
|
36
37
|
stages {
|
37
38
|
stage ("Skip build if triggering job didn't create a release") {
|
38
39
|
when {
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
6.0.1-
|
1
|
+
6.0.1-394
|
data/dev/Dockerfile.dev
CHANGED
data/dev/docker-compose.yml
CHANGED
data/dev/start
CHANGED
@@ -5,7 +5,7 @@ function development() {
|
|
5
5
|
|
6
6
|
docker compose exec -T conjur conjurctl wait
|
7
7
|
|
8
|
-
local api_key=$(docker compose exec -T conjur rake 'role:retrieve-key[cucumber:user:admin]')
|
8
|
+
local api_key=$(docker compose exec -T conjur bundle exec rake 'role:retrieve-key[cucumber:user:admin]')
|
9
9
|
api_key=$(docker compose exec -T conjur conjurctl role retrieve-key cucumber:user:admin | tr -d '\r')
|
10
10
|
|
11
11
|
docker exec -e CONJUR_AUTHN_API_KEY="$api_key" -it --detach-keys 'ctrl-\' $(docker compose ps -q gem) bash
|
data/lib/conjur/configuration.rb
CHANGED
@@ -22,6 +22,7 @@
|
|
22
22
|
require 'openssl'
|
23
23
|
require 'set'
|
24
24
|
require 'conjur/cert_utils'
|
25
|
+
require 'base64'
|
25
26
|
|
26
27
|
module Conjur
|
27
28
|
class << self
|
@@ -368,6 +369,19 @@ module Conjur
|
|
368
369
|
# @see cert_file
|
369
370
|
add_option :ssl_certificate
|
370
371
|
|
372
|
+
# add custom header to request containing customer detail and sdk version
|
373
|
+
add_option :integration_name, default: "SecretsManagerRuby SDK"
|
374
|
+
|
375
|
+
add_option :integration_type, default: "cybr-secretsmanager"
|
376
|
+
|
377
|
+
add_option :integration_version, default: Conjur::API::VERSION
|
378
|
+
|
379
|
+
add_option :vendor_name, default: "CyberArk"
|
380
|
+
|
381
|
+
add_option :vendor_version, default: nil
|
382
|
+
|
383
|
+
add_option :final_telemetry_header
|
384
|
+
|
371
385
|
# @!attribute rest_client_options
|
372
386
|
#
|
373
387
|
# Custom options for the underlying RestClient Requests. This defaults to:
|
@@ -384,7 +398,10 @@ module Conjur
|
|
384
398
|
# you must manually set them on the value you provide.
|
385
399
|
add_option :rest_client_options do
|
386
400
|
{
|
387
|
-
ssl_cert_store: OpenSSL::SSL::SSLContext::DEFAULT_CERT_STORE
|
401
|
+
ssl_cert_store: OpenSSL::SSL::SSLContext::DEFAULT_CERT_STORE,
|
402
|
+
headers: {
|
403
|
+
'x-cybr-telemetry': get_telemetry_header
|
404
|
+
}
|
388
405
|
}
|
389
406
|
end
|
390
407
|
|
@@ -397,7 +414,8 @@ module Conjur
|
|
397
414
|
# Create rest_client_options by merging the input with the
|
398
415
|
# rest_client_options present on the configuration object.
|
399
416
|
def create_rest_client_options options
|
400
|
-
|
417
|
+
options ||= {}
|
418
|
+
rest_client_options.merge(options) { |key, left, right| left.merge(right) }
|
401
419
|
end
|
402
420
|
|
403
421
|
# Add the certificate configured by the {#ssl_certificate} and {#cert_file} options to the certificate
|
@@ -436,5 +454,43 @@ module Conjur
|
|
436
454
|
# propagate.
|
437
455
|
File.open(path) {}
|
438
456
|
end
|
457
|
+
|
458
|
+
# get_telemetry_header constructs and returns a base64-encoded telemetry header string.
|
459
|
+
#
|
460
|
+
# The method checks the values of various instance variables (`integration_name`,
|
461
|
+
# `integration_version`, `integration_type`, `vendor_name`, `vendor_version`) and
|
462
|
+
# constructs the header accordingly. If any of these values are not provided (empty or nil),
|
463
|
+
# they will be omitted from the final header string.
|
464
|
+
#
|
465
|
+
# The telemetry header is formatted as a series of key-value pairs separated by "&". Each key-value
|
466
|
+
# pair corresponds to one of the following fields:
|
467
|
+
# - `in`: Integration Name
|
468
|
+
# - `iv`: Integration Version
|
469
|
+
# - `it`: Integration Type
|
470
|
+
# - `vn`: Vendor Name
|
471
|
+
# - `vv`: Vendor Version
|
472
|
+
#
|
473
|
+
# The final header string is base64-encoded using URL-safe encoding (without padding).
|
474
|
+
# If the header has been previously generated and cached in `final_telemetry_header`, it is returned directly.
|
475
|
+
#
|
476
|
+
# Returns:
|
477
|
+
# - String: The base64-encoded telemetry header string.
|
478
|
+
def get_telemetry_header
|
479
|
+
unless final_telemetry_header.nil?
|
480
|
+
return final_telemetry_header
|
481
|
+
end
|
482
|
+
final_telemetry_header = ""
|
483
|
+
if integration_name && !integration_name.strip.empty?
|
484
|
+
final_telemetry_header += "in=#{integration_name}"
|
485
|
+
final_telemetry_header += "&iv=#{integration_version}" if integration_version && !integration_version.strip.empty?
|
486
|
+
final_telemetry_header += "&it=#{integration_type}" if integration_type && !integration_type.strip.empty?
|
487
|
+
end
|
488
|
+
|
489
|
+
if vendor_name && !vendor_name.strip.empty?
|
490
|
+
final_telemetry_header += "&vn=#{vendor_name}"
|
491
|
+
final_telemetry_header += "&vv=#{vendor_version}" if vendor_version && !vendor_version.strip.empty?
|
492
|
+
end
|
493
|
+
Base64.urlsafe_encode64(final_telemetry_header, padding: false)
|
494
|
+
end
|
439
495
|
end
|
440
496
|
end
|
data/spec/configuration_spec.rb
CHANGED
@@ -31,10 +31,12 @@ describe Conjur::Configuration do
|
|
31
31
|
}
|
32
32
|
|
33
33
|
it "rest_client_options defaults" do
|
34
|
+
encoded_attr = Base64.urlsafe_encode64("in=SecretsManager Ruby SDK&iv=0.0.dev&it=cybr-secretsmanager&vn=CyberArk", padding: false)
|
34
35
|
expected = {
|
35
|
-
ssl_cert_store: OpenSSL::SSL::SSLContext::DEFAULT_CERT_STORE
|
36
|
+
ssl_cert_store: OpenSSL::SSL::SSLContext::DEFAULT_CERT_STORE,
|
37
|
+
headers: { 'x-cybr-telemetry': encoded_attr}
|
36
38
|
}
|
37
|
-
expect(configuration.rest_client_options).to
|
39
|
+
expect(configuration.rest_client_options[:headers]).to include(:'x-cybr-telemetry')
|
38
40
|
end
|
39
41
|
|
40
42
|
it "rest_client_options propagate to RestClient::Resource" do
|
data/test.sh
CHANGED
@@ -60,7 +60,7 @@ function runTests() {
|
|
60
60
|
-e CONJUR_AUTHN_API_KEY="$api_key" \
|
61
61
|
-e SSL_CERT_FILE=/etc/ssl/certs/keycloak.pem \
|
62
62
|
tester \
|
63
|
-
"/scripts/fetch_certificate && rake jenkins_init jenkins_spec jenkins_cucumber"
|
63
|
+
"/scripts/fetch_certificate && bundle exec rake jenkins_init jenkins_spec jenkins_cucumber"
|
64
64
|
}
|
65
65
|
|
66
66
|
main
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: conjur-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 6.0.1.pre.
|
4
|
+
version: 6.0.1.pre.394
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- CyberArk Maintainers
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-03-
|
11
|
+
date: 2025-03-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rest-client
|