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

feat: compliance checking architecture exists #2

Merged
merged 18 commits into from
Apr 16, 2022
Merged

feat: compliance checking architecture exists #2

merged 18 commits into from
Apr 16, 2022

Conversation

SgtPooki
Copy link
Member

@SgtPooki SgtPooki commented Mar 21, 2022

@SgtPooki
Copy link
Member Author

@lidel Can you take a peek here and let me know what you think?

Current output of ts-node src/cli/index.ts -s $PINATA_API_ENDPOINT $PINATA_API_TOKEN -s $ESTUARY_API_ENDPOINT $ESTUARY_API_TOKEN -s $NFT_API_ENDPOINT $NFT_API_TOKEN -s $WEB3_API_ENDPOINT $WEB3_API_TOKEN

results in the following report in the terminal:

https://api.pinata.cloud/psa compliance:

Return 403 for requests with no authentication token - ✘ FAILED

Details

Response data from RemotePinningServiceClient

via util.inspect

null

Joi validation failures

No failures

Request - GET: https://api.pinata.cloud/psa/pins

Headers
{}
Body
undefined

Response - Bad Request (400)

Headers
{
  "access-control-allow-credentials": "true",
  "connection": "close",
  "content-length": "117",
  "content-type": "application/json; charset=utf-8",
  "date": "Mon, 28 Mar 2022 19:32:29 GMT",
  "etag": "W/\"75-8hWiVluTmqi8Bp2+E+MmsFL38tY\"",
  "server": "nginx/1.16.1",
  "vary": "Origin",
  "x-powered-by": "Express",
  "x-ratelimit-limit": "180",
  "x-ratelimit-remaining": "179",
  "x-ratelimit-reset": "1648496005"
}
Body
{
  "error": {
    "reason": "KEYS_MUST_BE_STRINGS",
    "details": "pinata_api_key and pinata_secret_api_key must both be strings"
  }
}

Return 403 for requests with an invalid authentication token - ✘ FAILED

Details

Response data from RemotePinningServiceClient

via util.inspect

null

Joi validation failures

No failures

Request - GET: https://api.pinata.cloud/psa/pins

Headers
{
  "Authorization": "Bearer REDACTED"
}
Body
undefined

Response - Unauthorized (401)

Headers
{
  "access-control-allow-credentials": "true",
  "connection": "close",
  "content-length": "82",
  "content-type": "application/json; charset=utf-8",
  "date": "Mon, 28 Mar 2022 19:32:29 GMT",
  "etag": "W/\"52-hDmJB39hiWxMgXnl95p1Dk5Zk6Q\"",
  "server": "nginx/1.16.1",
  "vary": "Origin",
  "x-powered-by": "Express",
  "x-ratelimit-limit": "180",
  "x-ratelimit-remaining": "178",
  "x-ratelimit-reset": "1648496005"
}
Body
{
  "error": {
    "reason": "INVALID_CREDENTIALS",
    "details": "Invalid/expired credentials"
  }
}

List pin objects (GET /pins) in all states - ✓ SUCCESS

https://api.estuary.tech/pinning compliance:

Return 403 for requests with no authentication token - ✓ SUCCESS

Return 403 for requests with an invalid authentication token - ✓ SUCCESS

List pin objects (GET /pins) in all states - ✓ SUCCESS

https://nft.storage/api compliance:

Return 403 for requests with no authentication token - ✘ FAILED

Details

Response data from RemotePinningServiceClient

via util.inspect

null

Joi validation failures

No failures

Request - GET: https://nft.storage/api/pins

Headers
{}
Body
undefined

Response - Unauthorized (401)

Headers
{
  "access-control-allow-origin": "*",
  "alt-svc": "h3=\":443\"; ma=86400, h3-29=\":443\"; ma=86400",
  "cf-ray": "6f32cac879900911-SEA",
  "connection": "close",
  "content-length": "86",
  "content-type": "application/json;charset=UTF-8",
  "date": "Mon, 28 Mar 2022 19:32:30 GMT",
  "expect-ct": "max-age=604800, report-uri=\"https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct\"",
  "server": "cloudflare",
  "vary": "Accept-Encoding"
}
Body
{
  "error": {
    "reason": "INTERNAL_SERVER_ERROR",
    "details": "An unexpected error occurred."
  }
}

Return 403 for requests with an invalid authentication token - ✘ FAILED

Details

Response data from RemotePinningServiceClient

via util.inspect

null

Joi validation failures

No failures

Request - GET: https://nft.storage/api/pins

Headers
{
  "Authorization": "Bearer REDACTED"
}
Body
undefined

Response - Unauthorized (401)

