@sphereon/ssi-sdk.data-store 0.34.1-feature.SSISDK.17.bitstring.sl.2 → 0.34.1-feature.SSISDK.17.bitstring.sl.25

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3,9 +3,12 @@ import Debug from 'debug'
3
3
  import { DataSource, In, type Repository } from 'typeorm'
4
4
  import { BitstringStatusListEntity, OAuthStatusListEntity, StatusList2021Entity, StatusListEntity } from '../entities/statusList/StatusListEntities'
5
5
  import { StatusListEntryEntity } from '../entities/statusList/StatusList2021EntryEntity'
6
- import type {
6
+ import { BitstringStatusListEntryEntity } from '../entities/statusList/BitstringStatusListEntryEntity'
7
+ import {
7
8
  IAddStatusListArgs,
8
9
  IAddStatusListEntryArgs,
10
+ IBitstringStatusListEntity,
11
+ IBitstringStatusListEntryEntity,
9
12
  IGetStatusListArgs,
10
13
  IGetStatusListEntriesArgs,
11
14
  IGetStatusListEntryByCredentialIdArgs,
@@ -41,11 +44,11 @@ export class StatusListStore implements IStatusListStore {
41
44
  async availableStatusListEntries(args: IStatusListEntryAvailableArgs): Promise<number[]> {
42
45
  const statusListIndex = Array.isArray(args.statusListIndex) ? args.statusListIndex : [args.statusListIndex]
43
46
  const statusList = await this.getStatusList({ ...args, id: args.statusListId })
44
- const repo = await this.getStatusListEntryRepo()
47
+ const repo = await this.getStatusListEntryRepo(statusList.type)
45
48
  const results = (
46
49
  await repo.find({
47
50
  where: {
48
- statusList,
51
+ statusListId: statusList.id,
49
52
  statusListIndex: In(statusListIndex),
50
53
  },
51
54
  })
@@ -53,33 +56,42 @@ export class StatusListStore implements IStatusListStore {
53
56
  return statusListIndex.filter((index) => !results.includes(index))
54
57
  }
55
58
 
56
- async addStatusListEntry(args: IAddStatusListEntryArgs): Promise<IStatusListEntryEntity> {
57
- return (await this.getStatusListEntryRepo()).save(args)
59
+ async addStatusListEntry(args: IAddStatusListEntryArgs): Promise<IStatusListEntryEntity | IBitstringStatusListEntryEntity> {
60
+ if (!args.statusListId) {
61
+ throw new Error('statusListId is required')
62
+ }
63
+
64
+ const statusList = await this.getStatusList({ id: args.statusListId })
65
+ return await (await this.getStatusListEntryRepo(statusList.type)).save(args)
58
66
  }
59
67
 
60
- async updateStatusListEntry(args: IAddStatusListEntryArgs): Promise<IStatusListEntryEntity> {
61
- const statusListId = args.statusListId ?? args.statusList?.id
68
+ async updateStatusListEntry(args: IAddStatusListEntryArgs): Promise<IStatusListEntryEntity | IBitstringStatusListEntryEntity> {
69
+ const statusListId = args.statusListId
70
+ if (!statusListId) {
71
+ throw new Error('statusListId is required')
72
+ }
73
+
74
+ const statusList = await this.getStatusList({ id: statusListId })
62
75
  const result = await this.getStatusListEntryByIndex({ ...args, statusListId, errorOnNotFound: false })
63
76
  const updatedEntry: Partial<IStatusListEntryEntity> = {
64
- value: args.value,
65
- correlationId: args.correlationId,
66
- credentialHash: args.credentialHash,
67
- credentialId: args.credentialId,
77
+ ...result,
78
+ ...args,
79
+ statusListId,
68
80
  }
69
81
 
70
82
  const updStatusListId = result?.statusListId ?? statusListId
71
83
  const updateResult = await (
72
- await this.getStatusListEntryRepo()
84
+ await this.getStatusListEntryRepo(statusList.type)
73
85
  ).upsert(
74
86
  { ...(result ?? { statusListId: updStatusListId, statusListIndex: args.statusListIndex }), ...updatedEntry },
75
87
  { conflictPaths: ['statusList', 'statusListIndex'] },
76
88
  )
77
- console.log(updateResult)
89
+ debug(updateResult)
78
90
  return (await this.getStatusListEntryByIndex({
79
91
  ...args,
80
92
  statusListId: updStatusListId,
81
93
  errorOnNotFound: true,
82
- })) as IStatusListEntryEntity
94
+ }))!
83
95
  }
84
96
 
85
97
  async getStatusListEntryByIndex({
@@ -88,7 +100,7 @@ export class StatusListStore implements IStatusListStore {
88
100
  statusListIndex,
89
101
  entryCorrelationId,
90
102
  errorOnNotFound,
91
- }: IGetStatusListEntryByIndexArgs): Promise<StatusListEntryEntity | undefined> {
103
+ }: IGetStatusListEntryByIndexArgs): Promise<StatusListEntryEntity | BitstringStatusListEntryEntity | undefined> {
92
104
  if (!statusListId && !statusListCorrelationId) {
93
105
  throw Error(`Cannot get statusList entry without either a statusList id or statusListCorrelationId`)
94
106
  }
@@ -97,8 +109,12 @@ export class StatusListStore implements IStatusListStore {
97
109
  throw Error(`Cannot get statusList entry without either a statusListIndex or entryCorrelationId`)
98
110
  }
99
111
 
112
+ const statusList = statusListId
113
+ ? await this.getStatusList({ id: statusListId })
114
+ : await this.getStatusList({ correlationId: statusListCorrelationId })
115
+
100
116
  const result = await (
101
- await this.getStatusListEntryRepo()
117
+ await this.getStatusListEntryRepo(statusList.type)
102
118
  ).findOne({
103
119
  where: {
104
120
  ...(statusListId && { statusListId }),
@@ -118,7 +134,9 @@ export class StatusListStore implements IStatusListStore {
118
134
  return result ?? undefined
119
135
  }
120
136
 
121
- async getStatusListEntryByCredentialId(args: IGetStatusListEntryByCredentialIdArgs): Promise<StatusListEntryEntity | undefined> {
137
+ async getStatusListEntryByCredentialId(
138
+ args: IGetStatusListEntryByCredentialIdArgs,
139
+ ): Promise<StatusListEntryEntity | BitstringStatusListEntryEntity | undefined> {
122
140
  const credentialId = args.credentialId
123
141
  if (!credentialId) {
124
142
  throw Error('Can only get a credential by credentialId when a credentialId is supplied')
@@ -132,8 +150,8 @@ export class StatusListStore implements IStatusListStore {
132
150
  ...(args.entryCorrelationId && { correlationId: args.entryCorrelationId }),
133
151
  credentialId,
134
152
  }
135
- console.log(`Entries: ${JSON.stringify(await (await this.getStatusListEntryRepo()).find(), null, 2)}`)
136
- const result = await (await this.getStatusListEntryRepo()).findOne({ where })
153
+ debug(`Entries: ${JSON.stringify(await (await this.getStatusListEntryRepo(statusList.type)).find(), null, 2)}`)
154
+ const result = await (await this.getStatusListEntryRepo(statusList.type)).findOne({ where })
137
155
 
138
156
  if (!result && args.errorOnNotFound) {
139
157
  throw Error(`Could not find status list credential id ${credentialId} for status list id ${statusList.id}`)
@@ -149,8 +167,12 @@ export class StatusListStore implements IStatusListStore {
149
167
  error = true
150
168
  }
151
169
  if (!error) {
170
+ const statusList = await this.getStatusList({
171
+ id: args.statusListId,
172
+ correlationId: args.statusListCorrelationId,
173
+ })
152
174
  const result = await (
153
- await this.getStatusListEntryRepo()
175
+ await this.getStatusListEntryRepo(statusList.type)
154
176
  ).delete({
155
177
  ...(args.statusListId && { statusList: args.statusListId }),
156
178
  ...(args.entryCorrelationId && { correlationId: args.entryCorrelationId }),
@@ -169,10 +191,11 @@ export class StatusListStore implements IStatusListStore {
169
191
  error = true
170
192
  }
171
193
  if (error) {
172
- console.log(`Could not delete statusList ${args.statusListId} entry by index ${args.statusListIndex}`)
194
+ console.error(`Could not delete statusList ${args.statusListId} entry by index ${args.statusListIndex}`)
173
195
  } else {
196
+ const statusList = await this.getStatusList({ id: args.statusListId })
174
197
  const result = await (
175
- await this.getStatusListEntryRepo()
198
+ await this.getStatusListEntryRepo(statusList.type)
176
199
  ).delete({
177
200
  ...(args.statusListId && { statusList: args.statusListId }),
178
201
  ...(args.entryCorrelationId && { correlationId: args.entryCorrelationId }),
@@ -183,12 +206,14 @@ export class StatusListStore implements IStatusListStore {
183
206
  return !error
184
207
  }
185
208
 
186
- async getStatusListEntries(args: IGetStatusListEntriesArgs): Promise<StatusListEntryEntity[]> {
187
- return (await this.getStatusListEntryRepo()).find({ where: { ...args?.filter, statusList: args.statusListId } })
188
- }
189
-
190
- async getStatusList(args: IGetStatusListArgs): Promise<IStatusListEntity> {
191
- return statusListFrom(await this.getStatusListEntity(args))
209
+ async getStatusListEntries(args: IGetStatusListEntriesArgs): Promise<Array<IStatusListEntryEntity | IBitstringStatusListEntryEntity>> {
210
+ const statusList = await this.getStatusList({ id: args.statusListId })
211
+ const results = await (
212
+ await this.getStatusListEntryRepo(statusList.type)
213
+ ).find({
214
+ where: { ...args?.filter, statusList: args.statusListId },
215
+ })
216
+ return results as Array<IStatusListEntryEntity | IBitstringStatusListEntryEntity>
192
217
  }
193
218
 
194
219
  private async getStatusListEntity(args: IGetStatusListArgs): Promise<StatusListEntity> {
@@ -208,7 +233,12 @@ export class StatusListStore implements IStatusListStore {
208
233
  return result
209
234
  }
210
235
 
211
- async getStatusLists(args: IGetStatusListsArgs): Promise<Array<IStatusListEntity>> {
236
+ async getStatusList(args: IGetStatusListArgs): Promise<IStatusListEntity | IBitstringStatusListEntity> {
237
+ const entity = await this.getStatusListEntity(args)
238
+ return statusListFrom(entity) as IStatusListEntity | IBitstringStatusListEntity
239
+ }
240
+
241
+ async getStatusLists(args: IGetStatusListsArgs): Promise<Array<IStatusListEntity | IBitstringStatusListEntity>> {
212
242
  const result = await (
213
243
  await this.getStatusListRepo()
214
244
  ).find({
@@ -219,7 +249,7 @@ export class StatusListStore implements IStatusListStore {
219
249
  return []
220
250
  }
221
251
 
222
- return result.map((entity) => statusListFrom(entity))
252
+ return result.map((entity) => statusListFrom(entity) as IStatusListEntity | IBitstringStatusListEntity)
223
253
  }
224
254
 
225
255
  async addStatusList(args: IAddStatusListArgs): Promise<IStatusListEntity> {
@@ -240,7 +270,7 @@ export class StatusListStore implements IStatusListStore {
240
270
  return statusListFrom(createdResult)
241
271
  }
242
272
 
243
- async updateStatusList(args: IUpdateStatusListIndexArgs): Promise<IStatusListEntity> {
273
+ async updateStatusList(args: IUpdateStatusListIndexArgs): Promise<IStatusListEntity | IBitstringStatusListEntity> {
244
274
  const result = await this.getStatusList(args)
245
275
  debug('Updating status list', result)
246
276
  const entity = statusListEntityFrom(args)
@@ -251,7 +281,7 @@ export class StatusListStore implements IStatusListStore {
251
281
  async removeStatusList(args: IRemoveStatusListArgs): Promise<boolean> {
252
282
  const result = await this.getStatusListEntity(args)
253
283
 
254
- await (await this.getStatusListEntryRepo()).delete({ statusListId: result.id })
284
+ await (await this.getStatusListEntryRepo(result.type)).delete({ statusListId: result.id })
255
285
  const deletedEntity = await (await this.getStatusListRepo()).remove(result)
256
286
 
257
287
  return Boolean(deletedEntity)
@@ -275,7 +305,13 @@ export class StatusListStore implements IStatusListStore {
275
305
  }
276
306
  }
277
307
 
278
- async getStatusListEntryRepo(): Promise<Repository<StatusListEntryEntity>> {
279
- return (await this.getDS()).getRepository(StatusListEntryEntity)
308
+ async getStatusListEntryRepo(type?: StatusListType): Promise<Repository<StatusListEntryEntity | BitstringStatusListEntryEntity>> {
309
+ const dataSource = await this.getDS()
310
+ switch (type) {
311
+ case StatusListType.BitstringStatusList:
312
+ return dataSource.getRepository(BitstringStatusListEntryEntity)
313
+ default:
314
+ return dataSource.getRepository(StatusListEntryEntity)
315
+ }
280
316
  }
281
317
  }
@@ -1,5 +1,21 @@
1
1
  import { FindOptionsWhere } from 'typeorm'
2
- import { IOAuthStatusListEntity, IStatusList2021Entity, IStatusListEntity, IStatusListEntryEntity } from './statusList'
2
+ import {
3
+ BitstringStatusPurpose,
4
+ IBitstringStatusListEntryEntity,
5
+ IOAuthStatusListEntity,
6
+ IStatusList2021Entity,
7
+ IStatusListEntryEntity,
8
+ } from './statusList'
9
+ import {
10
+ CredentialProofFormat,
11
+ IIssuer,
12
+ StatusListCredential,
13
+ StatusListCredentialIdMode,
14
+ StatusListDriverType,
15
+ StatusListIndexingDirection,
16
+ StatusListType,
17
+ StatusPurpose2021,
18
+ } from '@sphereon/ssi-types'
3
19
 
4
20
  export type FindStatusListArgs = FindOptionsWhere<IStatusList2021Entity | IOAuthStatusListEntity>[]
5
21
  export type FindStatusListEntryArgs = FindOptionsWhere<IStatusListEntryEntity>[] | FindOptionsWhere<IStatusListEntryEntity>
@@ -30,7 +46,7 @@ export interface IGetStatusListEntriesArgs {
30
46
  filter?: FindStatusListEntryArgs
31
47
  }
32
48
 
33
- export type IAddStatusListEntryArgs = IStatusListEntryEntity
49
+ export type IAddStatusListEntryArgs = IStatusListEntryEntity | IBitstringStatusListEntryEntity
34
50
 
35
51
  export interface IGetStatusListArgs {
36
52
  id?: string
@@ -43,6 +59,40 @@ export interface IGetStatusListsArgs {
43
59
  filter?: FindStatusListArgs
44
60
  }
45
61
 
46
- export type IAddStatusListArgs = IStatusListEntity
62
+ interface IBaseStatusListArgs {
63
+ id: string
64
+ correlationId: string
65
+ driverType: StatusListDriverType
66
+ credentialIdMode: StatusListCredentialIdMode
67
+ length: number
68
+ issuer: string | IIssuer
69
+ type: StatusListType
70
+ proofFormat: CredentialProofFormat
71
+ statusListCredential?: StatusListCredential
72
+ bitsPerStatus?: number
73
+ }
74
+
75
+ export type IStatusList2021Args = IBaseStatusListArgs & {
76
+ type: StatusListType.StatusList2021
77
+ indexingDirection: StatusListIndexingDirection
78
+ statusPurpose: StatusPurpose2021
79
+ }
80
+
81
+ export type IOAuthStatusListArgs = IBaseStatusListArgs & {
82
+ type: StatusListType.OAuthStatusList
83
+ bitsPerStatus: number
84
+ expiresAt?: Date
85
+ }
86
+
87
+ export type IBitstringStatusListArgs = IBaseStatusListArgs & {
88
+ type: StatusListType.BitstringStatusList
89
+ statusPurpose: BitstringStatusPurpose | BitstringStatusPurpose[]
90
+ bitsPerStatus?: number
91
+ validFrom?: Date
92
+ validUntil?: Date
93
+ ttl?: number
94
+ }
95
+
96
+ export type IAddStatusListArgs = IStatusList2021Args | IOAuthStatusListArgs | IBitstringStatusListArgs
47
97
 
48
- export type IUpdateStatusListIndexArgs = IStatusListEntity
98
+ export type IUpdateStatusListIndexArgs = IAddStatusListArgs
@@ -1,6 +1,6 @@
1
1
  import {
2
- BitstringStatusPurpose,
3
2
  type CredentialProofFormat,
3
+ type ICredentialStatus,
4
4
  IIssuer,
5
5
  RequireOneOf,
6
6
  StatusListCredential,
@@ -12,12 +12,6 @@ import {
12
12
  } from '@sphereon/ssi-types'
13
13
  import { StatusListEntity } from '../../entities/statusList/StatusListEntities'
14
14
 
15
- export type BitstringStatus = {
16
- status: string
17
- message?: string
18
- [x: string]: any
19
- }
20
-
21
15
  export interface IStatusListEntity {
22
16
  id: string
23
17
  correlationId: string
@@ -28,6 +22,7 @@ export interface IStatusListEntity {
28
22
  type: StatusListType
29
23
  proofFormat: CredentialProofFormat
30
24
  statusListCredential?: StatusListCredential
25
+ bitsPerStatus?: number
31
26
  }
32
27
 
33
28
  export interface IStatusList2021Entity extends IStatusListEntity {
@@ -41,8 +36,8 @@ export interface IOAuthStatusListEntity extends IStatusListEntity {
41
36
  }
42
37
 
43
38
  export interface IBitstringStatusListEntity extends IStatusListEntity {
44
- statusPurpose: BitstringStatusPurpose | BitstringStatusPurpose[]
45
- statusSize?: number
39
+ statusPurpose: BitstringStatusPurpose | Array<BitstringStatusPurpose>
40
+ bitsPerStatus?: number
46
41
  validFrom?: Date
47
42
  validUntil?: Date
48
43
  ttl?: number
@@ -60,3 +55,41 @@ export type IStatusListEntryEntity = RequireOneOf<
60
55
  },
61
56
  'statusList' | 'statusListId'
62
57
  >
58
+
59
+ export type BitstringStatusPurpose = 'revocation' | 'suspension' | 'refresh' | 'message' | string // From vc-bitstring-status-lists without pulling in the whole dep for just this one type
60
+
61
+ export type BitstringStatusMessage = {
62
+ status: string
63
+ message?: string
64
+ [x: string]: any
65
+ }
66
+
67
+ export interface BitstringStatusListEntryCredentialStatus extends ICredentialStatus {
68
+ type: 'BitstringStatusListEntry'
69
+ statusPurpose: BitstringStatusPurpose | Array<BitstringStatusPurpose>
70
+ statusListIndex: string
71
+ statusListCredential: string
72
+ bitsPerStatus?: number
73
+ statusMessage?: Array<BitstringStatusMessage>
74
+ statusReference?: string | Array<string>
75
+ }
76
+
77
+ export type BitstringStatusListArgs = {
78
+ statusPurpose: BitstringStatusPurpose
79
+ bitsPerStatus: number
80
+ ttl?: number
81
+ validFrom?: Date
82
+ validUntil?: Date
83
+ }
84
+
85
+ export interface IBitstringStatusListEntryEntity {
86
+ statusListId: string
87
+ statusListIndex: number
88
+ credentialId?: string
89
+ credentialHash?: string
90
+ entryCorrelationId?: string
91
+ statusPurpose: string
92
+ bitsPerStatus?: number
93
+ statusMessage?: Array<BitstringStatusMessage>
94
+ statusReference?: string | Array<string>
95
+ }
@@ -9,55 +9,62 @@ import { StatusListType } from '@sphereon/ssi-types'
9
9
  import { replaceNullWithUndefined } from '../FormattingUtils'
10
10
 
11
11
  export const statusListEntityFrom = (args: IStatusListEntity): StatusListEntity => {
12
- if (args.type === StatusListType.StatusList2021) {
13
- const entity = new StatusList2021Entity()
14
- const sl2021 = args as IStatusList2021Entity
15
- entity.indexingDirection = sl2021.indexingDirection
16
- entity.statusPurpose = sl2021.statusPurpose
17
- setBaseFields(entity, args)
18
- Object.defineProperty(entity, 'type', {
19
- value: StatusListType.StatusList2021,
20
- enumerable: true,
21
- configurable: true,
22
- })
23
- return entity
24
- }
12
+ switch (args.type) {
13
+ case StatusListType.StatusList2021: {
14
+ const entity = new StatusList2021Entity()
15
+ const sl2021 = args as IStatusList2021Entity
16
+ entity.indexingDirection = sl2021.indexingDirection
17
+ entity.statusPurpose = sl2021.statusPurpose
18
+ setBaseFields(entity, args)
19
+ Object.defineProperty(entity, 'type', {
20
+ value: StatusListType.StatusList2021,
21
+ enumerable: true,
22
+ configurable: true,
23
+ })
24
+ return entity
25
+ }
25
26
 
26
- if (args.type === StatusListType.OAuthStatusList) {
27
- const entity = new OAuthStatusListEntity()
28
- const oauthSl = args as IOAuthStatusListEntity
29
- entity.bitsPerStatus = oauthSl.bitsPerStatus
30
- entity.expiresAt = oauthSl.expiresAt
31
- setBaseFields(entity, args)
32
- Object.defineProperty(entity, 'type', {
33
- value: StatusListType.OAuthStatusList,
34
- enumerable: true,
35
- configurable: true,
36
- })
37
- return entity
38
- }
27
+ case StatusListType.OAuthStatusList: {
28
+ const entity = new OAuthStatusListEntity()
29
+ const oauthSl = args as IOAuthStatusListEntity
30
+ entity.bitsPerStatus = oauthSl.bitsPerStatus
31
+ entity.expiresAt = oauthSl.expiresAt
32
+ setBaseFields(entity, args)
33
+ Object.defineProperty(entity, 'type', {
34
+ value: StatusListType.OAuthStatusList,
35
+ enumerable: true,
36
+ configurable: true,
37
+ })
38
+ return entity
39
+ }
39
40
 
40
- if (args.type === StatusListType.BitstringStatusList) {
41
- const entity = new BitstringStatusListEntity()
42
- const bitstringsl = args as IBitstringStatusListEntity
43
- entity.statusPurpose = bitstringsl.statusPurpose
44
- entity.statusSize = bitstringsl.statusSize
45
- entity.validFrom = bitstringsl.validFrom
46
- entity.validUntil = bitstringsl.validUntil
47
- entity.ttl = bitstringsl.ttl
48
- setBaseFields(entity, args)
49
- Object.defineProperty(entity, 'type', {
50
- value: StatusListType.BitstringStatusList,
51
- enumerable: true,
52
- configurable: true,
53
- })
54
- return entity
55
- }
41
+ case StatusListType.BitstringStatusList: {
42
+ const entity = new BitstringStatusListEntity()
43
+ const bitstringsl = args as IBitstringStatusListEntity
44
+ if (!bitstringsl.bitsPerStatus) {
45
+ throw Error('bitsPerStatus must be set for BitstringStatusList')
46
+ }
56
47
 
57
- throw new Error(`Invalid status list type ${args.type}`)
48
+ entity.statusPurpose = bitstringsl.statusPurpose
49
+ entity.bitsPerStatus = bitstringsl.bitsPerStatus
50
+ entity.validFrom = bitstringsl.validFrom
51
+ entity.validUntil = bitstringsl.validUntil
52
+ entity.ttl = bitstringsl.ttl
53
+ setBaseFields(entity, args)
54
+ Object.defineProperty(entity, 'type', {
55
+ value: StatusListType.BitstringStatusList,
56
+ enumerable: true,
57
+ configurable: true,
58
+ })
59
+ return entity
60
+ }
61
+
62
+ default:
63
+ throw new Error(`Invalid status list type ${args.type}`)
64
+ }
58
65
  }
59
66
 
60
- export const statusListFrom = (entity: StatusListEntity): IStatusListEntity => {
67
+ export const statusListFrom = (entity: StatusListEntity): IStatusListEntity | IBitstringStatusListEntity => {
61
68
  if (entity instanceof StatusList2021Entity) {
62
69
  const result: IStatusList2021Entity = {
63
70
  ...getBaseFields(entity),
@@ -83,7 +90,7 @@ export const statusListFrom = (entity: StatusListEntity): IStatusListEntity => {
83
90
  ...getBaseFields(entity),
84
91
  type: StatusListType.BitstringStatusList,
85
92
  statusPurpose: entity.statusPurpose,
86
- statusSize: entity.statusSize,
93
+ bitsPerStatus: entity.bitsPerStatus,
87
94
  validFrom: entity.validFrom,
88
95
  validUntil: entity.validUntil,
89
96
  ttl: entity.ttl,