Jiri Simsa | 756772c | 2015-03-25 15:40:54 -0700 | [diff] [blame] | 1 | // 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 Wang | 8c4e5cc | 2015-04-09 11:30:52 -0700 | [diff] [blame] | 5 | // Package discharger defines an interface for obtaining discharges for |
| 6 | // third-party caveats. |
Todd Wang | 5bcf1c1 | 2015-04-03 18:49:40 -0700 | [diff] [blame] | 7 | package discharger |
Andres Erbsen | 975c883 | 2014-06-18 12:06:07 -0700 | [diff] [blame] | 8 | |
Jiri Simsa | 6ac9522 | 2015-02-23 16:11:49 -0800 | [diff] [blame] | 9 | import "v.io/v23/security" |
Andres Erbsen | 975c883 | 2014-06-18 12:06:07 -0700 | [diff] [blame] | 10 | |
Asim Shankar | a94e507 | 2014-08-19 18:18:36 -0700 | [diff] [blame] | 11 | // Discharger is the interface for obtaining discharges for ThirdPartyCaveats. |
Andres Erbsen | 975c883 | 2014-06-18 12:06:07 -0700 | [diff] [blame] | 12 | type 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 Shankar | ef95149 | 2015-02-11 11:41:03 -0800 | [diff] [blame] | 16 | Discharge(Caveat security.Caveat, Impetus security.DischargeImpetus) (Discharge security.WireDischarge | error) |
Andres Erbsen | 975c883 | 2014-06-18 12:06:07 -0700 | [diff] [blame] | 17 | } |
Robin Thellend | 83cd612 | 2015-03-30 10:09:13 -0700 | [diff] [blame] | 18 | |
| 19 | error ( |
| 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 | ) |