Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/util/Vocabularies.ts
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,7 @@ export const OIDC = createVocabulary(
export const PIM = createVocabulary(
'http://www.w3.org/ns/pim/space#',
'Storage',
'storage',
);

export const POSIX = createVocabulary(
Expand Down
2 changes: 2 additions & 0 deletions templates/pod/base/profile/card$.ttl.hbs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
@prefix foaf: <http://xmlns.com/foaf/0.1/>.
@prefix solid: <http://www.w3.org/ns/solid/terms#>.
@prefix pim: <http://www.w3.org/ns/pim/space#>.

<>
a foaf:PersonalProfileDocument;
Expand All @@ -9,4 +10,5 @@
<{{webId}}>
{{#if name}}foaf:name "{{name}}";{{/if}}
{{#if oidcIssuer}}solid:oidcIssuer <{{oidcIssuer}}>;{{/if}}
pim:storage <{{base.path}}>;
a foaf:Person.
18 changes: 18 additions & 0 deletions test/integration/Accounts.test.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import fetch from 'cross-fetch';
import { Parser } from 'n3';
import { parse, splitCookiesString } from 'set-cookie-parser';
import { BasicRepresentation } from '../../src/http/representation/BasicRepresentation';
import type { App } from '../../src/init/App';
import type { ResourceStore } from '../../src/storage/ResourceStore';
import { APPLICATION_X_WWW_FORM_URLENCODED } from '../../src/util/ContentTypes';
import { joinUrl } from '../../src/util/PathUtil';
import { PIM } from '../../src/util/Vocabularies';
import { getPort } from '../util/Util';
import { getDefaultVariables, getTestConfigPath, getTestFolder, instantiateFromConfig, removeFolder } from './Config';

Expand Down Expand Up @@ -272,6 +274,22 @@ describe.each(stores)('A server with account management using %s', (name, { conf
expect((await res.json()).webIdLinks[webId]).toBeDefined();
});

it('includes pim:storage triple in the WebID profile.', async(): Promise<void> => {
// Fetch the WebID profile document
const profileUrl = webId.split('#')[0];
const res = await fetch(profileUrl, { headers: { accept: 'text/turtle' }});
expect(res.status).toBe(200);

// Parse and verify the pim:storage triple points to the pod root
const parser = new Parser({ baseIRI: profileUrl });
const quads = parser.parse(await res.text());
const storageQuads = quads.filter((q): boolean =>
q.subject.value === webId &&
q.predicate.value === PIM.storage &&
q.object.value === pod);
expect(storageQuads).toHaveLength(1);
});

it('can not remove the last owner of a pod.', async(): Promise<void> => {
const res = await fetch(podResource, {
method: 'POST',
Expand Down
Loading