Skip to content

FuzzingLabs/daml-viewer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

daml-viewer

Rust CLI to scan a DAML project recursively and print a single Markdown table summarizing access-control info.

The program prints only the table to stdout (no extra text) and also writes it to disk.

Output example

Level Name Ensure Choice Lifecycle Controllers Signatories Observers Maintainers
template Accounts.Account (none) (N/A) (N/A) [issuer] [owner] (none)
choice Accounts.Account.Adjust (N/A) consuming [issuer] [issuer] [owner] (none)
template Accounts.AccountsDirectory (none) (N/A) (N/A) [issuer] (none) (none)
choice Accounts.AccountsDirectory.OpenAccount (N/A) consuming [issuer] [issuer] (none) (none)
choice Accounts.AccountsDirectory.LookupAccount (N/A) nonconsuming [issuer] [issuer] (none) (none)
choice Accounts.AccountsDirectory.AdjustBalance (N/A) consuming [issuer] [issuer] (none) (none)
template Flags.FlagGate (none) (N/A) (N/A) [issuer] [merchant] (none)
choice Flags.FlagGate.ClaimFlag (N/A) consuming [merchant] [issuer] [merchant] (none)
template Flags.Flag (none) (N/A) (N/A) [merchant] (none) (none)
template MerchantConfig.MerchantConfig (none) (N/A) (N/A) [issuer] [merchant] (none)
choice MerchantConfig.MerchantConfig.RedeemCoupons (N/A) consuming [merchant] [issuer] [merchant] (none)
template MerchantConfig.MerchantConfigDirectory (none) (N/A) (N/A) [issuer] (none) (none)
choice MerchantConfig.MerchantConfigDirectory.UpsertConfig (N/A) consuming [issuer] [issuer] (none) (none)
choice MerchantConfig.MerchantConfigDirectory.LookupConfig (N/A) nonconsuming [issuer] [issuer] (none) (none)
template Payment.PaymentPermit (none) (N/A) (N/A) [customer, issuer] [merchant] (none)
choice Payment.PaymentPermit.SubmitCapture (N/A) consuming [merchant] [customer, issuer] [merchant] (none)
template Payment.CaptureMsg (none) (N/A) (N/A) [merchant] [issuer, customer] (none)
choice Payment.CaptureMsg.Process (N/A) nonconsuming [issuer] [merchant] [issuer, customer] (none)
template Payment.ProcessedCapture (none) (N/A) (N/A) [issuer] [customer, merchant] (none)
choice Payment.ProcessedCapture.Purge (N/A) consuming [merchant] [issuer] [customer, merchant] (none)
template Payment.Receipt (none) (N/A) (N/A) [issuer] [customer, merchant] (none)

Cleared version (using --cleared)

Level Name Ensure Choice Lifecycle Controllers Signatories Observers Maintainers
template Accounts.Account [issuer] [owner]
choice Accounts.Account.Adjust consuming [issuer] [issuer] [owner]
template Accounts.AccountsDirectory [issuer]
choice Accounts.AccountsDirectory.OpenAccount consuming [issuer] [issuer]
choice Accounts.AccountsDirectory.LookupAccount nonconsuming [issuer] [issuer]
choice Accounts.AccountsDirectory.AdjustBalance consuming [issuer] [issuer]
template Flags.FlagGate [issuer] [merchant]
choice Flags.FlagGate.ClaimFlag consuming [merchant] [issuer] [merchant]
template Flags.Flag [merchant]
template MerchantConfig.MerchantConfig [issuer] [merchant]
choice MerchantConfig.MerchantConfig.RedeemCoupons consuming [merchant] [issuer] [merchant]
template MerchantConfig.MerchantConfigDirectory [issuer]
choice MerchantConfig.MerchantConfigDirectory.UpsertConfig consuming [issuer] [issuer]
choice MerchantConfig.MerchantConfigDirectory.LookupConfig nonconsuming [issuer] [issuer]
template Payment.PaymentPermit [customer, issuer] [merchant]
choice Payment.PaymentPermit.SubmitCapture consuming [merchant] [customer, issuer] [merchant]
template Payment.CaptureMsg [merchant] [issuer, customer]
choice Payment.CaptureMsg.Process nonconsuming [issuer] [merchant] [issuer, customer]
template Payment.ProcessedCapture [issuer] [customer, merchant]
choice Payment.ProcessedCapture.Purge consuming [merchant] [issuer] [customer, merchant]
template Payment.Receipt [issuer] [customer, merchant]

Usage

cargo run --quiet -- /path/to/daml/project
# stdout: Markdown table
# file:   ./daml_table.md

Optional:

cargo run --quiet -- /path/to/daml/project --output ./access-control.md

Clear placeholder cells ((N/A) and (none)) from output:

cargo run --quiet -- /path/to/daml/project --cleared

Documentation

The project includes a full mdBook under docs/.

Build locally:

cd docs
mdbook build

Serve with live reload:

cd docs
mdbook serve --open

About

Summary generator of DAML contracts access-control

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published