Headers
{
  "access-control-allow-origin": "*",
  "alt-svc": "h3=\":443\"; ma=86400, h3-29=\":443\"; ma=86400",
  "cf-ray": "6f32cacb6821680b-SEA",
  "connection": "close",
  "content-length": "86",
  "content-type": "application/json;charset=UTF-8",
  "date": "Mon, 28 Mar 2022 19:32:31 GMT",
  "expect-ct": "max-age=604800, report-uri=\"https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct\"",
  "server": "cloudflare",
  "vary": "Accept-Encoding"
}
Body
{
  "error": {
    "reason": "INTERNAL_SERVER_ERROR",
    "details": "An unexpected error occurred."
  }
}

List pin objects (GET /pins) in all states - ✘ FAILED

Details

Response data from RemotePinningServiceClient

via util.inspect

null

Joi validation failures

No failures

Request - GET: https://nft.storage/api/pins

Headers
{
  "Authorization": "Bearer REDACTED"
}
Body
undefined

Response - Bad Request (400)

Headers
{
  "access-control-allow-origin": "*",
  "alt-svc": "h3=\":443\"; ma=86400, h3-29=\":443\"; ma=86400",
  "cf-ray": "6f32cace780c092b-SEA",
  "connection": "close",
  "content-length": "181",
  "content-type": "application/json;charset=UTF-8",
  "date": "Mon, 28 Mar 2022 19:32:32 GMT",
  "expect-ct": "max-age=604800, report-uri=\"https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct\"",
  "server": "cloudflare",
  "vary": "Accept-Encoding"
}
Body
{
  "reason": "VALIDATION_ERROR",
  "details": [
    {
      "instanceLocation": "#",
      "keyword": "required",
      "keywordLocation": "#/required",
      "error": "Instance does not have required property \"status\"."
    }
  ]
}

https://api.web3.storage compliance:

Return 403 for requests with no authentication token - ✘ FAILED

Details

Response data from RemotePinningServiceClient

via util.inspect

null

Joi validation failures

No failures

Request - GET: https://api.web3.storage/pins

Headers
{}
Body
undefined

Response - Unauthorized (401)

Headers
{
  "access-control-allow-origin": "*",
  "access-control-expose-headers": "Link",
  "cf-ray": "6f32cad5ffb26114-SEA",
  "connection": "close",
  "content-length": "87",
  "content-type": "application/json;charset=UTF-8",
  "date": "Mon, 28 Mar 2022 19:32:32 GMT",
  "expect-ct": "max-age=604800, report-uri=\"https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct\"",
  "server": "cloudflare",
  "vary": "Accept-Encoding"
}
Body
{
  "code": "ERROR_NO_TOKEN",
  "message": "No token found in `Authorization: Bearer ` header"
}

Return 403 for requests with an invalid authentication token - ✘ FAILED

Details

Response data from RemotePinningServiceClient

via util.inspect

null

Joi validation failures

No failures

Request - GET: https://api.web3.storage/pins

Headers
{
  "Authorization": "Bearer REDACTED"
}
Body
undefined

Response - Unauthorized (401)

Headers
{
  "access-control-allow-origin": "*",
  "access-control-expose-headers": "Link",
  "cf-ray": "6f32cad87d9cf5b5-SEA",
  "connection": "close",
  "content-length": "82",
  "content-type": "application/json;charset=UTF-8",
  "date": "Mon, 28 Mar 2022 19:32:33 GMT",
  "expect-ct": "max-age=604800, report-uri=\"https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct\"",
  "server": "cloudflare",
  "vary": "Accept-Encoding"
}
Body
{
  "code": "ERROR_UNRECOGNISED_TOKEN",
  "message": "Could not parse provided API token"
}

List pin objects (GET /pins) in all states - ✘ FAILED

Details

Response data from RemotePinningServiceClient

via util.inspect

null

Joi validation failures

No failures

Request - GET: https://api.web3.storage/pins

Headers
{
  "Authorization": "Bearer REDACTED"
}
Body
undefined

Response - Bad Request (400)

Headers
{
  "access-control-allow-origin": "*",
  "access-control-expose-headers": "Link",
  "cf-ray": "6f32cadb484c08e7-SEA",
  "connection": "close",
  "content-length": "95",
  "content-type": "application/json;charset=UTF-8",
  "date": "Mon, 28 Mar 2022 19:32:34 GMT",
  "expect-ct": "max-age=604800, report-uri=\"https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct\"",
  "server": "cloudflare",
  "vary": "Accept-Encoding"
}
Body
{
  "reason": "PSA_REQUIRED_DATA",
  "details": "Instance does not have required property \"status\"."
}

@SgtPooki SgtPooki requested a review from lidel March 28, 2022 19:35
@SgtPooki SgtPooki linked an issue Mar 29, 2022 that may be closed by this pull request
1 task
@SgtPooki SgtPooki merged commit 4c2d52b into main Apr 16, 2022
@SgtPooki SgtPooki deleted the develop branch April 16, 2022 00:04
@github-actions
Copy link

🎉 This PR is included in version 1.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Compliance Check: confirm Authentication is present
1 participant