blob: 92eb8387a695b14421c138902f9aa3fead686d02 [file] [log] [blame]
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001<html><body>
2<style>
3
4body, h1, h2, h3, div, span, p, pre, a {
5 margin: 0;
6 padding: 0;
7 border: 0;
8 font-weight: inherit;
9 font-style: inherit;
10 font-size: 100%;
11 font-family: inherit;
12 vertical-align: baseline;
13}
14
15body {
16 font-size: 13px;
17 padding: 1em;
18}
19
20h1 {
21 font-size: 26px;
22 margin-bottom: 1em;
23}
24
25h2 {
26 font-size: 24px;
27 margin-bottom: 1em;
28}
29
30h3 {
31 font-size: 20px;
32 margin-bottom: 1em;
33 margin-top: 1em;
34}
35
36pre, code {
37 line-height: 1.5;
38 font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace;
39}
40
41pre {
42 margin-top: 0.5em;
43}
44
45h1, h2, h3, p {
46 font-family: Arial, sans serif;
47}
48
49h1, h2, h3 {
50 border-bottom: solid #CCC 1px;
51}
52
53.toc_element {
54 margin-top: 0.5em;
55}
56
57.firstline {
58 margin-left: 2 em;
59}
60
61.method {
62 margin-top: 1em;
63 border: solid 1px #CCC;
64 padding: 1em;
65 background: #EEE;
66}
67
68.details {
69 font-weight: bold;
70 font-size: 14px;
71}
72
73</style>
74
75<h1><a href="digitalassetlinks_v1.html">Digital Asset Links API</a> . <a href="digitalassetlinks_v1.assetlinks.html">assetlinks</a></h1>
76<h2>Instance Methods</h2>
77<p class="toc_element">
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -070078 <code><a href="#check">check(source_androidApp_packageName=None, source_web_site=None, target_androidApp_packageName=None, source_androidApp_certificate_sha256Fingerprint=None, SHA256=None, relation=None, target_web_site=None, target_androidApp_certificate_sha256Fingerprint=None, SHA256=None, x__xgafv=None)</a></code></p>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070079<p class="firstline">Determines whether the specified (directional) relationship exists between</p>
80<h3>Method Details</h3>
81<div class="method">
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -070082 <code class="details" id="check">check(source_androidApp_packageName=None, source_web_site=None, target_androidApp_packageName=None, source_androidApp_certificate_sha256Fingerprint=None, SHA256=None, relation=None, target_web_site=None, target_androidApp_certificate_sha256Fingerprint=None, SHA256=None, x__xgafv=None)</code>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070083 <pre>Determines whether the specified (directional) relationship exists between
84the specified source and target assets.
85
86The relation describes the intent of the link between the two assets as
87claimed by the source asset. An example for such relationships is the
88delegation of privileges or permissions.
89
90This command is most often used by infrastructure systems to check
91preconditions for an action. For example, a client may want to know if it
92is OK to send a web URL to a particular mobile app instead. The client can
93check for the relevant asset link from the website to the mobile app to
94decide if the operation should be allowed.
95
96A note about security: if you specify a secure asset as the source, such as
97an HTTPS website or an Android app, the API will ensure that any
98statements used to generate the response have been made in a secure way by
99the owner of that asset. Conversely, if the source asset is an insecure
100HTTP website (that is, the URL starts with `http://` instead of
101`https://`), the API cannot verify its statements securely, and it is not
Bu Sun Kim65020912020-05-20 12:08:20 -0700102possible to ensure that the website&#x27;s statements have not been altered by a
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700103third party. For more information, see the [Digital Asset Links technical
104design
105specification](https://github.com/google/digitalassetlinks/blob/master/well-known/details.md).
106
107Args:
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700108 source_androidApp_packageName: string, Android App assets are naturally identified by their Java package name.
109For example, the Google Maps app uses the package name
110`com.google.android.apps.maps`.
111REQUIRED
112 source_web_site: string, Web assets are identified by a URL that contains only the scheme, hostname
113and port parts. The format is
114
115 http[s]://&lt;hostname&gt;[:&lt;port&gt;]
116
117Hostnames must be fully qualified: they must end in a single period
118(&quot;`.`&quot;).
119
120Only the schemes &quot;http&quot; and &quot;https&quot; are currently allowed.
121
122Port numbers are given as a decimal number, and they must be omitted if the
123standard port numbers are used: 80 for http and 443 for https.
124
125We call this limited URL the &quot;site&quot;. All URLs that share the same scheme,
126hostname and port are considered to be a part of the site and thus belong
127to the web asset.
128
129Example: the asset with the site `https://www.google.com` contains all
130these URLs:
131
132 * `https://www.google.com/`
133 * `https://www.google.com:443/`
134 * `https://www.google.com/foo`
135 * `https://www.google.com/foo?bar`
136 * `https://www.google.com/foo#bar`
137 * `https://user@password:www.google.com/`
138
139But it does not contain these URLs:
140
141 * `http://www.google.com/` (wrong scheme)
142 * `https://google.com/` (hostname does not match)
143 * `https://www.google.com:444/` (port does not match)
144REQUIRED
Bu Sun Kim65020912020-05-20 12:08:20 -0700145 target_androidApp_packageName: string, Android App assets are naturally identified by their Java package name.
146For example, the Google Maps app uses the package name
147`com.google.android.apps.maps`.
148REQUIRED
149 source_androidApp_certificate_sha256Fingerprint: string, The uppercase SHA-265 fingerprint of the certificate. From the PEM
150 certificate, it can be acquired like this:
151
152 $ keytool -printcert -file $CERTFILE | grep SHA256:
153 SHA256: 14:6D:E9:83:C5:73:06:50:D8:EE:B9:95:2F:34:FC:64:16:A0:83: \
154 42:E6:1D:BE:A8:8A:04:96:B2:3F:CF:44:E5
155
156or like this:
157
158 $ openssl x509 -in $CERTFILE -noout -fingerprint -sha256
159 SHA256 Fingerprint=14:6D:E9:83:C5:73:06:50:D8:EE:B9:95:2F:34:FC:64: \
160 16:A0:83:42:E6:1D:BE:A8:8A:04:96:B2:3F:CF:44:E5
161
162In this example, the contents of this field would be `14:6D:E9:83:C5:73:
16306:50:D8:EE:B9:95:2F:34:FC:64:16:A0:83:42:E6:1D:BE:A8:8A:04:96:B2:3F:CF:
16444:E5`.
165
166If these tools are not available to you, you can convert the PEM
167certificate into the DER format, compute the SHA-256 hash of that string
168and represent the result as a hexstring (that is, uppercase hexadecimal
169representations of each octet, separated by colons).
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700170 relation: string, Query string for the relation.
171
Dan O'Mearadd494642020-05-01 07:42:23 -0700172We identify relations with strings of the format `&lt;kind&gt;/&lt;detail&gt;`, where
173`&lt;kind&gt;` must be one of a set of pre-defined purpose categories, and
174`&lt;detail&gt;` is a free-form lowercase alphanumeric string that describes the
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700175specific use case of the statement.
176
177Refer to [our API documentation](/digital-asset-links/v1/relation-strings)
178for the current list of supported relations.
179
Bu Sun Kim65020912020-05-20 12:08:20 -0700180For a query to match an asset link, both the query&#x27;s and the asset link&#x27;s
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700181relation strings must match exactly.
182
183Example: A query with relation `delegate_permission/common.handle_all_urls`
184matches an asset link with relation
185`delegate_permission/common.handle_all_urls`.
Bu Sun Kim65020912020-05-20 12:08:20 -0700186 target_web_site: string, Web assets are identified by a URL that contains only the scheme, hostname
187and port parts. The format is
188
189 http[s]://&lt;hostname&gt;[:&lt;port&gt;]
190
191Hostnames must be fully qualified: they must end in a single period
192(&quot;`.`&quot;).
193
194Only the schemes &quot;http&quot; and &quot;https&quot; are currently allowed.
195
196Port numbers are given as a decimal number, and they must be omitted if the
197standard port numbers are used: 80 for http and 443 for https.
198
199We call this limited URL the &quot;site&quot;. All URLs that share the same scheme,
200hostname and port are considered to be a part of the site and thus belong
201to the web asset.
202
203Example: the asset with the site `https://www.google.com` contains all
204these URLs:
205
206 * `https://www.google.com/`
207 * `https://www.google.com:443/`
208 * `https://www.google.com/foo`
209 * `https://www.google.com/foo?bar`
210 * `https://www.google.com/foo#bar`
211 * `https://user@password:www.google.com/`
212
213But it does not contain these URLs:
214
215 * `http://www.google.com/` (wrong scheme)
216 * `https://google.com/` (hostname does not match)
217 * `https://www.google.com:444/` (port does not match)
218REQUIRED
219 target_androidApp_certificate_sha256Fingerprint: string, The uppercase SHA-265 fingerprint of the certificate. From the PEM
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700220 certificate, it can be acquired like this:
221
222 $ keytool -printcert -file $CERTFILE | grep SHA256:
223 SHA256: 14:6D:E9:83:C5:73:06:50:D8:EE:B9:95:2F:34:FC:64:16:A0:83: \
224 42:E6:1D:BE:A8:8A:04:96:B2:3F:CF:44:E5
225
226or like this:
227
228 $ openssl x509 -in $CERTFILE -noout -fingerprint -sha256
229 SHA256 Fingerprint=14:6D:E9:83:C5:73:06:50:D8:EE:B9:95:2F:34:FC:64: \
230 16:A0:83:42:E6:1D:BE:A8:8A:04:96:B2:3F:CF:44:E5
231
232In this example, the contents of this field would be `14:6D:E9:83:C5:73:
23306:50:D8:EE:B9:95:2F:34:FC:64:16:A0:83:42:E6:1D:BE:A8:8A:04:96:B2:3F:CF:
23444:E5`.
235
236If these tools are not available to you, you can convert the PEM
237certificate into the DER format, compute the SHA-256 hash of that string
238and represent the result as a hexstring (that is, uppercase hexadecimal
239representations of each octet, separated by colons).
Bu Sun Kim65020912020-05-20 12:08:20 -0700240 x__xgafv: string, V1 error format.
241 Allowed values
242 1 - v1 error format
243 2 - v2 error format
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700244
245Returns:
246 An object of the form:
247
248 { # Response message for the CheckAssetLinks call.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700249 &quot;maxAge&quot;: &quot;A String&quot;, # From serving time, how much longer the response should be considered valid
250 # barring further updates.
251 # REQUIRED
252 &quot;errorCode&quot;: [ # Error codes that describe the result of the Check operation.
253 &quot;A String&quot;,
254 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700255 &quot;linked&quot;: True or False, # Set to true if the assets specified in the request are linked by the
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700256 # relation specified in the request.
Bu Sun Kim65020912020-05-20 12:08:20 -0700257 &quot;debugString&quot;: &quot;A String&quot;, # Human-readable message containing information intended to help end users
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700258 # understand, reproduce and debug the result.
259 #
260 #
261 # The message will be in English and we are currently not planning to offer
262 # any translations.
263 #
264 # Please note that no guarantees are made about the contents or format of
265 # this string. Any aspect of it may be subject to change without notice.
266 # You should not attempt to programmatically parse this data. For
267 # programmatic access, use the error_code field below.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700268 }</pre>
269</div>
270
271</body></html>