< Summary

Information
Class: Elsa.Connections.Contracts.ConnectionCredentialGrantManagementRequest
Assembly: Elsa.Connections
File(s): /home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Connections/Contracts/IConnectionCredentialUseGrantStore.cs
Line coverage
50%
Covered lines: 4
Uncovered lines: 4
Coverable lines: 8
Total lines: 46
Line coverage: 50%
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_WorkflowInstanceId()100%210%
get_LogicalBindingId()100%210%
get_ConnectionId()100%210%
get_BindingRevision()100%210%
get_Action()100%11100%

File(s)

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

#LineLine coverage
 1using System.Security.Claims;
 2using Elsa.Connections.Models;
 3
 4namespace Elsa.Connections.Contracts;
 5
 6/// <summary>Host-only durable grant storage. A grant never carries credential material.</summary>
 7public interface IConnectionCredentialUseGrantStore
 8{
 9    Task<ConnectionCredentialUseGrant?> FindAsync(
 10        string tenantId, string environmentId, string workflowInstanceId, string logicalBindingId,
 11        CancellationToken cancellationToken = default);
 12
 13    Task<ConnectionCredentialUseGrant?> TryIssueAsync(
 14        string tenantId, string environmentId, string workflowInstanceId, string logicalBindingId,
 15        string connectionId, long bindingRevision, string actorId, DateTimeOffset issuedAt,
 16        CancellationToken cancellationToken = default);
 17
 18    Task<bool> TryWithdrawAsync(
 19        string tenantId, string environmentId, string workflowInstanceId, string logicalBindingId,
 20        long expectedRevision, DateTimeOffset withdrawnAt,
 21        CancellationToken cancellationToken = default);
 22}
 23
 24public enum ConnectionCredentialGrantAction
 25{
 26    Issue,
 27    Withdraw
 28}
 29
 2830public sealed record ConnectionCredentialGrantManagementRequest(
 2631    string TenantId,
 2632    string EnvironmentId,
 033    string WorkflowInstanceId,
 034    string LogicalBindingId,
 035    string ConnectionId,
 036    long BindingRevision,
 3137    ConnectionCredentialGrantAction Action);
 38
 39/// <summary>Host policy for issuing or withdrawing workflow-use grants; connection management does not imply this permi
 40public interface IConnectionCredentialGrantManagementAuthorizer
 41{
 42    Task<bool> AuthorizeAsync(
 43        ClaimsPrincipal principal,
 44        ConnectionCredentialGrantManagementRequest request,
 45        CancellationToken cancellationToken = default);
 46}