@zlink-systems/framework-locations-etcd 0.0.0-stage → 0.34.0

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.
Files changed (40) hide show
  1. package/LICENSE +93 -0
  2. package/README.en.md +66 -0
  3. package/README.ko.md +116 -0
  4. package/dist/.tsbuildinfo +1 -0
  5. package/dist/admin.d.ts +2 -0
  6. package/dist/admin.js +143 -0
  7. package/dist/index.d.ts +2 -0
  8. package/dist/index.js +5 -0
  9. package/dist/internal/admin-engine.d.ts +36 -0
  10. package/dist/internal/admin-engine.js +171 -0
  11. package/dist/internal/client.d.ts +61 -0
  12. package/dist/internal/client.js +182 -0
  13. package/dist/internal/cursor.d.ts +18 -0
  14. package/dist/internal/cursor.js +67 -0
  15. package/dist/internal/encoding.d.ts +29 -0
  16. package/dist/internal/encoding.js +119 -0
  17. package/dist/internal/input.d.ts +6 -0
  18. package/dist/internal/input.js +81 -0
  19. package/dist/internal/options.d.ts +4 -0
  20. package/dist/internal/options.js +65 -0
  21. package/dist/location-store.d.ts +20 -0
  22. package/dist/location-store.js +285 -0
  23. package/dist/options.d.ts +19 -0
  24. package/dist/options.js +2 -0
  25. package/dist/proto/README.ko.md +39 -0
  26. package/dist/proto/v3.6.16/etcd/api/authpb/auth.proto +44 -0
  27. package/dist/proto/v3.6.16/etcd/api/etcdserverpb/rpc.proto +1436 -0
  28. package/dist/proto/v3.6.16/etcd/api/mvccpb/kv.proto +51 -0
  29. package/dist/proto/v3.6.16/etcd/api/versionpb/version.proto +30 -0
  30. package/dist/proto/v3.6.16/gogoproto/gogo.proto +144 -0
  31. package/dist/proto/v3.6.16/google/api/annotations.proto +31 -0
  32. package/dist/proto/v3.6.16/google/api/http.proto +379 -0
  33. package/dist/proto/v3.6.16/licenses/etcd-LICENSE +202 -0
  34. package/dist/proto/v3.6.16/licenses/gogo-protobuf-LICENSE +35 -0
  35. package/dist/proto/v3.6.16/licenses/googleapis-LICENSE +201 -0
  36. package/dist/proto/v3.6.16/licenses/grpc-gateway-LICENSE +27 -0
  37. package/dist/proto/v3.6.16/protoc-gen-openapiv2/options/annotations.proto +51 -0
  38. package/dist/proto/v3.6.16/protoc-gen-openapiv2/options/openapiv2.proto +762 -0
  39. package/package.json +24 -4
  40. package/README.md +0 -3
