Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
d9f617b
support for manage access dialog
SharonStrats Sep 26, 2026
10ae9ef
Add tests for new acl functions
SharonStrats Sep 27, 2026
0431915
made changes to support PR feedback from solid-ui PR
SharonStrats Sep 27, 2026
1e5242b
Merge pull request #331 from SolidOS/feat/access
SharonStrats Oct 3, 2026
b0c6e2c
acl classify subject
SharonStrats Oct 4, 2026
918c145
directory logic
SharonStrats Oct 4, 2026
aab2b85
Merge pull request #336 from SolidOS/feat/access-input
SharonStrats Oct 6, 2026
879d79f
needed exported types
SharonStrats Oct 6, 2026
eac4b08
Merge pull request #337 from SolidOS/fix/solidui
SharonStrats Oct 6, 2026
20af41a
update version
SharonStrats Oct 7, 2026
0e6dcd6
Merge pull request #340 from SolidOS/fix/version
SharonStrats Oct 7, 2026
52001b9
support the general access dialog section
SharonStrats Oct 9, 2026
f9eb986
Fix AuthenticatedAgent IRI in resourceLogic test
SharonStrats Oct 9, 2026
ab36e23
Fix AuthenticatedAgent IRI in resourceLogic test
SharonStrats Oct 9, 2026
ad8792f
Merge pull request #341 from SolidOS/feat/access-general
SharonStrats Oct 9, 2026
e8e6dd0
change dokeili version, trying to trigger publish
SharonStrats Oct 9, 2026
da4a033
Merge pull request #342 from SolidOS/fix/publish
SharonStrats Oct 9, 2026
c518df7
saving latest work
SharonStrats Oct 14, 2026
5e26ad0
move the content fetch from source pane to resource logic
SharonStrats Oct 16, 2026
a657fc5
Added tests
SharonStrats Oct 16, 2026
1e8e448
Add new features to ensure we do not lose functionality from what was…
SharonStrats Oct 18, 2026
1f9ccd4
Handle when multiple principal contents authorizations have edits
SharonStrats Oct 20, 2026
9215db6
Safety for conditions and authorization ids
SharonStrats Oct 20, 2026
38a4a4b
Normalize role handling and prepare for owner (write locked)
SharonStrats Oct 20, 2026
ebb754f
update version
SharonStrats Oct 20, 2026
142a912
address PR feedback
SharonStrats Oct 20, 2026
51a1b73
handle unknown public
SharonStrats Oct 21, 2026
1afd7ff
Merge pull request #345 from SolidOS/feat/acl-match-legacy
SharonStrats Oct 21, 2026
d35f2dd
Merge branch 'staging' into task/restructure
SharonStrats Oct 21, 2026
2ca93fb
prefer authfetch to fetch
SharonStrats Oct 23, 2026
884f8c1
fixed tests
SharonStrats Oct 23, 2026
6987cbe
Merge pull request #346 from SolidOS/task/restructure
SharonStrats Oct 23, 2026
310cb03
feat(resource): add cached media type detection
SharonStrats Oct 26, 2026
961a6b3
Merge pull request #348 from SolidOS/feat/isimage
SharonStrats Oct 26, 2026
52da868
move vite to devdepencies
SharonStrats Nov 2, 2026
d169f2b
Merge pull request #353 from SolidOS/fix/vite-dep
SharonStrats Nov 2, 2026
86fc380
fix recursive delete
SharonStrats Nov 7, 2026
2c38e62
Merge pull request #356 from SolidOS/fix/recursive-del
SharonStrats Nov 7, 2026
049e4dc
Bring over upload from the widgets so it can be reused
SharonStrats Nov 6, 2026
130612f
Fix variable name for folderName assignment
SharonStrats Nov 6, 2026
706e034
Improve error handling for file upload response
SharonStrats Nov 6, 2026
27c5194
Merge pull request #354 from SolidOS/add-upload
SharonStrats Nov 7, 2026
70e892e
log what we delete
timea-solid Nov 9, 2026
4bac07a
Merge pull request #357 from SolidOS/deleteContainerMessage
timea-solid Nov 9, 2026
5339fd9
update dependencies
bourgeoa Nov 16, 2026
8979309
6.1.0
bourgeoa Nov 16, 2026
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
2,635 changes: 949 additions & 1,686 deletions package-lock.json

Large diffs are not rendered by default.

