Skip to content

Commit 22b21f7

Browse files
committed
Some basic infrastructure
1 parent e63734e commit 22b21f7

File tree

4 files changed

+52
-0
lines changed

4 files changed

+52
-0
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
@prefix solid: <http://www.w3.org/ns/solid/terms#>.
2+
@prefix unit: <http://www.w3.invalid/ns#>.
3+
4+
<>
5+
a pim:ConfigurationFile;
6+
7+
dct:description "Administrative settings for the server that are only readable to the user." .
8+
9+
<{{webId}}>
10+
solid:storageQuota "25"^^unit:megabyte .
11+
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
@prefix acl: <http://www.w3.org/ns/auth/acl#>.
2+
@prefix foaf: <http://xmlns.com/foaf/0.1/>.
3+
4+
<#owner>
5+
a acl:Authorization;
6+
7+
acl:agent
8+
<{{webId}}>;
9+
10+
acl:accessTo <./serverSide.ttl>;
11+
12+
acl:mode acl:Read .
13+

lib/utils.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,3 +239,18 @@ function routeResolvedFile (router, path, file, appendFileName = true) {
239239
const fullFile = require.resolve(file)
240240
router.get(fullPath, (req, res) => res.sendFile(fullFile))
241241
}
242+
243+
/**
244+
* Returns the number of bytes that the user owning the requested POD
245+
* may store or Infinity if no limit
246+
*/
247+
248+
/* function getQuota (req) {
249+
// const path = reqToPath(req)
250+
var quota = 25
251+
return quota
252+
}
253+
254+
/* function overQuota (req) {
255+
return getQuota(req)
256+
} */

test/integration/quota-test.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
var expect = require('chai').expect
2+
// var getQuota = require('../../lib/utils').getQuota
3+
const path = require('path')
4+
const read = require('../utils').read
5+
const host = 'localhost:3457'
6+
var domain = host.split(':')[0]
7+
8+
describe('Quota', function () {
9+
it('Check that the file is readable', function () {
10+
var prefs = read(path.join('accounts/nicola.' + domain, 'settings/serverSide.ttl'))
11+
expect(prefs).to.be.true()
12+
})
13+
})

0 commit comments

Comments
 (0)