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

update api to allow credential-wrapped requests #489

Merged
merged 10 commits into from
Jun 7, 2023

Commits on Jun 1, 2023

  1. update api to allow credential-wrapped requests

    - stage
    - query
    - multiquery
    - history
    
    In order to handle string requests, we need to understand string when discerning whether
    we're dealing with an insert or a retract, so there are a couple updates to handle
    that (fql.parse/update? and update/insert? and update/retract?).
    
    In each case we unwrap the credential subject before parsing. We only use a limited
    subset of the credential spec internally, but the wide world of credentials has a very
    large schema and I didn't want to include it in our internal query/transaction schema.
    dpetran committed Jun 1, 2023
    Configuration menu
    Copy the full SHA
    3635071 View commit details
    Browse the repository at this point in the history
  2. used derived id for verified credential issuer

    We were just pulling the "issuer" field off of the verified credential, but that part of
    the credential is not signed. Now we just use the did key from the proof, which is part
    of the cryptographic signature.
    
    Also refactored the `generate` function and stubbed out an assertion that we can use in
    the future once our incoming credential subjects are proper json-ld.
    dpetran committed Jun 1, 2023
    Configuration menu
    Copy the full SHA
    09474b0 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    a352c16 View commit details
    Browse the repository at this point in the history
  4. use credential auth id in policy enforcement

    If no role is specified, but a did is, look up the roles associated with the identity
    and enforce them on the operation.
    dpetran committed Jun 1, 2023
    Configuration menu
    Copy the full SHA
    6343e77 View commit details
    Browse the repository at this point in the history
  5. unwrap db policy after stage

    When staging with a policy-activating opt (:did or :role), you need to be able to
    subsequently transact with different policies for different users. This commit makes
    that possible by resetting the db to a root db after checking policies.
    
    If you want to interact with the db with a specific policy wrapping, you need to specify
    the identity/role with which you are doing so every time.
    dpetran committed Jun 1, 2023
    Configuration menu
    Copy the full SHA
    326e93a View commit details
    Browse the repository at this point in the history
  6. call a did a did

    dpetran committed Jun 1, 2023
    Configuration menu
    Copy the full SHA
    32a3349 View commit details
    Browse the repository at this point in the history

Commits on Jun 6, 2023

  1. Configuration menu
    Copy the full SHA
    5951fa3 View commit details
    Browse the repository at this point in the history
  2. use more efficient query for did roles

    Since we know the subject ids for the predicates we care about, we don't need to invoke
    the whole query pipeline in order to get the results we care about.
    
    Cleaned up a redundant ns require for fql.
    
    Added some test cases to verify that no errors are thrown when there are no roles or
    identities.
    dpetran committed Jun 6, 2023
    Configuration menu
    Copy the full SHA
    b509653 View commit details
    Browse the repository at this point in the history
  3. make policy role lookups more efficient

    We were looking up an identity's roles, then looking up those roles iris, only to
    translate them back into iris.
    
    This allows us to skip the iri lookups and just keep the sids.
    dpetran committed Jun 6, 2023
    Configuration menu
    Copy the full SHA
    ecf05c0 View commit details
    Browse the repository at this point in the history

Commits on Jun 7, 2023

  1. update docstrings

    Also, there's a function for (not (not-empty ...)).
    dpetran committed Jun 7, 2023
    Configuration menu
    Copy the full SHA
    ce94640 View commit details
    Browse the repository at this point in the history