Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
policies
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Gaia-X
Trust Services API
policies
Commits
b3a2c000
Commit
b3a2c000
authored
2 years ago
by
Yordan Kinkov
Browse files
Options
Downloads
Patches
Plain Diff
Update hackaton policy
parent
53d5ff27
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#53786
passed with stage
Stage:
in 31 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
example/hackaton/1.0/data.json
+18
-5
18 additions, 5 deletions
example/hackaton/1.0/data.json
example/hackaton/1.0/policy.rego
+23
-5
23 additions, 5 deletions
example/hackaton/1.0/policy.rego
with
41 additions
and
10 deletions
example/hackaton/1.0/data.json
+
18
−
5
View file @
b3a2c000
{
"admins"
:
[
"John"
,
"Jane"
]
}
\ No newline at end of file
"trustlist"
:
[
"did:key:z6MkpxjNepTaD1xo49dEbbW36FguWgsiToxNdhR8YJMnFQoJ"
,
"did:key:z6Mkfriq1MqLBoPWecGoDLjguo1sB9brj6wT3qZ5BxkKpuP6"
,
"did:key:z6Mkk7yqnGF3YwTrLpqrW6PGsKci7dNqh1CjnvMbzrMerSeL"
],
"vaccines"
:
{
"EU/1/20/1528"
:
{
"active"
:
true
,
"medicinalProductName"
:
"COVID-19 Vaccine Moderna"
,
"marketingAuthorizationHolder"
:
"Moderna Biotech"
},
"EU/2/18/1678"
:
{
"active"
:
true
,
"medicinalProductName"
:
"Pfizer–BioNTech COVID-19 vaccine"
,
"marketingAuthorizationHolder"
:
"Pfizer–BioNTech"
}
}
}
This diff is collapsed.
Click to expand it.
example/hackaton/1.0/policy.rego
+
23
−
5
View file @
b3a2c000
...
...
@@ -2,9 +2,27 @@ package example.hackaton
import
future
.
keywords
.
in
default
result
=
false
default
trusted
=
false
default
expired
=
false
default
valid
=
false
result
{
user
:=
input
.
user
user
in
data
.
admins
}
\ No newline at end of file
trusted
{
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
}
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
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment