anon-identity
Version:
Decentralized identity framework with DIDs, Verifiable Credentials, and privacy-preserving selective disclosure
86 lines • 2.83 kB
TypeScript
import { RevocationService } from '../revocation/revocation-service';
import { KeyPair } from '../types/index';
import { IStorageProvider } from '../storage';
import { DelegationCredential } from './types';
export interface AgentRevocationRecord {
agentDID: string;
parentDID: string;
serviceDID?: string;
revokedAt: Date;
reason?: string;
}
export declare class AgentRevocationService extends RevocationService {
private delegationManager;
private agentRevocations;
constructor(keyPair: KeyPair, issuerDID: string, storageProvider?: IStorageProvider);
/**
* Revoke an agent's access entirely
*/
revokeAgent(agentDID: string, parentDID: string, reason?: string): Promise<void>;
/**
* Revoke an agent's access to a specific service
*/
revokeAgentServiceAccess(agentDID: string, parentDID: string, serviceDID: string, reason?: string): Promise<void>;
/**
* Check if an agent is revoked
*/
isAgentRevoked(agentDID: string, parentDID: string): Promise<boolean>;
/**
* Check if an agent's service access is revoked
*/
isAgentServiceRevoked(agentDID: string, parentDID: string, serviceDID: string): Promise<boolean>;
/**
* Get all revocation records for a parent
*/
getRevocationRecords(parentDID: string): AgentRevocationRecord[];
/**
* Validate a delegation credential including revocation check
*/
validateDelegationCredential(credential: DelegationCredential): Promise<{
valid: boolean;
reason?: string;
}>;
/**
* Revoke all delegation credentials for an agent
*/
private revokeDelegationCredentialsForAgent;
/**
* Revoke delegation credentials for a specific service
*/
private revokeDelegationCredentialsForService;
/**
* Restore an agent's access
*/
restoreAgent(agentDID: string, parentDID: string): Promise<void>;
/**
* Restore an agent's service access
*/
restoreAgentServiceAccess(agentDID: string, parentDID: string, serviceDID: string): Promise<void>;
/**
* Get revocation statistics
*/
getRevocationStats(): {
totalAgentsRevoked: number;
totalServiceRevocations: number;
revocationsByParent: Record<string, number>;
};
/**
* Export revocation data for backup/migration
*/
exportRevocationData(): {
agentRevocations: Array<{
parentDID: string;
records: AgentRevocationRecord[];
}>;
};
/**
* Import revocation data from backup/migration
*/
importRevocationData(data: {
agentRevocations: Array<{
parentDID: string;
records: AgentRevocationRecord[];
}>;
}): void;
}
//# sourceMappingURL=agent-revocation-service.d.ts.map