anon-identity
Version:
Decentralized identity framework with DIDs, Verifiable Credentials, and privacy-preserving selective disclosure
50 lines • 2.32 kB
TypeScript
import { ServiceProvider, VerificationResult, ServiceProviderOptions } from './service-provider';
import { VerifiablePresentation } from '../types/index';
import { ServiceManifest, AgentValidation } from '../agent/types';
import { ServiceManifestBuilder } from '../agent/service-manifest';
import { AgentRevocationService } from '../agent/agent-revocation-service';
import { ActivityLogger } from '../agent/activity/activity-logger';
export interface AgentServiceProviderOptions extends ServiceProviderOptions {
serviceManifest?: ServiceManifest;
requireAgentValidation?: boolean;
agentRevocationService?: AgentRevocationService;
}
export declare class AgentEnabledServiceProvider extends ServiceProvider {
private serviceManifest;
private scopeValidator;
private requireAgentValidation;
private agentRevocationService?;
private activityLogger;
private agentSessions;
constructor(name: string, did: string, trustedIssuers?: string[], options?: AgentServiceProviderOptions);
setServiceManifest(manifest: ServiceManifest): void;
getServiceManifest(): ServiceManifest;
verifyPresentation(presentation: VerifiablePresentation): Promise<VerificationResult>;
private verifyAgentPresentation;
validateAgent(presentation: VerifiablePresentation, requiredScopes: string[]): Promise<AgentValidation>;
hasScope(agentDID: string, scope: string): boolean;
getAgentScopes(agentDID: string): string[];
getAgentParent(agentDID: string): string | null;
revokeAgentSession(agentDID: string): Promise<boolean>;
getAllAgentSessions(): Array<{
sessionId: string;
agentDID: string;
parentDID: string;
scopes: string[];
}>;
static createManifestBuilder(serviceDID: string, name: string): ServiceManifestBuilder;
getScopeDescriptions(): Record<string, string>;
validateScopeRequirements(grantedScopes: string[]): {
valid: boolean;
missingRequired: string[];
additionalOptional: string[];
};
logScopeUsage(agentDID: string, scope: string, details?: {
resourceType?: string;
resourceId?: string;
operation?: string;
success?: boolean;
}): Promise<void>;
getActivityLogger(): ActivityLogger;
}
//# sourceMappingURL=service-provider-agent.d.ts.map