Skip to content

Commit

Permalink
chore: cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
sanderPostma committed Feb 1, 2025
1 parent ad23b4e commit b790d43
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ export class StatusListPlugin implements IAgentPlugin {
return Promise.reject(Error(`Either a datasource or dbName needs to be supplied`))
}
const dataSource = instance.dataSource ? await instance.dataSource : await this.allDataSources.getDbConnection(instance.driverOptions!.dbName!)
await handleSdJwtCredentialStatus(credential, context, {
await handleSdJwtCredentialStatus(credential, {
...rest,
statusListId: statusListUri,
driver: await getDriver({ dataSource, id: statusListUri }),
Expand Down
15 changes: 1 addition & 14 deletions packages/vc-status-list-issuer/src/functions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,13 @@ import {
IRequiredPlugins,
IStatusListPlugin,
StatusListResult,
StatusOAuth,
updateStatusIndexFromStatusListCredential,
} from '@sphereon/ssi-sdk.vc-status-list'
import { getDriver, IStatusListDriver } from '@sphereon/ssi-sdk.vc-status-list-issuer-drivers'
import { StatusListCredentialIdMode, StatusListType, StatusPurpose2021 } from '@sphereon/ssi-types'
import { IAgentContext, ICredentialPlugin } from '@veramo/core'
import { IAgentContext } from '@veramo/core'
import debug from 'debug'
import { StatusListInstance } from './types'
import { SdJwtVcPayload } from '@sd-jwt/sd-jwt-vc'
import { IIdentifierResolution } from '@sphereon/ssi-sdk-ext.identifier-resolution'

export const createStatusListFromInstance = async (
args: {
Expand Down Expand Up @@ -129,7 +126,6 @@ export const handleCredentialStatus = async (
}
export const handleSdJwtCredentialStatus = async (
credential: SdJwtVcPayload,
context: IAgentContext<ICredentialPlugin & IIdentifierResolution>,
credentialStatusOpts?: IIssueCredentialStatusOpts & {
driver?: IStatusListDriver
},
Expand Down Expand Up @@ -184,15 +180,6 @@ export const handleSdJwtCredentialStatus = async (
})
debug(`StatusListEntry with statusListIndex ${statusListIndex} created for credential with statusListId ${statusListId}`)

// Create a Valid status in the status list
let details = await slDriver.getStatusList()
let statusListCredential = details.statusListCredential
details = await updateStatusIndexFromStatusListCredential(
{ statusListCredential: statusListCredential, statusListIndex: statusListIndex, value: StatusOAuth.Valid },
context,
)
await slDriver.updateStatusList({ statusListCredential: details.statusListCredential })

credential.status.status_list.idx = statusListIndex
}
}

0 comments on commit b790d43

Please sign in to comment.