Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 1 | <html><body> |
| 2 | <style> |
| 3 | |
| 4 | body, 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 | |
| 15 | body { |
| 16 | font-size: 13px; |
| 17 | padding: 1em; |
| 18 | } |
| 19 | |
| 20 | h1 { |
| 21 | font-size: 26px; |
| 22 | margin-bottom: 1em; |
| 23 | } |
| 24 | |
| 25 | h2 { |
| 26 | font-size: 24px; |
| 27 | margin-bottom: 1em; |
| 28 | } |
| 29 | |
| 30 | h3 { |
| 31 | font-size: 20px; |
| 32 | margin-bottom: 1em; |
| 33 | margin-top: 1em; |
| 34 | } |
| 35 | |
| 36 | pre, code { |
| 37 | line-height: 1.5; |
| 38 | font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace; |
| 39 | } |
| 40 | |
| 41 | pre { |
| 42 | margin-top: 0.5em; |
| 43 | } |
| 44 | |
| 45 | h1, h2, h3, p { |
| 46 | font-family: Arial, sans serif; |
| 47 | } |
| 48 | |
| 49 | h1, 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 |
| 84 | the specified source and target assets. |
| 85 | |
| 86 | The relation describes the intent of the link between the two assets as |
| 87 | claimed by the source asset. An example for such relationships is the |
| 88 | delegation of privileges or permissions. |
| 89 | |
| 90 | This command is most often used by infrastructure systems to check |
| 91 | preconditions for an action. For example, a client may want to know if it |
| 92 | is OK to send a web URL to a particular mobile app instead. The client can |
| 93 | check for the relevant asset link from the website to the mobile app to |
| 94 | decide if the operation should be allowed. |
| 95 | |
| 96 | A note about security: if you specify a secure asset as the source, such as |
| 97 | an HTTPS website or an Android app, the API will ensure that any |
| 98 | statements used to generate the response have been made in a secure way by |
| 99 | the owner of that asset. Conversely, if the source asset is an insecure |
| 100 | HTTP website (that is, the URL starts with `http://` instead of |
| 101 | `https://`), the API cannot verify its statements securely, and it is not |
| 102 | possible to ensure that the website's statements have not been altered by a |
| 103 | third party. For more information, see the [Digital Asset Links technical |
| 104 | design |
| 105 | specification](https://github.com/google/digitalassetlinks/blob/master/well-known/details.md). |
| 106 | |
| 107 | Args: |
| 108 | relation: string, Query string for the relation. |
| 109 | |
| 110 | We 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 |
| 113 | specific use case of the statement. |
| 114 | |
| 115 | Refer to [our API documentation](/digital-asset-links/v1/relation-strings) |
| 116 | for the current list of supported relations. |
| 117 | |
| 118 | For a query to match an asset link, both the query's and the asset link's |
| 119 | relation strings must match exactly. |
| 120 | |
| 121 | Example: A query with relation `delegate_permission/common.handle_all_urls` |
| 122 | matches 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 | |
| 131 | or 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 | |
| 137 | In this example, the contents of this field would be `14:6D:E9:83:C5:73: |
| 138 | 06:50:D8:EE:B9:95:2F:34:FC:64:16:A0:83:42:E6:1D:BE:A8:8A:04:96:B2:3F:CF: |
| 139 | 44:E5`. |
| 140 | |
| 141 | If these tools are not available to you, you can convert the PEM |
| 142 | certificate into the DER format, compute the SHA-256 hash of that string |
| 143 | and represent the result as a hexstring (that is, uppercase hexadecimal |
| 144 | representations of each octet, separated by colons). |
| 145 | source_androidApp_packageName: string, Android App assets are naturally identified by their Java package name. |
| 146 | For example, the Google Maps app uses the package name |
| 147 | `com.google.android.apps.maps`. |
| 148 | REQUIRED |
| 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 | |
| 160 | or 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 | |
| 166 | In this example, the contents of this field would be `14:6D:E9:83:C5:73: |
| 167 | 06:50:D8:EE:B9:95:2F:34:FC:64:16:A0:83:42:E6:1D:BE:A8:8A:04:96:B2:3F:CF: |
| 168 | 44:E5`. |
| 169 | |
| 170 | If these tools are not available to you, you can convert the PEM |
| 171 | certificate into the DER format, compute the SHA-256 hash of that string |
| 172 | and represent the result as a hexstring (that is, uppercase hexadecimal |
| 173 | representations of each octet, separated by colons). |
| 174 | target_web_site: string, Web assets are identified by a URL that contains only the scheme, hostname |
| 175 | and port parts. The format is |
| 176 | |
| 177 | http[s]://<hostname>[:<port>] |
| 178 | |
| 179 | Hostnames must be fully qualified: they must end in a single period |
| 180 | ("`.`"). |
| 181 | |
| 182 | Only the schemes "http" and "https" are currently allowed. |
| 183 | |
| 184 | Port numbers are given as a decimal number, and they must be omitted if the |
| 185 | standard port numbers are used: 80 for http and 443 for https. |
| 186 | |
| 187 | We call this limited URL the "site". All URLs that share the same scheme, |
| 188 | hostname and port are considered to be a part of the site and thus belong |
| 189 | to the web asset. |
| 190 | |
| 191 | Example: the asset with the site `https://www.google.com` contains all |
| 192 | these 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 | |
| 201 | But 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) |
| 206 | REQUIRED |
| 207 | target_androidApp_packageName: string, Android App assets are naturally identified by their Java package name. |
| 208 | For example, the Google Maps app uses the package name |
| 209 | `com.google.android.apps.maps`. |
| 210 | REQUIRED |
| 211 | source_web_site: string, Web assets are identified by a URL that contains only the scheme, hostname |
| 212 | and port parts. The format is |
| 213 | |
| 214 | http[s]://<hostname>[:<port>] |
| 215 | |
| 216 | Hostnames must be fully qualified: they must end in a single period |
| 217 | ("`.`"). |
| 218 | |
| 219 | Only the schemes "http" and "https" are currently allowed. |
| 220 | |
| 221 | Port numbers are given as a decimal number, and they must be omitted if the |
| 222 | standard port numbers are used: 80 for http and 443 for https. |
| 223 | |
| 224 | We call this limited URL the "site". All URLs that share the same scheme, |
| 225 | hostname and port are considered to be a part of the site and thus belong |
| 226 | to the web asset. |
| 227 | |
| 228 | Example: the asset with the site `https://www.google.com` contains all |
| 229 | these 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 | |
| 238 | But 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) |
| 243 | REQUIRED |
| 244 | |
| 245 | Returns: |
| 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> |