0.34.0 • Published 3 months ago

@sphereon/ssi-sdk.oid4vci-holder v0.34.0

Weekly downloads
-
License
Apache-2.0
Repository
-
Last release
3 months ago

Warning: This package still is in very early development. Breaking changes without notice will happen at this point!


A Veramo event logger plugin. This plugin allows for listening to events and to persist them into a database. There are also functions that can be manually called to persist events. Current, only audit events are supported that can be used to create an audit log.

Ideally this plugin should be used in combination with the event logger from our core package. This event logger will also default debug the events. This is mainly as a fallback for when no listener is present within the agent.

Available functions

  • loggerGetAuditEvents
  • loggerStoreAuditEvent

Usage

Adding the plugin to an agent:

import { migrations, Entities } from '@veramo/data-store'
import { EventLogger, IEventLogger } from '@sphereon/ssi-sdk.event-logger'
import { EventLoggerStore, DataStoreMigrations, DataStoreEventLoggerEntities, LoggingEventType } from '@sphereon/ssi-sdk.data-store'

const dbConnection = createConnection({
  type: 'react-native',
  database: 'app.sqlite',
  location: 'default',
  logging: false,
  synchronize: false,
  migrationsRun: true,
  migrations: [...DataStoreMigrations, ...migrations],
  entities: [...DataStoreEventLoggerEntities, ...Entities],
})

const agent = createAgent<IEventLogger>({
  plugins: [
    new EventLogger({
      eventTypes: [LoggingEventType.AUDIT],
      store: new EventLoggerStore(dbConnection),
    }),
  ],
})

Log event using event listener:

import {
  EventLogger,
  EventLoggerBuilder,
  LoggingEventType,
  LogLevel,
  System,
  SubSystem,
  ActionType,
  InitiatorType,
  SystemCorrelationIdType,
  PartyCorrelationType,
} from '@sphereon/ssi-sdk.core'

const agentContext = { agent }
const logger: EventLogger = new EventLoggerBuilder().withContext(agentContext).withNamespace('custom_namespace').build()

await logger.logEvent({
  type: LoggingEventType.AUDIT,
  data: {
    level: LogLevel.DEBUG,
    correlationId: 'b40b8474-58a2-4b23-9fde-bd6ee1902cdb',
    system: System.GENERAL,
    subSystemType: SubSystem.DID_PROVIDER,
    actionType: ActionType.CREATE,
    actionSubType: 'Key generation',
    initiatorType: InitiatorType.EXTERNAL,
    systemCorrelationIdType: SystemCorrelationIdType.DID,
    systemCorrelationId: 'did:example:123456789abcdefghi',
    systemAlias: 'test_alias',
    partyCorrelationType: PartyCorrelationType.DID,
    partyCorrelationId: 'did:example:123456789abcdefghi',
    partyAlias: 'test_alias',
    description: 'test_description',
    data: 'test_data_string',
    diagnosticData: { data: 'test_data_string' },
  },
})

Log event manually:

import {
  AuditLoggingEvent,
  LogLevel,
  System,
  SubSystem,
  ActionType,
  InitiatorType,
  SystemCorrelationIdType,
  PartyCorrelationType,
} from '@sphereon/ssi-sdk.core'
import { GetAuditEventsArgs, NonPersistedAuditLoggingEvent } from '@sphereon/ssi-sdk.event-logger'

const auditEvent: NonPersistedAuditLoggingEvent = {
  level: LogLevel.DEBUG,
  correlationId: 'b40b8474-58a2-4b23-9fde-bd6ee1902cdb',
  system: System.GENERAL,
  subSystemType: SubSystem.DID_PROVIDER,
  actionType: ActionType.CREATE,
  actionSubType: 'Key generation',
  initiatorType: InitiatorType.EXTERNAL,
  systemCorrelationIdType: SystemCorrelationIdType.DID,
  systemCorrelationId: 'did:example:123456789abcdefghi',
  systemAlias: 'test_alias',
  partyCorrelationType: PartyCorrelationType.DID,
  partyCorrelationId: 'did:example:123456789abcdefghi',
  partyAlias: 'test_alias',
  description: 'test_description',
  data: 'test_data_string',
  diagnosticData: { data: 'test_data_string' },
}

const result: AuditLoggingEvent = await agent.loggerLogAuditEvent({ event: auditEvent })

Retrieve audit events:

