Skip to content

Commit

Permalink
Merge pull request #784 from walt-id/wal-68-update-presentation-defin…
Browse files Browse the repository at this point in the history
…ition-policy

WAL 68 update presentation definition policy
  • Loading branch information
philpotisk authored Oct 3, 2024
2 parents b10bee5 + c3c747f commit a1beb62
Show file tree
Hide file tree
Showing 26 changed files with 489 additions and 371 deletions.
19 changes: 11 additions & 8 deletions docker-compose/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,14 +99,6 @@ This value will be used by reverse proxy (and services configs, if any).

## Troubleshooting

---

#### Display of VC verification result on success page of portal doesn't work

We are working on fixing this issue.

---

#### Updating ports doesn't work

Make sure the ports are also updated in:
Expand All @@ -121,3 +113,14 @@ Make sure the ports are also updated in:
- wallet-api/config
- web.conf
- db.conf


#### Removing the DB volume
```
docker volume rm docker-compose_wallet-api-db
```
#### DB Backup / Restore
```
pg_dump -U your_user_name -h your_host -d your_db_name > backup.sql
psql -U your_user_name -h your_host -d your_db_name < backup.sql
```
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,14 @@ kotlin {
implementation("io.github.optimumcode:json-schema-validator:0.2.3")

implementation(project(":waltid-libraries:credentials:waltid-verifiable-credentials"))

// Loggin
implementation("io.github.oshai:kotlin-logging:7.0.0")
}
}
val commonTest by getting {
dependencies {
implementation(kotlin("test"))
//implementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:1.9.0")
}
}
val jvmTest by getting {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable
import kotlinx.serialization.json.JsonElement
import kotlinx.serialization.json.JsonObject
import kotlinx.serialization.json.contentOrNull
import kotlinx.serialization.json.jsonPrimitive

@Serializable
data class PresentationDefinition(
Expand Down Expand Up @@ -64,7 +66,7 @@ data class PresentationDefinition(
val name: String? = null,
@SerialName("intent_to_retain")
val intentToRetain: Boolean? = null,
val filter: JsonElement? = null,
val filter: JsonObject? = null,
val predicate: String? = null
)

Expand All @@ -86,4 +88,14 @@ data class PresentationDefinition(
}
}
}

fun primitiveVerificationGetTypeList(): List<String> {
val fields = inputDescriptors.mapNotNull { it.constraints.fields }.flatten()
// filter for field paths "$.type" (W3C) or "$.vct" (sd-jwt-vc)
.filter { field -> field.path.any { "type" in it || "vct" in it } && field.filter?.get("type")?.jsonPrimitive?.contentOrNull == "string" }

val types = fields.mapNotNull { it.filter?.get("pattern")?.jsonPrimitive?.contentOrNull }

return types
}
}
Loading

0 comments on commit a1beb62

Please sign in to comment.