Class: SDM::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/strongdm.rb

Overview

Client bundles all the services together and initializes them.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_access_key, api_secret_key, host: "app.strongdm.com:443", insecure: false, retry_rate_limit_errors: true, page_limit: 0) ⇒ Client

Creates a new strongDM API client.

Raises:

  • (TypeError)


37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
# File 'lib/strongdm.rb', line 37

def initialize(api_access_key, api_secret_key, host: "app.strongdm.com:443", insecure: false, retry_rate_limit_errors: true, page_limit: 0)
  raise TypeError, "client access key must be a string" unless api_access_key.kind_of?(String)
  raise TypeError, "client secret key must be a string" unless api_secret_key.kind_of?(String)
  raise TypeError, "client host must be a string" unless host.kind_of?(String)
  @api_access_key = api_access_key.strip
  @api_secret_key = Base64.strict_decode64(api_secret_key.strip)
  @base_retry_delay = DEFAULT_BASE_RETRY_DELAY
  @max_retry_delay = DEFAULT_MAX_RETRY_DELAY
  @retry_factor = DEFAULT_RETRY_FACTOR
  @retry_jitter = DEFAULT_RETRY_JITTER
  @page_limit = page_limit
  @retry_rate_limit_errors = retry_rate_limit_errors
  @snapshot_time = nil
  begin
    if insecure
      @channel = GRPC::Core::Channel.new(host, {}, :this_channel_is_insecure)
    else
      cred = GRPC::Core::ChannelCredentials.new()
      @channel = GRPC::Core::Channel.new(host, {}, cred)
    end
  rescue => exception
    raise Plumbing::convert_error_to_porcelain(exception)
  end
  @access_requests = AccessRequests.new(@channel, self)
  @access_request_events_history = AccessRequestEventsHistory.new(@channel, self)
  @access_requests_history = AccessRequestsHistory.new(@channel, self)
  @account_attachments = AccountAttachments.new(@channel, self)
  @account_attachments_history = AccountAttachmentsHistory.new(@channel, self)
  @account_grants = AccountGrants.new(@channel, self)
  @account_grants_history = AccountGrantsHistory.new(@channel, self)
  @account_permissions = AccountPermissions.new(@channel, self)
  @account_resources = AccountResources.new(@channel, self)
  @account_resources_history = AccountResourcesHistory.new(@channel, self)
  @accounts = Accounts.new(@channel, self)
  @accounts_groups = AccountsGroups.new(@channel, self)
  @accounts_groups_history = AccountsGroupsHistory.new(@channel, self)
  @accounts_history = AccountsHistory.new(@channel, self)
  @activities = Activities.new(@channel, self)
  @approval_workflow_approvers = ApprovalWorkflowApprovers.new(@channel, self)
  @approval_workflow_approvers_history = ApprovalWorkflowApproversHistory.new(@channel, self)
  @approval_workflow_steps = ApprovalWorkflowSteps.new(@channel, self)
  @approval_workflow_steps_history = ApprovalWorkflowStepsHistory.new(@channel, self)
  @approval_workflows = ApprovalWorkflows.new(@channel, self)
  @approval_workflows_history = ApprovalWorkflowsHistory.new(@channel, self)
  @control_panel = ControlPanel.new(@channel, self)
  @roles = Roles.new(@channel, self)
  @groups = Groups.new(@channel, self)
  @groups_history = GroupsHistory.new(@channel, self)
  @groups_roles = GroupsRoles.new(@channel, self)
  @groups_roles_history = GroupsRolesHistory.new(@channel, self)
  @health_checks = HealthChecks.new(@channel, self)
  @identity_aliases = IdentityAliases.new(@channel, self)
  @identity_aliases_history = IdentityAliasesHistory.new(@channel, self)
  @identity_sets = IdentitySets.new(@channel, self)
  @identity_sets_history = IdentitySetsHistory.new(@channel, self)
  @managed_secrets = ManagedSecrets.new(@channel, self)
  @nodes = Nodes.new(@channel, self)
  @nodes_history = NodesHistory.new(@channel, self)
  @organization_history = OrganizationHistory.new(@channel, self)
  @peering_group_nodes = PeeringGroupNodes.new(@channel, self)
  @peering_group_peers = PeeringGroupPeers.new(@channel, self)
  @peering_group_resources = PeeringGroupResources.new(@channel, self)
  @peering_groups = PeeringGroups.new(@channel, self)
  @policies = Policies.new(@channel, self)
  @policies_history = PoliciesHistory.new(@channel, self)
  @proxy_cluster_keys = ProxyClusterKeys.new(@channel, self)
  @queries = Queries.new(@channel, self)
  @remote_identities = RemoteIdentities.new(@channel, self)
  @remote_identities_history = RemoteIdentitiesHistory.new(@channel, self)
  @remote_identity_groups = RemoteIdentityGroups.new(@channel, self)
  @remote_identity_groups_history = RemoteIdentityGroupsHistory.new(@channel, self)
  @replays = Replays.new(@channel, self)
  @resources = Resources.new(@channel, self)
  @resources_history = ResourcesHistory.new(@channel, self)
  @role_resources = RoleResources.new(@channel, self)
  @role_resources_history = RoleResourcesHistory.new(@channel, self)
  @roles_history = RolesHistory.new(@channel, self)
  @secret_stores = SecretStores.new(@channel, self)
  @secret_engines = SecretEngines.new(@channel, self)
  @secret_store_healths = SecretStoreHealths.new(@channel, self)
  @secret_stores_history = SecretStoresHistory.new(@channel, self)
  @workflow_approvers = WorkflowApprovers.new(@channel, self)
  @workflow_approvers_history = WorkflowApproversHistory.new(@channel, self)
  @workflow_roles = WorkflowRoles.new(@channel, self)
  @workflow_roles_history = WorkflowRolesHistory.new(@channel, self)
  @workflows = Workflows.new(@channel, self)
  @workflows_history = WorkflowsHistory.new(@channel, self)
end

Instance Attribute Details

#access_request_events_historyObject (readonly)

AccessRequestEventsHistory provides records of all changes to the state of an AccessRequest.

See AccessRequestEventsHistory.



243
244
245
# File 'lib/strongdm.rb', line 243

def access_request_events_history
  @access_request_events_history
end

#access_requestsObject (readonly)

AccessRequests are requests for access to a resource that may match a Workflow.

See AccessRequests.



239
240
241
# File 'lib/strongdm.rb', line 239

def access_requests
  @access_requests
end

#access_requests_historyObject (readonly)

AccessRequestsHistory provides records of all changes to the state of an AccessRequest.

See AccessRequestsHistory.



247
248
249
# File 'lib/strongdm.rb', line 247

def access_requests_history
  @access_requests_history
end

#account_attachmentsObject (readonly)

AccountAttachments assign an account to a role.

See AccountAttachments.



251
252
253
# File 'lib/strongdm.rb', line 251

def 
  @account_attachments
end

#account_attachments_historyObject (readonly)

AccountAttachmentsHistory records all changes to the state of an AccountAttachment.

See AccountAttachmentsHistory.



255
256
257
# File 'lib/strongdm.rb', line 255

def 
  @account_attachments_history
end

#account_grantsObject (readonly)

AccountGrants assign a resource directly to an account, giving the account the permission to connect to that resource.

See AccountGrants.



259
260
261
# File 'lib/strongdm.rb', line 259

def 
  @account_grants
end

#account_grants_historyObject (readonly)

AccountGrantsHistory records all changes to the state of an AccountGrant.

See AccountGrantsHistory.



263
264
265
# File 'lib/strongdm.rb', line 263

def 
  @account_grants_history
end

#account_permissionsObject (readonly)

AccountPermissions records the granular permissions accounts have, allowing them to execute relevant commands via StrongDM's APIs.

See AccountPermissions.



268
269
270
# File 'lib/strongdm.rb', line 268

def 
  @account_permissions
end

#account_resourcesObject (readonly)

AccountResources enumerates the resources to which accounts have access. The AccountResources service is read-only.

See AccountResources.



273
274
275
# File 'lib/strongdm.rb', line 273

def 
  @account_resources
end

#account_resources_historyObject (readonly)

AccountResourcesHistory records all changes to the state of a AccountResource.

See AccountResourcesHistory.



277
278
279
# File 'lib/strongdm.rb', line 277

def 
  @account_resources_history
end

#accountsObject (readonly)

