@synopackageland/sdk 0.9.3 → 0.9.4
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.
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { type ProtocolOp, type ProtocolParams, type RefusalCode } from './v1';
|
|
2
|
+
/** remote_addr: the browser's address (REMOTE_ADDR); the executor checks App Privileges for it and refuses without it. */
|
|
2
3
|
export interface ProtocolAuth {
|
|
3
4
|
dsm_cookie: string;
|
|
4
5
|
dsm_synotoken: string;
|
|
6
|
+
remote_addr?: string;
|
|
5
7
|
}
|
|
6
8
|
export type ProtocolResponse = {
|
|
7
9
|
ok: true;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@synopackageland/sdk",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.4",
|
|
4
4
|
"description": "Frontend SDK for DSM packages built with synopkgland: headless client and Vue components",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://github.com/synopackageland/syno-pkg-land-sdk/tree/main/ts#readme",
|
|
@@ -30,14 +30,18 @@ the executor against the vectors here.
|
|
|
30
30
|
## Request
|
|
31
31
|
|
|
32
32
|
```json
|
|
33
|
-
{"v":1,"op":"files.moveFromStaging","auth":{"dsm_cookie":"…","dsm_synotoken":"…"},"params":{…}}
|
|
33
|
+
{"v":1,"op":"files.moveFromStaging","auth":{"dsm_cookie":"…","dsm_synotoken":"…","remote_addr":"192.0.2.1"},"params":{…}}
|
|
34
34
|
```
|
|
35
35
|
|
|
36
36
|
- `v` MUST be `1`.
|
|
37
37
|
- `op` MUST be one of the ops with a schema in `schema/`. An unknown op is
|
|
38
38
|
`UNKNOWN_OP`; an op outside the approved policy is `POLICY_DENIED`.
|
|
39
|
-
- `auth` is OPTIONAL. When present it MUST contain only `dsm_cookie
|
|
40
|
-
`dsm_synotoken
|
|
39
|
+
- `auth` is OPTIONAL. When present it MUST contain only `dsm_cookie`,
|
|
40
|
+
`dsm_synotoken` and `remote_addr` (since 0.9.4), the browser's address
|
|
41
|
+
(REMOTE_ADDR). DSM's Application Privileges are evaluated for that address;
|
|
42
|
+
an op that checks them MUST be refused with `APP_DENIED` when a present
|
|
43
|
+
`auth` has no usable `remote_addr`. Requests without `auth` are checked as
|
|
44
|
+
coming from 127.0.0.1. A present `auth` is always treated as caller
|
|
41
45
|
authentication, never ignored, even when empty. Ops whose schema says
|
|
42
46
|
`"auth": "required"` MUST be refused with `AUTH_DENIED` without a valid DSM
|
|
43
47
|
session.
|