diff --git a/example/TrustedConnectionCredentials/1.0/policy.rego b/example/TrustedConnectionCredentials/1.0/policy.rego index ce41342cdbcfc93e1bf42ba5a4c9bedef31f833e..bf3b7368c34b3847073ca5163ba6f232157462c3 100644 --- a/example/TrustedConnectionCredentials/1.0/policy.rego +++ b/example/TrustedConnectionCredentials/1.0/policy.rego @@ -1,3 +1,3 @@ package example.TrustedConnectionCredentials -default allow = true \ No newline at end of file +default allow = true diff --git a/example/createProof/1.0/policy.rego b/example/createProof/1.0/policy.rego deleted file mode 100644 index 31ba7d16417a11aef21c04cd74504727172b4136..0000000000000000000000000000000000000000 --- a/example/createProof/1.0/policy.rego +++ /dev/null @@ -1,3 +0,0 @@ -package example.createProof - -_ := proof.create(input) diff --git a/example/createProofVC/1.0/policy.rego b/example/createProofVC/1.0/policy.rego new file mode 100644 index 0000000000000000000000000000000000000000..18e71a6a1a64f0627541923250abd1c5de656916 --- /dev/null +++ b/example/createProofVC/1.0/policy.rego @@ -0,0 +1,3 @@ +package example.createProofVC + +_ := add_vc_proof("transit", "key1", input) diff --git a/example/createProofVP/1.0/policy.rego b/example/createProofVP/1.0/policy.rego new file mode 100644 index 0000000000000000000000000000000000000000..860aa576622073658be2948aa85d6d64f716cf76 --- /dev/null +++ b/example/createProofVP/1.0/policy.rego @@ -0,0 +1,3 @@ +package example.createProofVP + +_ := add_vp_proof("did:web:example.com", "transit", "key1", input) diff --git a/example/hackaton/1.0/policy.rego b/example/hackaton/1.0/policy.rego index f78145714a5d32b78bee1e062c8915f64bfc952a..4ec799dc409707b46e791713c5c949964261b603 100644 --- a/example/hackaton/1.0/policy.rego +++ b/example/hackaton/1.0/policy.rego @@ -7,22 +7,22 @@ default expired = false default valid = false trusted { - m := input.issuer - m in data.trustlist + m := input.issuer + m in data.trustlist } expired { - exp:= time.parse_ns("2006-01-02T15:04:05Z07:00",input.expirationDate) - now:=time.now_ns() - now>exp + exp:= time.parse_ns("2006-01-02T15:04:05Z07:00",input.expirationDate) + now:=time.now_ns() + now>exp } valid = semanticallyValid(input) semanticallyValid(i) = res { - now:=time.now_ns() - vac:= data.vaccines[i.credentialSubject.vaccine.vacCode].active == true - vacDate:=time.parse_ns("2006-01-02T15:04:05Z07:00",i.credentialSubject.dateOfVaccination) - vacStillValid:=now < (vacDate+15552000000000000) - res := vac == vacStillValid + now:=time.now_ns() + vac:= data.vaccines[i.credentialSubject.vaccine.vacCode].active == true + vacDate:=time.parse_ns("2006-01-02T15:04:05Z07:00",i.credentialSubject.dateOfVaccination) + vacStillValid:=now < (vacDate+15552000000000000) + res := vac == vacStillValid } diff --git a/example/publicKeysForDIDs/1.0/data.json b/example/publicKeysForDIDs/1.0/data.json index c8cca05dfa1d16229b4abc9307675db502f3f536..f57a60e64768ddd301ebf1ace52d2f76d0c6576b 100644 --- a/example/publicKeysForDIDs/1.0/data.json +++ b/example/publicKeysForDIDs/1.0/data.json @@ -3,4 +3,4 @@ "did:key:z6MkpxjNepTaD1xo49dEbbW36FguWgsiToxNdhR8YJMnFQoJ", "did:key:z6Mkfriq1MqLBoPWecGoDLjguo1sB9brj6wT3qZ5BxkKpuP6" ] -} \ No newline at end of file +} diff --git a/example/publicKeysForDIDs/1.0/policy.rego b/example/publicKeysForDIDs/1.0/policy.rego index 30ba5de761f067b6fb6b7929ab206825a0e71f08..310f529ce63558807930a3ce403f157ce5fa6af8 100644 --- a/example/publicKeysForDIDs/1.0/policy.rego +++ b/example/publicKeysForDIDs/1.0/policy.rego @@ -6,4 +6,4 @@ getKeys(i) = res { doc1 = did.resolve(data.dids[0]) doc2 = did.resolve(data.dids[1]) res := array.concat([doc1.didDocument.verificationMethod[0].publicKeyMultibase], [doc2.didDocument.verificationMethod[0].publicKeyMultibase]) -} \ No newline at end of file +} diff --git a/example/returnDID/1.0/policy.rego b/example/returnDID/1.0/policy.rego index 3fc575d1ba9a37d44ef625b821e27dd4fd930ce2..2bb67fa4ef85d01428d8fb7566b9030d98bb3877 100644 --- a/example/returnDID/1.0/policy.rego +++ b/example/returnDID/1.0/policy.rego @@ -1,7 +1,7 @@ package example.returnDID -_ := { - "@context": ["https://www.w3.org/ns/did/v1", "https://w3id.org/security/suites/ed25519-2020/v1"], - "id": issuer().did, - "verificationMethod": keys.getAll() +_ = { + "@context": ["https://www.w3.org/ns/did/v1", "https://w3id.org/security/suites/jws-2020/v1"], + "id": "did:web:gaiax.vereign.com:tsa:policy:policy:example:returnDID:1.0:evaluation", + "verificationMethod": verification_methods("did:web:gaiax.vereign.com:tsa:policy:policy:example:returnDID:1.0:evaluation", "transit") } \ No newline at end of file diff --git a/example/selfDescription/1.0/policy.rego b/example/selfDescription/1.0/policy.rego index 760e80e372d07426140519bb0b22e00cc667aa41..031208d77e06ce7773e8a0733256d536830d515d 100644 --- a/example/selfDescription/1.0/policy.rego +++ b/example/selfDescription/1.0/policy.rego @@ -1,3 +1,3 @@ package example.selfDescription -_ := cache.get(input.key, input.scope, input.namespace) \ No newline at end of file +_ := cache.get(input.key, input.scope, input.namespace) diff --git a/example/validateVacVC/1.0/data.json b/example/validateVacVC/1.0/data.json index 41aa0072aace0bf870c24451b359a1a1897d1e6d..93e24b1c1a61195ca3ec4a9b831f342db647bc5d 100644 --- a/example/validateVacVC/1.0/data.json +++ b/example/validateVacVC/1.0/data.json @@ -15,6 +15,5 @@ "medicinalProductName": "Pfizer–BioNTech COVID-19 vaccine", "marketingAuthorizationHolder": "Pfizer–BioNTech" } - } } diff --git a/example/validateVacVC/1.0/policy.rego b/example/validateVacVC/1.0/policy.rego index 161cb45b0f1a5034c187f6ea16c9b0716dbfd3f6..06fcbefa43ae90bb190e8e54a4f5f96d9d887382 100644 --- a/example/validateVacVC/1.0/policy.rego +++ b/example/validateVacVC/1.0/policy.rego @@ -7,22 +7,22 @@ default expired = false default valid = false trusted { - m := input.issuer - m in data.trustlist + m := input.issuer + m in data.trustlist } expired { - exp:= time.parse_ns("2006-01-02T15:04:05Z07:00",input.expirationDate) - now:=time.now_ns() - now>exp + exp:= time.parse_ns("2006-01-02T15:04:05Z07:00",input.expirationDate) + now:=time.now_ns() + now>exp } valid = semanticallyValid(input) semanticallyValid(i) = res { - now:=time.now_ns() - vac:= data.vaccines[i.credentialSubject.vaccine.vacCode].active == true - vacDate:=time.parse_ns("2006-01-02T15:04:05Z07:00",i.credentialSubject.dateOfVaccination) - vacStillValid:=now < (vacDate+15552000000000000) - res := vac == vacStillValid + now:=time.now_ns() + vac:= data.vaccines[i.credentialSubject.vaccine.vacCode].active == true + vacDate:=time.parse_ns("2006-01-02T15:04:05Z07:00",i.credentialSubject.dateOfVaccination) + vacStillValid:=now < (vacDate+15552000000000000) + res := vac == vacStillValid }