Skip to content
Snippets Groups Projects
Commit 86798413 authored by Berend Sliedrecht's avatar Berend Sliedrecht
Browse files

feat(ssi-abstraction): create a custom revocation index instead of it being manually defined


Signed-off-by: default avatarBerend Sliedrecht <berend@animo.id>
parent 7339541b
No related branches found
No related tags found
1 merge request!40End to end run preparation
......@@ -55,7 +55,6 @@ export type EventDidcommAnonCredsCredentialsOfferInput = BaseEventInput<{
credentialDefinitionId: string;
attributes: Array<{ name: string; value: string; mimeType?: string }>;
revocationRegistryDefinitionId?: string;
revocationRegistryIndex?: number;
}>;
export class EventDidcommAnonCredsCredentialsOffer extends BaseEvent<CredentialExchangeRecord> {
public static token = 'didcomm.anoncreds.credentials.offer';
......
......@@ -30,6 +30,7 @@ import {
V2CredentialProtocol,
V2ProofProtocol,
WebDidResolver,
WsOutboundTransport,
} from '@credo-ts/core';
import {
IndyVdrAnonCredsRegistry,
......@@ -78,6 +79,7 @@ export class AgentService implements OnApplicationShutdown {
this.agent.registerInboundTransport(httpInbound);
this.agent.registerOutboundTransport(new WsOutboundTransport());
this.agent.registerOutboundTransport(new HttpOutboundTransport());
}
......@@ -94,7 +96,7 @@ export class AgentService implements OnApplicationShutdown {
key: walletKey,
},
endpoints,
logger: new AgentLogger(LogLevel.debug),
logger: new AgentLogger(LogLevel.warn),
};
}
......
......@@ -23,8 +23,8 @@ import type {
} from '@ocm/shared';
import {
AutoAcceptCredential,
CredentialEventTypes,
AutoAcceptCredential,
CredentialState,
} from '@credo-ts/core';
import { GenericRecord } from '@credo-ts/core/build/modules/generic-records/repository/GenericRecord.js';
......@@ -154,7 +154,6 @@ export class AnonCredsCredentialsService {
connectionId,
credentialDefinitionId,
attributes,
revocationRegistryIndex,
revocationRegistryDefinitionId,
}: EventDidcommAnonCredsCredentialsOfferInput): Promise<
EventDidcommAnonCredsCredentialsOffer['data']
......@@ -180,7 +179,6 @@ export class AnonCredsCredentialsService {
tenantId,
credentialDefinitionId,
attributes,
revocationRegistryIndex,
revocationRegistryDefinitionId,
}: EventDidcommAnonCredsCredentialsOfferToSelfInput): Promise<
EventDidcommAnonCredsCredentialsOfferToSelf['data']
......@@ -204,8 +202,6 @@ export class AnonCredsCredentialsService {
throw new Error('Connection with yourself is not ready, yet');
}
const revocationRegistryIndex = await this.getNextRevocationIdx(t);
const acceptOfferListener = new Promise((resolve) => {
this.agentService.agent.events.on<CredentialStateChangedEvent>(
CredentialEventTypes.CredentialStateChanged,
......@@ -249,6 +245,8 @@ export class AnonCredsCredentialsService {
),
);
const revocationRegistryIndex = await this.getNextRevocationIdx(t);
void t.credentials.offerCredential({
protocolVersion: 'v2',
autoAcceptCredential: AutoAcceptCredential.Always,
......
......@@ -7,7 +7,7 @@ import { validationSchema } from '../validation.js';
const mockConfig = (port: number = 3001, withLedger = false): AppConfig => ({
agentHost: '',
port: 3000,
port,
s3: {
secret: 'very-long-secret-key',
accessKey: 'ssi-abstraction',
......
......@@ -233,7 +233,6 @@ describe('Revocation', () => {
{ name: 'Age', value: '30' },
],
revocationRegistryDefinitionId: revRegDefId,
revocationRegistryIndex: 10,
credentialDefinitionId,
});
const response = await firstValueFrom(response$);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment