Skip to content
Snippets Groups Projects
Commit 2e066893 authored by Yordan Kinkov's avatar Yordan Kinkov
Browse files

example policies for OCM integration

parent 255465d3
No related branches found
No related tags found
1 merge request!11Example policies for OCM integration
package example.CredentialIssueRequest
_ = {
"connectionId": "conn-id",
"credentialDefinitionId": "cred-def-id",
"comment": "Created",
"preview": {
"@type": "https://didcomm.org/issue-credential/1.0/credential-preview",
"attributes": [
{
"name": "email",
"value": "test_fname_3"
},
{
"name": "name",
"value": "test_lname_3"
},
{
"name": "number",
"value": "test_gender_3"
}
]
},
"autoAcceptCredential": "never"
}
\ No newline at end of file
package example.GetTrustedConnectionState
_ = {
"comment": "Tested participant",
"attributes": [
{
"attribute_name": "email",
"value": "",
"condition": ""
},
{
"attribute_name": "name",
"value": "",
"condition": ""
}
],
"schemaId": "schema-id",
"credential_def_id": "",
"connectionId": "conn-id"
}
\ No newline at end of file
package example.PresentationFreshnessState
_ = [
{
"presentationId": "07f27a99-4ff2-4d3c-82f9-0f49cd6d8203",
"ProofStateValid": "true"
},
{
"presentationId": "07f27a99-4ff2-4d3c-82f9-0f49cd6d8200",
"ProofStateValid": "false"
}
]
\ No newline at end of file
package example.PrincipalCredentialRequest
default allow = true
\ No newline at end of file
package example.ProofRequestResponse
default allow = true
\ No newline at end of file
package example.TrustedConnectionCredentials
default allow = true
\ No newline at end of file
package example.cacheGet
result := cache.get("mykey", "mynamespace", "myscope")
package example.cacheSet
default success = false
success = true {
msg := cache.set("mykey", "mynamespace", "myscope", input)
msg == "success"
}
package example.examplePolicy
default allow = false
allow {
input.method == "GET"
input.path == ["salary", input.subject.user]
}
allow {
is_admin
}
is_admin {
input.subject.groups[_] == "admin"
}
\ No newline at end of file
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