Accounts are users that have access to strongDM. There are two types of accounts:

  1. Users: humans who are authenticated through username and password or SSO.
  2. Service Accounts: machines that are authenticated using a service token.
  3. Tokens are access keys with permissions that can be used for authentication.

See Accounts.



284
285
286
# File 'lib/strongdm.rb', line 284

def accounts
  @accounts
end

#accounts_groupsObject (readonly)

An AccountGroup links an account and a group.

See AccountsGroups.



288
289
290
# File 'lib/strongdm.rb', line 288

def accounts_groups
  @accounts_groups
end

#accounts_groups_historyObject (readonly)

AccountsGroupsHistory records all changes to the state of an AccountGroup.

See AccountsGroupsHistory.



292
293
294
# File 'lib/strongdm.rb', line 292

def accounts_groups_history
  @accounts_groups_history
end

#accounts_historyObject (readonly)

AccountsHistory records all changes to the state of an Account.

See AccountsHistory.



296
297
298
# File 'lib/strongdm.rb', line 296

def accounts_history
  @accounts_history
end

#activitiesObject (readonly)

An Activity is a record of an action taken against a strongDM deployment, e.g. a user creation, resource deletion, sso configuration change, etc. The Activities service is read-only.

See Activities.



302
303
304
# File 'lib/strongdm.rb', line 302

def activities
  @activities
end

#api_access_keyObject (readonly)

API authentication token (read-only).



233
234
235
# File 'lib/strongdm.rb', line 233

def api_access_key
  @api_access_key
end

#approval_workflow_approversObject (readonly)

ApprovalWorkflowApprovers link approval workflow approvers to an ApprovalWorkflowStep

See ApprovalWorkflowApprovers.



306
307
308
# File 'lib/strongdm.rb', line 306

def approval_workflow_approvers
  @approval_workflow_approvers
end

#approval_workflow_approvers_historyObject (readonly)

ApprovalWorkflowApproversHistory records all changes to the state of an ApprovalWorkflowApprover.

See ApprovalWorkflowApproversHistory.



310
311
312
# File 'lib/strongdm.rb', line 310

def approval_workflow_approvers_history
  @approval_workflow_approvers_history
end

#approval_workflow_stepsObject (readonly)

ApprovalWorkflowSteps link approval workflow steps to an ApprovalWorkflow

See ApprovalWorkflowSteps.



314
315
316
# File 'lib/strongdm.rb', line 314

def approval_workflow_steps
  @approval_workflow_steps
end

#approval_workflow_steps_historyObject (readonly)

ApprovalWorkflowStepsHistory records all changes to the state of an ApprovalWorkflowStep.

See ApprovalWorkflowStepsHistory.



318
319
320
# File 'lib/strongdm.rb', line 318

def approval_workflow_steps_history
  @approval_workflow_steps_history
end

#approval_workflowsObject (readonly)

ApprovalWorkflows are the mechanism by which requests for access can be viewed by authorized approvers and be approved or denied.

See ApprovalWorkflows.



323
324
325
# File 'lib/strongdm.rb', line 323

def approval_workflows
  @approval_workflows
end

#approval_workflows_historyObject (readonly)

ApprovalWorkflowsHistory records all changes to the state of an ApprovalWorkflow.

See ApprovalWorkflowsHistory.



327
328
329
# File 'lib/strongdm.rb', line 327

def approval_workflows_history
  @approval_workflows_history
end

#base_retry_delayObject (readonly)

Returns the value of attribute base_retry_delay.



228
229
230
# File 'lib/strongdm.rb', line 228

def base_retry_delay
  @base_retry_delay
end

#control_panelObject (readonly)

ControlPanel contains all administrative controls.

See SDM::ControlPanel.



331
332
333
# File 'lib/strongdm.rb', line 331

def control_panel
  @control_panel
end

#groupsObject (readonly)

A Group is a set of principals.

See Groups.



341
342
343
# File 'lib/strongdm.rb', line 341

def groups
  @groups
end

#groups_historyObject (readonly)

GroupsHistory records all changes to the state of a Group.

See GroupsHistory.



345
346
347
# File 'lib/strongdm.rb', line 345

def groups_history
  @groups_history
end

#groups_rolesObject (readonly)

A GroupRole is an assignment of a Group to a Role.

