|
1 | 1 | import { expect } from 'chai'
|
2 |
| -import { foaf, ldp, solid, space } from 'rdf-namespaces' |
| 2 | +import { foaf, solid, space } from 'rdf-namespaces' |
3 | 3 | import * as config from '../../config'
|
4 | 4 | import { Person } from './types'
|
5 | 5 |
|
@@ -124,68 +124,12 @@ export const setupEmailSettings = async ({
|
124 | 124 | })
|
125 | 125 | }
|
126 | 126 |
|
127 |
| -export const setupInbox = async ({ |
128 |
| - webId, |
129 |
| - inbox, |
130 |
| - authenticatedFetch, |
131 |
| -}: { |
132 |
| - webId: string |
133 |
| - inbox: string |
134 |
| - authenticatedFetch: typeof fetch |
135 |
| -}) => { |
136 |
| - // create inbox |
137 |
| - const createInboxResponse = await authenticatedFetch(inbox, { |
138 |
| - method: 'PUT', |
139 |
| - headers: { |
140 |
| - link: '<http://www.w3.org/ns/ldp#BasicContainer>; rel="type"', |
141 |
| - 'content-type': 'text/turtle', |
142 |
| - }, |
143 |
| - }) |
144 |
| - |
145 |
| - expect(createInboxResponse.ok).to.be.true |
146 |
| - |
147 |
| - const createInboxAclResponse = await authenticatedFetch(inbox + '.acl', { |
148 |
| - // this .acl is a shortcut, should find .acl properly TODO |
149 |
| - method: 'PUT', |
150 |
| - headers: { 'content-type': 'text/turtle' }, |
151 |
| - body: ` |
152 |
| - @prefix acl: <http://www.w3.org/ns/auth/acl#>. |
153 |
| -
|
154 |
| - <#Append> |
155 |
| - a acl:Authorization; |
156 |
| - acl:agentClass acl:AuthenticatedAgent; |
157 |
| - acl:accessTo <./>; |
158 |
| - acl:default <./>; |
159 |
| - acl:mode acl:Append. |
160 |
| - <#ControlReadWrite> |
161 |
| - a acl:Authorization; |
162 |
| - acl:agent <${webId}>; |
163 |
| - acl:accessTo <./>; |
164 |
| - acl:default <./>; |
165 |
| - acl:mode acl:Control, acl:Read, acl:Write. |
166 |
| - `, |
167 |
| - }) |
168 |
| - |
169 |
| - expect(createInboxAclResponse.ok).to.be.true |
170 |
| - |
171 |
| - const linkInboxResponse = await authenticatedFetch(webId, { |
172 |
| - method: 'PATCH', |
173 |
| - headers: { 'content-type': 'text/n3' }, |
174 |
| - body: ` |
175 |
| - _:mutate a <${solid.InsertDeletePatch}>; <${solid.inserts}> { |
176 |
| - <${webId}> <${ldp.inbox}> <${inbox}>. |
177 |
| - }.`, |
178 |
| - }) |
179 |
| - |
180 |
| - expect(linkInboxResponse.ok).to.be.true |
181 |
| -} |
182 |
| - |
183 | 127 | /**
|
184 | 128 | * Give agent a read access (e.g. to inbox)
|
185 | 129 | *
|
186 | 130 | * Currently assumes we're changing rights to container!
|
187 | 131 | */
|
188 |
| -export const addRead = async ({ |
| 132 | +const addRead = async ({ |
189 | 133 | resource,
|
190 | 134 | agent,
|
191 | 135 | authenticatedFetch,
|
@@ -215,7 +159,7 @@ export const addRead = async ({
|
215 | 159 | return response
|
216 | 160 | }
|
217 | 161 |
|
218 |
| -export const addPublicRead = async ({ |
| 162 | +const addPublicRead = async ({ |
219 | 163 | resource,
|
220 | 164 | authenticatedFetch,
|
221 | 165 | }: {
|
|
0 commit comments