Interface IConsentService
- Namespace
- Excalibur.Compliance
- Assembly
- Excalibur.Compliance.Abstractions.dll
Provides GDPR-compliant consent management capabilities.
public interface IConsentService
Remarks
This service manages the recording, querying, and withdrawal of data subject consent per GDPR Article 7. It maintains a complete audit trail of all consent lifecycle events.
Methods
GetConsentAsync(string, string, CancellationToken)
Gets the current consent status for a data subject and purpose.
Task<ConsentRecord?> GetConsentAsync(string subjectId, string purpose, CancellationToken cancellationToken)
Parameters
subjectIdstringThe data subject identifier.
purposestringThe processing purpose.
cancellationTokenCancellationTokenCancellation token.
Returns
- Task<ConsentRecord>
The consent record, or null if no consent exists.
RecordConsentAsync(ConsentRecord, CancellationToken)
Records a consent grant for a data subject and purpose.
Task RecordConsentAsync(ConsentRecord record, CancellationToken cancellationToken)
Parameters
recordConsentRecordThe consent record to store.
cancellationTokenCancellationTokenCancellation token.
Returns
- Task
A task representing the asynchronous operation.
Exceptions
- ArgumentNullException
Thrown when
recordis null.
WithdrawConsentAsync(string, string, CancellationToken)
Withdraws consent for a data subject and purpose.
Task<bool> WithdrawConsentAsync(string subjectId, string purpose, CancellationToken cancellationToken)
Parameters
subjectIdstringThe data subject identifier.
purposestringThe processing purpose.
cancellationTokenCancellationTokenCancellation token.