Return sector 3 payload blocks in card prepare
All checks were successful
build-and-deploy / build-deploy (push) Successful in 33s
All checks were successful
build-and-deploy / build-deploy (push) Successful in 33s
This commit is contained in:
@@ -74,9 +74,9 @@ class IssuedCards(
|
|||||||
timeData = payload.timeData,
|
timeData = payload.timeData,
|
||||||
issuedAt = issuedAt.toString(),
|
issuedAt = issuedAt.toString(),
|
||||||
expiresAt = expiresAt.toString(),
|
expiresAt = expiresAt.toString(),
|
||||||
issuerUserId = actor.id,
|
sector3Block0 = encodeBlock(actor.name),
|
||||||
issuerFirebaseUid = actor.firebaseUid,
|
sector3Block1 = encodeBlock(actor.id?.toString()),
|
||||||
issuerName = actor.name
|
sector3Block2 = encodeBlock(null)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -183,6 +183,16 @@ class IssuedCards(
|
|||||||
return OffsetDateTime.now(zone)
|
return OffsetDateTime.now(zone)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun encodeBlock(value: String?): String {
|
||||||
|
val raw = (value ?: "").padEnd(16).take(16)
|
||||||
|
val bytes = raw.toByteArray(Charsets.UTF_8)
|
||||||
|
val sb = StringBuilder(bytes.size * 2)
|
||||||
|
for (b in bytes) {
|
||||||
|
sb.append(String.format("%02X", b))
|
||||||
|
}
|
||||||
|
return sb.toString()
|
||||||
|
}
|
||||||
|
|
||||||
private fun requireMember(propertyId: UUID, principal: MyPrincipal?) {
|
private fun requireMember(propertyId: UUID, principal: MyPrincipal?) {
|
||||||
if (principal == null) {
|
if (principal == null) {
|
||||||
throw ResponseStatusException(HttpStatus.UNAUTHORIZED, "Missing principal")
|
throw ResponseStatusException(HttpStatus.UNAUTHORIZED, "Missing principal")
|
||||||
|
|||||||
@@ -60,9 +60,9 @@ class TemporaryRoomCards(
|
|||||||
timeData = payload.timeData,
|
timeData = payload.timeData,
|
||||||
issuedAt = issuedAt.toString(),
|
issuedAt = issuedAt.toString(),
|
||||||
expiresAt = expiresAt.toString(),
|
expiresAt = expiresAt.toString(),
|
||||||
issuerUserId = actor.id,
|
sector3Block0 = encodeBlock(actor.name),
|
||||||
issuerFirebaseUid = actor.firebaseUid,
|
sector3Block1 = encodeBlock(actor.id?.toString()),
|
||||||
issuerName = actor.name
|
sector3Block2 = encodeBlock(null)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -114,6 +114,16 @@ class TemporaryRoomCards(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun encodeBlock(value: String?): String {
|
||||||
|
val raw = (value ?: "").padEnd(16).take(16)
|
||||||
|
val bytes = raw.toByteArray(Charsets.UTF_8)
|
||||||
|
val sb = StringBuilder(bytes.size * 2)
|
||||||
|
for (b in bytes) {
|
||||||
|
sb.append(String.format("%02X", b))
|
||||||
|
}
|
||||||
|
return sb.toString()
|
||||||
|
}
|
||||||
|
|
||||||
private fun nowForProperty(timezone: String?): OffsetDateTime {
|
private fun nowForProperty(timezone: String?): OffsetDateTime {
|
||||||
val zone = try {
|
val zone = try {
|
||||||
if (timezone.isNullOrBlank()) ZoneId.of("Asia/Kolkata") else ZoneId.of(timezone)
|
if (timezone.isNullOrBlank()) ZoneId.of("Asia/Kolkata") else ZoneId.of(timezone)
|
||||||
|
|||||||
@@ -82,7 +82,7 @@ data class CardPrepareResponse(
|
|||||||
val timeData: String,
|
val timeData: String,
|
||||||
val issuedAt: String,
|
val issuedAt: String,
|
||||||
val expiresAt: String,
|
val expiresAt: String,
|
||||||
val issuerUserId: UUID? = null,
|
val sector3Block0: String? = null,
|
||||||
val issuerFirebaseUid: String? = null,
|
val sector3Block1: String? = null,
|
||||||
val issuerName: String? = null
|
val sector3Block2: String? = null
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user