30 changes: 16 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"name": "solid-logic",
"version": "6.0.0",
"version": "6.1.0",
"description": "Core business logic of SolidOS",
"main": "dist/index.cjs.js",
"module": "dist/index.esm.js",
"types": "dist/index.d.ts",
"exports": {
".": {
"types": "./dist/index.d.ts",
"import": "./dist/index.esm.js",
"require": "./dist/index.cjs.js",
"types": "./dist/index.d.ts"
"require": "./dist/index.cjs.js"
}
},
"sideEffects": false,
Expand All @@ -20,7 +20,8 @@
],
"scripts": {
"clean": "rm -rf dist src/versionInfo.ts",
"build": "npm run clean && npm run typecheck && vite build",
"build": "npm run clean && npm run typecheck && vite build && npm run build-types",
"build-types": "tsc --emitDeclarationOnly",
"watch": "vite build --watch",
"postbuild": "npm run postbuild-js",
"postbuild-js": "rm -f dist/versionInfo.d.ts dist/versionInfo.d.ts.map dist/index.js dist/index.js.map",
Expand Down Expand Up @@ -49,24 +50,25 @@
"node": ">=18"
},
"devDependencies": {
"@typescript-eslint/parser": "^8.61.1",
"eslint": "^9.39.4",
"@typescript-eslint/parser": "^8.72.2",
"eslint": "^9.39.5",
"eslint-config-prettier": "^10.1.8",
"eslint-plugin-import": "^2.32.0",
"vitest": "^4.1.9",
"jsdom": "^21.1.0",
"jsdom": "^21.1.2",
"rdflib": "^2.4.1",
"ts-loader": "^9.6.1",
"tslib": "^2.8.1",
"ts-loader": "^9.6.2",
"tslib": "^2.9.1",
"typescript": "^5.9.3",
"@vitest/coverage-v8": "^4.1.9",
"@vitest/coverage-v8": "^4.1.12",
"vite": "^8.3.8",
"vitest": "^4.1.12",
"solidos-toolkit": "dev"
},
"dependencies": {
"@dokieli/web-access-control": "^1.1.0",
"@uvdsl/solid-oidc-client-browser": "^0.2.3",
"solid-namespace": "^0.5.4",
"vite": "^8.0.16",
"vitest": "^4.1.9"
"mime-types": "^3.0.2",
"solid-namespace": "^0.5.4"
},
"solidosDependencies": [
"rdflib"
Expand Down
102 changes: 102 additions & 0 deletions src/acl/accessControlSubjects.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
import { LiveStore, sym } from 'rdflib'
import { ns } from '../util/ns'
import * as debug from '../util/debug'

export type AccessControlSubjectKind = 'agent' | 'agentGroup' | 'agentClass' | 'origin'

export type AccessControlSubject = {
kind: AccessControlSubjectKind
subjectValue: string
}

const ACCESS_CONTROL_SUBJECT_GROUPS = {
agentClass: [ns.foaf('Agent'), ns.acl('AuthenticatedAgent'), ns.rdf('Resource'), ns.owl('Thing')],
agent: [ns.vcard('WebID'), ns.vcard('Individual'), ns.foaf('Person'), ns.foaf('Agent')],
agentGroup: [ns.vcard('Group')],
origin: [ns.solid('AppProvider'), ns.solid('AppProviderClass')]
} as const

function hasKnownTypes (types: Record<string, unknown>): boolean {
return Object.keys(types).length > 0
}

function isHttpUrl (value: string): boolean {
return value.startsWith('http://') || value.startsWith('https://')
}

function isBareOriginUrl (value: string): boolean {
try {
const parsed = new URL(value)
return (parsed.protocol === 'http:' || parsed.protocol === 'https:') &&
Boolean(parsed.hostname) &&
parsed.pathname === '/' &&
!parsed.search &&
!parsed.hash &&
!parsed.username &&
!parsed.password
} catch (_error) {
return false
}
}

function normalizeOriginUrl (value: string): string {
try {
const parsed = new URL(value)
if (
(parsed.protocol === 'http:' || parsed.protocol === 'https:') &&
parsed.hostname &&
parsed.pathname === '/' &&
!parsed.search &&
!parsed.hash &&
!parsed.username &&
!parsed.password
) {
return `${parsed.protocol}//${parsed.host}`
}
} catch (_error) {
// Return the original value below when parsing fails.
}

return value
}

export async function classifyAccessControlSubject (store: LiveStore, principle: string): Promise<AccessControlSubject | undefined> {
const subject = sym(principle)
let types = store.findTypeURIs(subject)

if (isBareOriginUrl(principle)) {
return { kind: 'origin', subjectValue: normalizeOriginUrl(principle) }
}

if (!hasKnownTypes(types) && isHttpUrl(principle)) {
try {
await store.fetcher.load(subject.doc())
} catch (error) {
debug.error(`Failed to load access target ${principle}`, error)
}

types = store.findTypeURIs(subject)
}

if (ACCESS_CONTROL_SUBJECT_GROUPS.origin.some(term => term.uri in types)) {
return { kind: 'origin', subjectValue: principle }
}

if (ACCESS_CONTROL_SUBJECT_GROUPS.agent.some(term => term.uri in types)) {
const preferredURI = store.any(subject, ns.foaf('preferredURI'))
return {
kind: 'agent',
subjectValue: preferredURI?.value ?? principle
}
}

if (ACCESS_CONTROL_SUBJECT_GROUPS.agentGroup.some(term => term.uri in types)) {
return { kind: 'agentGroup', subjectValue: principle }
}

if (ACCESS_CONTROL_SUBJECT_GROUPS.agentClass.some(term => subject.sameTerm(term))) {
return { kind: 'agentClass', subjectValue: principle }
}

return undefined
}
Loading
Loading