1// Copyright 2023 Google LLC 2// 3// Licensed under the Apache License, Version 2.0 (the "License"); 4// you may not use this file except in compliance with the License. 5// You may obtain a copy of the License at 6// 7// https://www.apache.org/licenses/LICENSE-2.0 8// 9// Unless required by applicable law or agreed to in writing, software 10// distributed under the License is distributed on an "AS-IS" BASIS, 11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12// See the License for the specific language governing permissions and 13// limitations under the License. 14 15syntax = "proto3"; 16 17package privacy.ppn; 18 19import "anonymous_tokens/proto/anonymous_tokens.proto"; 20 21option java_multiple_files = true; 22option java_package = "com.google.privacy.ppn.proto"; 23 24// Contains fields which will be cryptographically linked to a blinded token and 25// visible to client, signer, and verifier. Clients should validate/set fields 26// contained within such that the values are reasonable for the security and 27// privacy constraints of the application. 28message PublicMetadata { 29 // Contains desired exit IP address's declared location. 30 message Location { 31 // TODO(b/268354975): fix copybara regex to strip this line automatically 32 33 // All caps ISO 3166-1 alpha-2. 34 string country = 1; 35 36 // City region geo id if requested by the client. 37 string city_geo_id = 2; 38 } 39 Location exit_location = 1; 40 41 // Indicates which service this token is associated with. 42 string service_type = 2; 43 44 // When the token and metadata expire. 45 anonymous_tokens.Timestamp expiration = 3; 46 47 // Indicates the debug context of this payload. 48 enum DebugMode { 49 UNSPECIFIED_DEBUG_MODE = 0; 50 DEBUG_ALL = 1; 51 } 52 DebugMode debug_mode = 4; 53} 54 55// Contains PublicMetadata and associated information. Only the public_metadata 56// is cryptographically associated with the token. 57message PublicMetadataInfo { 58 PublicMetadata public_metadata = 1; 59 60 // Earliest validation version that this public metadata conforms to. 61 int32 validation_version = 2; 62} 63