strongdm 13.11.0 → 14.0.0
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/.git/ORIG_HEAD +1 -1
- data/.git/index +0 -0
- data/.git/logs/HEAD +3 -3
- data/.git/logs/refs/heads/master +2 -2
- data/.git/logs/refs/remotes/origin/HEAD +1 -1
- data/.git/objects/pack/{pack-1d9fc140c6d5e5a873af3b9499b2cf070fc0bd1e.idx → pack-506fd68e43b73695be77ec3d6e0aef9ecb46e913.idx} +0 -0
- data/.git/objects/pack/{pack-1d9fc140c6d5e5a873af3b9499b2cf070fc0bd1e.pack → pack-506fd68e43b73695be77ec3d6e0aef9ecb46e913.pack} +0 -0
- data/.git/packed-refs +4 -2
- data/.git/refs/heads/master +1 -1
- data/lib/grpc/accounts_pb.rb +2 -0
- data/lib/grpc/approval_workflow_approvers_services_pb.rb +4 -4
- data/lib/grpc/approval_workflow_steps_pb.rb +4 -0
- data/lib/grpc/approval_workflow_steps_services_pb.rb +4 -4
- data/lib/grpc/managed_secrets_pb.rb +171 -0
- data/lib/grpc/managed_secrets_services_pb.rb +59 -0
- data/lib/grpc/plumbing.rb +4265 -2492
- data/lib/grpc/secret_engine_policy_pb.rb +41 -0
- data/lib/grpc/secret_engine_types_pb.rb +75 -0
- data/lib/grpc/secret_engines_pb.rb +124 -0
- data/lib/grpc/secret_engines_services_pb.rb +53 -0
- data/lib/models/porcelain.rb +1304 -60
- data/lib/strongdm.rb +15 -1
- data/lib/svc.rb +668 -12
- data/lib/version +1 -1
- data/lib/version.rb +1 -1
- metadata +10 -4
data/lib/svc.rb
CHANGED
@@ -1284,7 +1284,7 @@ module SDM #:nodoc:
|
|
1284
1284
|
@parent = parent
|
1285
1285
|
end
|
1286
1286
|
|
1287
|
-
# Create creates a new approval workflow approver.
|
1287
|
+
# Deprecated: Create creates a new approval workflow approver.
|
1288
1288
|
def create(
|
1289
1289
|
approval_workflow_approver,
|
1290
1290
|
deadline: nil
|
@@ -1313,7 +1313,7 @@ module SDM #:nodoc:
|
|
1313
1313
|
resp
|
1314
1314
|
end
|
1315
1315
|
|
1316
|
-
# Get reads one approval workflow approver by ID.
|
1316
|
+
# Deprecated: Get reads one approval workflow approver by ID.
|
1317
1317
|
def get(
|
1318
1318
|
id,
|
1319
1319
|
deadline: nil
|
@@ -1347,7 +1347,7 @@ module SDM #:nodoc:
|
|
1347
1347
|
resp
|
1348
1348
|
end
|
1349
1349
|
|
1350
|
-
# Delete deletes an existing approval workflow approver.
|
1350
|
+
# Deprecated: Delete deletes an existing approval workflow approver.
|
1351
1351
|
def delete(
|
1352
1352
|
id,
|
1353
1353
|
deadline: nil
|
@@ -1376,7 +1376,7 @@ module SDM #:nodoc:
|
|
1376
1376
|
resp
|
1377
1377
|
end
|
1378
1378
|
|
1379
|
-
# Lists existing approval workflow approvers.
|
1379
|
+
# Deprecated: Lists existing approval workflow approvers.
|
1380
1380
|
def list(
|
1381
1381
|
filter,
|
1382
1382
|
*args,
|
@@ -1425,7 +1425,7 @@ module SDM #:nodoc:
|
|
1425
1425
|
@approval_workflow_approvers = approval_workflow_approvers
|
1426
1426
|
end
|
1427
1427
|
|
1428
|
-
# Get reads one approval workflow approver by ID.
|
1428
|
+
# Deprecated: Get reads one approval workflow approver by ID.
|
1429
1429
|
def get(
|
1430
1430
|
id,
|
1431
1431
|
deadline: nil
|
@@ -1436,7 +1436,7 @@ module SDM #:nodoc:
|
|
1436
1436
|
)
|
1437
1437
|
end
|
1438
1438
|
|
1439
|
-
# Lists existing approval workflow approvers.
|
1439
|
+
# Deprecated: Lists existing approval workflow approvers.
|
1440
1440
|
def list(
|
1441
1441
|
filter,
|
1442
1442
|
*args,
|
@@ -1520,7 +1520,7 @@ module SDM #:nodoc:
|
|
1520
1520
|
@parent = parent
|
1521
1521
|
end
|
1522
1522
|
|
1523
|
-
# Create creates a new approval workflow step.
|
1523
|
+
# Deprecated: Create creates a new approval workflow step.
|
1524
1524
|
def create(
|
1525
1525
|
approval_workflow_step,
|
1526
1526
|
deadline: nil
|
@@ -1549,7 +1549,7 @@ module SDM #:nodoc:
|
|
1549
1549
|
resp
|
1550
1550
|
end
|
1551
1551
|
|
1552
|
-
# Get reads one approval workflow step by ID.
|
1552
|
+
# Deprecated: Get reads one approval workflow step by ID.
|
1553
1553
|
def get(
|
1554
1554
|
id,
|
1555
1555
|
deadline: nil
|
@@ -1583,7 +1583,7 @@ module SDM #:nodoc:
|
|
1583
1583
|
resp
|
1584
1584
|
end
|
1585
1585
|
|
1586
|
-
# Delete deletes an existing approval workflow step.
|
1586
|
+
# Deprecated: Delete deletes an existing approval workflow step.
|
1587
1587
|
def delete(
|
1588
1588
|
id,
|
1589
1589
|
deadline: nil
|
@@ -1612,7 +1612,7 @@ module SDM #:nodoc:
|
|
1612
1612
|
resp
|
1613
1613
|
end
|
1614
1614
|
|
1615
|
-
# Lists existing approval workflow steps.
|
1615
|
+
# Deprecated: Lists existing approval workflow steps.
|
1616
1616
|
def list(
|
1617
1617
|
filter,
|
1618
1618
|
*args,
|
@@ -1661,7 +1661,7 @@ module SDM #:nodoc:
|
|
1661
1661
|
@approval_workflow_steps = approval_workflow_steps
|
1662
1662
|
end
|
1663
1663
|
|
1664
|
-
# Get reads one approval workflow step by ID.
|
1664
|
+
# Deprecated: Get reads one approval workflow step by ID.
|
1665
1665
|
def get(
|
1666
1666
|
id,
|
1667
1667
|
deadline: nil
|
@@ -1672,7 +1672,7 @@ module SDM #:nodoc:
|
|
1672
1672
|
)
|
1673
1673
|
end
|
1674
1674
|
|
1675
|
-
# Lists existing approval workflow steps.
|
1675
|
+
# Deprecated: Lists existing approval workflow steps.
|
1676
1676
|
def list(
|
1677
1677
|
filter,
|
1678
1678
|
*args,
|
@@ -2699,6 +2699,357 @@ module SDM #:nodoc:
|
|
2699
2699
|
end
|
2700
2700
|
end
|
2701
2701
|
|
2702
|
+
# ManagedSecret is a private vertical for creating, reading, updating,
|
2703
|
+
# deleting, listing and rotating the managed secrets in the secrets engines as
|
2704
|
+
# an authenticated user.
|
2705
|
+
#
|
2706
|
+
# See {ManagedSecret}.
|
2707
|
+
class ManagedSecrets
|
2708
|
+
extend Gem::Deprecate
|
2709
|
+
|
2710
|
+
def initialize(channel, parent)
|
2711
|
+
begin
|
2712
|
+
@stub = V1::ManagedSecrets::Stub.new(nil, nil, channel_override: channel)
|
2713
|
+
rescue => exception
|
2714
|
+
raise Plumbing::convert_error_to_porcelain(exception)
|
2715
|
+
end
|
2716
|
+
@parent = parent
|
2717
|
+
end
|
2718
|
+
|
2719
|
+
# List returns Managed Secrets from a Secret Engine.
|
2720
|
+
def list(
|
2721
|
+
filter,
|
2722
|
+
*args,
|
2723
|
+
deadline: nil
|
2724
|
+
)
|
2725
|
+
req = V1::ManagedSecretListRequest.new()
|
2726
|
+
req.meta = V1::ListRequestMetadata.new()
|
2727
|
+
if @parent.page_limit > 0
|
2728
|
+
req.meta.limit = @parent.page_limit
|
2729
|
+
end
|
2730
|
+
if not @parent.snapshot_time.nil?
|
2731
|
+
req.meta.snapshot_at = @parent.snapshot_time
|
2732
|
+
end
|
2733
|
+
|
2734
|
+
req.filter = Plumbing::quote_filter_args(filter, *args)
|
2735
|
+
resp = Enumerator::Generator.new { |g|
|
2736
|
+
tries = 0
|
2737
|
+
loop do
|
2738
|
+
begin
|
2739
|
+
plumbing_response = @stub.list(req, metadata: @parent.get_metadata("ManagedSecrets.List", req), deadline: deadline)
|
2740
|
+
rescue => exception
|
2741
|
+
if (@parent.shouldRetry(tries, exception))
|
2742
|
+
tries + +@parent.jitterSleep(tries)
|
2743
|
+
next
|
2744
|
+
end
|
2745
|
+
raise Plumbing::convert_error_to_porcelain(exception)
|
2746
|
+
end
|
2747
|
+
tries = 0
|
2748
|
+
plumbing_response.managed_secrets.each do |plumbing_item|
|
2749
|
+
g.yield Plumbing::convert_managed_secret_to_porcelain(plumbing_item)
|
2750
|
+
end
|
2751
|
+
break if plumbing_response.meta.next_cursor == ""
|
2752
|
+
req.meta.cursor = plumbing_response.meta.next_cursor
|
2753
|
+
end
|
2754
|
+
}
|
2755
|
+
resp
|
2756
|
+
end
|
2757
|
+
|
2758
|
+
# List returns Managed Secrets for an Actor from a Secret Engine.
|
2759
|
+
def list_by_actor(
|
2760
|
+
filter,
|
2761
|
+
*args,
|
2762
|
+
deadline: nil
|
2763
|
+
)
|
2764
|
+
req = V1::ManagedSecretListRequest.new()
|
2765
|
+
req.meta = V1::ListRequestMetadata.new()
|
2766
|
+
if @parent.page_limit > 0
|
2767
|
+
req.meta.limit = @parent.page_limit
|
2768
|
+
end
|
2769
|
+
if not @parent.snapshot_time.nil?
|
2770
|
+
req.meta.snapshot_at = @parent.snapshot_time
|
2771
|
+
end
|
2772
|
+
|
2773
|
+
req.filter = Plumbing::quote_filter_args(filter, *args)
|
2774
|
+
resp = Enumerator::Generator.new { |g|
|
2775
|
+
tries = 0
|
2776
|
+
loop do
|
2777
|
+
begin
|
2778
|
+
plumbing_response = @stub.list_by_actor(req, metadata: @parent.get_metadata("ManagedSecrets.ListByActor", req), deadline: deadline)
|
2779
|
+
rescue => exception
|
2780
|
+
if (@parent.shouldRetry(tries, exception))
|
2781
|
+
tries + +@parent.jitterSleep(tries)
|
2782
|
+
next
|
2783
|
+
end
|
2784
|
+
raise Plumbing::convert_error_to_porcelain(exception)
|
2785
|
+
end
|
2786
|
+
tries = 0
|
2787
|
+
plumbing_response.managed_secrets.each do |plumbing_item|
|
2788
|
+
g.yield Plumbing::convert_managed_secret_to_porcelain(plumbing_item)
|
2789
|
+
end
|
2790
|
+
break if plumbing_response.meta.next_cursor == ""
|
2791
|
+
req.meta.cursor = plumbing_response.meta.next_cursor
|
2792
|
+
end
|
2793
|
+
}
|
2794
|
+
resp
|
2795
|
+
end
|
2796
|
+
|
2797
|
+
# Create creates a Managed Secret
|
2798
|
+
def create(
|
2799
|
+
managed_secret,
|
2800
|
+
deadline: nil
|
2801
|
+
)
|
2802
|
+
req = V1::ManagedSecretCreateRequest.new()
|
2803
|
+
|
2804
|
+
req.managed_secret = Plumbing::convert_managed_secret_to_plumbing(managed_secret)
|
2805
|
+
tries = 0
|
2806
|
+
plumbing_response = nil
|
2807
|
+
loop do
|
2808
|
+
begin
|
2809
|
+
plumbing_response = @stub.create(req, metadata: @parent.get_metadata("ManagedSecrets.Create", req), deadline: deadline)
|
2810
|
+
rescue => exception
|
2811
|
+
if (@parent.shouldRetry(tries, exception))
|
2812
|
+
tries + +@parent.jitterSleep(tries)
|
2813
|
+
next
|
2814
|
+
end
|
2815
|
+
raise Plumbing::convert_error_to_porcelain(exception)
|
2816
|
+
end
|
2817
|
+
break
|
2818
|
+
end
|
2819
|
+
|
2820
|
+
resp = ManagedSecretCreateResponse.new()
|
2821
|
+
resp.managed_secret = Plumbing::convert_managed_secret_to_porcelain(plumbing_response.managed_secret)
|
2822
|
+
resp.meta = Plumbing::convert_create_response_metadata_to_porcelain(plumbing_response.meta)
|
2823
|
+
resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
|
2824
|
+
resp
|
2825
|
+
end
|
2826
|
+
|
2827
|
+
# Update updates a Managed Secret
|
2828
|
+
def update(
|
2829
|
+
managed_secret,
|
2830
|
+
deadline: nil
|
2831
|
+
)
|
2832
|
+
req = V1::ManagedSecretUpdateRequest.new()
|
2833
|
+
|
2834
|
+
req.managed_secret = Plumbing::convert_managed_secret_to_plumbing(managed_secret)
|
2835
|
+
tries = 0
|
2836
|
+
plumbing_response = nil
|
2837
|
+
loop do
|
2838
|
+
begin
|
2839
|
+
plumbing_response = @stub.update(req, metadata: @parent.get_metadata("ManagedSecrets.Update", req), deadline: deadline)
|
2840
|
+
rescue => exception
|
2841
|
+
if (@parent.shouldRetry(tries, exception))
|
2842
|
+
tries + +@parent.jitterSleep(tries)
|
2843
|
+
next
|
2844
|
+
end
|
2845
|
+
raise Plumbing::convert_error_to_porcelain(exception)
|
2846
|
+
end
|
2847
|
+
break
|
2848
|
+
end
|
2849
|
+
|
2850
|
+
resp = ManagedSecretUpdateResponse.new()
|
2851
|
+
resp.managed_secret = Plumbing::convert_managed_secret_to_porcelain(plumbing_response.managed_secret)
|
2852
|
+
resp.meta = Plumbing::convert_update_response_metadata_to_porcelain(plumbing_response.meta)
|
2853
|
+
resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
|
2854
|
+
resp
|
2855
|
+
end
|
2856
|
+
|
2857
|
+
# Rotate forces rotation of Managed Secret
|
2858
|
+
def rotate(
|
2859
|
+
id,
|
2860
|
+
deadline: nil
|
2861
|
+
)
|
2862
|
+
req = V1::ManagedSecretRotateRequest.new()
|
2863
|
+
|
2864
|
+
req.id = (id)
|
2865
|
+
tries = 0
|
2866
|
+
plumbing_response = nil
|
2867
|
+
loop do
|
2868
|
+
begin
|
2869
|
+
plumbing_response = @stub.rotate(req, metadata: @parent.get_metadata("ManagedSecrets.Rotate", req), deadline: deadline)
|
2870
|
+
rescue => exception
|
2871
|
+
if (@parent.shouldRetry(tries, exception))
|
2872
|
+
tries + +@parent.jitterSleep(tries)
|
2873
|
+
next
|
2874
|
+
end
|
2875
|
+
raise Plumbing::convert_error_to_porcelain(exception)
|
2876
|
+
end
|
2877
|
+
break
|
2878
|
+
end
|
2879
|
+
|
2880
|
+
resp = ManagedSecretRotateResponse.new()
|
2881
|
+
resp.meta = Plumbing::convert_generic_response_metadata_to_porcelain(plumbing_response.meta)
|
2882
|
+
resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
|
2883
|
+
resp
|
2884
|
+
end
|
2885
|
+
|
2886
|
+
# Delete deletes a Managed Secret
|
2887
|
+
def delete(
|
2888
|
+
id,
|
2889
|
+
deadline: nil
|
2890
|
+
)
|
2891
|
+
req = V1::ManagedSecretDeleteRequest.new()
|
2892
|
+
|
2893
|
+
req.id = (id)
|
2894
|
+
tries = 0
|
2895
|
+
plumbing_response = nil
|
2896
|
+
loop do
|
2897
|
+
begin
|
2898
|
+
plumbing_response = @stub.delete(req, metadata: @parent.get_metadata("ManagedSecrets.Delete", req), deadline: deadline)
|
2899
|
+
rescue => exception
|
2900
|
+
if (@parent.shouldRetry(tries, exception))
|
2901
|
+
tries + +@parent.jitterSleep(tries)
|
2902
|
+
next
|
2903
|
+
end
|
2904
|
+
raise Plumbing::convert_error_to_porcelain(exception)
|
2905
|
+
end
|
2906
|
+
break
|
2907
|
+
end
|
2908
|
+
|
2909
|
+
resp = ManagedSecretDeleteResponse.new()
|
2910
|
+
resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
|
2911
|
+
resp
|
2912
|
+
end
|
2913
|
+
|
2914
|
+
# Get gets details of a Managed Secret without sensitive data
|
2915
|
+
def get(
|
2916
|
+
id,
|
2917
|
+
deadline: nil
|
2918
|
+
)
|
2919
|
+
req = V1::ManagedSecretGetRequest.new()
|
2920
|
+
if not @parent.snapshot_time.nil?
|
2921
|
+
req.meta = V1::GetRequestMetadata.new()
|
2922
|
+
req.meta.snapshot_at = @parent.snapshot_time
|
2923
|
+
end
|
2924
|
+
|
2925
|
+
req.id = (id)
|
2926
|
+
tries = 0
|
2927
|
+
plumbing_response = nil
|
2928
|
+
loop do
|
2929
|
+
begin
|
2930
|
+
plumbing_response = @stub.get(req, metadata: @parent.get_metadata("ManagedSecrets.Get", req), deadline: deadline)
|
2931
|
+
rescue => exception
|
2932
|
+
if (@parent.shouldRetry(tries, exception))
|
2933
|
+
tries + +@parent.jitterSleep(tries)
|
2934
|
+
next
|
2935
|
+
end
|
2936
|
+
raise Plumbing::convert_error_to_porcelain(exception)
|
2937
|
+
end
|
2938
|
+
break
|
2939
|
+
end
|
2940
|
+
|
2941
|
+
resp = ManagedSecretGetResponse.new()
|
2942
|
+
resp.managed_secret = Plumbing::convert_managed_secret_to_porcelain(plumbing_response.managed_secret)
|
2943
|
+
resp.meta = Plumbing::convert_get_response_metadata_to_porcelain(plumbing_response.meta)
|
2944
|
+
resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
|
2945
|
+
resp
|
2946
|
+
end
|
2947
|
+
|
2948
|
+
# Retrieve returns Managed Secret with sensitive data
|
2949
|
+
def retrieve(
|
2950
|
+
id,
|
2951
|
+
public_key,
|
2952
|
+
deadline: nil
|
2953
|
+
)
|
2954
|
+
req = V1::ManagedSecretRetrieveRequest.new()
|
2955
|
+
|
2956
|
+
req.id = (id)
|
2957
|
+
req.public_key = (public_key)
|
2958
|
+
tries = 0
|
2959
|
+
plumbing_response = nil
|
2960
|
+
loop do
|
2961
|
+
begin
|
2962
|
+
plumbing_response = @stub.retrieve(req, metadata: @parent.get_metadata("ManagedSecrets.Retrieve", req), deadline: deadline)
|
2963
|
+
rescue => exception
|
2964
|
+
if (@parent.shouldRetry(tries, exception))
|
2965
|
+
tries + +@parent.jitterSleep(tries)
|
2966
|
+
next
|
2967
|
+
end
|
2968
|
+
raise Plumbing::convert_error_to_porcelain(exception)
|
2969
|
+
end
|
2970
|
+
break
|
2971
|
+
end
|
2972
|
+
|
2973
|
+
resp = ManagedSecretRetrieveResponse.new()
|
2974
|
+
resp.managed_secret = Plumbing::convert_managed_secret_to_porcelain(plumbing_response.managed_secret)
|
2975
|
+
resp.meta = Plumbing::convert_get_response_metadata_to_porcelain(plumbing_response.meta)
|
2976
|
+
resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
|
2977
|
+
resp
|
2978
|
+
end
|
2979
|
+
|
2980
|
+
# Validate returns the result of testing the stored credential against the
|
2981
|
+
# secret engine.
|
2982
|
+
def validate(
|
2983
|
+
id,
|
2984
|
+
deadline: nil
|
2985
|
+
)
|
2986
|
+
req = V1::ManagedSecretValidateRequest.new()
|
2987
|
+
|
2988
|
+
req.id = (id)
|
2989
|
+
tries = 0
|
2990
|
+
plumbing_response = nil
|
2991
|
+
loop do
|
2992
|
+
begin
|
2993
|
+
plumbing_response = @stub.validate(req, metadata: @parent.get_metadata("ManagedSecrets.Validate", req), deadline: deadline)
|
2994
|
+
rescue => exception
|
2995
|
+
if (@parent.shouldRetry(tries, exception))
|
2996
|
+
tries + +@parent.jitterSleep(tries)
|
2997
|
+
next
|
2998
|
+
end
|
2999
|
+
raise Plumbing::convert_error_to_porcelain(exception)
|
3000
|
+
end
|
3001
|
+
break
|
3002
|
+
end
|
3003
|
+
|
3004
|
+
resp = ManagedSecretValidateResponse.new()
|
3005
|
+
resp.invalid_info = (plumbing_response.invalid_info)
|
3006
|
+
resp.meta = Plumbing::convert_get_response_metadata_to_porcelain(plumbing_response.meta)
|
3007
|
+
resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
|
3008
|
+
resp.valid = (plumbing_response.valid)
|
3009
|
+
resp
|
3010
|
+
end
|
3011
|
+
|
3012
|
+
# Logs returns the audit records for the managed secret. This may be replaced
|
3013
|
+
# in the future.
|
3014
|
+
def logs(
|
3015
|
+
filter,
|
3016
|
+
*args,
|
3017
|
+
deadline: nil
|
3018
|
+
)
|
3019
|
+
req = V1::ManagedSecretLogsRequest.new()
|
3020
|
+
req.meta = V1::ListRequestMetadata.new()
|
3021
|
+
if @parent.page_limit > 0
|
3022
|
+
req.meta.limit = @parent.page_limit
|
3023
|
+
end
|
3024
|
+
if not @parent.snapshot_time.nil?
|
3025
|
+
req.meta.snapshot_at = @parent.snapshot_time
|
3026
|
+
end
|
3027
|
+
|
3028
|
+
req.filter = Plumbing::quote_filter_args(filter, *args)
|
3029
|
+
resp = Enumerator::Generator.new { |g|
|
3030
|
+
tries = 0
|
3031
|
+
loop do
|
3032
|
+
begin
|
3033
|
+
plumbing_response = @stub.logs(req, metadata: @parent.get_metadata("ManagedSecrets.Logs", req), deadline: deadline)
|
3034
|
+
rescue => exception
|
3035
|
+
if (@parent.shouldRetry(tries, exception))
|
3036
|
+
tries + +@parent.jitterSleep(tries)
|
3037
|
+
next
|
3038
|
+
end
|
3039
|
+
raise Plumbing::convert_error_to_porcelain(exception)
|
3040
|
+
end
|
3041
|
+
tries = 0
|
3042
|
+
plumbing_response.managed_secret_logs.each do |plumbing_item|
|
3043
|
+
g.yield Plumbing::convert_managed_secret_log_to_porcelain(plumbing_item)
|
3044
|
+
end
|
3045
|
+
break if plumbing_response.meta.next_cursor == ""
|
3046
|
+
req.meta.cursor = plumbing_response.meta.next_cursor
|
3047
|
+
end
|
3048
|
+
}
|
3049
|
+
resp
|
3050
|
+
end
|
3051
|
+
end
|
3052
|
+
|
2702
3053
|
# Nodes make up the strongDM network, and allow your users to connect securely to your resources. There are two types of nodes:
|
2703
3054
|
# - **Gateways** are the entry points into network. They listen for connection from the strongDM client, and provide access to databases and servers.
|
2704
3055
|
# - **Relays** are used to extend the strongDM network into segmented subnets. They provide access to databases and servers but do not listen for incoming connections.
|
@@ -5706,6 +6057,311 @@ module SDM #:nodoc:
|
|
5706
6057
|
end
|
5707
6058
|
end
|
5708
6059
|
|
6060
|
+
#
|
6061
|
+
# See:
|
6062
|
+
# {ActiveDirectoryEngine}
|
6063
|
+
# {KeyValueEngine}
|
6064
|
+
class SecretEngines
|
6065
|
+
extend Gem::Deprecate
|
6066
|
+
|
6067
|
+
def initialize(channel, parent)
|
6068
|
+
begin
|
6069
|
+
@stub = V1::SecretEngines::Stub.new(nil, nil, channel_override: channel)
|
6070
|
+
rescue => exception
|
6071
|
+
raise Plumbing::convert_error_to_porcelain(exception)
|
6072
|
+
end
|
6073
|
+
@parent = parent
|
6074
|
+
end
|
6075
|
+
|
6076
|
+
# List returns a list of Secret Engines
|
6077
|
+
def list(
|
6078
|
+
filter,
|
6079
|
+
*args,
|
6080
|
+
deadline: nil
|
6081
|
+
)
|
6082
|
+
req = V1::SecretEngineListRequest.new()
|
6083
|
+
req.meta = V1::ListRequestMetadata.new()
|
6084
|
+
if @parent.page_limit > 0
|
6085
|
+
req.meta.limit = @parent.page_limit
|
6086
|
+
end
|
6087
|
+
if not @parent.snapshot_time.nil?
|
6088
|
+
req.meta.snapshot_at = @parent.snapshot_time
|
6089
|
+
end
|
6090
|
+
|
6091
|
+
req.filter = Plumbing::quote_filter_args(filter, *args)
|
6092
|
+
resp = Enumerator::Generator.new { |g|
|
6093
|
+
tries = 0
|
6094
|
+
loop do
|
6095
|
+
begin
|
6096
|
+
plumbing_response = @stub.list(req, metadata: @parent.get_metadata("SecretEngines.List", req), deadline: deadline)
|
6097
|
+
rescue => exception
|
6098
|
+
if (@parent.shouldRetry(tries, exception))
|
6099
|
+
tries + +@parent.jitterSleep(tries)
|
6100
|
+
next
|
6101
|
+
end
|
6102
|
+
raise Plumbing::convert_error_to_porcelain(exception)
|
6103
|
+
end
|
6104
|
+
tries = 0
|
6105
|
+
plumbing_response.secret_engines.each do |plumbing_item|
|
6106
|
+
g.yield Plumbing::convert_secret_engine_to_porcelain(plumbing_item)
|
6107
|
+
end
|
6108
|
+
break if plumbing_response.meta.next_cursor == ""
|
6109
|
+
req.meta.cursor = plumbing_response.meta.next_cursor
|
6110
|
+
end
|
6111
|
+
}
|
6112
|
+
resp
|
6113
|
+
end
|
6114
|
+
|
6115
|
+
# Get returns a secret engine details
|
6116
|
+
def get(
|
6117
|
+
id,
|
6118
|
+
deadline: nil
|
6119
|
+
)
|
6120
|
+
req = V1::SecretEngineGetRequest.new()
|
6121
|
+
if not @parent.snapshot_time.nil?
|
6122
|
+
req.meta = V1::GetRequestMetadata.new()
|
6123
|
+
req.meta.snapshot_at = @parent.snapshot_time
|
6124
|
+
end
|
6125
|
+
|
6126
|
+
req.id = (id)
|
6127
|
+
tries = 0
|
6128
|
+
plumbing_response = nil
|
6129
|
+
loop do
|
6130
|
+
begin
|
6131
|
+
plumbing_response = @stub.get(req, metadata: @parent.get_metadata("SecretEngines.Get", req), deadline: deadline)
|
6132
|
+
rescue => exception
|
6133
|
+
if (@parent.shouldRetry(tries, exception))
|
6134
|
+
tries + +@parent.jitterSleep(tries)
|
6135
|
+
next
|
6136
|
+
end
|
6137
|
+
raise Plumbing::convert_error_to_porcelain(exception)
|
6138
|
+
end
|
6139
|
+
break
|
6140
|
+
end
|
6141
|
+
|
6142
|
+
resp = SecretEngineGetResponse.new()
|
6143
|
+
resp.meta = Plumbing::convert_get_response_metadata_to_porcelain(plumbing_response.meta)
|
6144
|
+
resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
|
6145
|
+
resp.secret_engine = Plumbing::convert_secret_engine_to_porcelain(plumbing_response.secret_engine)
|
6146
|
+
resp
|
6147
|
+
end
|
6148
|
+
|
6149
|
+
# Create creates a secret engine
|
6150
|
+
def create(
|
6151
|
+
secret_engine,
|
6152
|
+
deadline: nil
|
6153
|
+
)
|
6154
|
+
req = V1::SecretEngineCreateRequest.new()
|
6155
|
+
|
6156
|
+
req.secret_engine = Plumbing::convert_secret_engine_to_plumbing(secret_engine)
|
6157
|
+
tries = 0
|
6158
|
+
plumbing_response = nil
|
6159
|
+
loop do
|
6160
|
+
begin
|
6161
|
+
plumbing_response = @stub.create(req, metadata: @parent.get_metadata("SecretEngines.Create", req), deadline: deadline)
|
6162
|
+
rescue => exception
|
6163
|
+
if (@parent.shouldRetry(tries, exception))
|
6164
|
+
tries + +@parent.jitterSleep(tries)
|
6165
|
+
next
|
6166
|
+
end
|
6167
|
+
raise Plumbing::convert_error_to_porcelain(exception)
|
6168
|
+
end
|
6169
|
+
break
|
6170
|
+
end
|
6171
|
+
|
6172
|
+
resp = SecretEngineCreateResponse.new()
|
6173
|
+
resp.meta = Plumbing::convert_create_response_metadata_to_porcelain(plumbing_response.meta)
|
6174
|
+
resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
|
6175
|
+
resp.secret_engine = Plumbing::convert_secret_engine_to_porcelain(plumbing_response.secret_engine)
|
6176
|
+
resp
|
6177
|
+
end
|
6178
|
+
|
6179
|
+
# Update updates a secret engine
|
6180
|
+
def update(
|
6181
|
+
secret_engine,
|
6182
|
+
deadline: nil
|
6183
|
+
)
|
6184
|
+
req = V1::SecretEngineUpdateRequest.new()
|
6185
|
+
|
6186
|
+
req.secret_engine = Plumbing::convert_secret_engine_to_plumbing(secret_engine)
|
6187
|
+
tries = 0
|
6188
|
+
plumbing_response = nil
|
6189
|
+
loop do
|
6190
|
+
begin
|
6191
|
+
plumbing_response = @stub.update(req, metadata: @parent.get_metadata("SecretEngines.Update", req), deadline: deadline)
|
6192
|
+
rescue => exception
|
6193
|
+
if (@parent.shouldRetry(tries, exception))
|
6194
|
+
tries + +@parent.jitterSleep(tries)
|
6195
|
+
next
|
6196
|
+
end
|
6197
|
+
raise Plumbing::convert_error_to_porcelain(exception)
|
6198
|
+
end
|
6199
|
+
break
|
6200
|
+
end
|
6201
|
+
|
6202
|
+
resp = SecretEngineUpdateResponse.new()
|
6203
|
+
resp.meta = Plumbing::convert_update_response_metadata_to_porcelain(plumbing_response.meta)
|
6204
|
+
resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
|
6205
|
+
resp.secret_engine = Plumbing::convert_secret_engine_to_porcelain(plumbing_response.secret_engine)
|
6206
|
+
resp
|
6207
|
+
end
|
6208
|
+
|
6209
|
+
# Delete deletes a secret engine
|
6210
|
+
def delete(
|
6211
|
+
id,
|
6212
|
+
deadline: nil
|
6213
|
+
)
|
6214
|
+
req = V1::SecretEngineDeleteRequest.new()
|
6215
|
+
|
6216
|
+
req.id = (id)
|
6217
|
+
tries = 0
|
6218
|
+
plumbing_response = nil
|
6219
|
+
loop do
|
6220
|
+
begin
|
6221
|
+
plumbing_response = @stub.delete(req, metadata: @parent.get_metadata("SecretEngines.Delete", req), deadline: deadline)
|
6222
|
+
rescue => exception
|
6223
|
+
if (@parent.shouldRetry(tries, exception))
|
6224
|
+
tries + +@parent.jitterSleep(tries)
|
6225
|
+
next
|
6226
|
+
end
|
6227
|
+
raise Plumbing::convert_error_to_porcelain(exception)
|
6228
|
+
end
|
6229
|
+
break
|
6230
|
+
end
|
6231
|
+
|
6232
|
+
resp = SecretEngineDeleteResponse.new()
|
6233
|
+
resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
|
6234
|
+
resp
|
6235
|
+
end
|
6236
|
+
|
6237
|
+
# ListSecretStores returns a list of Secret Stores that can be used as a backing store
|
6238
|
+
# for Secret Engine
|
6239
|
+
def list_secret_stores(
|
6240
|
+
filter,
|
6241
|
+
*args,
|
6242
|
+
deadline: nil
|
6243
|
+
)
|
6244
|
+
req = V1::SecretStoreListRequest.new()
|
6245
|
+
req.meta = V1::ListRequestMetadata.new()
|
6246
|
+
if @parent.page_limit > 0
|
6247
|
+
req.meta.limit = @parent.page_limit
|
6248
|
+
end
|
6249
|
+
if not @parent.snapshot_time.nil?
|
6250
|
+
req.meta.snapshot_at = @parent.snapshot_time
|
6251
|
+
end
|
6252
|
+
|
6253
|
+
req.filter = Plumbing::quote_filter_args(filter, *args)
|
6254
|
+
resp = Enumerator::Generator.new { |g|
|
6255
|
+
tries = 0
|
6256
|
+
loop do
|
6257
|
+
begin
|
6258
|
+
plumbing_response = @stub.list_secret_stores(req, metadata: @parent.get_metadata("SecretEngines.ListSecretStores", req), deadline: deadline)
|
6259
|
+
rescue => exception
|
6260
|
+
if (@parent.shouldRetry(tries, exception))
|
6261
|
+
tries + +@parent.jitterSleep(tries)
|
6262
|
+
next
|
6263
|
+
end
|
6264
|
+
raise Plumbing::convert_error_to_porcelain(exception)
|
6265
|
+
end
|
6266
|
+
tries = 0
|
6267
|
+
plumbing_response.secret_stores.each do |plumbing_item|
|
6268
|
+
g.yield Plumbing::convert_secret_store_to_porcelain(plumbing_item)
|
6269
|
+
end
|
6270
|
+
break if plumbing_response.meta.next_cursor == ""
|
6271
|
+
req.meta.cursor = plumbing_response.meta.next_cursor
|
6272
|
+
end
|
6273
|
+
}
|
6274
|
+
resp
|
6275
|
+
end
|
6276
|
+
|
6277
|
+
# GenerateKeys generates a private key, stores it in a secret store and stores a public key in a secret engine
|
6278
|
+
def generate_keys(
|
6279
|
+
secret_engine_id,
|
6280
|
+
deadline: nil
|
6281
|
+
)
|
6282
|
+
req = V1::GenerateKeysRequest.new()
|
6283
|
+
|
6284
|
+
req.secret_engine_id = (secret_engine_id)
|
6285
|
+
tries = 0
|
6286
|
+
plumbing_response = nil
|
6287
|
+
loop do
|
6288
|
+
begin
|
6289
|
+
plumbing_response = @stub.generate_keys(req, metadata: @parent.get_metadata("SecretEngines.GenerateKeys", req), deadline: deadline)
|
6290
|
+
rescue => exception
|
6291
|
+
if (@parent.shouldRetry(tries, exception))
|
6292
|
+
tries + +@parent.jitterSleep(tries)
|
6293
|
+
next
|
6294
|
+
end
|
6295
|
+
raise Plumbing::convert_error_to_porcelain(exception)
|
6296
|
+
end
|
6297
|
+
break
|
6298
|
+
end
|
6299
|
+
|
6300
|
+
resp = GenerateKeysResponse.new()
|
6301
|
+
resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
|
6302
|
+
resp
|
6303
|
+
end
|
6304
|
+
|
6305
|
+
# Healthcheck triggers a healthcheck for all nodes serving a secret engine
|
6306
|
+
def healthcheck(
|
6307
|
+
secret_engine_id,
|
6308
|
+
deadline: nil
|
6309
|
+
)
|
6310
|
+
req = V1::HealthcheckRequest.new()
|
6311
|
+
|
6312
|
+
req.secret_engine_id = (secret_engine_id)
|
6313
|
+
tries = 0
|
6314
|
+
plumbing_response = nil
|
6315
|
+
loop do
|
6316
|
+
begin
|
6317
|
+
plumbing_response = @stub.healthcheck(req, metadata: @parent.get_metadata("SecretEngines.Healthcheck", req), deadline: deadline)
|
6318
|
+
rescue => exception
|
6319
|
+
if (@parent.shouldRetry(tries, exception))
|
6320
|
+
tries + +@parent.jitterSleep(tries)
|
6321
|
+
next
|
6322
|
+
end
|
6323
|
+
raise Plumbing::convert_error_to_porcelain(exception)
|
6324
|
+
end
|
6325
|
+
break
|
6326
|
+
end
|
6327
|
+
|
6328
|
+
resp = HealthcheckResponse.new()
|
6329
|
+
resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
|
6330
|
+
resp.status = Plumbing::convert_repeated_healthcheck_status_to_porcelain(plumbing_response.status)
|
6331
|
+
resp
|
6332
|
+
end
|
6333
|
+
|
6334
|
+
# Rotate rotates secret engine's credentials
|
6335
|
+
def rotate(
|
6336
|
+
id,
|
6337
|
+
password_policy,
|
6338
|
+
deadline: nil
|
6339
|
+
)
|
6340
|
+
req = V1::SecretEngineRotateRequest.new()
|
6341
|
+
|
6342
|
+
req.id = (id)
|
6343
|
+
req.password_policy = Plumbing::convert_secret_engine_password_policy_to_plumbing(password_policy)
|
6344
|
+
tries = 0
|
6345
|
+
plumbing_response = nil
|
6346
|
+
loop do
|
6347
|
+
begin
|
6348
|
+
plumbing_response = @stub.rotate(req, metadata: @parent.get_metadata("SecretEngines.Rotate", req), deadline: deadline)
|
6349
|
+
rescue => exception
|
6350
|
+
if (@parent.shouldRetry(tries, exception))
|
6351
|
+
tries + +@parent.jitterSleep(tries)
|
6352
|
+
next
|
6353
|
+
end
|
6354
|
+
raise Plumbing::convert_error_to_porcelain(exception)
|
6355
|
+
end
|
6356
|
+
break
|
6357
|
+
end
|
6358
|
+
|
6359
|
+
resp = SecretEngineRotateResponse.new()
|
6360
|
+
resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
|
6361
|
+
resp
|
6362
|
+
end
|
6363
|
+
end
|
6364
|
+
|
5709
6365
|
# SecretStoreHealths exposes health states for secret stores.
|
5710
6366
|
#
|
5711
6367
|
# See {SecretStoreHealth}.
|