See GroupsRoles.



349
350
351
# File 'lib/strongdm.rb', line 349

def groups_roles
  @groups_roles
end

#groups_roles_historyObject (readonly)

GroupsRolesHistory records all changes to the state of a GroupRole.

See GroupsRolesHistory.



353
354
355
# File 'lib/strongdm.rb', line 353

def groups_roles_history
  @groups_roles_history
end

#health_checksObject (readonly)

HealthChecks lists the last healthcheck between each node and resource. Note the unconventional capitalization here is to prevent having a collision with GRPC

See HealthChecks.



358
359
360
# File 'lib/strongdm.rb', line 358

def health_checks
  @health_checks
end

#identity_aliasesObject (readonly)

IdentityAliases assign an alias to an account within an IdentitySet. The alias is used as the username when connecting to a identity supported resource.

See IdentityAliases.



363
364
365
# File 'lib/strongdm.rb', line 363

def identity_aliases
  @identity_aliases
end

#identity_aliases_historyObject (readonly)

IdentityAliasesHistory records all changes to the state of a IdentityAlias.

See IdentityAliasesHistory.



367
368
369
# File 'lib/strongdm.rb', line 367

def identity_aliases_history
  @identity_aliases_history
end

#identity_setsObject (readonly)

A IdentitySet is a named grouping of Identity Aliases for Accounts. An Account's relationship to a IdentitySet is defined via IdentityAlias objects.

See IdentitySets.



372
373
374
# File 'lib/strongdm.rb', line 372

def identity_sets
  @identity_sets
end

#identity_sets_historyObject (readonly)

IdentitySetsHistory records all changes to the state of a IdentitySet.

See IdentitySetsHistory.



376
377
378
# File 'lib/strongdm.rb', line 376

def identity_sets_history
  @identity_sets_history
end

#managed_secretsObject (readonly)

ManagedSecret is a private vertical for creating, reading, updating, deleting, listing and rotating the managed secrets in the secrets engines as an authenticated user.

See ManagedSecrets.



382
383
384
# File 'lib/strongdm.rb', line 382

def managed_secrets
  @managed_secrets
end

#max_retry_delayObject (readonly)

Returns the value of attribute max_retry_delay.



229
230
231
# File 'lib/strongdm.rb', line 229

def max_retry_delay
  @max_retry_delay
end

#nodesObject (readonly)

Nodes make up the strongDM network, and allow your users to connect securely to your resources. There are two types of nodes:

  • Gateways are the entry points into network. They listen for connection from the strongDM client, and provide access to databases and servers.
  • 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.

See Nodes.



388
389
390
# File 'lib/strongdm.rb', line 388

def nodes
  @nodes
end

#nodes_historyObject (readonly)

NodesHistory records all changes to the state of a Node.

See NodesHistory.



392
393
394
# File 'lib/strongdm.rb', line 392

def nodes_history
  @nodes_history
end

#organization_historyObject (readonly)

OrganizationHistory records all changes to the state of an Organization.

See OrganizationHistory.



396
397
398
# File 'lib/strongdm.rb', line 396

def organization_history
  @organization_history
end

#page_limitObject

Returns the value of attribute page_limit.



230
231
232
# File 'lib/strongdm.rb', line 230

def page_limit
  @page_limit
end

#peering_group_nodesObject (readonly)

PeeringGroupNodes provides the building blocks necessary to obtain attach a node to a peering group.

See PeeringGroupNodes.



400
401
402
# File 'lib/strongdm.rb', line 400

def peering_group_nodes
  @peering_group_nodes
end

#peering_group_peersObject (readonly)

PeeringGroupPeers provides the building blocks necessary to link two peering groups.

See PeeringGroupPeers.



404
405
406
# File 'lib/strongdm.rb', line 404

def peering_group_peers
  @peering_group_peers
end

#peering_group_resourcesObject (readonly)

PeeringGroupResources provides the building blocks necessary to obtain attach a resource to a peering group.

See PeeringGroupResources.



408
409
410
# File 'lib/strongdm.rb', line 408

def peering_group_resources
  @peering_group_resources
end

#peering_groupsObject (readonly)

PeeringGroups provides the building blocks necessary to obtain explicit network topology and routing.

See PeeringGroups.



412
413
414
# File 'lib/strongdm.rb', line 412

