MatrixAI / Polykey

Polykey Core Library
https://polykey.com
GNU General Public License v3.0
30 stars 4 forks source link

Add versions to claims and better validation for processing claims #737

Open tegefaulkes opened 3 months ago

tegefaulkes commented 3 months ago

Specification

Given recent changes to identity claims, we saw a first hand example of failing to process a claim. In this case the claim was missing a field that we were expecting leading to a failure to process the claims.

So we need to make the following changes to handle this.

  1. Claims need to contain a version field that gets incremented each time the claim schema changes.
  2. We need better error logging for why the claim failed to be processed.

The version number is a simple addition. However when processing a claim we need to do more validation rather than just trusting that it is correct.

Additional context

Tasks

  1. Claims need to contain a version field that gets incremented each time the claim schema changes.
  2. We need better error logging for why the claim failed to be processed.
linear[bot] commented 3 months ago

ENG-331 Add versions to claims and better validation for processing claims

tegefaulkes commented 3 months ago

Any old claims on an identity will break the processing of that identity. Updating the parsing of claims will fix this. Currently we take it as read that the format will be valid if it was a valid claim. But we can have missing fields that we need to verify and handle gracefully.

If we fail to parse a claim on an identity, we need to just skip it with a warning and move on rather than fail to process all the claims.

CMCDragonkai commented 3 months ago

Discovery may work without GitHub token cause it's supposed to be public, but this provider specific. If we are not authenticated in some providers, there should be an error or feedback indicating that this is not possible. Which is why we need a discovery queue introspection commands (possibly related to operational logs or general task inspection).