import {
  AuditLoggingEvent,
  LogLevel,
  System,
  SubSystem,
  ActionType,
  InitiatorType,
  SystemCorrelationIdType,
  PartyCorrelationType,
} from '@sphereon/ssi-sdk.core'
import { GetAuditEventsArgs, NonPersistedAuditLoggingEvent } from '@sphereon/ssi-sdk.event-logger'

const auditEvent: NonPersistedAuditLoggingEvent = {
  level: LogLevel.DEBUG,
  correlationId: 'b40b8474-58a2-4b23-9fde-bd6ee1902cdb',
  system: System.GENERAL,
  subSystemType: SubSystem.DID_PROVIDER,
  actionType: ActionType.CREATE,
  actionSubType: 'Key generation',
  initiatorType: InitiatorType.EXTERNAL,
  systemCorrelationIdType: SystemCorrelationIdType.DID,
  systemCorrelationId: 'did:example:123456789abcdefghi',
  systemAlias: 'test_alias',
  partyCorrelationType: PartyCorrelationType.DID,
  partyCorrelationId: 'did:example:123456789abcdefghi',
  partyAlias: 'test_alias',
  description: 'test_description',
  data: 'test_data_string',
  diagnosticData: { data: 'test_data_string' },
}

await agent.loggerLogAuditEvent({ event: auditEvent })
const getAuditEventArgs: GetAuditEventsArgs = {
  filter: [{ correlationId: auditEvent.correlationId }],
}
const result: Array<AuditLoggingEvent> = await agent.loggerGetAuditEvents(getAuditEventArgs)

Installation

yarn add @sphereon/ssi-sdk.event-logger

Build

yarn build
0.30.2-next.394

9 months ago

0.30.2-next.395

9 months ago

0.30.2-fix.364

9 months ago

0.30.2-fix.363

9 months ago

0.30.2-fix.368

9 months ago

0.30.2-fix.367

9 months ago

0.30.2-next.373

9 months ago

0.31.1-fix.4

9 months ago

0.31.1-fix.5

9 months ago

0.33.0

5 months ago

0.30.2-next.148

9 months ago

0.30.2-next.145

9 months ago

0.31.1-next.4

9 months ago

0.30.2-next.390

9 months ago

0.31.0

9 months ago

0.30.2-next.191

9 months ago

0.30.2-fix.199

9 months ago

0.30.2-fix.198

9 months ago

0.30.2-next.328

9 months ago

0.30.2-next.329

9 months ago

0.32.1-next.291

5 months ago

0.32.1-next.287

5 months ago

0.30.2-fix.395

9 months ago

0.30.2-fix.393

9 months ago

0.30.2-next.365

9 months ago

0.30.2-next.367

9 months ago

0.30.2-next.362

9 months ago

0.30.2-next.363

9 months ago

0.30.2-fix.139

9 months ago

0.30.2-fix.140

9 months ago

0.31.1-fix.20

9 months ago

0.30.2-next.276

9 months ago

0.30.2-next.279

9 months ago

0.30.2-next.273

9 months ago

0.30.2-next.275

9 months ago

0.30.2-next.281

9 months ago

0.32.0

8 months ago

0.30.2-next.285

9 months ago

0.30.2-next.259

9 months ago

0.32.1-next.113

7 months ago

0.30.2-next.269

9 months ago

0.30.2-next.267

9 months ago

0.31.1-next.44

8 months ago

0.31.1-next.42

8 months ago

0.31.1-next.41

8 months ago

0.31.1-next.39

8 months ago

0.31.1-next.33

8 months ago

0.31.1-next.32

8 months ago

0.32.1-fix.160

6 months ago

0.31.1-next.30

8 months ago

0.32.1-next.161

6 months ago

0.33.1-next.3

4 months ago

0.33.1-next.2

4 months ago

0.31.1-next.62

8 months ago

0.32.1-next.54

7 months ago

0.32.1-next.157

6 months ago

0.31.1-next.60

8 months ago

0.32.1-next.150

6 months ago

0.32.1-next.141

6 months ago

0.32.1-next.145

6 months ago

0.33.1-next.73

3 months ago

0.32.1-fix.143

6 months ago

0.32.1-fix.142

6 months ago

0.33.1-next.68

3 months ago

0.30.2-next.200

9 months ago

0.31.1-next.29

8 months ago

0.31.1-next.26

8 months ago

0.31.1-next.28

8 months ago

0.31.1-next.21

9 months ago

0.31.1-next.24

8 months ago

0.31.1-next.23

9 months ago

