1// Copyright 2020 The Chromium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5module network.mojom;
6
7import "services/network/public/mojom/cross_origin_embedder_policy.mojom";
8import "services/network/public/mojom/ip_address_space.mojom";
9
10// How to treat private network requests.
11//
12// Private network requests are any requests to a resource served by a
13// non-public IP address.
14//
15// See the CORS-RFC1918 spec for details: https://wicg.github.io/cors-rfc1918.
16enum PrivateNetworkRequestPolicy {
17  // Allow all requests.
18  kAllow,
19
20  // Forbid requests to more-private address spaces than that of the initiator,
21  // when the initiator is not in a secure context.
22  kBlockFromInsecureToMorePrivate,
23};
24
25struct ClientSecurityState {
26  // See: https://html.spec.whatwg.org/multipage/origin.html#coep
27  CrossOriginEmbedderPolicy cross_origin_embedder_policy;
28
29  // Whether the initiator of the requests is in a web secure context.
30  // See: https://developer.mozilla.org/en-US/docs/Web/Security/Secure_Contexts
31  bool is_web_secure_context = false;
32
33  // The initiator's IP AddressSpace.
34  IPAddressSpace ip_address_space = kUnknown;
35
36  // The policy to apply to private network requests.
37  PrivateNetworkRequestPolicy private_network_request_policy = kAllow;
38};
39
40