Skip to content

Commit

Permalink
[INJIMOB-2471] use context VCMetadata instead of calling function for…
Browse files Browse the repository at this point in the history
… accessing in issuersMachine

Signed-off-by: KiruthikaJeyashankar <[email protected]>
  • Loading branch information
KiruthikaJeyashankar committed Dec 17, 2024
1 parent 5ba7198 commit 2f37986
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .talismanrc
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ fileignoreconfig:
- filename: machines/Issuers/IssuersGuards.ts
checksum: 21783a057207ad04facdb4c71884f49b0230490def04158419d730e0cc60eb83
- filename: machines/Issuers/IssuersActions.ts
checksum: 4414aa10588d2305293b1902982c5969895c858355e4b91d01dfaa8601c2dd62
checksum: 03949a8a7f66f9b94a57b6b817b6c425e8438a7c796d75c00692d030342102b1
- filename: injitest/automation_trigger.sh
checksum: f2f34839c99cb1b871dde17aed8508a071345d22738796e005ff709d2dab8644
- filename: machines/Issuers/IssuersService.ts
Expand Down
21 changes: 11 additions & 10 deletions machines/Issuers/IssuersActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,12 @@ export const IssuersActions = (model: any) => {
if (error.includes(REQUEST_TIMEOUT)) {
return ErrorMessage.REQUEST_TIMEDOUT;
}
if (error.includes(OIDCErrors.AUTHORIZATION_ENDPOINT_DISCOVERY.GRANT_TYPE_NOT_SUPPORTED)) {
if (
error.includes(
OIDCErrors.AUTHORIZATION_ENDPOINT_DISCOVERY
.GRANT_TYPE_NOT_SUPPORTED,
)
) {
return ErrorMessage.AUTHORIZATION_GRANT_TYPE_NOT_SUPPORTED;
}
return ErrorMessage.GENERIC;
Expand Down Expand Up @@ -150,11 +155,7 @@ export const IssuersActions = (model: any) => {
},

storeVerifiableCredentialMeta: send(
context =>
StoreEvents.PREPEND(
MY_VCS_STORE_KEY,
getVCMetadata(context, context.keyType),
),
context => StoreEvents.PREPEND(MY_VCS_STORE_KEY, context.vcMetadata),
{
to: (context: any) => context.serviceRefs.store,
},
Expand All @@ -175,7 +176,7 @@ export const IssuersActions = (model: any) => {

storeVerifiableCredentialData: send(
(context: any) => {
const vcMetadata = getVCMetadata(context, context.keyType);
const vcMetadata = context.vcMetadata;
const {
verifiableCredential: {
processedCredential,
Expand All @@ -201,7 +202,7 @@ export const IssuersActions = (model: any) => {
context => {
return {
type: 'VC_ADDED',
vcMetadata: getVCMetadata(context, context.keyType),
vcMetadata: context.vcMetadata,
};
},
{
Expand All @@ -213,7 +214,7 @@ export const IssuersActions = (model: any) => {
(context: any) => {
return {
type: 'VC_DOWNLOADED',
vcMetadata: getVCMetadata(context, context.keyType),
vcMetadata: context.vcMetadata,
vc: context.credentialWrapper,
};
},
Expand Down Expand Up @@ -288,7 +289,7 @@ export const IssuersActions = (model: any) => {

logDownloaded: send(
context => {
const vcMetadata = getVCMetadata(context, context.keyType);
const vcMetadata = context.vcMetadata;
return ActivityLogEvents.LOG_ACTIVITY(
VCActivityLog.getLogFromObject({
_vcKey: vcMetadata.getVcKey(),
Expand Down
2 changes: 1 addition & 1 deletion shared/VCMetadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ export function parseMetadatas(metadataStrings: object[]) {

export const getVCMetadata = (context: object, keyType: string) => {
const issuer = context.selectedIssuer.credential_issuer;
const credentialId = context.vcMetadata.id || `${UUID.generate()}_${issuer}`;
const credentialId = `${UUID.generate()}_${issuer}`;

return VCMetadata.fromVC({
requestId: credentialId,
Expand Down

0 comments on commit 2f37986

Please sign in to comment.