blob: edf7431eeaef919f0b10738ba6778f5020704790 [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">
78 <code><a href="#check">check(relation=None, source_androidApp_certificate_sha256Fingerprint=None, SHA256=None, source_androidApp_packageName=None, x__xgafv=None, target_androidApp_certificate_sha256Fingerprint=None, SHA256=None, target_web_site=None, target_androidApp_packageName=None, source_web_site=None)</a></code></p>
79<p class="firstline">Determines whether the specified (directional) relationship exists between</p>
80<h3>Method Details</h3>
81<div class="method">
82 <code class="details" id="check">check(relation=None, source_androidApp_certificate_sha256Fingerprint=None, SHA256=None, source_androidApp_packageName=None, x__xgafv=None, target_androidApp_certificate_sha256Fingerprint=None, SHA256=None, target_web_site=None, target_androidApp_packageName=None, source_web_site=None)</code>
83 <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
102possible to ensure that the website's statements have not been altered by a
103third 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:
108 relation: string, Query string for the relation.
109
110We identify relations with strings of the format `<kind>/<detail>`, where
111`<kind>` must be one of a set of pre-defined purpose categories, and
112`<detail>` is a free-form lowercase alphanumeric string that describes the
113specific use case of the statement.
114
115Refer to [our API documentation](/digital-asset-links/v1/relation-strings)
116for the current list of supported relations.
117
118For a query to match an asset link, both the query's and the asset link's
119relation strings must match exactly.
120
121Example: A query with relation `delegate_permission/common.handle_all_urls`
122matches an asset link with relation
123`delegate_permission/common.handle_all_urls`.
124 source_androidApp_certificate_sha256Fingerprint: string, The uppercase SHA-265 fingerprint of the certificate. From the PEM
125 certificate, it can be acquired like this:
126
127 $ keytool -printcert -file $CERTFILE | grep SHA256:
128 SHA256: 14:6D:E9:83:C5:73:06:50:D8:EE:B9:95:2F:34:FC:64:16:A0:83: \
129 42:E6:1D:BE:A8:8A:04:96:B2:3F:CF:44:E5
130
131or like this:
132
133 $ openssl x509 -in $CERTFILE -noout -fingerprint -sha256
134 SHA256 Fingerprint=14:6D:E9:83:C5:73:06:50:D8:EE:B9:95:2F:34:FC:64: \
135 16:A0:83:42:E6:1D:BE:A8:8A:04:96:B2:3F:CF:44:E5
136
137In this example, the contents of this field would be `14:6D:E9:83:C5:73:
13806:50:D8:EE:B9:95:2F:34:FC:64:16:A0:83:42:E6:1D:BE:A8:8A:04:96:B2:3F:CF:
13944:E5`.
140
141If these tools are not available to you, you can convert the PEM
142certificate into the DER format, compute the SHA-256 hash of that string
143and represent the result as a hexstring (that is, uppercase hexadecimal
144representations of each octet, separated by colons).
145 source_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 x__xgafv: string, V1 error format.
150 Allowed values
151 1 - v1 error format
152 2 - v2 error format
153 target_androidApp_certificate_sha256Fingerprint: string, The uppercase SHA-265 fingerprint of the certificate. From the PEM
154 certificate, it can be acquired like this:
155
156 $ keytool -printcert -file $CERTFILE | grep SHA256:
157 SHA256: 14:6D:E9:83:C5:73:06:50:D8:EE:B9:95:2F:34:FC:64:16:A0:83: \
158 42:E6:1D:BE:A8:8A:04:96:B2:3F:CF:44:E5
159
160or like this:
161
162 $ openssl x509 -in $CERTFILE -noout -fingerprint -sha256
163 SHA256 Fingerprint=14:6D:E9:83:C5:73:06:50:D8:EE:B9:95:2F:34:FC:64: \
164 16:A0:83:42:E6:1D:BE:A8:8A:04:96:B2:3F:CF:44:E5
165
166In this example, the contents of this field would be `14:6D:E9:83:C5:73:
16706:50:D8:EE:B9:95:2F:34:FC:64:16:A0:83:42:E6:1D:BE:A8:8A:04:96:B2:3F:CF:
16844:E5`.
169
170If these tools are not available to you, you can convert the PEM
171certificate into the DER format, compute the SHA-256 hash of that string
172and represent the result as a hexstring (that is, uppercase hexadecimal
173representations of each octet, separated by colons).
174 target_web_site: string, Web assets are identified by a URL that contains only the scheme, hostname
175and port parts. The format is
176
177 http[s]://<hostname>[:<port>]
178
179Hostnames must be fully qualified: they must end in a single period
180("`.`").
181
182Only the schemes "http" and "https" are currently allowed.
183
184Port numbers are given as a decimal number, and they must be omitted if the
185standard port numbers are used: 80 for http and 443 for https.
186
187We call this limited URL the "site". All URLs that share the same scheme,
188hostname and port are considered to be a part of the site and thus belong
189to the web asset.
190
191Example: the asset with the site `https://www.google.com` contains all
192these URLs:
193
194 * `https://www.google.com/`
195 * `https://www.google.com:443/`
196 * `https://www.google.com/foo`
197 * `https://www.google.com/foo?bar`
198 * `https://www.google.com/foo#bar`
199 * `https://user@password:www.google.com/`
200
201But it does not contain these URLs:
202
203 * `http://www.google.com/` (wrong scheme)
204 * `https://google.com/` (hostname does not match)
205 * `https://www.google.com:444/` (port does not match)
206REQUIRED
207 target_androidApp_packageName: string, Android App assets are naturally identified by their Java package name.
208For example, the Google Maps app uses the package name
209`com.google.android.apps.maps`.
210REQUIRED
211 source_web_site: string, Web assets are identified by a URL that contains only the scheme, hostname
212and port parts. The format is
213
214 http[s]://<hostname>[:<port>]
215
216Hostnames must be fully qualified: they must end in a single period
217("`.`").
218
219Only the schemes "http" and "https" are currently allowed.
220
221Port numbers are given as a decimal number, and they must be omitted if the
222standard port numbers are used: 80 for http and 443 for https.
223
224We call this limited URL the "site". All URLs that share the same scheme,
225hostname and port are considered to be a part of the site and thus belong
226to the web asset.
227
228Example: the asset with the site `https://www.google.com` contains all
229these URLs:
230
231 * `https://www.google.com/`
232 * `https://www.google.com:443/`
233 * `https://www.google.com/foo`
234 * `https://www.google.com/foo?bar`
235 * `https://www.google.com/foo#bar`
236 * `https://user@password:www.google.com/`
237
238But it does not contain these URLs:
239
240 * `http://www.google.com/` (wrong scheme)
241 * `https://google.com/` (hostname does not match)
242 * `https://www.google.com:444/` (port does not match)
243REQUIRED
244
245Returns:
246 An object of the form:
247
248 { # Response message for the CheckAssetLinks call.
249 "errorCode": [ # Error codes that describe the result of the Check operation.
250 "A String",
251 ],
252 "maxAge": "A String", # From serving time, how much longer the response should be considered valid
253 # barring further updates.
254 # REQUIRED
255 "linked": True or False, # Set to true if the assets specified in the request are linked by the
256 # relation specified in the request.
257 "debugString": "A String", # Human-readable message containing information intended to help end users
258 # 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.
268 }</pre>
269</div>
270
271</body></html>