blob: c04ae3a3d205379458095945a0b56d32b170f657 [file] [log] [blame]
Jiri Simsa756772c2015-03-25 15:40:54 -07001// Copyright 2015 The Vanadium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style
3// license that can be found in the LICENSE file.
4
Todd Wang8c4e5cc2015-04-09 11:30:52 -07005// Package discharger defines an interface for obtaining discharges for
6// third-party caveats.
Todd Wang5bcf1c12015-04-03 18:49:40 -07007package discharger
Andres Erbsen975c8832014-06-18 12:06:07 -07008
Jiri Simsa6ac95222015-02-23 16:11:49 -08009import "v.io/v23/security"
Andres Erbsen975c8832014-06-18 12:06:07 -070010
Asim Shankara94e5072014-08-19 18:18:36 -070011// Discharger is the interface for obtaining discharges for ThirdPartyCaveats.
Andres Erbsen975c8832014-06-18 12:06:07 -070012type Discharger interface {
13 // Discharge is called by a principal that holds a blessing with a third
14 // party caveat and seeks to get a discharge that proves the fulfillment of
15 // this caveat.
Asim Shankaref951492015-02-11 11:41:03 -080016 Discharge(Caveat security.Caveat, Impetus security.DischargeImpetus) (Discharge security.WireDischarge | error)
Andres Erbsen975c8832014-06-18 12:06:07 -070017}
Robin Thellend83cd6122015-03-30 10:09:13 -070018
19error (
20 // Indicates that the Caveat does not require a discharge
21 NotAThirdPartyCaveat(c security.Caveat) { "en": "discharges are not required for non-third-party caveats (id: {c.id})" }
22)