0.31.1-next.19

9 months ago

0.31.1-next.14

9 months ago

0.31.1-next.17

9 months ago

0.31.1-next.13

9 months ago

0.34.0

3 months ago

0.30.2-fix.278

9 months ago

0.30.2-fix.270

9 months ago

0.30.2-fix.280

9 months ago

0.30.2-next.215

9 months ago

0.30.2-next.221

9 months ago

0.30.2-next.223

9 months ago

0.30.2-fix.266

9 months ago

0.30.2-fix.265

9 months ago

0.30.2-fix.263

9 months ago

0.30.2-fix.262

9 months ago

0.32.1-fix.15

8 months ago

0.32.1-next.13

8 months ago

0.32.1-next.17

8 months ago

0.32.1-next.18

8 months ago

0.32.1-next.12

8 months ago

0.32.1-next.20

7 months ago

0.30.2-fix.138

9 months ago

0.30.2-next.133

10 months ago

0.30.2-next.135

10 months ago

0.30.2-fix.136

10 months ago

0.30.2-next.129

10 months ago

0.30.2-next.125

10 months ago

0.30.2-next.103

10 months ago

0.30.2-fix.50

10 months ago

0.30.2-fix.48

10 months ago

0.30.2-fix.49

10 months ago

0.30.2-next.58

10 months ago

0.30.2-next.66

10 months ago

0.30.2-next.47

10 months ago

0.30.2-unstable.27

10 months ago

0.30.2-unstable.8

10 months ago

0.30.2-unstable.24

10 months ago

0.30.2-unstable.25

10 months ago

0.30.2-unstable.26

10 months ago

0.30.2-unstable.21

10 months ago

0.30.2-unstable.22

10 months ago

0.30.2-unstable.23

10 months ago

0.30.2-unstable.3

11 months ago

0.30.2-unstable.7

10 months ago

0.30.2-unstable.6

10 months ago

0.30.2-unstable.5

10 months ago

0.30.2-unstable.4

11 months ago

0.30.2-unstable.9

10 months ago

0.30.2-next.4

11 months ago

0.30.2-next.5

10 months ago

0.30.2-next.6

10 months ago

0.29.1-next.185

11 months ago

0.30.1

11 months ago

0.29.1-next.175

11 months ago

0.29.1-next.174

11 months ago

0.29.1-next.177

11 months ago

0.29.1-next.176

11 months ago

0.29.1-unstable.185

11 months ago

0.29.1-unstable.184

11 months ago

0.29.1-unstable.183

11 months ago

0.29.1-unstable.182

11 months ago

0.30.1-unstable.5

11 months ago

0.30.2-unstable.13

10 months ago

0.30.2-unstable.14

10 months ago

0.30.2-unstable.11

10 months ago

0.30.2-unstable.12

10 months ago

0.30.2-unstable.10

11 months ago

0.30.2-unstable.19

10 months ago

0.30.2-unstable.17

10 months ago

0.30.2-unstable.18

10 months ago

0.30.2-unstable.15

10 months ago

0.30.2-unstable.20

10 months ago

0.29.1-unstable.158

11 months ago

0.27.1-next.20

1 year ago

0.27.1-next.24

1 year ago

0.27.1-next.25

1 year ago

0.29.1-next.80

12 months ago

0.27.1-next.28

1 year ago

0.29.1-unstable.216

11 months ago

0.27.1-next.29

1 year ago

0.29.1-unstable.215

11 months ago

0.27.1-next.26

1 year ago

0.29.1-unstable.218

11 months ago

0.29.1-unstable.220

11 months ago

0.29.1-unstable.224

11 months ago

0.29.1-unstable.103

12 months ago

0.29.1-unstable.223

11 months ago

0.29.1-unstable.102

12 months ago

0.29.1-unstable.101

12 months ago

0.29.1-unstable.221

11 months ago

0.29.1-unstable.100

12 months ago

0.29.1-next.82

12 months ago

0.28.1-next.51

1 year ago

0.28.1-next.50

1 year ago

0.28.1-next.53

1 year ago

0.28.1-next.52

1 year ago

0.27.1-next.31

1 year ago

0.27.1-next.33

1 year ago

0.29.1-unstable.206

12 months ago

0.27.1-next.39

1 year ago

0.29.1-unstable.205

12 months ago

0.27.1-next.38

1 year ago

0.29.1-unstable.209

12 months ago

0.29.1-unstable.208

12 months ago

