dovuofficial / guardian-php-sdk

Configuration based Guardian policy consumption and management for dovu platform
MIT License
0 stars 0 forks source link

[Medium Term] Create functionality to be able to traverse policies on the fly to detect all tags, roles and workflows for each individual actor. #13

Open mattsmithies opened 5 months ago

mattsmithies commented 5 months ago

Overview

This is a large one, but the goal here is to be able to ingest any policy regardless of any role that is engaged and to be able to test policies on the fly so the ability for a role such as a supplier to run through all the data capture elements as expected, for the verification/validation to take place for any particular actor, and for all the steps to be composed in a way where assets are minted.

This needs to be completely dynamic, and potentially become a backbone for a dynamic test environment for any type of policy on guardian.

mattsmithies commented 3 months ago

This will also need to expect a dynamic seeding component (or simple base values) for schema consumption.

mattsmithies commented 3 months ago

This task may actually expand into the dynamic generation of a bespoke configuration file that can be used for anyone to simply consume a policy over an API.

Like for the current "DOVU" process.

[
    {
        :role :supplier
        :tag :create_ecological_project
        :type :data
        :key :create-project
    }
    {
        :role :owner
        :require {
           :status :waiting
        }
        :filter {
            :tag :supplier_grid_filter
            :key :uuid
        }
        :source_tag :supplier_grid
        :tag :approve_supplier_btn
        :options [
            :approve.template
            :reject.template
        ]
        :type :approval
        :key :approve-project
    }
    {
        :role :supplier
        :require {
            :status :approved
        }
        :tag :create_site_form
        :source_tag :create_site_form
        :type :data
        :allow_many true
        :key :register-site
    }
    {
        :role :owner
        :require {
           :status :waiting
        }
        :filter {
            :tag :site_grid_owner_filter
            :key :uuid
        }
        :source_tag :approve_sites_grid
        :tag :approve_site_button
        :options [
            :approve.template
            :reject.template
        ]
        :type :approval
        :key :approve-site
    }
    {
        :role :supplier
        :require {
           :status :approved
        }
        :tag :create_claim_request_form
        :filter {
            :tag :site_grid_supplier_filter
            :key :uuid
        }
        :source_tag :sites_grid
        :type :data
        :allow_many true
        :key :create-claim
    }
    {
        :role :verifier
        :require {
           :status :waiting
        }
        :filter {
            :tag :claim_request_verifier_filter
            :key :uuid
        }
        :source_tag "claim_requests_grid(verifier)"
        :tag :approve_claim_requests_btn
        :options [
            :approve.template
            :reject.template
        ]
        :type :approval
        :key :approve-claim
    }
]