def peering_groups
  @peering_groups
end

#policiesObject (readonly)

Policies are the collection of one or more statements that enforce fine-grained access control for the users of an organization.

See Policies.



417
418
419
# File 'lib/strongdm.rb', line 417

def policies
  @policies
end

#policies_historyObject (readonly)

PoliciesHistory records all changes to the state of a Policy.

See PoliciesHistory.



421
422
423
# File 'lib/strongdm.rb', line 421

def policies_history
  @policies_history
end

#proxy_cluster_keysObject (readonly)

Proxy Cluster Keys are authentication keys for all proxies within a cluster. The proxies within a cluster share the same key. One cluster can have multiple keys in order to facilitate key rotation.

See ProxyClusterKeys.



427
428
429
# File 'lib/strongdm.rb', line 427

def proxy_cluster_keys
  @proxy_cluster_keys
end

#queriesObject (readonly)

A Query is a record of a single client request to a resource, such as a SQL query. Long-running SSH, RDP, or Kubernetes interactive sessions also count as queries. The Queries service is read-only.

See Queries.



433
434
435
# File 'lib/strongdm.rb', line 433

def queries
  @queries
end

#remote_identitiesObject (readonly)

RemoteIdentities assign a resource directly to an account, giving the account the permission to connect to that resource.

See RemoteIdentities.



437
438
439
# File 'lib/strongdm.rb', line 437

def remote_identities
  @remote_identities
end

#remote_identities_historyObject (readonly)

RemoteIdentitiesHistory records all changes to the state of a RemoteIdentity.

See RemoteIdentitiesHistory.



441
442
443
# File 'lib/strongdm.rb', line 441

def remote_identities_history
  @remote_identities_history
end

#remote_identity_groupsObject (readonly)

A RemoteIdentityGroup is a named grouping of Remote Identities for Accounts. An Account's relationship to a RemoteIdentityGroup is defined via RemoteIdentity objects.

See RemoteIdentityGroups.



446
447
448
# File 'lib/strongdm.rb', line 446

def remote_identity_groups
  @remote_identity_groups
end

#remote_identity_groups_historyObject (readonly)

RemoteIdentityGroupsHistory records all changes to the state of a RemoteIdentityGroup.

See RemoteIdentityGroupsHistory.



450
451
452
# File 'lib/strongdm.rb', line 450

def remote_identity_groups_history
  @remote_identity_groups_history
end

#replaysObject (readonly)

A Replay captures the data transferred over a long-running SSH, RDP, or Kubernetes interactive session (otherwise referred to as a query). The Replays service is read-only.

See Replays.



455
456
457
# File 'lib/strongdm.rb', line 455

def replays
  @replays
end

#resourcesObject (readonly)

Resources are databases, servers, clusters, websites, or clouds that strongDM delegates access to.

See Resources.



460
461
462
# File 'lib/strongdm.rb', line 460

def resources
  @resources
end

#resources_historyObject (readonly)

ResourcesHistory records all changes to the state of a Resource.

See ResourcesHistory.



464
465
466
# File 'lib/strongdm.rb', line 464

def resources_history
  @resources_history
end

#role_resourcesObject (readonly)

RoleResources enumerates the resources to which roles have access. The RoleResources service is read-only.

See RoleResources.



469
470
471
# File 'lib/strongdm.rb', line 469

def role_resources
  @role_resources
end

#role_resources_historyObject (readonly)

RoleResourcesHistory records all changes to the state of a RoleResource.

See RoleResourcesHistory.



473
474
475
# File 'lib/strongdm.rb', line 473

def role_resources_history
  @role_resources_history
end

#rolesObject (readonly)

A Role has a list of access rules which determine which Resources the members of the Role have access to. An Account can be a member of multiple Roles via AccountAttachments.

See Roles.



337
338
339
# File 'lib/strongdm.rb', line 337

def roles
  @roles
end

#roles_historyObject (readonly)

RolesHistory records all changes to the state of a Role.

See RolesHistory.



477
478
479
# File 'lib/strongdm.rb', line 477

def roles_history
  @roles_history
end

#secret_enginesObject (readonly)



485
486
487
# File 'lib/strongdm.rb', line 485

def secret_engines
  @secret_engines
end