0.29.1-unstable.213

11 months ago

0.28.1-next.48

1 year ago

0.29.1-unstable.212

12 months ago

0.29.1-unstable.210

12 months ago

0.28.1-next.49

1 year ago

0.28.1-next.44

1 year ago

0.29.1-next.5

1 year ago

0.28.1-next.40

1 year ago

0.26.1-next.6

1 year ago

0.29.1-next.4

1 year ago

0.26.1-next.4

1 year ago

0.29.1-next.2

1 year ago

0.28.1-next.41

1 year ago

0.29.1-unstable.202

12 months ago

0.26.1-next.140

1 year ago

0.29.1-unstable.201

12 months ago

0.29.1-unstable.200

12 months ago

0.29.1-next.61

1 year ago

0.28.1-next.60

1 year ago

0.26.1-next.129

1 year ago

0.26.1-next.127

1 year ago

0.26.1-next.131

1 year ago

0.26.1-next.132

1 year ago

0.29.1-unstable.139

12 months ago

0.29.1-unstable.138

12 months ago

0.29.1-unstable.137

12 months ago

0.26.1-next.115

1 year ago

0.26.1-next.113

1 year ago

0.29.1-unstable.143

12 months ago

0.29.1-unstable.142

11 months ago

0.29.1-unstable.141

12 months ago

0.29.1-unstable.147

12 months ago

0.29.1-unstable.146

12 months ago

0.29.1-unstable.145

12 months ago

0.29.1-unstable.144

12 months ago

0.26.1-next.108

1 year ago

0.26.1-next.106

1 year ago

0.29.1-unstable.132

11 months ago

0.29.1-unstable.131

12 months ago

0.29.1-unstable.134

12 months ago

0.29.1-unstable.237

11 months ago

0.29.1-unstable.236

11 months ago

0.29.1-unstable.119

11 months ago

0.29.1-unstable.121

11 months ago

0.29.1-unstable.120

11 months ago

0.29.1-unstable.241

11 months ago

0.29.1-unstable.107

11 months ago

0.29.1-unstable.228

11 months ago

0.29.1-unstable.227

11 months ago

0.29.1-unstable.106

12 months ago

0.29.1-unstable.225

11 months ago

0.29.1-unstable.104

12 months ago

0.29.1-unstable.109

11 months ago

0.29.1-unstable.110

11 months ago

0.29.1-unstable.231

11 months ago

0.29.1-unstable.235

11 months ago

0.29.1-unstable.113

11 months ago

0.29.1-unstable.234

11 months ago

0.29.1-unstable.112

11 months ago

0.29.1-unstable.233

11 months ago

0.29.1-unstable.111

11 months ago

0.29.1-unstable.187

12 months ago

0.29.1-unstable.186

12 months ago

0.29.1-unstable.188

12 months ago

0.29.1-unstable.180

12 months ago

0.29.1-unstable.175

12 months ago

0.29.1-unstable.174

12 months ago

0.29.1-unstable.173

12 months ago

0.25.0

1 year ago

0.29.1-unstable.177

12 months ago

0.29.1-unstable.172

12 months ago

0.29.1-unstable.171

12 months ago

0.29.1-unstable.170

12 months ago

0.29.1-unstable.159

12 months ago

0.29.1-unstable.165

12 months ago

0.29.1-unstable.163

12 months ago

0.27.1-next.8

1 year ago

0.29.1-unstable.162

12 months ago

0.27.1-next.9

1 year ago

0.29.1-unstable.169

12 months ago

0.27.1-next.6

1 year ago

0.27.1-next.7

1 year ago

0.27.1-next.4

1 year ago

0.29.1-unstable.166

12 months ago

0.29.1-unstable.161

12 months ago

0.29.1-unstable.160

12 months ago

0.27.1-next.2

1 year ago

0.29.1-unstable.149

12 months ago

0.29.1-unstable.148

12 months ago

0.29.1-unstable.154

11 months ago

0.29.1-unstable.153

12 months ago

0.29.1-unstable.152

12 months ago

0.29.1-unstable.151

12 months ago

0.26.0

1 year ago

0.29.1-unstable.157

12 months ago

0.29.1-unstable.156

12 months ago

0.29.1-unstable.155

12 months ago

0.29.1-unstable.150

12 months ago

0.28.1-next.11

1 year ago

0.28.1-next.10

1 year ago

0.28.1-next.13

1 year ago

0.25.1-next.118

1 year ago

0.30.0-unstable.0

