| // 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 caveat |
| |
| import ( |
| "v.io/v23/uniqueid" |
| "v.io/v23/security" |
| ) |
| |
| type CaveatThatValidatesData struct { |
| A int64 |
| B string |
| } |
| |
| const ( |
| CaveatThatValidates = security.CaveatDescriptor{ |
| Id: uniqueid.Id{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}, |
| ParamType: typeobject(CaveatThatValidatesData), |
| } |
| |
| CaveatDoesntValidate = security.CaveatDescriptor{ |
| Id: uniqueid.Id{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1}, |
| ParamType: typeobject(int32), |
| } |
| |
| CaveatWithCollision = security.CaveatDescriptor{ |
| Id: uniqueid.Id{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}, |
| ParamType: typeobject(float64), |
| } |
| ) |
| |
| // Expected data for the tests. |
| const( |
| CaveatThatValidatesExpectedData = CaveatThatValidatesData{5, "AString"} |
| CaveatDoesntValidateExpectedData = int32(3) |
| CaveatWithCollisionExpectedData = float64(9.4) |
| ) |