blob: 293e622362445c56f2eda207593080b07169b00d [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 Kimd059ad82020-07-22 17:02:09 -070078 <code><a href="#check">check(source_androidApp_certificate_sha256Fingerprint=None, SHA256=None, source_web_site=None, target_androidApp_certificate_sha256Fingerprint=None, SHA256=None, target_web_site=None, source_androidApp_packageName=None, target_androidApp_packageName=None, relation=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 Kimd059ad82020-07-22 17:02:09 -070082 <code class="details" id="check">check(source_androidApp_certificate_sha256Fingerprint=None, SHA256=None, source_web_site=None, target_androidApp_certificate_sha256Fingerprint=None, SHA256=None, target_web_site=None, source_androidApp_packageName=None, target_androidApp_packageName=None, relation=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 Kim65020912020-05-20 12:08:20 -0700108 source_androidApp_certificate_sha256Fingerprint: string, The uppercase SHA-265 fingerprint of the certificate. From the PEM
109 certificate, it can be acquired like this:
110
111 $ keytool -printcert -file $CERTFILE | grep SHA256:
112 SHA256: 14:6D:E9:83:C5:73:06:50:D8:EE:B9:95:2F:34:FC:64:16:A0:83: \
113 42:E6:1D:BE:A8:8A:04:96:B2:3F:CF:44:E5
114
115or like this:
116
117 $ openssl x509 -in $CERTFILE -noout -fingerprint -sha256
118 SHA256 Fingerprint=14:6D:E9:83:C5:73:06:50:D8:EE:B9:95:2F:34:FC:64: \
119 16:A0:83:42:E6:1D:BE:A8:8A:04:96:B2:3F:CF:44:E5
120
121In this example, the contents of this field would be `14:6D:E9:83:C5:73:
12206:50:D8:EE:B9:95:2F:34:FC:64:16:A0:83:42:E6:1D:BE:A8:8A:04:96:B2:3F:CF:
12344:E5`.
124
125If these tools are not available to you, you can convert the PEM
126certificate into the DER format, compute the SHA-256 hash of that string
127and represent the result as a hexstring (that is, uppercase hexadecimal
128representations of each octet, separated by colons).
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700129 source_web_site: string, Web assets are identified by a URL that contains only the scheme, hostname
Bu Sun Kim65020912020-05-20 12:08:20 -0700130and port parts. The format is
131
132 http[s]://&lt;hostname&gt;[:&lt;port&gt;]
133
134Hostnames must be fully qualified: they must end in a single period
135(&quot;`.`&quot;).
136
137Only the schemes &quot;http&quot; and &quot;https&quot; are currently allowed.
138
139Port numbers are given as a decimal number, and they must be omitted if the
140standard port numbers are used: 80 for http and 443 for https.
141
142We call this limited URL the &quot;site&quot;. All URLs that share the same scheme,
143hostname and port are considered to be a part of the site and thus belong
144to the web asset.
145
146Example: the asset with the site `https://www.google.com` contains all
147these URLs:
148
149 * `https://www.google.com/`
150 * `https://www.google.com:443/`
151 * `https://www.google.com/foo`
152 * `https://www.google.com/foo?bar`
153 * `https://www.google.com/foo#bar`
154 * `https://user@password:www.google.com/`
155
156But it does not contain these URLs:
157
158 * `http://www.google.com/` (wrong scheme)
159 * `https://google.com/` (hostname does not match)
160 * `https://www.google.com:444/` (port does not match)
161REQUIRED
162 target_androidApp_certificate_sha256Fingerprint: string, The uppercase SHA-265 fingerprint of the certificate. From the PEM
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700163 certificate, it can be acquired like this:
164
165 $ keytool -printcert -file $CERTFILE | grep SHA256:
166 SHA256: 14:6D:E9:83:C5:73:06:50:D8:EE:B9:95:2F:34:FC:64:16:A0:83: \
167 42:E6:1D:BE:A8:8A:04:96:B2:3F:CF:44:E5
168
169or like this:
170
171 $ openssl x509 -in $CERTFILE -noout -fingerprint -sha256
172 SHA256 Fingerprint=14:6D:E9:83:C5:73:06:50:D8:EE:B9:95:2F:34:FC:64: \
173 16:A0:83:42:E6:1D:BE:A8:8A:04:96:B2:3F:CF:44:E5
174
175In this example, the contents of this field would be `14:6D:E9:83:C5:73:
17606:50:D8:EE:B9:95:2F:34:FC:64:16:A0:83:42:E6:1D:BE:A8:8A:04:96:B2:3F:CF:
17744:E5`.
178
179If these tools are not available to you, you can convert the PEM
180certificate into the DER format, compute the SHA-256 hash of that string
181and represent the result as a hexstring (that is, uppercase hexadecimal
182representations of each octet, separated by colons).
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700183 target_web_site: string, Web assets are identified by a URL that contains only the scheme, hostname
184and port parts. The format is
185
186 http[s]://&lt;hostname&gt;[:&lt;port&gt;]
187
188Hostnames must be fully qualified: they must end in a single period
189(&quot;`.`&quot;).
190
191Only the schemes &quot;http&quot; and &quot;https&quot; are currently allowed.
192
193Port numbers are given as a decimal number, and they must be omitted if the
194standard port numbers are used: 80 for http and 443 for https.
195
196We call this limited URL the &quot;site&quot;. All URLs that share the same scheme,
197hostname and port are considered to be a part of the site and thus belong
198to the web asset.
199
200Example: the asset with the site `https://www.google.com` contains all
201these URLs:
202
203 * `https://www.google.com/`
204 * `https://www.google.com:443/`
205 * `https://www.google.com/foo`
206 * `https://www.google.com/foo?bar`
207 * `https://www.google.com/foo#bar`
208 * `https://user@password:www.google.com/`
209
210But it does not contain these URLs:
211
212 * `http://www.google.com/` (wrong scheme)
213 * `https://google.com/` (hostname does not match)
214 * `https://www.google.com:444/` (port does not match)
215REQUIRED
216 source_androidApp_packageName: string, Android App assets are naturally identified by their Java package name.
217For example, the Google Maps app uses the package name
218`com.google.android.apps.maps`.
219REQUIRED
220 target_androidApp_packageName: string, Android App assets are naturally identified by their Java package name.
221For example, the Google Maps app uses the package name
222`com.google.android.apps.maps`.
223REQUIRED
224 relation: string, Query string for the relation.
225
226We identify relations with strings of the format `&lt;kind&gt;/&lt;detail&gt;`, where
227`&lt;kind&gt;` must be one of a set of pre-defined purpose categories, and
228`&lt;detail&gt;` is a free-form lowercase alphanumeric string that describes the
229specific use case of the statement.
230
231Refer to [our API documentation](/digital-asset-links/v1/relation-strings)
232for the current list of supported relations.
233
234For a query to match an asset link, both the query&#x27;s and the asset link&#x27;s
235relation strings must match exactly.
236
237Example: A query with relation `delegate_permission/common.handle_all_urls`
238matches an asset link with relation
239`delegate_permission/common.handle_all_urls`.
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 Kim65020912020-05-20 12:08:20 -0700249 &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 -0700250 # understand, reproduce and debug the result.
251 #
252 #
253 # The message will be in English and we are currently not planning to offer
254 # any translations.
255 #
256 # Please note that no guarantees are made about the contents or format of
257 # this string. Any aspect of it may be subject to change without notice.
258 # You should not attempt to programmatically parse this data. For
259 # programmatic access, use the error_code field below.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700260 &quot;maxAge&quot;: &quot;A String&quot;, # From serving time, how much longer the response should be considered valid
261 # barring further updates.
262 # REQUIRED
263 &quot;errorCode&quot;: [ # Error codes that describe the result of the Check operation.
264 &quot;A String&quot;,
265 ],
266 &quot;linked&quot;: True or False, # Set to true if the assets specified in the request are linked by the
267 # relation specified in the request.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700268 }</pre>
269</div>
270
271</body></html>