From 5ff9585fd2a6a42ca9ec541240ed7e3b84740646 Mon Sep 17 00:00:00 2001 From: Zelzahn Date: Wed, 24 Jul 2024 13:55:07 +0200 Subject: [PATCH] Add controller --- .vitepress/config.mts | 167 +++++++++--------- deliverables/controller.md | 11 ++ {loama => deliverables/loama}/design.md | 0 {loama => deliverables/loama}/development.md | 0 {loama => deliverables/loama}/feedback.md | 0 {loama => deliverables/loama}/index.md | 0 {loama => deliverables/loama}/limitations.md | 0 .../toco}/doctorapp/index.md | 0 {toco => deliverables/toco}/mockbook/index.md | 0 9 files changed, 95 insertions(+), 83 deletions(-) create mode 100644 deliverables/controller.md rename {loama => deliverables/loama}/design.md (100%) rename {loama => deliverables/loama}/development.md (100%) rename {loama => deliverables/loama}/feedback.md (100%) rename {loama => deliverables/loama}/index.md (100%) rename {loama => deliverables/loama}/limitations.md (100%) rename {toco => deliverables/toco}/doctorapp/index.md (100%) rename {toco => deliverables/toco}/mockbook/index.md (100%) diff --git a/.vitepress/config.mts b/.vitepress/config.mts index a40448c..39d5125 100644 --- a/.vitepress/config.mts +++ b/.vitepress/config.mts @@ -1,54 +1,63 @@ -import { defineConfig } from 'vitepress' +import { defineConfig } from "vitepress"; const projectSidebar = { - text: "Project", items: [ + text: "Project", + items: [ { - text: 'Goal', - link: '/project/goal' + text: "Goal", + link: "project/goal", }, { - text: 'Audience', - link: '/project/audience' - } - ] + text: "Audience", + link: "project/audience", + }, + ], }; const loamaSidebar = { - text: 'Loama', + text: "Loama", items: [ { - text: 'Design', - link: '/loama/design.md' + text: "Design", + link: "deliverables/loama/design.md", }, { - text: 'Development', - link: '/loama/development' + text: "Development", + link: "deliverables/loama/development", }, { - text: 'Current Limitations', - link: '/loama/limitations' + text: "Current Limitations", + link: "deliverables/loama/limitations", }, { - text: 'Feedback & Future suggestions', - link: '/loama/feedback' - } - ] + text: "Feedback & Future suggestions", + link: "deliverables/loama/feedback", + }, + ], }; const mockAppSidebar = { - text: 'Mock Apps', + text: "Mock Apps", items: [ { - text: 'Mockbook', - link: '/toco/mockbook/index' - + text: "Mockbook", + link: "deliverables/toco/mockbook/index", }, { - text: 'Doctorapp', - link: '/toco/doctorapp/index', - } - ] -} + text: "Doctorapp", + link: "deliverables/toco/doctorapp/index", + }, + ], +}; + +const deliverablesSidebar = { + text: "Deliverables", + items: [ + loamaSidebar, + mockAppSidebar, + { text: "Controller", link: "deliverables/controller" }, + ], +}; // https://vitepress.dev/reference/site-config export default defineConfig({ @@ -56,35 +65,50 @@ export default defineConfig({ title: "Loama", description: "The documentation & handover website of the LOAMA project", themeConfig: { - logo: '/loama-logo.svg', + logo: "/loama-logo.svg", socialLinks: [ - { icon: 'github', link: 'https://github.com/osoc24' }, - { icon: 'linkedin', link: 'https://www.linkedin.com/company/open-summer-of-code/posts/?feedView=all' }, + { icon: "github", link: "https://github.com/osoc24" }, + { + icon: "linkedin", + link: "https://www.linkedin.com/company/open-summer-of-code/posts/?feedView=all", + }, ], search: { - provider: 'local' + provider: "local", }, nav: [ - { text: 'Home', link: '/' }, + { text: "Home", link: "/" }, { - text: 'Project', items: [ - { text: 'Why?', link: "/project/goal" }, - { text: 'For whom?', link: "/project/audience" }, - ] + text: "Project", + items: [ + { text: "Why?", link: "/project/goal" }, + { text: "For whom?", link: "/project/audience" }, + ], }, { - text: 'Loama', items: [ - { text: 'Design', link: '/loama/design.md' }, - { text: 'Development', link: '/loama/development' }, - { text: "Feedback", link: "/loama/feedback" } - ] + text: "Deliverables", + items: [ + { + text: "Loama", + items: [ + { text: "Design", link: "/deliverables/loama/design.md" }, + { text: "Development", link: "/deliverables/loama/development" }, + { text: "Feedback", link: "/deliverables/loama/feedback" }, + ], + }, + { + text: "Mock Apps", + items: [ + { text: "MockBook", link: "/deliverables/toco/mockbook/index" }, + { text: "Docterapp", link: "/deliverables/toco/doctorapp/index" }, + ], + }, + { + text: "Controller", + link: "/deliverables/controller", + }, + ], }, - { - text: "Mock Apps", items: [ - { text: "MockBook", link: "/toco/mockbook/index" }, - { text: "Docterapp", link: "/toco/doctorapp/index" } - ] - } ], sidebar: { @@ -92,55 +116,32 @@ export default defineConfig({ { text: "Home", link: "/" }, { text: "Lexicon", - link: "/lexicon" + link: "/lexicon", }, { ...projectSidebar, - collapsed: true - }, - { - ...loamaSidebar, - collapsed: true + collapsed: true, }, { - ...mockAppSidebar, - collapsed: true + ...deliverablesSidebar, + collapsed: true, }, { text: "Team", link: "/team" }, ], - '/project': [ + "/project": [ projectSidebar, { - ...loamaSidebar, - collapsed: true + ...deliverablesSidebar, + collapsed: true, }, - { - ...mockAppSidebar, - collapsed: true - } ], - '/loama': [ + "/deliverables": [ { ...projectSidebar, - collapsed: true + collapsed: true, }, - loamaSidebar, - { - ...mockAppSidebar, - collapsed: true - } + deliverablesSidebar, ], - '/toco': [ - { - ...projectSidebar, - collapsed: true - }, - { - ...loamaSidebar, - collapsed: true - }, - mockAppSidebar - ] }, - } -}) + }, +}); diff --git a/deliverables/controller.md b/deliverables/controller.md new file mode 100644 index 0000000..e3879c0 --- /dev/null +++ b/deliverables/controller.md @@ -0,0 +1,11 @@ +# Controller + +The intent of this library is to provide a wrapper around the [@inrupt/solid-client](https://docs.inrupt.com/developer-tools/api/javascript/solid-client/) library, such that more of the intricate Solid details are abstracted away. Furthermore, because this library lives outside of LOAMA it's easy to swap this controller out with another one that doesn't make use of [@inrupt/solid-client](https://docs.inrupt.com/developer-tools/api/javascript/solid-client/) under the hood. + +Internally the controller uses a JSON file called `index`, which is stored in the root of the pod, to maintain an overview of the currently managed connections inside of LOAMA. It is entirely possible, though, that the ACL files contain permissions which aren't reflected inside the `index.json`. This is not an issue, as over time and after repeated usage the `index.json` will synchronize naturally. + +To have the distinction between this permission is destined to manage an agent/ group and this permission is for the general public a nullable `UserType` object is used. Wherein a null signifies that it's for the public access. + +## Deviations from `solid-client` + +The controller merges the `ControlRead` and `ControlWrite` into `Control`. Furthermore, the `AccessModes` is mapped to a `Permission[]`. As the `AccessModes` is an object where the key is the permission and the value is a boolean indicating if it should be removed or given. In the `Permission[]` this is interpreted as: If it's there it's given, otherwise not. diff --git a/loama/design.md b/deliverables/loama/design.md similarity index 100% rename from loama/design.md rename to deliverables/loama/design.md diff --git a/loama/development.md b/deliverables/loama/development.md similarity index 100% rename from loama/development.md rename to deliverables/loama/development.md diff --git a/loama/feedback.md b/deliverables/loama/feedback.md similarity index 100% rename from loama/feedback.md rename to deliverables/loama/feedback.md diff --git a/loama/index.md b/deliverables/loama/index.md similarity index 100% rename from loama/index.md rename to deliverables/loama/index.md diff --git a/loama/limitations.md b/deliverables/loama/limitations.md similarity index 100% rename from loama/limitations.md rename to deliverables/loama/limitations.md diff --git a/toco/doctorapp/index.md b/deliverables/toco/doctorapp/index.md similarity index 100% rename from toco/doctorapp/index.md rename to deliverables/toco/doctorapp/index.md diff --git a/toco/mockbook/index.md b/deliverables/toco/mockbook/index.md similarity index 100% rename from toco/mockbook/index.md rename to deliverables/toco/mockbook/index.md