Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dynamic endpoint #37

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions test_client.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,12 @@ client=$(docker run --rm -it \
--grant-type authorization_code \
--response-type token,code,id_token \
--scope openid \
--redirect-uri http://localhost:9010/callback \
--redirect-uri "http://localhost:3000/api/auth/callback/oidc" \
-e http://hydra:4445 \
--format json )

echo $client

client_id=$(echo $client | jq -r '.client_id')

docker run --rm -it \
--network ory-hydra-net \
-p 9010:9010 \
Expand All @@ -24,8 +22,8 @@ docker run --rm -it \
--port 9010 \
--client-id $client_id \
--client-secret some-secret \
--redirect http://localhost:9010/callback \
--redirect "http://localhost:3000/api/auth/callback/oidc" \
--scope openid \
--auth-url http://localhost:5004/oauth2/auth \
--token-url http://hydra:4444/oauth2/token \
--token-url http://localhost:5004/oauth2/token \
-e http://hydra:4444
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[
{
"id": "verifiableId",
"name": "Input descriptor for login credential",
"purpose": "Sign-in to MVG",
"constraints": {
"fields": [
{
"path": ["$.credentialSubject.type"],
"filter": {
"type": "string",
"pattern": "VerifiableId"
}
}
]
}
}
]
2 changes: 1 addition & 1 deletion vclogin/__tests__/testdata/policies/acceptAnything.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[
{
"credentialId": "credential1",
"credentialId": "1",
"patterns": [
{
"issuer": "*",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[
{
"credentialId": "some random string",
"patterns": [
{
"issuer": "*",
"claims": [
{
"claimPath": "$.credentialSubject.id"
}
]
}
]
}
]
32 changes: 32 additions & 0 deletions vclogin/__tests__/testdata/policies/acceptAnythingMultiVC.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
[
{
"credentialId": "1",
"patterns": [
{
"issuer": "*",
"claims": [
{
"claimPath": "$1.credentialSubject.*",
"newPath": "$.firstCredentialSubject",
"required": false
}
]
}
]
},
{
"credentialId": "2",
"patterns": [
{
"issuer": "*",
"claims": [
{
"claimPath": "$.credentialSubject.*",
"newPath": "$.secondCredentialSubject",
"required": false
}
]
}
]
}
]
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[
{
"credentialId": "one",
"credentialId": "1",
"patterns": [
{
"issuer": "did:web:app.altme.io:issuer",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[
{
"credentialId": "one",
"credentialId": "1",
"patterns": [
{
"issuer": "did:web:app.altme.io:issuer",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[
{
"credentialId": "one",
"credentialId": "1",
"patterns": [
{
"issuer": "*",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
[
{
"credentialId": "1",
"patterns": [
{
"issuer": "did:web:app.altme.io:issuer",
"claims": [
{
"claimPath": "$.credentialSubject.email"
}
],
"constraint": {
"op": "equalsDID",
"a": "$VP.proof.verificationMethod",
"b": "$1.credentialSubject.id"
}
}
]
},
{
"credentialId": "2",
"patterns": [
{
"issuer": "did:web:app.altme.io:issuer",
"claims": [
{
"claimPath": "$.credentialSubject.type"
}
],
"constraint": {
"op": "equalsDID",
"a": "$2.credentialSubject.id",
"b": "$1.credentialSubject.id"
}
}
]
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
[
{
"credentialId": "1",
"patterns": [
{
"issuer": "did:web:app.altme.io:issuer",
"claims": [
{
"claimPath": "$.credentialSubject.email"
}
],
"constraint": {
"op": "equalsDID",
"a": "$VP.proof.verificationMethod",
"b": "$1.credentialSubject.id"
}
}
]
},
{
"credentialId": "2",
"patterns": [
{
"issuer": "did:web:app.altme.io:issuer",
"claims": [
{
"claimPath": "$.credentialSubject.type"
}
]
}
]
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
[
{
"credentialId": "1",
"patterns": [
{
"issuer": "did:web:app.altme.io:issuer",
"claims": [
{
"claimPath": "$.credentialSubject.email"
}
],
"constraint": {
"op": "equalsDID",
"a": "$VP.proof.verificationMethod",
"b": "$1.credentialSubject.id"
}
}
]
},
{
"credentialId": "2",
"patterns": [
{
"issuer": "did:web:app.altme.io:issuer",
"claims": [
{
"claimPath": "$.credentialSubject.firstName"
}
],
"constraint": {
"op": "equals",
"a": "$2.credentialSubject.id",
"b": "$1.credentialSubject.id"
}
}
]
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
[
{
"credentialId": "one",
"patterns": [
{
"issuer": "*",
"claims": [
{
"claimPath": "$.credentialSubject.type"
}
]
}
]
},
{
"credentialId": "two",
"patterns": [
{
"issuer": "*",
"claims": [
{
"claimPath": "$.credentialSubject.id"
}
]
}
]
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
[
{
"credentialId": "1",
"patterns": [
{
"issuer": "did:web:app.altme.io:issuer",
"claims": [
{
"claimPath": "$.credentialSubject.email"
}
],
"constraint": {
"op": "equalsDID",
"a": "$VP.proof.verificationMethod",
"b": "$1.credentialSubject.id"
}
}
]
},
{
"credentialId": "2",
"patterns": [
{
"issuer": "did:web:app.altme.io:issuer",
"claims": [
{
"claimPath": "$.credentialSubject.firstName"
}
]
}
]
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[
{
"credentialId": "1",
"patterns": [
{
"issuer": "did:web:app.altme.io:issuer",
"claims": [
{
"claimPath": "$.credentialSubject.dateOfBirth"
},
{
"claimPath": "$.credentialSubject.firstName"
},
{
"claimPath": "$.credentialSubject.familyName"
}
]
}
]
}
]
Loading
Loading