Skip to content

Commit 7cfb9c8

Browse files
committed
chore: add debug
1 parent e43b2a6 commit 7cfb9c8

File tree

4 files changed

+13
-0
lines changed

4 files changed

+13
-0
lines changed

src/storage/kv/get.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212

1313
export default async function getKv(env, daCtx) {
1414
const body = await env.DA_CONFIG.get(daCtx.fullKey);
15+
const object = body ? JSON.parse(body) : null;
16+
console.log('read config via getKv', daCtx.fullKey, object?.permissions?.data);
1517
if (body) return { body, status: 200 };
1618
return { body: JSON.stringify({ error: 'not found' }), status: 404 };
1719
}

src/storage/kv/put.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ async function save(env, key, string) {
3939
await env.DA_CONFIG.put(key, string);
4040
// Validate the content is there
4141
body = await env.DA_CONFIG.get(key);
42+
const object = body ? JSON.parse(body) : null;
43+
console.log('read config via save', key, object?.permissions?.data);
4244
status = 201;
4345
} catch {
4446
body = JSON.stringify({ error: 'Couldn\'t parse or save config.' });

src/utils/auth.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,8 @@ export async function getAclCtx(env, org, users, key, api) {
226226

227227
const props = await env.DA_CONFIG?.get(org, { type: 'json' });
228228

229+
console.log('read config via getAclCtx', org, props?.permissions?.data);
230+
229231
if (props && props[':type'] === 'sheet' && props[':sheetname'] === 'permissions') {
230232
// It's a single-sheet, move the data to the right place
231233
props.permissions = { data: props.data };

wrangler.toml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,3 +124,10 @@ VERSION="0.0.0-it"
124124
DA_COLLAB = "http://localhost:4711"
125125
AEM_BUCKET_NAME = "aem-content-local"
126126

127+
[observability]
128+
[observability.logs]
129+
enabled = false
130+
head_sampling_rate = 1
131+
invocation_logs = true
132+
persist = true
133+

0 commit comments

Comments
 (0)