|
1 | | -import { AlgJwk, App, CachedJwkGenerator, MemoryMapStorage } from '@solid/community-server'; |
| 1 | +import { AlgJwk, App, CachedJwkGenerator, joinUrl, MemoryMapStorage } from '@solid/community-server'; |
2 | 2 | import { setGlobalLoggerFactory, WinstonLoggerFactory } from 'global-logger-factory'; |
3 | 3 | import { decodeJwt, importJWK, SignJWT } from 'jose'; |
4 | 4 | import { randomUUID } from 'node:crypto'; |
@@ -165,6 +165,14 @@ describe('A server supporting OIDC tokens', (): void => { |
165 | 165 | expect(payload.sub).toBe(sub); |
166 | 166 | expect(payload.sub).not.toBe(`http://example.com/id/${sub}`); |
167 | 167 | }); |
| 168 | + |
| 169 | + it('can remove the policy.', async(): Promise<void> => { |
| 170 | + const response = await fetch(joinUrl(policyEndpoint, encodeURIComponent('http://example.org/policyStandard')), { |
| 171 | + method: 'DELETE', |
| 172 | + headers: { authorization: `WebID ${encodeURIComponent(webId)}`, 'content-type': 'text/turtle' }, |
| 173 | + }); |
| 174 | + expect(response.status).toBe(204); |
| 175 | + }); |
168 | 176 | }); |
169 | 177 |
|
170 | 178 | describe('accessing a resource using a standard OIDC token with a specific client.', (): void => { |
@@ -233,6 +241,14 @@ describe('A server supporting OIDC tokens', (): void => { |
233 | 241 | }); |
234 | 242 | expect(response.status).toBe(200); |
235 | 243 | }); |
| 244 | + |
| 245 | + it('can remove the policy.', async(): Promise<void> => { |
| 246 | + const response = await fetch(joinUrl(policyEndpoint, encodeURIComponent('http://example.org/policyStandardClient')), { |
| 247 | + method: 'DELETE', |
| 248 | + headers: { authorization: `WebID ${encodeURIComponent(webId)}`, 'content-type': 'text/turtle' }, |
| 249 | + }); |
| 250 | + expect(response.status).toBe(204); |
| 251 | + }); |
236 | 252 | }); |
237 | 253 |
|
238 | 254 | describe('accessing a resource using a Solid OIDC token.', (): void => { |
@@ -286,6 +302,14 @@ describe('A server supporting OIDC tokens', (): void => { |
286 | 302 | }); |
287 | 303 | expect(response.status).toBe(200); |
288 | 304 | }); |
| 305 | + |
| 306 | + it('can remove the policy.', async(): Promise<void> => { |
| 307 | + const response = await fetch(joinUrl(policyEndpoint, encodeURIComponent('http://example.org/policySolid')), { |
| 308 | + method: 'DELETE', |
| 309 | + headers: { authorization: `WebID ${encodeURIComponent(webId)}`, 'content-type': 'text/turtle' }, |
| 310 | + }); |
| 311 | + expect(response.status).toBe(204); |
| 312 | + }); |
289 | 313 | }); |
290 | 314 |
|
291 | 315 | describe('accessing a resource using a Solid OIDC token with a specific client.', (): void => { |
@@ -356,5 +380,13 @@ describe('A server supporting OIDC tokens', (): void => { |
356 | 380 | }); |
357 | 381 | expect(response.status).toBe(200); |
358 | 382 | }); |
| 383 | + |
| 384 | + it('can remove the policy.', async(): Promise<void> => { |
| 385 | + const response = await fetch(joinUrl(policyEndpoint, encodeURIComponent('http://example.org/policySolidClient')), { |
| 386 | + method: 'DELETE', |
| 387 | + headers: { authorization: `WebID ${encodeURIComponent(webId)}`, 'content-type': 'text/turtle' }, |
| 388 | + }); |
| 389 | + expect(response.status).toBe(204); |
| 390 | + }); |
359 | 391 | }); |
360 | 392 | }); |
0 commit comments