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

complete s2s e2e test #2677

Merged
merged 3 commits into from
Dec 18, 2023
Merged

complete s2s e2e test #2677

merged 3 commits into from
Dec 18, 2023

Conversation

woutslakhorst
Copy link
Member

No description provided.

return IntrospectAccessToken200JSONResponse{}, nil
}

token := AccessToken{}
if err := r.accessTokenStore().Get(request.Body.Token, &token); err != nil {
// Return 200 + 'Active = false' when token is invalid or malformed
log.Logger().Debug("IntrospectAccessToken: failed to get token from store")
return IntrospectAccessToken200JSONResponse{}, err
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

error is still logged, right?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nothing was logged, now there's some debug log. We may want to create an issue to 'fix' the logging for introspection calls?

e2e-tests/oauth-flow/rfc021/node-A/nginx.conf Show resolved Hide resolved
e2e-tests/oauth-flow/rfc021/node-A/nginx.conf Show resolved Hide resolved
e2e-tests/oauth-flow/rfc021/node-A/nuts.yaml Outdated Show resolved Hide resolved
@@ -0,0 +1,22 @@
function introspectAccessToken(r) {
// strip the first 8 chars
var token = "token=" + r.headersIn['Authorization'].substring(7);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does this always have the right encoding?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we use 128bit b64 encoded strings, so for us: yes.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I raw thinking of standard/raw/URL base64 encoding, but if it works...

# echo $RESPONSE
# exitWithDockerLogs 1
#fi
RESPONSE=$(docker compose exec nodeB curl --http1.1 --insecure --cert /etc/nginx/ssl/server.pem --key /etc/nginx/ssl/key.pem https://nodeA:443/resource -H "Authorization: bearer $(cat ./node-B/data/accesstoken.txt)" -v)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we also have a not-OK test?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd like to have e2e tests to make sure the integration isn't broken at some point. Various error conditions should be tested by unit-tests. At this point a no-OK test would largely test the nginx config.

@@ -0,0 +1,22 @@
function introspectAccessToken(r) {
// strip the first 8 chars
var token = "token=" + r.headersIn['Authorization'].substring(7);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I raw thinking of standard/raw/URL base64 encoding, but if it works...

@woutslakhorst woutslakhorst merged commit 788f923 into master Dec 18, 2023
7 of 9 checks passed
@woutslakhorst woutslakhorst deleted the e2e_test/s2s_token branch December 18, 2023 08:23
rolandgroen added a commit to Headease/nuts-node that referenced this pull request Dec 18, 2023
* master:
  complete s2s e2e test (nuts-foundation#2677)
  Cleanup unused file (nuts-foundation#2692)
  Discovery: implement server API (nuts-foundation#2659)
  VCR: Use JWT/JSON-LD constants from go-did (nuts-foundation#2691)
  Bump github/codeql-action from 2 to 3 (nuts-foundation#2687)
  split signature verification from verifier (nuts-foundation#2683)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants