Skip to content

Commit

Permalink
Merge pull request #3 from bourgeoa/CSS_v7
Browse files Browse the repository at this point in the history
updated to CSS V7
  • Loading branch information
bourgeoa authored Nov 20, 2024
2 parents 6b7aea2 + 823b1d4 commit 7ee359a
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions copy-pods-to-css.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/usr/bin/env node --no-warnings
#!/usr/bin/env node
// #!/usr/bin/env node --no-warnings
// ©2023 Ruben Verborgh – MIT License
// 2024-11 Alain Bourgeois updated to CSS V7

import assert from 'node:assert';
import { resolve } from 'node:path';
Expand Down Expand Up @@ -123,7 +125,7 @@ async function updateAccount(account, internalPath) {
checks.read = true;

// Update the password section
const passwordSections = Object.values(accountConfig['**password**']);
const passwordSections = Object.values(accountConfig['payload']['**password**']);
assert.equal(passwordSections.length, 1);
assert(account.hashedPassword.startsWith(passwordHashStart));
assert(passwordSections[0].password.startsWith(passwordHashStart));
Expand All @@ -132,7 +134,7 @@ async function updateAccount(account, internalPath) {

// Update the WebID section
if (account.webId) {
const webIdSections = Object.values(accountConfig['**webIdLink**']);
const webIdSections = Object.values(accountConfig['payload']['**webIdLink**']);
assert.equal(webIdSections.length, 1);
assert(webIdSections[0].webId.startsWith('http'));
assert(account.webId.startsWith('http'));
Expand Down Expand Up @@ -196,7 +198,7 @@ async function testPod({ username }, cssUrl) {
async function getAccountControls(cssUrl) {
try {
const body = await cssApiGet(new URL('.account/', cssUrl));
assert.equal(body.version, '0.5', 'Unsupported CSS account API');
// assert.equal(body.version, '0.5', 'Unsupported CSS account API');
return body.controls;
}
catch (cause) {
Expand Down Expand Up @@ -225,7 +227,7 @@ async function cssApiFetch(url, options = {}, authorization = '') {
headers: {
...options.headers,
accept: 'application/json',
authorization: `CSS-Account-Cookie ${authorization}`,
authorization: `CSS-Account-Token ${authorization}`,
},
});
const json = await response.json();
Expand Down

0 comments on commit 7ee359a

Please sign in to comment.