#secret_store_healthsObject (readonly)

SecretStoreHealths exposes health states for secret stores.

See SecretStoreHealths.



489
490
491
# File 'lib/strongdm.rb', line 489

def secret_store_healths
  @secret_store_healths
end

#secret_storesObject (readonly)

SecretStores are servers where resource secrets (passwords, keys) are stored.

See SecretStores.



481
482
483
# File 'lib/strongdm.rb', line 481

def secret_stores
  @secret_stores
end

#secret_stores_historyObject (readonly)

SecretStoresHistory records all changes to the state of a SecretStore.

See SecretStoresHistory.



493
494
495
# File 'lib/strongdm.rb', line 493

def secret_stores_history
  @secret_stores_history
end

#snapshot_timeObject

Optional timestamp at which to provide historical data



235
236
237
# File 'lib/strongdm.rb', line 235

def snapshot_time
  @snapshot_time
end

#workflow_approversObject (readonly)

WorkflowApprovers is an account or a role with the ability to approve requests bound to a workflow.

See WorkflowApprovers.



497
498
499
# File 'lib/strongdm.rb', line 497

def workflow_approvers
  @workflow_approvers
end

#workflow_approvers_historyObject (readonly)

WorkflowApproversHistory provides records of all changes to the state of a WorkflowApprover.

See WorkflowApproversHistory.



501
502
503
# File 'lib/strongdm.rb', line 501

def workflow_approvers_history
  @workflow_approvers_history
end

#workflow_rolesObject (readonly)

WorkflowRole links a role to a workflow. The linked roles indicate which roles a user must be a part of to request access to a resource via the workflow.

See WorkflowRoles.



506
507
508
# File 'lib/strongdm.rb', line 506

def workflow_roles
  @workflow_roles
end

#workflow_roles_historyObject (readonly)

WorkflowRolesHistory provides records of all changes to the state of a WorkflowRole

See WorkflowRolesHistory.



510
511
512
# File 'lib/strongdm.rb', line 510

def workflow_roles_history
  @workflow_roles_history
end

#workflowsObject (readonly)

Workflows are the collection of rules that define the resources to which access can be requested, the users that can request that access, and the mechanism for approving those requests which can either be automatic approval or a set of users authorized to approve the requests.

See Workflows.



516
517
518
# File 'lib/strongdm.rb', line 516

def workflows
  @workflows
end

#workflows_historyObject (readonly)

WorkflowsHistory provides records of all changes to the state of a Workflow.

See WorkflowsHistory.



520
521
522
# File 'lib/strongdm.rb', line 520

def workflows_history
  @workflows_history
end

Instance Method Details

#closeObject

Closes this client and releases all resources held by it.



127
128
129
130
131
132
133
# File 'lib/strongdm.rb', line 127

def close
  begin
    @channel.close()
  rescue => exception
    raise Plumbing::convert_error_to_porcelain(exception)
  end
end

#max_retriesObject

Deprecated.


224
225
226
# File 'lib/strongdm.rb', line 224

def max_retries
  3
end

#sign(method_name, msg_bytes) ⇒ Object



145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
# File 'lib/strongdm.rb', line 145

def sign(method_name, msg_bytes)
  current_utc_date = Time.now.utc
  date = sprintf("%04d-%02d-%02d", current_utc_date.year, current_utc_date.month, current_utc_date.day)

  signing_key = OpenSSL::HMAC.digest(OpenSSL::Digest::SHA256.new, @api_secret_key, date)
  signing_key = OpenSSL::HMAC.digest(OpenSSL::Digest::SHA256.new, signing_key, "sdm_api_v1")

  sha_req = Digest::SHA256.new
  sha_req << method_name
  sha_req << "\n"
  sha_req << msg_bytes
  request_hash = sha_req.digest

  return Base64.strict_encode64(OpenSSL::HMAC.digest(OpenSSL::Digest::SHA256.new, signing_key, request_hash))
end

#snapshot_at(snapshot_time) ⇒ Object

Constructs a read-only client that will provide historical data from the provided timestamp. See SnapshotClient.



217
218
219
220
221
# File 'lib/strongdm.rb', line 217

def snapshot_at(snapshot_time)
  client = self.clone
  client.snapshot_time = snapshot_time
  return SnapshotClient.new(client)
end