import "v.io/x/ref/services/identity/internal/caveats"
browser_caveat_selector.go caveat_factory.go caveat_selector.go mock_caveat_selector.go
type CaveatFactory interface { New(caveatInfo CaveatInfo) (security.Caveat, error) }
func NewCaveatFactory() CaveatFactory
type CaveatSelector interface { // Render renders the caveat input form. When the user has completed inputing caveats, // Render should redirect to the specified redirect route. // blessingName is the name used for the blessings that is being caveated. // state is any state passed by the caller (e.g., for CSRF mitigation) and is returned by ParseSelections. // redirectRoute is the route to be returned to. Render(blessingName, state, redirectURL string, w http.ResponseWriter, r *http.Request) error // ParseSelections parse the users choices of Caveats, and returns the information needed to create them, // the state passed to Render, and any additionalExtension selected by the user to further extend the blessing. ParseSelections(r *http.Request) (caveats []CaveatInfo, state string, additionalExtension string, err error) }
CaveatSelector is used to render a web page where the user can select caveats to be added to a blessing being granted
func NewBrowserCaveatSelector(assetsPrefix string) CaveatSelector
NewBrowserCaveatSelector returns a caveat selector that renders a form in the to accept user caveat selections.
func NewMockCaveatSelector() CaveatSelector
NewMockCaveatSelector returns a CaveatSelector that always returns a default set of caveats: [exprity caveat with a 1h expiry, revocation caveat, and a method caveat for methods "methodA" and "methodB"] and the additional extension: "test-extension" This selector is only meant to be used during testing.
Package caveats imports 7 packages (graph) and is imported by 21 packages. Updated 2020-09-08. Refresh now. Tools for package owners.