@@ -0,0 +1,285 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ZLinkEtcdLocationStore = void 0;
4
+ const client_1 = require("./internal/client");
5
+ const encoding_1 = require("./internal/encoding");
6
+ const input_1 = require("./internal/input");
7
+ const cursor_1 = require("./internal/cursor");
8
+ const range = (key, revision) => ({
9
+ request_range: { key, revision, serializable: false }
10
+ });
11
+ const missing = (key) => ({ key, target: 'CREATE', result: 'EQUAL', create_revision: '0' });
12
+ const same = (key, record) => record === undefined
13
+ ? missing(key)
14
+ : { key, target: 'MOD', result: 'EQUAL', mod_revision: record.mod_revision };
15
+ const live = (metadata, clock) => metadata !== null && (!metadata.hasExpiry || metadata.expiresAtMs > clock);
16
+ const date = (value) => new Date(Number(value));
17
+ /** Opaque Location Store SPI backed by etcd linearizable transactions. */
18
+ class ZLinkEtcdLocationStore {
19
+ client;
20
+ keys;
21
+ cursors;
22
+ pending = new Set();
23
+ disposal;
24
+ constructor(options) {
25
+ this.client = new client_1.EtcdClient(options);
26
+ this.keys = (0, encoding_1.keys)(options.namespace);
27
+ this.cursors = new cursor_1.ScanCursor(options.namespace);
28
+ }
29
+ async read(subject, signal) {
30
+ const logical = (0, input_1.key)(subject);
31
+ return this.perform(signal, async (operation) => {
32
+ const response = await this.readTxn([this.keys.clock, this.keys.metadata(logical), this.keys.payload(logical)], operation);
33
+ const clock = this.clock(response);
34
+ const metadata = response.responses[1].response_range.kvs.at(0);
35
+ const payload = response.responses[2].response_range.kvs.at(0);
36
+ const decoded = (0, encoding_1.validateRecord)(metadata?.value ?? null, payload?.value ?? null, metadata?.mod_revision ?? '', payload?.mod_revision ?? '');
37
+ if (!live(decoded, clock))
38
+ return { kind: 'missing', storeNow: date(clock) };
39
+ return {
40
+ kind: 'found',
41
+ value: this.value(metadata, payload, decoded, clock, response.header.cluster_id)
42
+ };
43
+ });
44
+ }
45
+ async write(request, signal) {
46
+ (0, input_1.validateWrite)(request);
47
+ return this.perform(signal, async (operation) => {
48
+ for (;;) {
49
+ const response = await this.readTxn([this.keys.clock, ...request.conditions.map((c) => this.keys.metadata((0, input_1.key)(c.key)))], operation);
50
+ const clock = this.clock(response);
51
+ const records = response.responses.slice(1).map((r) => r.response_range.kvs.at(0));
52
+ const metadata = records.map((r) => (r === undefined ? null : (0, encoding_1.decodeMetadata)(r.value)));
53
+ const payloadIndexes = request.conditions.flatMap((condition, index) => condition.kind === 'value' &&
54
+ metadata[index]?.payloadLength === condition.expected.byteLength
55
+ ? [index]
56
+ : []);
57
+ const payloads = new Map();
58
+ if (payloadIndexes.length > 0) {
59
+ let read;
60
+ try {
61
+ read = await this.readTxn(payloadIndexes.map((i) => this.keys.payload((0, input_1.key)(request.conditions[i].key))), operation, response.header.revision);
62
+ }
63
+ catch (error) {
64
+ if (error instanceof client_1.EtcdCallError && error.kind === 'compaction')
65
+ continue;
66
+ throw error;
67
+ }
68
+ for (const [offset, index] of payloadIndexes.entries()) {
69
+ const payload = read.responses[offset].response_range.kvs.at(0);
70
+ (0, encoding_1.validateRecord)(records[index].value, payload?.value ?? null, records[index].mod_revision, payload?.mod_revision ?? '');
71
+ payloads.set(index, payload);
72
+ }
73
+ }
74
+ const matched = request.conditions.every((condition, index) => {
75
+ const record = metadata[index];
76
+ if (condition.kind === 'missing')
77
+ return !live(record, clock);
78
+ if (!live(record, clock))
79
+ return false;
80
+ if (condition.kind === 'version')
81
+ return (condition.expected.value ===
82
+ (0, encoding_1.encodeVersion)(response.header.cluster_id, records[index].mod_revision));
83
+ return payloads.get(index)?.value.equals(Buffer.from(condition.expected)) === true;
84
+ });
85
+ if (!matched)
86
+ return { kind: 'conflict', storeNow: date(clock) };
87
+ const expiries = request.conditions.flatMap((condition, index) => condition.kind !== 'missing' && metadata[index]?.hasExpiry === true
88
+ ? [metadata[index].expiresAtMs]
89
+ : []);
90
+ const compare = [
91
+ { key: this.keys.clock, target: 'CREATE', result: 'GREATER', create_revision: '0' },
92
+ ...request.conditions.map((condition, index) => same(this.keys.metadata((0, input_1.key)(condition.key)), records[index]))
93
+ ];
94
+ if (expiries.length > 0)
95
+ compare.push({
96
+ key: this.keys.clock,
97
+ target: 'VALUE',
98
+ result: 'LESS',
99
+ value: (0, encoding_1.encodeClock)(expiries.reduce((a, b) => (a < b ? a : b)))
100
+ });
101
+ const success = [];
102
+ for (const mutation of request.mutations) {
103
+ const logical = (0, input_1.key)(mutation.key);
104
+ if (mutation.kind === 'delete') {
105
+ success.push({ request_delete_range: { key: this.keys.metadata(logical) } }, { request_delete_range: { key: this.keys.payload(logical) } });
106
+ }
107
+ else {
108
+ const expiresAtMs = mutation.retentionMs === undefined
109
+ ? 0n
110
+ : clock + BigInt(Math.ceil(mutation.retentionMs));
111
+ if (expiresAtMs > encoding_1.MAX_TIME_MS)
112
+ throw new RangeError('Store expiry exceeds its encoding range');
113
+ success.push({
114
+ request_put: {
115
+ key: this.keys.metadata(logical),
116
+ value: (0, encoding_1.encodeMetadata)({
117
+ hasExpiry: mutation.retentionMs !== undefined,
118
+ expiresAtMs,
119
+ payloadLength: mutation.bytes.byteLength
120
+ })
121
+ }
122
+ }, {
123
+ request_put: { key: this.keys.payload(logical), value: Buffer.from(mutation.bytes) }
124
+ });
125
+ }
126
+ }
127
+ const applied = await this.client.rpc('KV', 'txn', { compare, success }, operation);
128
+ if (!applied.succeeded)
129
+ continue;
130
+ return {
131
+ kind: 'applied',
132
+ storeNow: date(clock),
133
+ putVersions: request.mutations
134
+ .filter((m) => m.kind === 'put')
135
+ .map((m) => ({
136
+ key: { value: m.key.value },
137
+ version: {
138
+ value: (0, encoding_1.encodeVersion)(applied.header.cluster_id, applied.header.revision)
139
+ }
140
+ }))
141
+ };
142
+ }
143
+ });
144
+ }
145
+ async scan(request, signal) {
146
+ (0, input_1.validateScan)(request);
147
+ return this.perform(signal, async (operation) => {
148
+ let snapshot;
149
+ if (request.cursor !== undefined) {
150
+ snapshot = this.cursors.decode(request.cursor.value, request.prefix);
151
+ if (snapshot === undefined)
152
+ return { kind: 'expired' };
153
+ }
154
+ const started = (0, cursor_1.monotonicMs)();
155
+ const observed = await this.readTxn([this.keys.clock], operation);
156
+ const clock = this.clock(observed);
157
+ snapshot ??= {
158
+ cluster: observed.header.cluster_id,
159
+ revision: observed.header.revision,
160
+ clock,
161
+ started,
162
+ last: Buffer.alloc(0)
163
+ };
164
+ if (snapshot.cluster !== observed.header.cluster_id)
165
+ return { kind: 'expired' };
166
+ try {
167
+ return await this.scanPage(request, snapshot, operation);
168
+ }
169
+ catch (error) {
170
+ if (error instanceof client_1.EtcdCallError && error.kind === 'compaction')
171
+ return { kind: 'expired' };
172
+ throw error;
173
+ }
174
+ });
175
+ }
176
+ dispose() {
177
+ this.disposal ??= Promise.allSettled([...this.pending]).then(() => this.client.close());
178
+ return this.disposal;
179
+ }
180
+ async perform(signal, action) {
181
+ if (this.disposal !== undefined)
182
+ throw new Error('Location Store is disposed');
183
+ if (signal?.aborted === true)
184
+ throw new Error('Store operation stopped');
185
+ const pending = action(this.client.operation(signal, true));
186
+ this.pending.add(pending);
187
+ try {
188
+ return await pending;
189
+ }
190
+ catch (error) {
191
+ if (error instanceof client_1.EtcdCallError)
192
+ throw new Error('Location Store operation failed');
193
+ throw error;
194
+ }
195
+ finally {
196
+ this.pending.delete(pending);
197
+ }
198
+ }
199
+ readTxn(subjects, operation, revision) {
200
+ return this.client.rpc('KV', 'txn', { success: subjects.map((subject) => range(subject, revision)) }, operation);
201
+ }
202
+ clock(response) {
203
+ const clock = response.responses[0].response_range.kvs.at(0);
204
+ if (clock === undefined)
205
+ throw new encoding_1.StoreFormatError();
206
+ return (0, encoding_1.decodeClock)(clock.value);
207
+ }
208
+ value(metadata, payload, decoded, clock, cluster) {
209
+ return {
210
+ bytes: Uint8Array.from(payload.value),
211
+ version: { value: (0, encoding_1.encodeVersion)(cluster, metadata.mod_revision) },
212
+ expiresAt: decoded.hasExpiry ? date(decoded.expiresAtMs) : undefined,
213
+ storeNow: date(clock)
214
+ };
215
+ }
216
+ async scanPage(request, snapshot, operation) {
217
+ const prefix = Buffer.concat([this.keys.metadataPrefix, Buffer.from(request.prefix)]);
218
+ const end = (0, encoding_1.prefixEnd)(prefix);
219
+ let start = snapshot.last.length === 0
220
+ ? prefix
221
+ : Buffer.concat([this.keys.metadata(snapshot.last), Buffer.from([0])]);
222
+ const selected = [];
223
+ let size = 0;
224
+ let more = true;
225
+ let pageFull = false;
226
+ while (more && !pageFull && selected.length < request.limit) {
227
+ if (!this.cursors.valid(snapshot))
228
+ return { kind: 'expired' };
229
+ const response = await this.client.rpc('KV', 'range', {
230
+ key: start,
231
+ range_end: end,
232
+ limit: '1000',
233
+ revision: snapshot.revision,
234
+ sort_order: 'ASCEND',
235
+ sort_target: 'KEY',
236
+ serializable: false
237
+ }, operation);
238
+ more = response.more;
239
+ for (const record of response.kvs) {
240
+ const decoded = (0, encoding_1.decodeMetadata)(record.value);
241
+ const logical = record.key.subarray(this.keys.metadataPrefix.length);
242
+ if (live(decoded, snapshot.clock)) {
243
+ const itemSize = logical.length +
244
+ Buffer.byteLength((0, encoding_1.encodeVersion)(snapshot.cluster, record.mod_revision)) +
245
+ decoded.payloadLength;
246
+ if (selected.length === request.limit ||
247
+ size + itemSize > input_1.bounds.ZLINK_PROVIDER_MAX_ENCODED_PAGE_BYTES) {
248
+ more = true;
249
+ pageFull = true;
250
+ break;
251
+ }
252
+ size += itemSize;
253
+ selected.push({ record, decoded, logical });
254
+ }
255
+ snapshot.last = logical;
256
+ }
257
+ start = Buffer.concat([this.keys.metadata(snapshot.last), Buffer.from([0])]);
258
+ }
259
+ const items = [];
260
+ if (selected.length > 0) {
261
+ const payloads = await this.readTxn(selected.map((item) => this.keys.payload(item.logical)), operation, snapshot.revision);
262
+ for (const [index, item] of selected.entries()) {
263
+ const payload = payloads.responses[index].response_range.kvs.at(0);
264
+ (0, encoding_1.validateRecord)(item.record.value, payload?.value ?? null, item.record.mod_revision, payload?.mod_revision ?? '');
265
+ items.push({
266
+ key: { value: item.logical.toString('utf8') },
267
+ value: this.value(item.record, payload, item.decoded, snapshot.clock, snapshot.cluster)
268
+ });
269
+ }
270
+ }
271
+ if (!this.cursors.valid(snapshot))
272
+ return { kind: 'expired' };
273
+ return {
274
+ kind: 'page',
275
+ value: {
276
+ items,
277
+ storeNow: date(snapshot.clock),
278
+ nextCursor: more
279
+ ? { value: this.cursors.encode(snapshot, request.prefix) }
280
+ : undefined
281
+ }
282
+ };
283
+ }
284
+ }
285
+ exports.ZLinkEtcdLocationStore = ZLinkEtcdLocationStore;
@@ -0,0 +1,19 @@
1
+ export interface ZLinkEtcdClientIdentity {
2
+ readonly certificatePem: string;
3
+ readonly keyPem: string;
4
+ }
5
+ export interface ZLinkEtcdTlsOptions {
6
+ readonly trustedCaPem?: string;
7
+ readonly clientIdentity?: ZLinkEtcdClientIdentity;
8
+ }
9
+ export interface ZLinkEtcdCredentials {
10
+ readonly user: string;
11
+ readonly password: string;
12
+ }
13
+ export interface ZLinkEtcdLocationOptions {
14
+ readonly endpoints: readonly string[];
15
+ readonly tls?: ZLinkEtcdTlsOptions;
16
+ readonly credentials?: ZLinkEtcdCredentials;
17
+ readonly namespace: string;
18
+ readonly operationTimeoutMs?: number;
19
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,39 @@
1
+ # etcd v3.6.16 공용 proto 사본
2
+
3
+ 공식 etcd Location Store provider와 Store 관리 도구는 이 디렉터리의 proto 사본을 함께 사용한다.
4
+ 파일은 upstream bytes 그대로 보관하며 import 경로를 바꾸지 않는다. Proto 검색 경로는 `v3.6.16/`이다.
5
+ 진입 파일은 `v3.6.16/etcd/api/etcdserverpb/rpc.proto`다.
6
+
7
+ etcd proto는 `etcd/api/` import 경로에 맞춰 배치했다. 의존 버전은 etcd v3.6.16의
8
+ [`api/go.mod`](https://github.com/etcd-io/etcd/blob/v3.6.16/api/go.mod)와
9
+ [`scripts/genproto.sh`](https://github.com/etcd-io/etcd/blob/v3.6.16/scripts/genproto.sh)의
10
+ `googleapi_commit`을 기준으로 한다.
11
+
12
+ `google/protobuf/descriptor.proto`와 `google/protobuf/struct.proto`는 protobuf well-known type이다.
13
+ Node의 `@grpc/proto-loader`는 `protobufjs`에 포함된 해당 정의를 사용하므로 별도 사본을 두지 않는다.
14
+ 다른 언어의 proto compiler에는 해당 compiler가 제공하는 well-known type 검색 경로를 추가한다.
15
+
16
+ ## 파일 출처와 SHA-256
17
+
18
+ 경로는 `v3.6.16/` 기준이다. SHA-256은 내려받은 파일 bytes로 계산했다.
19
+
20
+ | 파일 | 출처 URL | 태그·commit | SHA-256 |
21
+ |---|---|---|---|
22
+ | `etcd/api/etcdserverpb/rpc.proto` | [upstream](https://raw.githubusercontent.com/etcd-io/etcd/v3.6.16/api/etcdserverpb/rpc.proto) | `etcd v3.6.16` | `c57117e8f4764667be927d862f4fb01fbf1faaf0f725bf2eecc3a523e12aacc6` |
23
+ | `etcd/api/mvccpb/kv.proto` | [upstream](https://raw.githubusercontent.com/etcd-io/etcd/v3.6.16/api/mvccpb/kv.proto) | `etcd v3.6.16` | `7416acaac7c76524c717df9107a8020d3c4eda92a490a35f1f211592ce8cfa1d` |
24
+ | `etcd/api/authpb/auth.proto` | [upstream](https://raw.githubusercontent.com/etcd-io/etcd/v3.6.16/api/authpb/auth.proto) | `etcd v3.6.16` | `e2b6936f3aee307f0f183c99613983e7d5d66e5daaf6da3cd2f4b6976db0a0a1` |
25
+ | `etcd/api/versionpb/version.proto` | [upstream](https://raw.githubusercontent.com/etcd-io/etcd/v3.6.16/api/versionpb/version.proto) | `etcd v3.6.16` | `8e948ec573b1c7803d72ee54763d80ead0287e0fc6987c37293b20d3a23d0dbd` |
26
+ | `gogoproto/gogo.proto` | [upstream](https://raw.githubusercontent.com/gogo/protobuf/v1.3.2/gogoproto/gogo.proto) | `gogo/protobuf v1.3.2` | `f2f77edf7de807ded7884813d851656f4ccb18262db717a8f31061995f3e7324` |
27
+ | `google/api/annotations.proto` | [upstream](https://raw.githubusercontent.com/googleapis/googleapis/0adf469dcd7822bf5bc058a7b0217f5558a75643/google/api/annotations.proto) | `googleapis 0adf469dcd7822bf5bc058a7b0217f5558a75643` | `d3d3b4bbe80c0481c35507376f5653fcfdfcbdc7f168aab097f25ae643b7ebe8` |
28
+ | `google/api/http.proto` | [upstream](https://raw.githubusercontent.com/googleapis/googleapis/0adf469dcd7822bf5bc058a7b0217f5558a75643/google/api/http.proto) | `googleapis 0adf469dcd7822bf5bc058a7b0217f5558a75643` | `2ffe191f209a9a68e30f0493c66d5ce15be8deac276d55bcd4127f8cc7f453e2` |
29
+ | `protoc-gen-openapiv2/options/annotations.proto` | [upstream](https://raw.githubusercontent.com/grpc-ecosystem/grpc-gateway/v2.29.0/protoc-gen-openapiv2/options/annotations.proto) | `grpc-gateway v2.29.0` | `1f8e23ce506c358349d5ce0e54c336e3b2f3bf17c5d9e7d965e24a6e3429c2c9` |
30
+ | `protoc-gen-openapiv2/options/openapiv2.proto` | [upstream](https://raw.githubusercontent.com/grpc-ecosystem/grpc-gateway/v2.29.0/protoc-gen-openapiv2/options/openapiv2.proto) | `grpc-gateway v2.29.0` | `8e9c28731f17e4608a1f7457cdd6f9a2718add4f5f9a0390dd5514a88e2023ef` |
31
+ | `licenses/etcd-LICENSE` | [upstream](https://raw.githubusercontent.com/etcd-io/etcd/v3.6.16/LICENSE) | `etcd v3.6.16` | `cfc7749b96f63bd31c3c42b5c471bf756814053e847c10f3eb003417bc523d30` |
32
+ | `licenses/gogo-protobuf-LICENSE` | [upstream](https://raw.githubusercontent.com/gogo/protobuf/v1.3.2/LICENSE) | `gogo/protobuf v1.3.2` | `3f571768c0ba2f330e5fee90de89bfe5141f48c1939be8008fa61461c30ca07f` |
33
+ | `licenses/googleapis-LICENSE` | [upstream](https://raw.githubusercontent.com/googleapis/googleapis/0adf469dcd7822bf5bc058a7b0217f5558a75643/LICENSE) | `googleapis 0adf469dcd7822bf5bc058a7b0217f5558a75643` | `c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4` |
34
+ | `licenses/grpc-gateway-LICENSE` | [upstream](https://raw.githubusercontent.com/grpc-ecosystem/grpc-gateway/v2.29.0/LICENSE) | `grpc-gateway v2.29.0` | `a15b1d1b168954c92ff7fb1620382418f7c72f4f4d251ee791d1098ad68ab0c4` |
35
+
36
+ ## License
37
+
38
+ etcd, googleapis와 grpc-gateway는 Apache License 2.0, gogo/protobuf는 BSD 3-Clause License로 배포된다.
39
+ 원본 license는 `v3.6.16/licenses/`에 보관한다. 각 proto의 copyright·license 주석도 원본 그대로 유지한다.
@@ -0,0 +1,44 @@
1
+ syntax = "proto3";
2
+ package authpb;
3
+
4
+ import "gogoproto/gogo.proto";
5
+
6
+ option go_package = "go.etcd.io/etcd/api/v3/authpb";
7
+
8
+ option (gogoproto.marshaler_all) = true;
9
+ option (gogoproto.sizer_all) = true;
10
+ option (gogoproto.unmarshaler_all) = true;
11
+ option (gogoproto.goproto_getters_all) = false;
12
+ option (gogoproto.goproto_enum_prefix_all) = false;
13
+
14
+ message UserAddOptions {
15
+ bool no_password = 1;
16
+ };
17
+
18
+ // User is a single entry in the bucket authUsers
19
+ message User {
20
+ bytes name = 1;
21
+ bytes password = 2;
22
+ repeated string roles = 3;
23
+ UserAddOptions options = 4;
24
+ }
25
+
26
+ // Permission is a single entity
27
+ message Permission {
28
+ enum Type {
29
+ READ = 0;
30
+ WRITE = 1;
31
+ READWRITE = 2;
32
+ }
33
+ Type permType = 1;
34
+
35
+ bytes key = 2;
36
+ bytes range_end = 3;
37
+ }
38
+
39
+ // Role is a single entry in the bucket authRoles
40
+ message Role {
41
+ bytes name = 1;
42
+
43
+ repeated Permission keyPermission = 2;
44
+ }