11 months ago

0.28.1-next.39

1 year ago

0.29.1-unstable.197

12 months ago

0.29.1-unstable.196

12 months ago

0.24.0

1 year ago

0.29.1-unstable.199

12 months ago

0.29.1-unstable.190

12 months ago

0.29.1-unstable.194

12 months ago

0.29.1-unstable.193

12 months ago

0.29.1-unstable.191

12 months ago

0.29.1-unstable.90

12 months ago

0.29.1-unstable.91

12 months ago

0.29.1-unstable.92

12 months ago

0.29.1-unstable.93

12 months ago

0.29.1-unstable.99

12 months ago

0.29.1-unstable.94

12 months ago

0.29.1-unstable.96

12 months ago

0.29.1-unstable.97

12 months ago

0.29.1-unstable.81

12 months ago

0.29.0

1 year ago

0.29.1-unstable.87

12 months ago

0.29.1-unstable.88

12 months ago

0.29.1-unstable.89

12 months ago

0.29.1-unstable.85

12 months ago

0.29.1-unstable.86

12 months ago

0.24.1-next.98

1 year ago

0.27.0

1 year ago

0.24.1-next.42

1 year ago

0.28.0

1 year ago

0.29.1-next.122

11 months ago

0.25.1-next.29

1 year ago

0.25.1-next.28

1 year ago

0.28.1-next.9

1 year ago

0.28.1-next.5

1 year ago

0.28.1-next.6

1 year ago

0.28.1-next.8

1 year ago

0.30.1-unstable.0

11 months ago

0.30.1-unstable.2

11 months ago

0.30.1-unstable.1

11 months ago

0.30.1-unstable.4

11 months ago

0.30.1-unstable.3

11 months ago

0.23.5-next.24

1 year ago

0.29.1-next.104

11 months ago

0.29.1-next.103

12 months ago

0.29.1-next.47

1 year ago

0.29.1-next.46

1 year ago

0.29.1-next.106

11 months ago

0.29.1-next.105

11 months ago

0.24.1-next.100

1 year ago

0.29.1-unstable.79

12 months ago

0.27.1-next.10

1 year ago

0.27.1-next.12

1 year ago

0.24.1-next.113

1 year ago

0.24.1-next.112

1 year ago

0.24.1-next.118

1 year ago

0.24.1-next.116

1 year ago

0.23.5-next.22

1 year ago

0.23.5-next.12

1 year ago

0.23.5-next.11

1 year ago

0.23.5-next.10

1 year ago

0.23.3-next.3

1 year ago

0.23.4

1 year ago

0.23.2-next.4

1 year ago

0.23.1-next.7

1 year ago

0.23.1

1 year ago

0.23.0

1 year ago

0.21.2-next.25

1 year ago

0.23.1-next.2

1 year ago

0.21.2-next.23

1 year ago

0.21.2-next.8

1 year ago

0.21.2-next.7

1 year ago

0.21.2-next.6

1 year ago

0.21.2-next.17

1 year ago

0.21.1

1 year ago

0.21.1-next.8

1 year ago

0.21.1-next.4

1 year ago

0.22.0

1 year ago

0.19.1-next.125

1 year ago

0.19.1-next.126

1 year ago

0.21.0

1 year ago

0.21.1-next.2

1 year ago

0.19.1-next.119

1 year ago

0.19.1-next.135

1 year ago

0.19.1-next.117

1 year ago

0.19.1-next.113

1 year ago

0.19.1-next.114

1 year ago

0.19.1-next.115

1 year ago

0.19.1-next.116

1 year ago

0.19.1-next.111

1 year ago

0.19.1-next.112

1 year ago

0.19.1-next.105

1 year ago

0.19.1-next.110

1 year ago

0.19.1-next.106

1 year ago

0.19.1-next.108

1 year ago

0.19.1-next.109

1 year ago

0.19.1-next.102

1 year ago

0.19.1-next.100

1 year ago

0.19.1-next.101

1 year ago

0.19.1-next.98

1 year ago

0.19.1-next.99

1 year ago

0.19.1-next.96

1 year ago

0.19.1-next.75

1 year ago

0.19.1-next.24

1 year ago

0.19.1-next.2

1 year ago

0.18.2-next.96

1 year ago

0.19.0

1 year ago

0.18.2-next.95

1 year ago

0.18.2-next.94

1 year ago

0.18.2-next.92

1 year ago

0.18.2-next.77

1 year ago