Skip to content
Snippets Groups Projects
Commit 835adb09 authored by Lyuben Penkovski's avatar Lyuben Penkovski
Browse files

Merge branch '1-update-example-policies' into 'main'

Update example policies because of changes for VC/VP proof functions

Closes #1

See merge request gaia-x/data-infrastructure-federation-services/tsa/policies!5
parents 0bbdb345 f898dcf1
No related branches found
No related tags found
No related merge requests found
Pipeline #55593 passed with stage
in 45 seconds
package example.TrustedConnectionCredentials
default allow = true
\ No newline at end of file
default allow = true
package example.createProof
_ := proof.create(input)
package example.createProofVC
_ := add_vc_proof("transit", "key1", input)
package example.createProofVP
_ := add_vp_proof("did:web:example.com", "transit", "key1", input)
......@@ -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
}
......@@ -3,4 +3,4 @@
"did:key:z6MkpxjNepTaD1xo49dEbbW36FguWgsiToxNdhR8YJMnFQoJ",
"did:key:z6Mkfriq1MqLBoPWecGoDLjguo1sB9brj6wT3qZ5BxkKpuP6"
]
}
\ No newline at end of file
}
......@@ -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
}
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
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)
......@@ -15,6 +15,5 @@
"medicinalProductName": "Pfizer–BioNTech COVID-19 vaccine",
"marketingAuthorizationHolder": "Pfizer–BioNTech"
}
}
}
......@@ -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
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment