Skip to content

Commit

Permalink
Artwork for various falvors of IDs + renamed Funke issuer.
Browse files Browse the repository at this point in the history
Signed-off-by: Peter Sorotokin <[email protected]>
  • Loading branch information
sorotokin committed Aug 21, 2024
1 parent 377b753 commit b5f5866
Show file tree
Hide file tree
Showing 12 changed files with 63 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,20 +71,20 @@ class FunkeIssuingAuthorityState(
CredentialFormat.MDOC_MSO -> "funkeMdocMso"
}
val issuingAuthorityName = when (credentialFormat) {
CredentialFormat.SD_JWT_VC -> "Funke PID Issuer (SD-JWT)"
CredentialFormat.MDOC_MSO -> "Funke PID Issuer (MDOC)"
CredentialFormat.SD_JWT_VC -> "Funke - SD-JWT"
CredentialFormat.MDOC_MSO -> "Funke - mDoc"
}
return env.cache(IssuingAuthorityConfiguration::class, id) { configuration, resources ->
val logoPath = "funke/logo.png"
val logo = resources.getRawResource(logoPath)!!
val artPath = "funke/card_art.png"
val artPath = "funke/card_art_funke_generic.png"
val art = resources.getRawResource(artPath)!!
val requireUserAuthenticationToViewDocument = false
IssuingAuthorityConfiguration(
identifier = id,
issuingAuthorityName = issuingAuthorityName,
issuingAuthorityLogo = logo.toByteArray(),
issuingAuthorityDescription = "Funke",
issuingAuthorityDescription = "Personal ID",
pendingDocumentInformation = DocumentConfiguration(
displayName = "Pending",
typeDisplayName = "EU Personal ID",
Expand Down Expand Up @@ -209,7 +209,8 @@ class FunkeIssuingAuthorityState(
check(issuerDocument.state == DocumentCondition.CONFIGURATION_AVAILABLE)
issuerDocument.state = DocumentCondition.READY
if (issuerDocument.documentConfiguration == null) {
issuerDocument.documentConfiguration = generateDocumentConfiguration(env)
val isCloudSecureArea = issuerDocument.secureAreaIdentifier!!.startsWith("CloudSecureArea?")
issuerDocument.documentConfiguration = generateDocumentConfiguration(env, isCloudSecureArea)
}
updateIssuerDocument(env, documentId, issuerDocument)
return issuerDocument.documentConfiguration!!
Expand Down Expand Up @@ -454,13 +455,18 @@ class FunkeIssuingAuthorityState(
}

private suspend fun generateDocumentConfiguration(
env: FlowEnvironment
env: FlowEnvironment,
isCloudSecureArea: Boolean
): DocumentConfiguration {
val artPath = "funke/card_art.png"
val art = env.getInterface(Resources::class)!!.getRawResource(artPath)!!

val resources = env.getInterface(Resources::class)!!
return when (credentialFormat) {
CredentialFormat.SD_JWT_VC ->
CredentialFormat.SD_JWT_VC -> {
val art = resources.getRawResource(
if (isCloudSecureArea) {
"funke/card_art_funke_sdjwt_c1.png"
} else {
"funke/card_art_funke_sdjwt_c.png"
})!!
DocumentConfiguration(
"Funke",
"Personal ID (SD-JWT)",
Expand All @@ -469,19 +475,28 @@ class FunkeIssuingAuthorityState(
null,
SdJwtVcDocumentConfiguration(FunkeUtil.SD_JWT_VCT)
)
CredentialFormat.MDOC_MSO -> DocumentConfiguration(
"Funke",
"Personal ID (MDOC)",
art.toByteArray(),
false,
MdocDocumentConfiguration(
EUPersonalID.EUPID_DOCTYPE,
staticData = fillInSampleData(
documentTypeRepository.getDocumentTypeForMdoc(EUPersonalID.EUPID_DOCTYPE)!!
).build()
),
null
)
}
CredentialFormat.MDOC_MSO -> {
val art = resources.getRawResource(
if (isCloudSecureArea) {
"funke/card_art_funke_mdoc_c1.png"
} else {
"funke/card_art_funke_mdoc_c.png"
})!!
DocumentConfiguration(
"Funke",
"Personal ID (MDOC)",
art.toByteArray(),
false,
MdocDocumentConfiguration(
EUPersonalID.EUPID_DOCTYPE,
staticData = fillInSampleData(
documentTypeRepository.getDocumentTypeForMdoc(EUPersonalID.EUPID_DOCTYPE)!!
).build()
),
null
)
}
}
}

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,6 @@ class LocalDevelopmentEnvironment(
R.drawable.utopia_pid_card_art,
Bitmap.CompressFormat.PNG
)
"funke/card_art.png" ->
bitmapData(
R.drawable.funke_card_art,
Bitmap.CompressFormat.PNG
)
"utopia_local/logo.png" ->
bitmapData(
R.drawable.utopia_dmv_issuing_authority_logo,
Expand All @@ -119,6 +114,31 @@ class LocalDevelopmentEnvironment(
R.drawable.utopia_pid_issuing_authority_logo,
Bitmap.CompressFormat.PNG
)
"funke/card_art_funke_generic.png" ->
bitmapData(
R.drawable.card_art_funke_generic,
Bitmap.CompressFormat.PNG
)
"funke/card_art_funke_mdoc_c.png" ->
bitmapData(
R.drawable.card_art_funke_mdoc_c,
Bitmap.CompressFormat.PNG
)
"funke/card_art_funke_mdoc_c1.png" ->
bitmapData(
R.drawable.card_art_funke_mdoc_c1,
Bitmap.CompressFormat.PNG
)
"funke/card_art_funke_sdjwt_c.png" ->
bitmapData(
R.drawable.card_art_funke_sdjwt_c,
Bitmap.CompressFormat.PNG
)
"funke/card_art_funke_sdjwt_c1.png" ->
bitmapData(
R.drawable.card_art_funke_sdjwt_c1,
Bitmap.CompressFormat.PNG
)
"funke/logo.png" -> bitmapData(
R.drawable.funke_logo,
Bitmap.CompressFormat.PNG
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit b5f5866

Please sign in to comment.