Skip to content

Commit

Permalink
Merge pull request #210 from potherca-contrib/fix/solid-community
Browse files Browse the repository at this point in the history
Change all occurrences of solid.community to solidcommunity.net.
  • Loading branch information
bourgeoa committed Oct 14, 2022
2 parents 855a768 + ec54a18 commit c38641b
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 21 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -420,11 +420,11 @@ example 2 :
// create a block rule
let aclUsers = await fc.acl.addUserMode({}, [{ agentClass: 'Agent' }], ['Read'])
// add an other rule in the block rule
aclUsers = await fc.acl.addUserMode(aclUsers, [{ agent: 'https://example.solid.community/profile/card#me' }], ['Read', 'Write', 'Control'], ['accessTo'])
aclUsers = await fc.acl.addUserMode(aclUsers, [{ agent: 'https://example.solidcommunity.net/profile/card#me' }], ['Read', 'Write', 'Control'], ['accessTo'])

// build the aclContent
const aclBloks = [aclUsers] // array of block rules
const aclContent = await fc.acl.createContent('https://example.solid.community/public/text.txt', aclBloks)
const aclContent = await fc.acl.createContent('https://example.solidcommunity.net/public/text.txt', aclBloks)
console.log('build an aclContent ' + aclContent)


Expand Down Expand Up @@ -460,7 +460,7 @@ const aclPredicates = ['agent', 'agentClass', 'agentGroup', 'origin']
const aclAccess = ['accessTo', 'default']
- userAgent : an array of objects (predicate: object). example: [{ agent: 'https://example.com/profile/card#me'}, { agentClass: 'Agent' }, { origin: 'https://solid.community' }, { default: '' }]
- userAgent : an array of objects (predicate: object). example: [{ agent: 'https://example.com/profile/card#me'}, { agentClass: 'Agent' }, { origin: 'https://solidcommunity.net' }, { default: '' }]
- userMode : an array of acl modes. example: ['Read', 'Write']. To be applied to each element of userAgent
- userAccess : an array of acl access. example : ['accessTo', 'default']
Expand Down
4 changes: 2 additions & 2 deletions docs/examples/browser-test.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
*/
cfg = batch.getConfig({
idp : 'https://solid.community',
base : 'https://jeffz.solid.community',
idp : 'https://solidcommunity.net',
base : 'https://jeffz.solidcommunity.net',
test : '/public/test/'
});
</script>
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/simple/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
if (session) {
return session
} else {
const popupUri = 'https://solid.community/common/popup.html';
const popupUri = 'https://solidcommunity.net/common/popup.html';
return solid.auth.popupLogin({ popupUri });
}
}
Expand Down
1 change: 1 addition & 0 deletions docs/examples/upload/upload.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ const fileClient = new SolidFileClient( auth, { enableLogging: true })
}
//end new
/*old
document.getElementById('login').addEventListener('click', e => solid.auth.popupLogin({ popupUri: 'https://solidcommunity.net/common/popup.html' }))
document.getElementById('logout').addEventListener('click', e => solid.auth.logout())
solid.auth.trackSession(session => {
Expand Down
2 changes: 1 addition & 1 deletion docs/node-upload.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const fc = new FileClient(auth)

// CHANGE THIS REMOTE URL TO ONE IN YOUR OWN POD!
//
const remote = "https://jeffz.solid.community/public/square.png"
const remote = "https://jeffz.solidcommunity.net/public/square.png"
const local = "file://" + process.cwd() + "/square.png"

async function run(){
Expand Down
2 changes: 1 addition & 1 deletion docs/using-with-node.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
When logging in from a node script, you may either pass the login credentials as an object, or store them in a file or in environment settings. See the [solid-auth-cli](https://github.com/jeff-zucker/solid-auth-cli) documentation for details of storing credentials. Here's how to use a credential object in a script.
```javascript
const credentials = {
"idp" : "https://solid.community", // or other identity provider
"idp" : "https://solidcommunity.net", // or other identity provider
"username" : "YOUR-USER-NAME",
"password" : "YOUR-PASSWORD"
}
Expand Down
24 changes: 12 additions & 12 deletions tests/aclParser.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ const prefix = test => `@prefix : <#>.
const append = (webId, access, inherit='') => `:Append${inherit}
a acl:Authorization;
${access} acl:agent <${webId}me>;
acl:origin <https://solid.community>;
acl:origin <https://solidcommunity.net>;
acl:mode acl:Append.
`
const appendDefault = (access) => `:AppendDefault
Expand All @@ -62,7 +62,7 @@ ${access} acl:agentClass foaf:Agent;
const read = (webId, access, inherit='') => `:Read${inherit}
a acl:Authorization;
${access} acl:agent <${webId}me>;
acl:agent <https://test.solid.community/profile/card#me>;
acl:agent <https://test.solidcommunity.net/profile/card#me>;
acl:mode acl:Read.
`
const readWrite = (access, inherit='') => `:ReadWrite${inherit}
Expand Down Expand Up @@ -112,14 +112,14 @@ describe('aclParser', () => {
test('users object for file', async () => {
const content = acl0('file.ext', '/profile/card#', '', '')
const users = await api.acl.contentParser(base+'file.ext', content)
const keysUsers = ['agent&' + host + 'profile/card#me', 'agent&https://test.solid.community/profile/card#me', 'agentClass&AuthenticatedAgent', 'agentClass&Agent']
const keysUsers = ['agent&' + host + 'profile/card#me', 'agent&https://test.solidcommunity.net/profile/card#me', 'agentClass&AuthenticatedAgent', 'agentClass&Agent']
const usersKeys = Object.keys(users)
expect(usersKeys).toEqual(keysUsers)
})
test('users object for folder', async () => {
const content = acl0('./', '/profile/card#', '', inherit)
const users = await api.acl.contentParser(base, content)
const keysUsers = ['agent&' + host + 'profile/card#me', 'agent&https://test.solid.community/profile/card#me','agentClass&AuthenticatedAgent', 'agentClass&Agent']
const keysUsers = ['agent&' + host + 'profile/card#me', 'agent&https://test.solidcommunity.net/profile/card#me','agentClass&AuthenticatedAgent', 'agentClass&Agent']
const usersKeys = Object.keys(users)
expect(usersKeys).toEqual(keysUsers)
})
Expand All @@ -145,38 +145,38 @@ describe('aclParser', () => {
test('remove "agents", create aclContent for folder', async () => {
const content = acl0('./', '/profile/card#', defaultTarget, inherit)
let users = await api.acl.contentParser(base, content)
users = await api.acl.deleteUserMode(users, [{ agent: host + 'profile/card#me' }, { agent: 'https://test.solid.community/profile/card#me' }]) // { agentClass: 'Agent'}])
users = await api.acl.deleteUserMode(users, [{ agent: host + 'profile/card#me' }, { agent: 'https://test.solidcommunity.net/profile/card#me' }]) // { agentClass: 'Agent'}])
const aclContent = await api.acl.createContent(base, users)
expect(aclContent).toBe(acl1('./', '/profile/card#', defaultTarget, ''))
})
test('add "Append" to "agent" and "origin", create aclContent for folder', async () => {
const content = acl1('./', '/profile/card#', defaultTarget, inherit)
let users = await api.acl.contentParser(base, content)
users = await api.acl.addUserMode(users, [{ agent: host + 'profile/card#me' }, { origin: 'https://solid.community'}], ['Append'], ['accessTo', 'default'])
users = await api.acl.addUserMode(users, [{ agent: host + 'profile/card#me' }, { origin: 'https://solidcommunity.net'}], ['Append'], ['accessTo', 'default'])
const aclContent = await api.acl.createContent(base, users)
expect(aclContent).toBe(acl2('./', '/profile/card#', defaultTarget, ''))
})
test('build acl for file from void content, accessTo by default', async () => {
let users = await api.acl.addUserMode({}, [{ agent: '/profile/card#me'}, { agent: 'https://test.solid.community/profile/card#me'}], ['Read']) // , ['accessTo'])
let users = await api.acl.addUserMode({}, [{ agent: '/profile/card#me'}, { agent: 'https://test.solidcommunity.net/profile/card#me'}], ['Read']) // , ['accessTo'])
users = await api.acl.addUserMode(users, [{ agentClass: 'Agent'}], ['Read', 'Write', 'Control'])
const aclContent = await api.acl.createContent(base + 'file.ext', [users])
expect(aclContent).toBe(acl4('file.ext', '/profile/card#', accessOnly, ''))
})
test('build acl for folder from void content, with "default" only to rule :Read', async () => {
let users = await api.acl.addUserMode({}, [{ agent: '/profile/card#me'}, { agent: 'https://test.solid.community/profile/card#me'}], ['Read'], ['default'])
let users = await api.acl.addUserMode({}, [{ agent: '/profile/card#me'}, { agent: 'https://test.solidcommunity.net/profile/card#me'}], ['Read'], ['default'])
.then(async users => await api.acl.addUserMode(users, [{ agentClass: 'Agent'}], ['Read', 'Write', 'Control'], ['accessTo']))
let users1 = await api.acl.addUserMode({}, [{ agentClass: 'Agent' }], ['Append'], ['default'])
const aclContent = await api.acl.createContent(base, [users, users1])
expect(aclContent).toBe(acl5('./', '/profile/card#', defaultOnly, accessOnly, inherit))
})
test('bad acl for folder no acl:control', async () => {
let users = await api.acl.addUserMode({}, [{ agentClass: 'Agent'}], ['Read'])
.then(async users => await api.acl.addUserMode(users, [{ agent: '/profile/card#me'}, { agent: 'https://test.solid.community/profile/card#me'}], ['Read', 'Write'], ['accessTo']))
.then(async users => await api.acl.addUserMode(users, [{ agent: '/profile/card#me'}, { agent: 'https://test.solidcommunity.net/profile/card#me'}], ['Read', 'Write'], ['accessTo']))
return expect(api.acl.createContent(base, users)).rejects.toThrow('no acl:Control')
})
test('bad acl for folder no agent with control and acl:accessTo', async () => {
let users = await api.acl.addUserMode({}, [{ agentClass: 'Agent'}], ['Read'])
.then(async users => await api.acl.addUserMode(users, [{ agent: '/profile/card#me'}, { agent: 'https://test.solid.community/profile/card#me'}], ['Read', 'Write', 'Control'], ['default']))
.then(async users => await api.acl.addUserMode(users, [{ agent: '/profile/card#me'}, { agent: 'https://test.solidcommunity.net/profile/card#me'}], ['Read', 'Write', 'Control'], ['default']))
return expect(api.acl.createContent(base, users)).rejects.toThrow('no agent with Control and acl:accessTo')
})
})
Expand Down Expand Up @@ -214,13 +214,13 @@ describe('aclUrlParser', () => {
})
test('get acl content for folder without acl', async () => {
const users = await api.aclUrlParser(folder.url+'nested/')
const keysUsers = ['agent&' + getRootUrl(folder.url) + '/profile/card#me', 'agent&https://test.solid.community/profile/card#me', 'agentClass&AuthenticatedAgent', 'agentClass&Agent']
const keysUsers = ['agent&' + getRootUrl(folder.url) + '/profile/card#me', 'agent&https://test.solidcommunity.net/profile/card#me', 'agentClass&AuthenticatedAgent', 'agentClass&Agent']
const usersKeys = Object.keys(users)
expect(usersKeys).toEqual(keysUsers)
})
test('get acl content for file without acl', async () => {
const users = await api.aclUrlParser(targetWithoutAcl.url)
const keysUsers = ['agent&' + getRootUrl(folder.url) + '/profile/card#me', 'agent&https://test.solid.community/profile/card#me', 'agentClass&AuthenticatedAgent', 'agentClass&Agent']
const keysUsers = ['agent&' + getRootUrl(folder.url) + '/profile/card#me', 'agent&https://test.solidcommunity.net/profile/card#me', 'agentClass&AuthenticatedAgent', 'agentClass&Agent']
const usersKeys = Object.keys(users)
expect(usersKeys).toEqual(keysUsers)
})
Expand Down
2 changes: 1 addition & 1 deletion tests/utils/contextSetup.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ async function getBaseUrl (prefix) {
if (!process.env.TEST_BASE_URL) {
throw new Error('Please specify TEST_BASE_URL url if you use the https prefix')
}
// Expects something like https://test.solid.community/private/tests/
// Expects something like https://test.solidcommunity.net/private/tests/
// It must be a publicy read and write able folder
baseUrl = process.env.TEST_BASE_URL
baseUrl += baseUrl.endsWith('/') ? '' : '/'
Expand Down

0 comments on commit c38641b

Please sign in to comment.