Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
policy
Manage
Activity
Members
Labels
Plan
Issues
4
Issue boards
Milestones
Wiki
Code
Merge requests
2
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
policy
Merge requests
!38
Rego extension function documentation
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Rego extension function documentation
44-regofuncs-documentation
into
main
Overview
1
Commits
2
Pipelines
4
Changes
2
Merged
Lyuben Penkovski
requested to merge
44-regofuncs-documentation
into
main
2 years ago
Overview
1
Commits
2
Pipelines
4
Changes
1
Expand
Closes
#44 (closed)
0
0
Merge request reports
Viewing commit
1d14d8d9
Prev
Next
Show latest version
1 file
+
68
−
0
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
1d14d8d9
Passwordless login extension functions documentation
· 1d14d8d9
Yordan Kinkov
authored
2 years ago
doc/policy_development.md
+
68
−
0
Options
@@ -310,3 +310,71 @@ Result:
"valid"
:
true
}
```
#### ocm.getLoginProofInvitation
Get a Proof Invitation URL from OCM's "out-of-band" endpoint.
This function accepts two arguments. The first argument is an array of scopes used to identify
credential types in OCM. The second argument is a map between scopes and credential types
which is statically defined in a
`data.json`
file.
Example request body:
```
json
{
"scope"
:
[
"openid"
,
"email"
]
}
```
Example
`data.json`
file containing "scope-to-credential-type" map:
```
json
{
"scopes"
:
{
"openid"
:
"principalMemberCredential"
,
"email"
:
"universityCert"
}
}
```
Example policy:
```
rego
package
example
.
GetLoginProofInvitation
_
=
ocm
.
getLoginProofInvitation
(
input
.
scope
,
data
.
scopes
)
```
Result:
```
json
{
"link"
:
"https://ocm:443/didcomm/?d_m=eyJAdHlwZSI6Imh0dHBzOi8vZGlkY29tbS5vc9tbSJ9fQ"
,
"requestId"
:
"851076fa-da78-444a-9127-e636c5102f40"
}
```
#### ocm.GetLoginProofResult
Get a Proof Invitation result from OCM containing a flattened list of claims.
This function accepts one argument which is the
`resuestId`
from the
`ocm.getLoginProofInvitation`
result.
Example policy:
```
rego
package
example
.
GetLoginProofResult
_
=
ocm
.
getLoginProofResult
(
input
.
requestId
)
```
Result:
```
json
{
"name"
:
"John Doe"
,
"given_name"
:
"John"
,
"family_name"
:
"Doe"
,
"email"
:
"example@example.com"
,
"email_verified"
:
true
,
"preferred_username"
:
"john"
,
"gender"
:
"NA"
}
```
Loading