-
Notifications
You must be signed in to change notification settings - Fork 16
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
added e2e test for OpenID4VP s2s flow #2617
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
version: "3.7" | ||
services: | ||
nodeA-backend: | ||
image: "${IMAGE_NODE_A:-nutsfoundation/nuts-node:master}" | ||
ports: | ||
- "11323:1323" | ||
environment: | ||
NUTS_CONFIGFILE: /opt/nuts/nuts.yaml | ||
volumes: | ||
- "./node-A/nuts.yaml:/opt/nuts/nuts.yaml:ro" | ||
- "./node-A/data:/opt/nuts/data:rw" | ||
- "../../tls-certs/nodeA-backend-certificate.pem:/opt/nuts/certificate-and-key.pem:ro" | ||
- "../../tls-certs/truststore.pem:/opt/nuts/truststore.pem:ro" | ||
- "./node-A/presentationexchangemapping.json:/opt/nuts/presentationexchangemapping.json:ro" | ||
healthcheck: | ||
interval: 1s # Make test run quicker by checking health status more often | ||
nodeA: | ||
image: nginx:1.25.1 | ||
ports: | ||
- "10443:443" | ||
volumes: | ||
- "./node-A/nginx.conf:/etc/nginx/nginx.conf:ro" | ||
- "../../tls-certs/nodeA-certificate.pem:/etc/nginx/ssl/server.pem:ro" | ||
- "../../tls-certs/nodeA-certificate.pem:/etc/nginx/ssl/key.pem:ro" | ||
- "../../tls-certs/truststore.pem:/etc/nginx/ssl/truststore.pem:ro" | ||
- "./node-A/html:/etc/nginx/html:ro" | ||
nodeB: | ||
image: "${IMAGE_NODE_B:-nutsfoundation/nuts-node:master}" | ||
ports: | ||
- "21323:1323" | ||
environment: | ||
NUTS_CONFIGFILE: /opt/nuts/nuts.yaml | ||
volumes: | ||
- "./node-B/data:/opt/nuts/data:rw" | ||
- "./node-B/nuts.yaml:/opt/nuts/nuts.yaml:ro" | ||
- "../../tls-certs/nodeB-certificate.pem:/opt/nuts/certificate-and-key.pem:ro" | ||
- "../../tls-certs/truststore.pem:/opt/nuts/truststore.pem:ro" | ||
- "../../tls-certs/truststore.pem:/etc/ssl/certs/truststore.pem:ro" | ||
healthcheck: | ||
interval: 1s # Make test run quicker by checking health status more often |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
user nginx; | ||
worker_processes 1; | ||
|
||
error_log /var/log/nginx/error.log debug; | ||
pid /var/run/nginx.pid; | ||
|
||
|
||
events { | ||
worker_connections 1024; | ||
} | ||
|
||
|
||
http { | ||
include /etc/nginx/mime.types; | ||
default_type application/octet-stream; | ||
|
||
log_format main '$remote_addr - $remote_user [$time_local] "$request" ' | ||
'$status $body_bytes_sent "$http_referer" ' | ||
'"$http_user_agent" "$http_x_forwarded_for"'; | ||
|
||
access_log /var/log/nginx/access.log main; | ||
|
||
keepalive_timeout 65; | ||
|
||
include /etc/nginx/conf.d/*.conf; | ||
|
||
upstream nodeA-backend { | ||
server nodeA-backend:1323; | ||
} | ||
|
||
server { | ||
server_name nodeA; | ||
listen 443 ssl; | ||
http2 on; | ||
ssl_certificate /etc/nginx/ssl/server.pem; | ||
ssl_certificate_key /etc/nginx/ssl/key.pem; | ||
ssl_client_certificate /etc/nginx/ssl/truststore.pem; | ||
ssl_verify_client optional; | ||
ssl_verify_depth 1; | ||
ssl_protocols TLSv1.3; | ||
|
||
location / { | ||
proxy_set_header X-Ssl-Client-Cert $ssl_client_escaped_cert; | ||
proxy_pass http://nodeA-backend; | ||
} | ||
|
||
location /ping { | ||
auth_request /delegated; | ||
auth_request_set $auth_status $upstream_status; | ||
} | ||
|
||
location = /delegated { | ||
woutslakhorst marked this conversation as resolved.
Show resolved
Hide resolved
|
||
internal; | ||
proxy_pass http://nodeA-backend/internal/auth/v1/accesstoken/verify; | ||
proxy_method HEAD; | ||
proxy_pass_request_body off; | ||
proxy_set_header X-Ssl-Client-Cert $ssl_client_escaped_cert; | ||
proxy_set_header Content-Length ""; | ||
proxy_set_header X-Original-URI $request_uri; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
verbosity: debug | ||
strictmode: false | ||
internalratelimiter: false | ||
datadir: /opt/nuts/data | ||
http: | ||
default: | ||
address: :1323 | ||
auth: | ||
publicurl: https://nodeA | ||
v2apienabled: true | ||
presentationexchangemappingfile: /opt/nuts/presentationexchangemapping.json | ||
contractvalidators: | ||
- dummy | ||
irma: | ||
autoupdateschemas: false | ||
tls: | ||
truststorefile: /opt/nuts/truststore.pem | ||
certfile: /opt/nuts/certificate-and-key.pem | ||
certkeyfile: /opt/nuts/certificate-and-key.pem |
43 changes: 43 additions & 0 deletions
43
e2e-tests/oauth-flow/openid4vp/node-A/presentationexchangemapping.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
{ | ||
"test": { | ||
"format": { | ||
"ldp_vp": { | ||
"proof_type": ["JsonWebSignature2020"] | ||
}, | ||
"ldp_vc": { | ||
"proof_type": ["JsonWebSignature2020"] | ||
} | ||
}, | ||
"id": "pd_any_care_organization", | ||
"name": "Care organization", | ||
"purpose": "Finding a care organization for authorizing access to medical metadata", | ||
"input_descriptors": [ | ||
{ | ||
"id": "id_nuts_care_organization_cred", | ||
"constraints": { | ||
"fields": [ | ||
{ | ||
"path": ["$.type"], | ||
"filter": { | ||
"type": "string", | ||
"const": "NutsOrganizationCredential" | ||
} | ||
}, | ||
{ | ||
"path": ["$.credentialSubject.organization.name"], | ||
"filter": { | ||
"type": "string" | ||
} | ||
}, | ||
{ | ||
"path": ["$.credentialSubject.organization.city"], | ||
"filter": { | ||
"type": "string" | ||
} | ||
} | ||
] | ||
} | ||
} | ||
] | ||
} | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
verbosity: debug | ||
strictmode: false | ||
internalratelimiter: false | ||
datadir: /opt/nuts/data | ||
http: | ||
default: | ||
address: :1323 | ||
auth: | ||
tlsenabled: true | ||
v2apienabled: true | ||
publicurl: https://nodeB | ||
contractvalidators: | ||
- dummy | ||
irma: | ||
autoupdateschemas: false | ||
tls: | ||
truststorefile: /opt/nuts/truststore.pem | ||
certfile: /opt/nuts/certificate-and-key.pem | ||
certkeyfile: /opt/nuts/certificate-and-key.pem | ||
|
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might just be that the error response is not an OAuth2 error? In that case just return the HTTP error as is?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should be (according to spec). If it's a different JSON return, it would become an empty 400 response. If it's not JSON then an error is logged and the original httpErr is returned.