blob: 5a65d5e023cd2bcb54ec297a0a057262135d3756 [file] [log] [blame]
// Copyright 2014 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
syntax = "proto2";
package affiliation_pb;
option optimize_for = LITE_RUNTIME;
// The messages below mirror the corresponding messages on the server side.
// These should be updated once the server side changes.
// Synced version: http://shortn/_TgsbdjhbU3
// Contains a list of affiliated facets.
// Affiliated facets are allowed to share credentials among each other.
message Affiliation {
// See the top level comment.
repeated Facet facet = 1;
reserved 2;
}
// A website or Android app within the affiliation.
message Facet {
// URL the uniquely identifies the website or Android app.
optional string id = 1;
// Branding info for this Facet.
optional BrandingInfo branding_info = 2;
// Top private domain of a facet. Exists only if facet ID refers to a website
// (starts with "http://" or "https://").
// See go/internet-domain-name for Top Private Domain definition.
// If no top private domain can be calculated (e.g. for IP addresses), then
// the domain in the facet ID is returned without changes.
// Examples (facet ID -> main_domain):
// http://www.facebook.com -> facebook.com
// https://google.com -> google.com
// http://192.168.0.1 -> 192.168.0.1
// http://somethinginvalid$%#^ -> somethinginvalid$%#^
// android://xyz@com.facebook -> field is not populated
optional string main_domain = 3;
// Info about where the user can change a password stored for this Facet. This
// info should be considered valid for any other Facet in the same FacetGroup.
// Only present for Facets in a FacetGroup.
optional ChangePasswordInfo change_password_info = 4;
}
// Message representing set of facets that should be grouped together in the UI.
message FacetGroup {
// Set of facets that can be grouped together in the UI.
// Do no use this for credential sharing - Affiliation.facet field is intended
// for that.
// Also, see the top level comment of Affiliation message.
repeated Facet facet = 1;
// Branding info (display name and the icon info) for the Group.
optional GroupBrandingInfo group_branding_info = 2;
}
// Branding info (display name and the icon info) for an affiliated group.
message GroupBrandingInfo {
// Display name of the group.
optional string name = 1;
// Eliding info for the name.
optional BrandingInfo.ElideInfo elide_info = 5;
// Icon URL of the group.
optional string icon_url = 2;
// Width and height of the icon. These fields are populated only when we're
// able to find or detect them.
optional int32 icon_width = 3;
optional int32 icon_height = 4;
}
// Branding info for a single facet.
message BrandingInfo {
enum ElideInfo {
UNKNOWN_ELIDE = 0;
// Elide the name from the front if it doesn't fit.
// Example: "https://www.facebook.evildomain.com" -> "...ook.evildomain.com"
ELIDE_FROM_FRONT = 1;
// Elide the name from the back if it doesn't fit.
// Example: "Facebook - The awesome app" -> "Facebook - The awe..."
ELIDE_FROM_BACK = 2;
}
// Display name.
optional string name = 1;
// Eliding info for the name.
optional ElideInfo elide_info = 6;
// Icon URL.
optional string icon_url = 2;
// Width and height of the icon. These fields are populated only when we're
// able to find or detect them.
optional int32 icon_width = 4;
optional int32 icon_height = 5;
}
// Various methods through which a user can change a password for a single
// facet.
message ChangePasswordInfo {
// A URL to a change password form or flow.
optional string change_password_url = 1;
}
// Request mask for LookupAffiliationRequest.
// Next id: 8
message LookupAffiliationMask {
// If true, branding info for all facets will be returned.
optional bool branding_info = 1;
// Preferred size of the icon returned in BrandingInfo or
// GroupBrandingInfo. Applies both to width and height of the image.
// This field can be set only if at least one of branding_info or
// affiliation_branding_info is set to true.
optional int32 preferred_icon_size = 4;
// If set, the display name for the specified locale will be returned.
optional string locale = 2;
// If true, insecure affiliation (e.g. with HTTP websites) will be returned.
// Note that this does not affect the returned grouping information.
optional bool insecure_affiliation = 3;
// If true the information required for password grouping.
optional bool grouping_info = 6;
// If true, an instance of GroupBrandingInfo will be populated in the
// grouping response. Can be set only if grouping_info and branding_info is
// set to true.
optional bool group_branding_info = 5;
// Whether to include change password infos in the response. Can be set only
// if grouping_info is set to true, as this is only populated for FacetGroups.
optional bool change_password_info = 7;
// If true, the entire list of main domains will be populated in the response,
// the server uses the PSL for grouping purposes. This is relevant for
// properly computing main domain or ignoring PSL matches which shouldn't
// share credentials.
optional bool psl_extension_list = 8;
}
// Request message for AffiliationService.Lookup.
message LookupAffiliationRequest {
// Facet IDs to query.
repeated string facet = 1;
// Request mask.
optional LookupAffiliationMask mask = 2;
}
// Response message for AffiliationService.Lookup.
message LookupAffiliationResponse {
// Affiliations containing the requested facets.
repeated Affiliation affiliation = 1;
// Information required for grouping facets in the UI.
repeated FacetGroup group = 2;
}
// Request message for AffiliationService.LookupByHashPrefix.
message LookupAffiliationByHashPrefixRequest {
// Request mask.
optional LookupAffiliationMask mask = 1;
// Number of bits in each hash prefix. Required, request will fail
// if this is not set.
optional uint32 hash_prefix_length = 2;
// The prefixes of the requested hashes. Encoding of the string prior to
// hashing should be UTF-8. SHA256 should be used to calculate the hashes. The
// prefix will be taken as the first 'hash_prefix_length' number of bits
// of this uint64. Other bits will be ignored.
repeated uint64 hash_prefixes = 3;
}
// Response message for AffiliationService.LookupByHashPrefix.
message LookupAffiliationByHashPrefixResponse {
// Affiliations containing facets that match the requested prefixes.
// Affiliations will be deduplicated, i.e. if an affiliation matched multiple
// prefixes only one copy will be returned. No correlation should be assumed
// between the order of returned affiliations and the order of requested
// prefixes.
repeated Affiliation affiliations = 1;
// Information required for grouping facets in the UI. Ordering and
// deplication works the same as for affiliations.
repeated FacetGroup groups = 2;
// The set of domains that the server uses as an extension to the PSL in the
// case the of non-hash-prefix lookups.
repeated string psl_extensions = 3;
}