blob: c04ae3a3d205379458095945a0b56d32b170f657 [file] [log] [blame] [edit]
// Copyright 2015 The Vanadium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Package discharger defines an interface for obtaining discharges for
// third-party caveats.
package discharger
import "v.io/v23/security"
// Discharger is the interface for obtaining discharges for ThirdPartyCaveats.
type Discharger interface {
// Discharge is called by a principal that holds a blessing with a third
// party caveat and seeks to get a discharge that proves the fulfillment of
// this caveat.
Discharge(Caveat security.Caveat, Impetus security.DischargeImpetus) (Discharge security.WireDischarge | error)
}
error (
// Indicates that the Caveat does not require a discharge
NotAThirdPartyCaveat(c security.Caveat) { "en": "discharges are not required for non-third-party caveats (id: {c.id})" }
)