digitalbazaar / ezcap

An opinionated Authorization Capabilities client
BSD 3-Clause "New" or "Revised" License
7 stars 1 forks source link

Add helper to get root invocation target from a zcap #21

Open dlongley opened 1 year ago

dlongley commented 1 year ago

A helper that could be used to get the root invocation target from a zcap would be helpful because well-known API paths can be added onto the root invocation target -- for zcaps that grant authority to some base in the path hierarchy.

For example, if a zcap has a invocation target of either <root invocation target>, <root invocation target>/foo or <root invocation target>/foo/bar, each can be used to hit well-known path: <root invocation target>/foo/bar/baz. The helper would return <root invocation target> for any of these zcaps, allowing the target URL to then be constructed from that.