AuditingSkillScriptGrantStore
AgentPrism.Core.dllWraps ISkillScriptGrantStore in a decorator that writes an audit trail.
public sealed class AuditingSkillScriptGrantStore : ISkillScriptGrantStore, IAuditDecoratedInheritance
Section titled “Inheritance”object ← AuditingSkillScriptGrantStore
Implements
Section titled “Implements”ISkillScriptGrantStore, IAuditDecorated
Inherited Members
Section titled “Inherited Members”object.GetType(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()
Remarks
Section titled “Remarks”Granting permission to run a script grants permission to run code on the server.
The script.grant and script.revoke actions therefore always enter
the audit trail.
Constructors
Section titled “Constructors”AuditingSkillScriptGrantStore(ISkillScriptGrantStore, IAuditLog, IAuditActorResolver, ILogger<AuditingSkillScriptGrantStore>)
Section titled “ AuditingSkillScriptGrantStore(ISkillScriptGrantStore, IAuditLog, IAuditActorResolver, ILogger<AuditingSkillScriptGrantStore>)”Initializes a new audited grant store.
public AuditingSkillScriptGrantStore(ISkillScriptGrantStore inner, IAuditLog auditLog, IAuditActorResolver actorResolver, ILogger<AuditingSkillScriptGrantStore> logger)Parameters
Section titled “Parameters”inner ISkillScriptGrantStore
The wrapped store.
auditLog IAuditLog
The audit log.
actorResolver IAuditActorResolver
The actor resolver.
logger ILogger<AuditingSkillScriptGrantStore>
The logger.
Exceptions
Section titled “Exceptions”A dependency is null.
Properties
Section titled “Properties”AuditedInner
Section titled “ AuditedInner”Gets the real store instance the decorator wraps.
public object AuditedInner { get; }Property Value
Section titled “Property Value”Methods
Section titled “Methods”FindActiveAsync(string, string, string, DateTimeOffset, CancellationToken)
Section titled “ FindActiveAsync(string, string, string, DateTimeOffset, CancellationToken)”Finds the active grant for the given script.
public ValueTask<SkillScriptGrant?> FindActiveAsync(string tenantId, string skillName, string scriptName, DateTimeOffset instant, CancellationToken cancellationToken = default)Parameters
Section titled “Parameters”tenantId string
The tenant identifier.
skillName string
The skill name.
scriptName string
The script name.
instant DateTimeOffset
The moment to check validity at.
cancellationToken CancellationToken
The cancellation token.
Returns
Section titled “Returns”The script-specific grant first, or the skill-wide grant otherwise. null if no active grant exists.
GrantAsync(SkillScriptGrant, CancellationToken)
Section titled “ GrantAsync(SkillScriptGrant, CancellationToken)”Grants access, or updates an existing grant.
public ValueTask<SkillScriptGrant> GrantAsync(SkillScriptGrant grant, CancellationToken cancellationToken = default)Parameters
Section titled “Parameters”grant SkillScriptGrant
The grant to save.
cancellationToken CancellationToken
The cancellation token.
Returns
Section titled “Returns”The grant with its identifier and timestamp assigned.
ListAsync(string, CancellationToken)
Section titled “ ListAsync(string, CancellationToken)”Lists all of a tenant’s grant records.
public ValueTask<IReadOnlyList<SkillScriptGrant>> ListAsync(string tenantId, CancellationToken cancellationToken = default)Parameters
Section titled “Parameters”tenantId string
The tenant identifier.
cancellationToken CancellationToken
The cancellation token.
Returns
Section titled “Returns”ValueTask<IReadOnlyList<SkillScriptGrant>>
All grants, including revoked and expired records.
RevokeAsync(string, string, string?, CancellationToken)
Section titled “ RevokeAsync(string, string, string?, CancellationToken)”Revokes a grant.
public ValueTask<bool> RevokeAsync(string tenantId, string skillName, string? scriptName, CancellationToken cancellationToken = default)Parameters
Section titled “Parameters”tenantId string
The tenant identifier.
skillName string
The skill name.
scriptName string?
The script name; null for the skill-wide grant.
cancellationToken CancellationToken
The cancellation token.
Returns
Section titled “Returns”true if an active grant was revoked.