From b0bfe003c971a35fba7fb05d195ca9df05ff3a05 Mon Sep 17 00:00:00 2001 From: Aravinth Manivannan Date: Wed, 6 Sep 2023 20:01:00 +0530 Subject: [PATCH] feat: add demo logs --- README.md | 103 +++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 99 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index d2b747f..899038c 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,11 @@ # WebFinger tests for ForgeFlux/ftest +## TODO + +- [ ] Write code to upload to ftest server +- [ ] Package Docker container +- [ ] Upload to Docker Hub + ## Environment Variables Please see [`.env_sample`](./.env_sample) @@ -18,8 +24,97 @@ source .env python run.py ``` -## TODO +## Demo -- [ ] Write code to upload to ftest server -- [ ] Package Docker container -- [ ] Upload to Docker Hub +### Successful run: + +
+ +Please open to see logs + +```bash +19:54 atm@lab webfinger ±|master|→ python run.py +2023-09-06 19:54:29,351 - webfinger - INFO - Environment: FTEST_AUTH: foobar +2023-09-06 19:54:29,351 - webfinger - INFO - Environment: FTEST_TARGET_HOST: https://gts.batsense.net +2023-09-06 19:54:29,351 - webfinger - INFO - Environment: FTEST_USER: realaravinth@batsense.net +2023-09-06 19:54:29,351 - webfinger - INFO - Query WebFinger: https://gts.batsense.net/.well-known/webfinger?resource=acct:realaravinth@batsense.net +2023-09-06 19:54:30,940 - webfinger - DEBUG - WebFinger response: + +STATUS: 200 + +HEADERS: + {'Server': 'nginx/1.18.0', 'Date': 'Wed, 06 Sep 2023 14:24:21 GMT', 'Content-Type': 'application/json; charset=utf-8', 'Content-Length': '197', 'Connection': 'keep-alive', 'Access-Control-Allow-Origin': '*', 'Access-Control-Expose-Headers': 'Link,X-Ratelimit-Reset,X-Ratelimit-Limit,X-Ratelimit-Remaining,X-Request-Id,Connection,Sec-Websocket-Accept,Upgrade', 'Cache-Control': 'public, max-age=120', 'Content-Encoding': 'gzip', 'Permissions-Policy': 'browsing-topics=(), interest-cohort=()', 'Vary': 'Accept-Encoding', 'X-Ratelimit-Limit': '300', 'X-Ratelimit-Remaining': '299', 'X-Ratelimit-Reset': '1694010561', 'X-Request-Id': 'tx0y2tma04001mwdmrb0'} + +RESPONSE PAYLOAD: +{'subject': 'acct:realaravinth@batsense.net', 'aliases': ['https://gts.batsense.net/users/realaravinth', 'https://gts.batsense.net/@realaravinth'], 'links': [{'rel': 'http://webfinger.net/rel/profile-page', 'type': 'text/html', 'href': 'https://gts.batsense.net/@realaravinth'}, {'rel': 'self', 'type': 'application/activity+json', 'href': 'https://gts.batsense.net/users/realaravinth'}]} +2023-09-06 19:54:30,940 - webfinger - INFO - [SUCCESS] WebFinger query response is HTTP 200 +2023-09-06 19:54:30,940 - webfinger - INFO - [SUCCESS] WebFinger response has 'subject', 'aliases' and 'links' parameters' +2023-09-06 19:54:30,940 - webfinger - DEBUG - 'rel==http://webfinger.net/rel/profile-page' is present in 'links' WebFinger response parameter +2023-09-06 19:54:30,940 - webfinger - INFO - [SUCESS] rel==self passed schema validation +2023-09-06 19:54:30,940 - webfinger - INFO - [SUCESS] rel==profile-page passed schema validation +2023-09-06 19:54:30,940 - webfinger - INFO - [SUCESS] 'links' object passed validation +2023-09-06 19:54:30,940 - webfinger - INFO - [SUCESS] WebFinger endpoint is configured correctly for CORS + + +=============== +All tests passed +Summary: + +Successful tests: + +[OK] test_main_params +[OK] test_links +[OK] test_subject +[OK] test_access_control_allow_origin +``` + +
+ +### Failed run: + +
+ +Please open to see logs + +```bash +19:59 atm@lab webfinger ±|master ✗|→ python run.py +2023-09-06 19:59:25,423 - webfinger - INFO - Environment: FTEST_AUTH: foobar +2023-09-06 19:59:25,423 - webfinger - INFO - Environment: FTEST_TARGET_HOST: https://gts.batsense.net +2023-09-06 19:59:25,423 - webfinger - INFO - Environment: FTEST_USER: realaravinth@batsense.net +2023-09-06 19:59:25,423 - webfinger - INFO - Query WebFinger: https://gts.batsense.net/.well-known/webfinger?resource=acct:realaravinth@batsense.net +2023-09-06 19:59:26,966 - webfinger - DEBUG - WebFinger response: + +STATUS: 200 + +HEADERS: + {'Server': 'nginx/1.18.0', 'Date': 'Wed, 06 Sep 2023 14:29:18 GMT', 'Content-Type': 'application/json; charset=utf-8', 'Content-Length': '197', 'Connection': 'keep-alive', 'Access-Control-Allow-Origin': '*', 'Access-Control-Expose-Headers': 'Link,X-Ratelimit-Reset,X-Ratelimit-Limit,X-Ratelimit-Remaining,X-Request-Id,Connection,Sec-Websocket-Accept,Upgrade', 'Cache-Control': 'public, max-age=120', 'Content-Encoding': 'gzip', 'Permissions-Policy': 'browsing-topics=(), interest-cohort=()', 'Vary': 'Accept-Encoding', 'X-Ratelimit-Limit': '300', 'X-Ratelimit-Remaining': '294', 'X-Ratelimit-Reset': '1694010784', 'X-Request-Id': '7v3eatma04000wbjxvyg'} + +RESPONSE PAYLOAD: +{'subject': 'acct:realaravinth@batsense.net', 'aliases': ['https://gts.batsense.net/users/realaravinth', 'https://gts.batsense.net/@realaravinth'], 'links': [{'rel': 'http://webfinger.net/rel/profile-page', 'type': 'text/html', 'href': 'https://gts.batsense.net/@realaravinth'}, {'rel': 'self', 'type': 'application/activity+json', 'href': 'https://gts.batsense.net/users/realaravinth'}]} +2023-09-06 19:59:26,966 - webfinger - INFO - [SUCCESS] WebFinger query response is HTTP 200 +2023-09-06 19:59:26,966 - webfinger - INFO - [SUCCESS] WebFinger response has 'subject', 'aliases' and 'links' parameters' +2023-09-06 19:59:26,966 - webfinger - DEBUG - 'rel==http://webfinger.net/rel/profile-page' is present in 'links' WebFinger response parameter +2023-09-06 19:59:26,966 - webfinger - INFO - [SUCESS] rel==self passed schema validation +2023-09-06 19:59:26,966 - webfinger - INFO - [SUCESS] rel==profile-page passed schema validation +2023-09-06 19:59:26,966 - webfinger - INFO - [SUCESS] 'links' object passed validation +2023-09-06 19:59:26,966 - webfinger - ERROR - Access-Control-Allow-Origin header should be '*' to allow any domain to access the resource with CORS. Please see https://www.rfc-editor.org/rfc/rfc7033.html#section-5 + + +=============== +Partial success. 4 out of 5 tests passed +Summary: + +Successful tests: + +[OK] test_main_params +[OK] test_links +[OK] test_subject + + +Failed tests: + +[FAIL] test_access_control_allow_origin failed with error: +Access-Control-Allow-Origin header should be '*' to allow any domain to access the resource with CORS. Please see https://www.rfc-editor.org/rfc/rfc7033.html#section-5 +``` + +