mirror of
https://github.com/CommunitySolidServer/CommunitySolidServer.git
synced 2024-10-03 14:55:10 +00:00
docs: Add pod README.
This commit is contained in:
parent
705a06633e
commit
defdb32a35
@ -135,7 +135,11 @@ export class RegistrationHandler extends HttpHandler {
|
|||||||
if (result.createPod) {
|
if (result.createPod) {
|
||||||
podBaseUrl = podBaseUrl ?? this.identifierGenerator.generate(result.podName!);
|
podBaseUrl = podBaseUrl ?? this.identifierGenerator.generate(result.podName!);
|
||||||
try {
|
try {
|
||||||
await this.podManager.createPod(podBaseUrl, { ...result.data, webId: result.webId! });
|
await this.podManager.createPod(podBaseUrl, {
|
||||||
|
...result.data,
|
||||||
|
podBaseUrl: podBaseUrl.path,
|
||||||
|
webId: result.webId!,
|
||||||
|
});
|
||||||
} catch (error: unknown) {
|
} catch (error: unknown) {
|
||||||
// In case pod creation errors we don't want to keep the account
|
// In case pod creation errors we don't want to keep the account
|
||||||
if (result.register) {
|
if (result.register) {
|
||||||
|
22
templates/pod/README$.md.hbs
Normal file
22
templates/pod/README$.md.hbs
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
# Welcome to your pod
|
||||||
|
|
||||||
|
## A place to store your data
|
||||||
|
Your pod is a **secure storage space** for your documents and data.
|
||||||
|
<br>
|
||||||
|
You can choose to share those with other people and apps.
|
||||||
|
|
||||||
|
As the owner of this pod,
|
||||||
|
identified by <a href="{{webId}}">{{webId}}</a>,
|
||||||
|
you have access to all of your documents.
|
||||||
|
|
||||||
|
## Working with your pod
|
||||||
|
The easiest way to interact with pods
|
||||||
|
is through Solid apps.
|
||||||
|
<br>
|
||||||
|
For example,
|
||||||
|
you can open your pod in [Databrowser](https://solid.github.io/mashlib/dist/browse.html?uri={{podBaseUrl}}).
|
||||||
|
|
||||||
|
## Learn more
|
||||||
|
The [Solid website](https://solidproject.org/)
|
||||||
|
and the people on its [forum](https://forum.solidproject.org/)
|
||||||
|
will be glad to help you on your journey.
|
12
templates/pod/README.acl.hbs
Normal file
12
templates/pod/README.acl.hbs
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
@prefix acl: <http://www.w3.org/ns/auth/acl#>.
|
||||||
|
@prefix foaf: <http://xmlns.com/foaf/0.1/>.
|
||||||
|
|
||||||
|
<#public>
|
||||||
|
acl:accessTo <./README>;
|
||||||
|
acl:agentClass foaf:Agent;
|
||||||
|
acl:mode acl:Read.
|
||||||
|
|
||||||
|
<#owner>
|
||||||
|
acl:accessTo <./README>;
|
||||||
|
acl:agent <{{webId}}>;
|
||||||
|
acl:mode acl:Read, acl:Write, acl:Control.
|
@ -20,6 +20,7 @@ describe('A RegistrationHandler', (): void => {
|
|||||||
const password = 'superSecretPassword';
|
const password = 'superSecretPassword';
|
||||||
const confirmPassword = password;
|
const confirmPassword = password;
|
||||||
const podName = 'alice';
|
const podName = 'alice';
|
||||||
|
const podBaseUrl = 'http://test.com/alice/';
|
||||||
// Strings instead of booleans because this is form data
|
// Strings instead of booleans because this is form data
|
||||||
const createWebId = 'true';
|
const createWebId = 'true';
|
||||||
const register = 'true';
|
const register = 'true';
|
||||||
@ -178,7 +179,9 @@ describe('A RegistrationHandler', (): void => {
|
|||||||
expect(identifierGenerator.generate).toHaveBeenCalledTimes(1);
|
expect(identifierGenerator.generate).toHaveBeenCalledTimes(1);
|
||||||
expect(identifierGenerator.generate).toHaveBeenLastCalledWith(podName);
|
expect(identifierGenerator.generate).toHaveBeenLastCalledWith(podName);
|
||||||
expect(podManager.createPod).toHaveBeenCalledTimes(1);
|
expect(podManager.createPod).toHaveBeenCalledTimes(1);
|
||||||
expect(podManager.createPod).toHaveBeenLastCalledWith({ path: `${baseUrl}${podName}/` }, params);
|
expect(podManager.createPod).toHaveBeenLastCalledWith(
|
||||||
|
{ path: `${baseUrl}${podName}/` }, { podBaseUrl, ...params },
|
||||||
|
);
|
||||||
|
|
||||||
expect(accountStore.create).toHaveBeenCalledTimes(0);
|
expect(accountStore.create).toHaveBeenCalledTimes(0);
|
||||||
expect(accountStore.verify).toHaveBeenCalledTimes(0);
|
expect(accountStore.verify).toHaveBeenCalledTimes(0);
|
||||||
@ -198,7 +201,9 @@ describe('A RegistrationHandler', (): void => {
|
|||||||
expect(identifierGenerator.generate).toHaveBeenLastCalledWith(podName);
|
expect(identifierGenerator.generate).toHaveBeenLastCalledWith(podName);
|
||||||
(params as any).oidcIssuer = baseUrl;
|
(params as any).oidcIssuer = baseUrl;
|
||||||
expect(podManager.createPod).toHaveBeenCalledTimes(1);
|
expect(podManager.createPod).toHaveBeenCalledTimes(1);
|
||||||
expect(podManager.createPod).toHaveBeenLastCalledWith({ path: `${baseUrl}${podName}/` }, params);
|
expect(podManager.createPod).toHaveBeenLastCalledWith(
|
||||||
|
{ path: `${baseUrl}${podName}/` }, { podBaseUrl, ...params },
|
||||||
|
);
|
||||||
expect(accountStore.verify).toHaveBeenCalledTimes(1);
|
expect(accountStore.verify).toHaveBeenCalledTimes(1);
|
||||||
expect(accountStore.verify).toHaveBeenLastCalledWith(email);
|
expect(accountStore.verify).toHaveBeenLastCalledWith(email);
|
||||||
|
|
||||||
@ -219,7 +224,9 @@ describe('A RegistrationHandler', (): void => {
|
|||||||
expect(identifierGenerator.generate).toHaveBeenLastCalledWith(podName);
|
expect(identifierGenerator.generate).toHaveBeenLastCalledWith(podName);
|
||||||
(params as any).oidcIssuer = baseUrl;
|
(params as any).oidcIssuer = baseUrl;
|
||||||
expect(podManager.createPod).toHaveBeenCalledTimes(1);
|
expect(podManager.createPod).toHaveBeenCalledTimes(1);
|
||||||
expect(podManager.createPod).toHaveBeenLastCalledWith({ path: `${baseUrl}${podName}/` }, params);
|
expect(podManager.createPod).toHaveBeenLastCalledWith(
|
||||||
|
{ path: `${baseUrl}${podName}/` }, { podBaseUrl, ...params },
|
||||||
|
);
|
||||||
expect(accountStore.deleteAccount).toHaveBeenCalledTimes(1);
|
expect(accountStore.deleteAccount).toHaveBeenCalledTimes(1);
|
||||||
expect(accountStore.deleteAccount).toHaveBeenLastCalledWith(email);
|
expect(accountStore.deleteAccount).toHaveBeenLastCalledWith(email);
|
||||||
|
|
||||||
@ -239,9 +246,10 @@ describe('A RegistrationHandler', (): void => {
|
|||||||
expect(accountStore.create).toHaveBeenLastCalledWith(email, generatedWebID, password);
|
expect(accountStore.create).toHaveBeenLastCalledWith(email, generatedWebID, password);
|
||||||
expect(accountStore.verify).toHaveBeenCalledTimes(1);
|
expect(accountStore.verify).toHaveBeenCalledTimes(1);
|
||||||
expect(accountStore.verify).toHaveBeenLastCalledWith(email);
|
expect(accountStore.verify).toHaveBeenLastCalledWith(email);
|
||||||
const podParams = { ...params, oidcIssuer: baseUrl, webId: generatedWebID };
|
|
||||||
expect(podManager.createPod).toHaveBeenCalledTimes(1);
|
expect(podManager.createPod).toHaveBeenCalledTimes(1);
|
||||||
expect(podManager.createPod).toHaveBeenLastCalledWith({ path: `${baseUrl}${podName}/` }, podParams);
|
expect(podManager.createPod).toHaveBeenLastCalledWith(
|
||||||
|
{ path: `${baseUrl}${podName}/` }, { ...params, podBaseUrl, oidcIssuer: baseUrl, webId: generatedWebID },
|
||||||
|
);
|
||||||
|
|
||||||
expect(ownershipValidator.handleSafe).toHaveBeenCalledTimes(0);
|
expect(ownershipValidator.handleSafe).toHaveBeenCalledTimes(0);
|
||||||
expect(accountStore.deleteAccount).toHaveBeenCalledTimes(0);
|
expect(accountStore.deleteAccount).toHaveBeenCalledTimes(0);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user