@powercred/liveness-web 0.0.0-stage → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +282 -2
- package/THIRD_PARTY_NOTICES.txt +216 -0
- package/dist/assets/liveness-face.bin +0 -0
- package/dist/assets/liveness-runtime-compat.js +20 -0
- package/dist/assets/liveness-runtime-compat.wasm +0 -0
- package/dist/assets/liveness-runtime.js +20 -0
- package/dist/assets/liveness-runtime.wasm +0 -0
- package/dist/index.d.ts +11 -0
- package/dist/liveness-device-C5ygqTPx.js +3741 -0
- package/dist/liveness.iife.js +70 -0
- package/dist/liveness.js +645 -0
- package/dist/sdk.d.ts +31 -0
- package/dist/types.d.ts +138 -0
- package/dist/ui/strings.d.ts +42 -0
- package/package.json +16 -4
package/README.md
CHANGED
|
@@ -1,3 +1,283 @@
|
|
|
1
|
-
#
|
|
1
|
+
# PowerCred Liveness for the web
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
`@powercred/liveness-web` adds PowerCred's liveness check to your web page. The person centres
|
|
4
|
+
their face, performs a few simple moves (turn, nod, smile), and holds still while the screen shows
|
|
5
|
+
a few colours. The SDK records the check, sends it to PowerCred, and tells you the result.
|
|
6
|
+
|
|
7
|
+
**PowerCred decides.** The browser follows each move to guide the person and catch mistakes early.
|
|
8
|
+
The verdict always comes from the PowerCred API, and your backend should read it from there before
|
|
9
|
+
acting on it.
|
|
10
|
+
|
|
11
|
+
For how the check works and its options, see the overview. For the backend calls, see
|
|
12
|
+
the API reference.
|
|
13
|
+
|
|
14
|
+
## Contents
|
|
15
|
+
|
|
16
|
+
- [Requirements](#requirements)
|
|
17
|
+
- [Install](#install)
|
|
18
|
+
- [Quick start](#quick-start)
|
|
19
|
+
- [Hosting the assets folder](#hosting-the-assets-folder)
|
|
20
|
+
- [Options](#options)
|
|
21
|
+
- [The result](#the-result)
|
|
22
|
+
- [Events](#events)
|
|
23
|
+
- [Customising the look and text](#customising-the-look-and-text)
|
|
24
|
+
- [Content security policy](#content-security-policy)
|
|
25
|
+
- [Iframes and single-page apps](#iframes-and-single-page-apps)
|
|
26
|
+
|
|
27
|
+
## Requirements
|
|
28
|
+
|
|
29
|
+
- **HTTPS.** Browsers only give camera access to secure pages (`http://localhost` also works for
|
|
30
|
+
development).
|
|
31
|
+
- **A supported browser:** Chrome or Edge 110+, Safari 15.4+ (iOS included), or Firefox 115+.
|
|
32
|
+
In-app browsers that block the camera are not supported.
|
|
33
|
+
- **A front camera.** Desktop webcams work too.
|
|
34
|
+
- **A backend** that can call the PowerCred API with your API key. The API key must never be put
|
|
35
|
+
in a web page.
|
|
36
|
+
|
|
37
|
+
## Install
|
|
38
|
+
|
|
39
|
+
**With npm** (for bundlers such as Vite, webpack or Next.js):
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
npm install @powercred/liveness-web
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
**With a script tag:** host the contents of the package's `dist` folder on your site, including
|
|
46
|
+
the `assets` folder, and load the script build. It defines `window.PowerCredLiveness`.
|
|
47
|
+
|
|
48
|
+
```html
|
|
49
|
+
<script src="/vendor/powercred/liveness.iife.js"></script>
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## Quick start
|
|
53
|
+
|
|
54
|
+
### 1. Create a session on your server
|
|
55
|
+
|
|
56
|
+
This is the only step on your side that isn't in the browser: one call from your own server to the
|
|
57
|
+
PowerCred API, which returns a session for this check. It stays on your server because it uses
|
|
58
|
+
your API key, which must never be put in a web page. The SDK does everything else: the camera,
|
|
59
|
+
the moves, the recording and the upload.
|
|
60
|
+
|
|
61
|
+
```js
|
|
62
|
+
// Your server (Node.js shown; any language works)
|
|
63
|
+
app.post('/api/liveness-session', async (req, res) => {
|
|
64
|
+
const r = await fetch(`https://<api-host>/kyc/id/liveness/sessions?apikey=${process.env.POWERCRED_API_KEY}`, {
|
|
65
|
+
method: 'POST',
|
|
66
|
+
headers: { 'Content-Type': 'application/json' },
|
|
67
|
+
body: JSON.stringify({ user_id: req.user.id, platform: 'web' }),
|
|
68
|
+
})
|
|
69
|
+
const session = await r.json()
|
|
70
|
+
// Store session.liveness_session_id with the user, then hand the whole session to the page.
|
|
71
|
+
res.status(r.status).json(session)
|
|
72
|
+
})
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
### 2. Run the check in your page
|
|
76
|
+
|
|
77
|
+
```html
|
|
78
|
+
<div id="liveness"></div>
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
```ts
|
|
82
|
+
import { PowerCredLiveness } from '@powercred/liveness-web'
|
|
83
|
+
|
|
84
|
+
const check = new PowerCredLiveness({
|
|
85
|
+
baseUrl: 'https://<api-host>/kyc',
|
|
86
|
+
sessionProvider: () => fetch('/api/liveness-session', { method: 'POST' }).then(r => r.json()),
|
|
87
|
+
})
|
|
88
|
+
|
|
89
|
+
const result = await check.start(document.getElementById('liveness')!)
|
|
90
|
+
|
|
91
|
+
if (result.status === 'passed') {
|
|
92
|
+
// Tell your backend, which confirms it with PowerCred (step 3).
|
|
93
|
+
}
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
With the script tag, the code is the same except that the class comes from
|
|
97
|
+
`window.PowerCredLiveness`:
|
|
98
|
+
|
|
99
|
+
```html
|
|
100
|
+
<script>
|
|
101
|
+
const check = new PowerCredLiveness.PowerCredLiveness({ baseUrl, sessionProvider })
|
|
102
|
+
</script>
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
### 3. Confirm the result from your backend
|
|
106
|
+
|
|
107
|
+
```bash
|
|
108
|
+
curl "https://<api-host>/kyc/id/liveness/sessions/<liveness_session_id>?apikey=$API_KEY"
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
Approve the person only if this returns `"status": "passed"`. See the
|
|
112
|
+
API reference.
|
|
113
|
+
|
|
114
|
+
## Hosting the assets folder
|
|
115
|
+
|
|
116
|
+
For live feedback, the SDK loads a few files from its `assets` folder: a small runtime and a face
|
|
117
|
+
model, about 13 MB in total. Serve them with a long cache lifetime so that browsers download them
|
|
118
|
+
only once.
|
|
119
|
+
|
|
120
|
+
- **Script tag:** keep `assets` next to `liveness.iife.js`. The SDK finds it by itself.
|
|
121
|
+
- **npm with a bundler:** bundlers don't copy the folder, so copy
|
|
122
|
+
`node_modules/@powercred/liveness-web/dist/assets` to your public folder as part of your build,
|
|
123
|
+
and tell the SDK where it is:
|
|
124
|
+
|
|
125
|
+
```ts
|
|
126
|
+
new PowerCredLiveness({ baseUrl, sessionProvider, assetsUrl: '/powercred-assets/' })
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
If the files cannot be loaded, the check still works: the SDK switches to timed prompts and
|
|
130
|
+
reports this through the `mode` event, with `fallbackReason: "model_unavailable"`.
|
|
131
|
+
|
|
132
|
+
Serve `.wasm` files as `application/wasm` (most servers and CDNs already do).
|
|
133
|
+
|
|
134
|
+
## Options
|
|
135
|
+
|
|
136
|
+
```ts
|
|
137
|
+
new PowerCredLiveness(options)
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
| Option | Default | Description |
|
|
141
|
+
|---|---|---|
|
|
142
|
+
| `baseUrl` | required | The PowerCred API base, for example `https://<api-host>/kyc` |
|
|
143
|
+
| `session` | | The session your backend created, if you already have it |
|
|
144
|
+
| `sessionProvider` | | An async function that returns a session from your backend. One of `session` or `sessionProvider` is required. |
|
|
145
|
+
| `waitForServer` | `true` | `true`: `start()` resolves with PowerCred's verdict. `false`: it resolves as soon as the recording is finished (`status: "submitted"`) while the upload continues in the background. Keep the page open, and don't call `destroy()`, until `onServerResult` is called. The verdict also reaches your backend. |
|
|
146
|
+
| `flash` | `true` | `false` skips the colour sequence even if the session asks for it |
|
|
147
|
+
| `assetsUrl` | `assets/` next to the SDK | Where the [assets folder](#hosting-the-assets-folder) is served from |
|
|
148
|
+
| `timedWindowSeconds` | `3.5` | Seconds per move when the browser shows timed prompts |
|
|
149
|
+
| `maxLocalRetries` | `2` | How many times the person may restart after a problem the browser catches (wrong way, face lost, too slow). These restarts don't use up attempts. Leaving the page mid-check (another tab or app) also restarts the attempt, but never counts towards this limit. |
|
|
150
|
+
| `showResult` | `true` | Show the built-in final screen (passed, failed or error). Set `false` to show your own when `start()` resolves. The prompts, and "Try again" between attempts, still appear. |
|
|
151
|
+
| `strings` | English | Replace any on-screen text. See [Customising](#customising-the-look-and-text). |
|
|
152
|
+
| `theme` | | `{ primaryColor, fontFamily }` |
|
|
153
|
+
| `onEvent` | | Called with [progress events](#events) |
|
|
154
|
+
| `onServerResult` | | Called with PowerCred's verdict for each uploaded attempt |
|
|
155
|
+
|
|
156
|
+
The session your backend creates decides the moves, the colour sequence, and whether the browser
|
|
157
|
+
follows the moves live (`client_checks: "device"`, the default) or shows timed prompts
|
|
158
|
+
(`client_checks: "none"`). See Choosing how the check runs.
|
|
159
|
+
|
|
160
|
+
### Methods
|
|
161
|
+
|
|
162
|
+
| Method | Description |
|
|
163
|
+
|---|---|
|
|
164
|
+
| `start(container)` | Shows the check inside `container` and resolves with the [result](#the-result) once it is finished. It never rejects for problems the person can see. Those resolve with `status: "error"`. |
|
|
165
|
+
| `cancel()` | Stops a running check. `start()` then resolves with `status: "cancelled"`. |
|
|
166
|
+
| `destroy()` | Cancels, switches off the camera and removes the UI |
|
|
167
|
+
|
|
168
|
+
## The result
|
|
169
|
+
|
|
170
|
+
```ts
|
|
171
|
+
{
|
|
172
|
+
status: 'passed' | 'failed' | 'inconclusive' | 'submitted' | 'cancelled' | 'error',
|
|
173
|
+
livenessSessionId: string | null,
|
|
174
|
+
attempt?: number, // the attempt the verdict belongs to
|
|
175
|
+
retryAllowed?: boolean,
|
|
176
|
+
device: { mode: 'device' | 'none', fallbackReason: string | null, passedChallenges: string[] } | null,
|
|
177
|
+
server?: { // PowerCred's verdict (see the API reference)
|
|
178
|
+
status, attempt, retry_allowed,
|
|
179
|
+
server_result: { passed, score, reasons, checks },
|
|
180
|
+
},
|
|
181
|
+
selfie?: Blob, // a JPEG photo facing the camera, for your own face match
|
|
182
|
+
reason?: string, // why: see below
|
|
183
|
+
}
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
| `status` | Meaning |
|
|
187
|
+
|---|---|
|
|
188
|
+
| `passed` | PowerCred confirmed the person is live |
|
|
189
|
+
| `failed` | Not confirmed, and no attempts are left, or the person could not complete the moves |
|
|
190
|
+
| `inconclusive` | PowerCred could not decide. Start a new check. |
|
|
191
|
+
| `submitted` | Only with `waitForServer: false`: the recording was sent, and the verdict follows |
|
|
192
|
+
| `cancelled` | Your page called `cancel()` or `destroy()` |
|
|
193
|
+
| `error` | The check could not run. See `reason`. |
|
|
194
|
+
|
|
195
|
+
**`reason` values:**
|
|
196
|
+
|
|
197
|
+
| With `status` | `reason` |
|
|
198
|
+
|---|---|
|
|
199
|
+
| `error` | `camera_denied`, `camera_unavailable`, `unsupported_browser`, `insecure_context`, `capture_failed`, `network`, `session_expired`, `session_invalid`, `attempts_exhausted`, `already_passed`, `recording_too_large`, `recording_rejected`, `service_unavailable`, `server_error`, `unexpected` |
|
|
200
|
+
| `failed`, when the person ran out of restarts | The last problem: `wrong_direction`, `face_lost`, `multiple_faces`, `too_slow` or `challenge_timeout:<move>` (for example `challenge_timeout:nod`) |
|
|
201
|
+
| `cancelled` | `cancelled` |
|
|
202
|
+
|
|
203
|
+
When PowerCred's verdict is `failed` or `inconclusive` with no attempts left, `reason` is not set.
|
|
204
|
+
The verdict's own reasons are in `server.server_result.reasons`.
|
|
205
|
+
|
|
206
|
+
When an attempt fails on the server and attempts remain, the SDK offers "Try again" by itself.
|
|
207
|
+
`start()` resolves only when the check is finished.
|
|
208
|
+
|
|
209
|
+
## Events
|
|
210
|
+
|
|
211
|
+
`onEvent` receives progress events. Use them for analytics, or to drive your own UI around the
|
|
212
|
+
check.
|
|
213
|
+
|
|
214
|
+
| Event | When |
|
|
215
|
+
|---|---|
|
|
216
|
+
| `{ type: 'camera_ready' }` | The camera is on |
|
|
217
|
+
| `{ type: 'mode', mode, fallbackReason }` | Whether the browser follows moves live (`device`) or shows timed prompts (`none`). `fallbackReason` (`slow_device` or `model_unavailable`) says why it switched. |
|
|
218
|
+
| `{ type: 'recording_started' }` | Recording began |
|
|
219
|
+
| `{ type: 'challenge_started', challenge }` | A move was asked for |
|
|
220
|
+
| `{ type: 'challenge_passed', challenge }` | The browser saw the move |
|
|
221
|
+
| `{ type: 'attempt_aborted', reason }` | The browser stopped the attempt: `wrong_direction`, `face_lost`, `multiple_faces`, `too_slow`, `challenge_timeout:<move>`, or `interrupted` (the person switched to another tab or app mid-check). Nothing is uploaded, and the person is offered a restart. |
|
|
222
|
+
| `{ type: 'flash_started' }`, `{ type: 'flash_ended' }` | The colour sequence |
|
|
223
|
+
| `{ type: 'uploading', bytes }` | The recording is being sent |
|
|
224
|
+
| `{ type: 'server_result', result }` | PowerCred's verdict for an attempt |
|
|
225
|
+
| `{ type: 'error', code, message }` | Something went wrong. `code` matches the `reason` values above. |
|
|
226
|
+
|
|
227
|
+
## Customising the look and text
|
|
228
|
+
|
|
229
|
+
**Text:** every on-screen text can be replaced, for example to translate it. The keys and English
|
|
230
|
+
defaults are exported as `defaultStrings`:
|
|
231
|
+
|
|
232
|
+
```ts
|
|
233
|
+
import { PowerCredLiveness, defaultStrings } from '@powercred/liveness-web'
|
|
234
|
+
|
|
235
|
+
new PowerCredLiveness({
|
|
236
|
+
baseUrl, sessionProvider,
|
|
237
|
+
strings: {
|
|
238
|
+
center: 'Posisikan wajah Anda di dalam oval',
|
|
239
|
+
turnLeft: 'Tolehkan kepala ke KIRI',
|
|
240
|
+
turnRight: 'Tolehkan kepala ke KANAN',
|
|
241
|
+
// …any keys you leave out stay in English
|
|
242
|
+
},
|
|
243
|
+
})
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+
**Colours and font:** `theme: { primaryColor: '#0B5FFF', fontFamily: 'Inter, sans-serif' }`.
|
|
247
|
+
|
|
248
|
+
**Your own result screen:** set `showResult: false` and show your own screen when `start()`
|
|
249
|
+
resolves.
|
|
250
|
+
|
|
251
|
+
The camera preview is mirrored, as people expect from a front camera. *Left* and *right* in the
|
|
252
|
+
prompts always mean the person's own left and right.
|
|
253
|
+
|
|
254
|
+
## Content security policy
|
|
255
|
+
|
|
256
|
+
If your site sets a `Content-Security-Policy`, allow:
|
|
257
|
+
|
|
258
|
+
| Directive | Add |
|
|
259
|
+
|---|---|
|
|
260
|
+
| `script-src` | The origin serving the SDK and its `assets` folder, and `'wasm-unsafe-eval'` |
|
|
261
|
+
| `connect-src` | Your PowerCred API host, and the origin serving the `assets` folder |
|
|
262
|
+
| `style-src` | `'unsafe-inline'`: the SDK styles its own UI, isolated from your page's styles |
|
|
263
|
+
|
|
264
|
+
## Iframes and single-page apps
|
|
265
|
+
|
|
266
|
+
- **Iframes:** the iframe needs camera permission: `<iframe src="…" allow="camera">`.
|
|
267
|
+
- **Single-page apps:** call `destroy()` when the user navigates away, so that the camera is
|
|
268
|
+
switched off. Use one `PowerCredLiveness` instance per check: `destroy()` the old one and create
|
|
269
|
+
a new one for the next check.
|
|
270
|
+
- **Several attempts:** within one session, the SDK handles retries by itself. For a fresh start
|
|
271
|
+
after `failed` or `inconclusive`, create a new session from your backend.
|
|
272
|
+
|
|
273
|
+
## Privacy
|
|
274
|
+
|
|
275
|
+
- The camera is only on while the check runs.
|
|
276
|
+
- The recording and photos go only to the PowerCred API, authorised by the session token. Your page
|
|
277
|
+
never holds your API key.
|
|
278
|
+
- The colour sequence is skipped when the person's device asks for reduced motion.
|
|
279
|
+
|
|
280
|
+
## Licences
|
|
281
|
+
|
|
282
|
+
Open-source components included in this package and their licences are listed in
|
|
283
|
+
`THIRD_PARTY_NOTICES.txt`.
|
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
Third-party software in @powercred/liveness-web
|
|
2
|
+
================================================
|
|
3
|
+
|
|
4
|
+
The on-device face tracking in this package (the device chunk of the JavaScript
|
|
5
|
+
build and the files in assets/) is built from:
|
|
6
|
+
|
|
7
|
+
MediaPipe Tasks Vision 0.10.21, including its face landmark model
|
|
8
|
+
Copyright The MediaPipe Authors
|
|
9
|
+
Licensed under the Apache License, Version 2.0 (below)
|
|
10
|
+
|
|
11
|
+
The files in assets/ are renamed copies; their contents are unmodified.
|
|
12
|
+
|
|
13
|
+
--------------------------------------------------------------------------------
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
Apache License
|
|
17
|
+
Version 2.0, January 2004
|
|
18
|
+
http://www.apache.org/licenses/
|
|
19
|
+
|
|
20
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
21
|
+
|
|
22
|
+
1. Definitions.
|
|
23
|
+
|
|
24
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
25
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
26
|
+
|
|
27
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
28
|
+
the copyright owner that is granting the License.
|
|
29
|
+
|
|
30
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
31
|
+
other entities that control, are controlled by, or are under common
|
|
32
|
+
control with that entity. For the purposes of this definition,
|
|
33
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
34
|
+
direction or management of such entity, whether by contract or
|
|
35
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
36
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
37
|
+
|
|
38
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
39
|
+
exercising permissions granted by this License.
|
|
40
|
+
|
|
41
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
42
|
+
including but not limited to software source code, documentation
|
|
43
|
+
source, and configuration files.
|
|
44
|
+
|
|
45
|
+
"Object" form shall mean any form resulting from mechanical
|
|
46
|
+
transformation or translation of a Source form, including but
|
|
47
|
+
not limited to compiled object code, generated documentation,
|
|
48
|
+
and conversions to other media types.
|
|
49
|
+
|
|
50
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
51
|
+
Object form, made available under the License, as indicated by a
|
|
52
|
+
copyright notice that is included in or attached to the work
|
|
53
|
+
(an example is provided in the Appendix below).
|
|
54
|
+
|
|
55
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
56
|
+
form, that is based on (or derived from) the Work and for which the
|
|
57
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
58
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
59
|
+
of this License, Derivative Works shall not include works that remain
|
|
60
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
61
|
+
the Work and Derivative Works thereof.
|
|
62
|
+
|
|
63
|
+
"Contribution" shall mean any work of authorship, including
|
|
64
|
+
the original version of the Work and any modifications or additions
|
|
65
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
66
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
67
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
68
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
69
|
+
means any form of electronic, verbal, or written communication sent
|
|
70
|
+
to the Licensor or its representatives, including but not limited to
|
|
71
|
+
communication on electronic mailing lists, source code control systems,
|
|
72
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
73
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
74
|
+
excluding communication that is conspicuously marked or otherwise
|
|
75
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
76
|
+
|
|
77
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
78
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
79
|
+
subsequently incorporated within the Work.
|
|
80
|
+
|
|
81
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
82
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
83
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
84
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
85
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
86
|
+
Work and such Derivative Works in Source or Object form.
|
|
87
|
+
|
|
88
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
89
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
90
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
91
|
+
(except as stated in this section) patent license to make, have made,
|
|
92
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
93
|
+
where such license applies only to those patent claims licensable
|
|
94
|
+
by such Contributor that are necessarily infringed by their
|
|
95
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
96
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
97
|
+
institute patent litigation against any entity (including a
|
|
98
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
99
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
100
|
+
or contributory patent infringement, then any patent licenses
|
|
101
|
+
granted to You under this License for that Work shall terminate
|
|
102
|
+
as of the date such litigation is filed.
|
|
103
|
+
|
|
104
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
105
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
106
|
+
modifications, and in Source or Object form, provided that You
|
|
107
|
+
meet the following conditions:
|
|
108
|
+
|
|
109
|
+
(a) You must give any other recipients of the Work or
|
|
110
|
+
Derivative Works a copy of this License; and
|
|
111
|
+
|
|
112
|
+
(b) You must cause any modified files to carry prominent notices
|
|
113
|
+
stating that You changed the files; and
|
|
114
|
+
|
|
115
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
116
|
+
that You distribute, all copyright, patent, trademark, and
|
|
117
|
+
attribution notices from the Source form of the Work,
|
|
118
|
+
excluding those notices that do not pertain to any part of
|
|
119
|
+
the Derivative Works; and
|
|
120
|
+
|
|
121
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
122
|
+
distribution, then any Derivative Works that You distribute must
|
|
123
|
+
include a readable copy of the attribution notices contained
|
|
124
|
+
within such NOTICE file, excluding those notices that do not
|
|
125
|
+
pertain to any part of the Derivative Works, in at least one
|
|
126
|
+
of the following places: within a NOTICE text file distributed
|
|
127
|
+
as part of the Derivative Works; within the Source form or
|
|
128
|
+
documentation, if provided along with the Derivative Works; or,
|
|
129
|
+
within a display generated by the Derivative Works, if and
|
|
130
|
+
wherever such third-party notices normally appear. The contents
|
|
131
|
+
of the NOTICE file are for informational purposes only and
|
|
132
|
+
do not modify the License. You may add Your own attribution
|
|
133
|
+
notices within Derivative Works that You distribute, alongside
|
|
134
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
135
|
+
that such additional attribution notices cannot be construed
|
|
136
|
+
as modifying the License.
|
|
137
|
+
|
|
138
|
+
You may add Your own copyright statement to Your modifications and
|
|
139
|
+
may provide additional or different license terms and conditions
|
|
140
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
141
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
142
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
143
|
+
the conditions stated in this License.
|
|
144
|
+
|
|
145
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
146
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
147
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
148
|
+
this License, without any additional terms or conditions.
|
|
149
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
150
|
+
the terms of any separate license agreement you may have executed
|
|
151
|
+
with Licensor regarding such Contributions.
|
|
152
|
+
|
|
153
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
154
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
155
|
+
except as required for reasonable and customary use in describing the
|
|
156
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
157
|
+
|
|
158
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
159
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
160
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
161
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
162
|
+
implied, including, without limitation, any warranties or conditions
|
|
163
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
164
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
165
|
+
appropriateness of using or redistributing the Work and assume any
|
|
166
|
+
risks associated with Your exercise of permissions under this License.
|
|
167
|
+
|
|
168
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
169
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
170
|
+
unless required by applicable law (such as deliberate and grossly
|
|
171
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
172
|
+
liable to You for damages, including any direct, indirect, special,
|
|
173
|
+
incidental, or consequential damages of any character arising as a
|
|
174
|
+
result of this License or out of the use or inability to use the
|
|
175
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
176
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
177
|
+
other commercial damages or losses), even if such Contributor
|
|
178
|
+
has been advised of the possibility of such damages.
|
|
179
|
+
|
|
180
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
181
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
182
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
183
|
+
or other liability obligations and/or rights consistent with this
|
|
184
|
+
License. However, in accepting such obligations, You may act only
|
|
185
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
186
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
187
|
+
defend, and hold each Contributor harmless for any liability
|
|
188
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
189
|
+
of your accepting any such warranty or additional liability.
|
|
190
|
+
|
|
191
|
+
END OF TERMS AND CONDITIONS
|
|
192
|
+
|
|
193
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
194
|
+
|
|
195
|
+
To apply the Apache License to your work, attach the following
|
|
196
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
197
|
+
replaced with your own identifying information. (Don't include
|
|
198
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
199
|
+
comment syntax for the file format. We also recommend that a
|
|
200
|
+
file or class name and description of purpose be included on the
|
|
201
|
+
same "printed page" as the copyright notice for easier
|
|
202
|
+
identification within third-party archives.
|
|
203
|
+
|
|
204
|
+
Copyright [yyyy] [name of copyright owner]
|
|
205
|
+
|
|
206
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
207
|
+
you may not use this file except in compliance with the License.
|
|
208
|
+
You may obtain a copy of the License at
|
|
209
|
+
|
|
210
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
211
|
+
|
|
212
|
+
Unless required by applicable law or agreed to in writing, software
|
|
213
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
214
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
215
|
+
See the License for the specific language governing permissions and
|
|
216
|
+
limitations under the License.
|
|
Binary file
|