v.io: v.io/x/ref/services/identity/internal/caveats Index | Files

package caveats

import "v.io/x/ref/services/identity/internal/caveats"

Index

Package Files

browser_caveat_selector.go caveat_factory.go caveat_selector.go mock_caveat_selector.go

Variables

var ErrSeekblessingsCancelled = fmt.Errorf("seekblessings has been cancelled")

type CaveatFactory Uses

type CaveatFactory interface {
    New(caveatInfo CaveatInfo) (security.Caveat, error)
}

func NewCaveatFactory Uses

func NewCaveatFactory() CaveatFactory

type CaveatInfo Uses

type CaveatInfo struct {
    Type string
    Args []interface{}
}

type CaveatSelector Uses

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 Uses

func NewBrowserCaveatSelector(assetsPrefix string) CaveatSelector

NewBrowserCaveatSelector returns a caveat selector that renders a form in the to accept user caveat selections.

func NewMockCaveatSelector Uses

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.