< Summary

Information
Class: Elsa.Connections.Contracts.ConnectionCredentialBindingManagementRequest
Assembly: Elsa.Connections
File(s): /home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Connections/Contracts/IConnectionCredentialBindingStore.cs
Line coverage
66%
Covered lines: 4
Uncovered lines: 2
Coverable lines: 6
Total lines: 67
Line coverage: 66.6%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
.ctor(...)100%11100%
get_TenantId()100%11100%
get_EnvironmentId()100%11100%
get_LogicalBindingId()100%210%
get_ConnectionId()100%210%
get_ExpectedRevision()100%11100%

File(s)

/home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Connections/Contracts/IConnectionCredentialBindingStore.cs

#LineLine coverage
 1using Elsa.Connections.Models;
 2
 3namespace Elsa.Connections.Contracts;
 4
 5/// <summary>
 6/// Host-only persistence primitive for durable, revisioned logical workflow bindings. Do not expose it through
 7/// HTTP; application services must authorize the exact tenant, environment, logical reference and target connection
 8/// before creating or rebinding a mapping.
 9/// </summary>
 10/// <remarks>
 11/// A binding selects a connection but does not grant use. A connection can disconnect after the store's active-state
 12/// check and leave a stale mapping; every resolution must still pass through the lifecycle service, which checks the
 13/// current connection status before returning a credential.
 14/// </remarks>
 15public interface IConnectionCredentialBindingStore
 16{
 17    Task<ConnectionCredentialBinding?> FindAsync(
 18        string tenantId,
 19        string environmentId,
 20        string logicalBindingId,
 21        CancellationToken cancellationToken = default);
 22
 23    Task<ConnectionCredentialBinding?> TryCreateAsync(
 24        string tenantId,
 25        string environmentId,
 26        string logicalBindingId,
 27        string connectionId,
 28        CancellationToken cancellationToken = default);
 29
 30    Task<ConnectionCredentialBinding?> TryRebindAsync(
 31        string tenantId,
 32        string environmentId,
 33        string logicalBindingId,
 34        long expectedRevision,
 35        string connectionId,
 36        CancellationToken cancellationToken = default);
 37}
 38
 39public sealed record ConnectionCredentialBindingUseRequest(
 40    string TenantId,
 41    string EnvironmentId,
 42    string LogicalBindingId,
 43    string ConnectionId,
 44    long BindingRevision,
 45    string WorkflowInstanceId);
 46
 47/// <summary>Host authorization for a workflow's use of the binding snapshot resolved by the adapter.</summary>
 48public interface IConnectionCredentialBindingUseAuthorizer
 49{
 50    Task<bool> AuthorizeAsync(ConnectionCredentialBindingUseRequest request, CancellationToken cancellationToken = defau
 51}
 52
 3753public sealed record ConnectionCredentialBindingManagementRequest(
 3754    string TenantId,
 3755    string EnvironmentId,
 056    string LogicalBindingId,
 057    string ConnectionId,
 3758    long? ExpectedRevision);
 59
 60/// <summary>Host authorization for a human creating or explicitly rebinding a logical connection mapping.</summary>
 61public interface IConnectionCredentialBindingManagementAuthorizer
 62{
 63    Task<bool> AuthorizeAsync(
 64        System.Security.Claims.ClaimsPrincipal principal,
 65        ConnectionCredentialBindingManagementRequest request,
 66        CancellationToken cancellationToken = default);
 67}