@solid/oidc-auth-manager 0.23.4 → 0.24.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.travis.yml +0 -0
- package/LICENSE.md +0 -0
- package/README.md +0 -0
- package/package.json +12 -12
- package/src/errors/auth-response-sent.js +0 -0
- package/src/handlers/auth-callback-request.js +0 -0
- package/src/handlers/index.js +0 -0
- package/src/handlers/login-consent-request.js +0 -0
- package/src/handlers/logout-request.js +0 -0
- package/src/handlers/select-provider-request.js +0 -0
- package/src/host-api.js +0 -0
- package/src/index.js +0 -0
- package/src/oidc-manager.js +0 -0
- package/src/preferred-provider.js +2 -2
- package/src/user-store.js +0 -0
- package/test/integration/oidc-manager-test.js +0 -0
- package/test/integration/user-store-test.js +0 -0
- package/test/resources/sample-webid-profile-with-oidc-issuer.js +19 -0
- package/test/resources/sample-webid-profile.js +1 -3
- package/test/unit/auth-callback-request.js +0 -0
- package/test/unit/auth-success-exception.js +0 -0
- package/test/unit/host-api-test.js +0 -0
- package/test/unit/login-consent-request.js +0 -0
- package/test/unit/logout-request.js +0 -0
- package/test/unit/oidc-manager-test.js +10 -0
- package/test/unit/preferred-provider-test.js +14 -5
- package/test/unit/select-provider-request.js +0 -0
- package/test/unit/user-store-test.js +0 -0
package/.travis.yml
CHANGED
|
File without changes
|
package/LICENSE.md
CHANGED
|
File without changes
|
package/README.md
CHANGED
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@solid/oidc-auth-manager",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.24.2",
|
|
4
4
|
"description": "An OpenID Connect (OIDC) authentication manager (OP, RP and RS) for decentralized peer-to-peer authentication",
|
|
5
5
|
"main": "./src/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -39,17 +39,17 @@
|
|
|
39
39
|
},
|
|
40
40
|
"homepage": "https://github.com/solid/oidc-auth-manager",
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@solid/oidc-op": "^0.
|
|
43
|
-
"@solid/oidc-rp": "^0.11.
|
|
44
|
-
"@solid/oidc-rs": "^0.5.
|
|
45
|
-
"@solid/solid-multi-rp-client": "^0.6.
|
|
46
|
-
"ajv": "^
|
|
42
|
+
"@solid/oidc-op": "^0.11.6",
|
|
43
|
+
"@solid/oidc-rp": "^0.11.5",
|
|
44
|
+
"@solid/oidc-rs": "^0.5.5",
|
|
45
|
+
"@solid/solid-multi-rp-client": "^0.6.4",
|
|
46
|
+
"ajv": "^7.0.3",
|
|
47
47
|
"bcryptjs": "^2.4.3",
|
|
48
|
-
"fs-extra": "^9.0
|
|
48
|
+
"fs-extra": "^9.1.0",
|
|
49
49
|
"kvplus-files": "0.0.4",
|
|
50
50
|
"li": "^1.3.0",
|
|
51
51
|
"node-fetch": "^2.6.1",
|
|
52
|
-
"rdflib": "^2.1.
|
|
52
|
+
"rdflib": "^2.1.7",
|
|
53
53
|
"valid-url": "^1.0.9"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
@@ -57,13 +57,13 @@
|
|
|
57
57
|
"chai-as-promised": "^7.1.1",
|
|
58
58
|
"dirty-chai": "^2.0.1",
|
|
59
59
|
"mocha": "^8.2.1",
|
|
60
|
-
"nock": "^13.0.
|
|
61
|
-
"node-mocks-http": "^1.
|
|
60
|
+
"nock": "^13.0.6",
|
|
61
|
+
"node-mocks-http": "^1.10.1",
|
|
62
62
|
"nyc": "^15.1.0",
|
|
63
|
-
"sinon": "^9.2.
|
|
63
|
+
"sinon": "^9.2.4",
|
|
64
64
|
"sinon-chai": "^3.5.0",
|
|
65
65
|
"solid-auth-cli": "^1.0.15",
|
|
66
|
-
"solid-auth-client": "^2.5.
|
|
66
|
+
"solid-auth-client": "^2.5.5",
|
|
67
67
|
"standard": "^16.0.3",
|
|
68
68
|
"whatwg-url": "^8.4.0"
|
|
69
69
|
},
|
|
File without changes
|
|
File without changes
|
package/src/handlers/index.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/src/host-api.js
CHANGED
|
File without changes
|
package/src/index.js
CHANGED
|
File without changes
|
package/src/oidc-manager.js
CHANGED
|
File without changes
|
|
@@ -62,9 +62,9 @@ function providerExists (uri) {
|
|
|
62
62
|
* provider URI was found, reject with an error.
|
|
63
63
|
*/
|
|
64
64
|
function discoverProviderFor (webId) {
|
|
65
|
-
return
|
|
65
|
+
return discoverFromProfile(webId)
|
|
66
66
|
|
|
67
|
-
.then(
|
|
67
|
+
.then(providerFromProfile => providerFromProfile || discoverFromHeaders(webId))
|
|
68
68
|
|
|
69
69
|
.then(providerUri => {
|
|
70
70
|
validateProviderUri(providerUri, webId) // Throw an error if empty or invalid
|
package/src/user-store.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
module.exports = `
|
|
2
|
+
@prefix solid: <http://www.w3.org/ns/solid/terms#>.
|
|
3
|
+
@prefix foaf: <http://xmlns.com/foaf/0.1/>.
|
|
4
|
+
@prefix pim: <http://www.w3.org/ns/pim/space#>.
|
|
5
|
+
@prefix schema: <http://schema.org/>.
|
|
6
|
+
@prefix ldp: <http://www.w3.org/ns/ldp#>.
|
|
7
|
+
|
|
8
|
+
<>
|
|
9
|
+
a foaf:PersonalProfileDocument ;
|
|
10
|
+
foaf:primaryTopic <#me> .
|
|
11
|
+
|
|
12
|
+
<#me>
|
|
13
|
+
a schema:Person ;
|
|
14
|
+
|
|
15
|
+
solid:account </> ; # link to the account uri
|
|
16
|
+
pim:storage </> ; # root storage
|
|
17
|
+
|
|
18
|
+
solid:oidcIssuer <https://provider.com> .
|
|
19
|
+
`
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -14,6 +14,8 @@ chai.should()
|
|
|
14
14
|
|
|
15
15
|
const OidcManager = require('../../src/oidc-manager')
|
|
16
16
|
|
|
17
|
+
const sampleProfileSrc = require('../resources/sample-webid-profile')
|
|
18
|
+
|
|
17
19
|
describe('OidcManager', () => {
|
|
18
20
|
afterEach(() => {
|
|
19
21
|
nock.cleanAll()
|
|
@@ -252,6 +254,10 @@ describe('OidcManager', () => {
|
|
|
252
254
|
sub: 'https://example.com/profile#me'
|
|
253
255
|
}
|
|
254
256
|
|
|
257
|
+
nock('https://example.com')
|
|
258
|
+
.get('/profile')
|
|
259
|
+
.reply(200, sampleProfileSrc)
|
|
260
|
+
|
|
255
261
|
nock('https://example.com')
|
|
256
262
|
.options('/profile')
|
|
257
263
|
.reply(204, 'No content', {
|
|
@@ -270,6 +276,10 @@ describe('OidcManager', () => {
|
|
|
270
276
|
sub: 'https://example.com/profile#me'
|
|
271
277
|
}
|
|
272
278
|
|
|
279
|
+
nock('https://example.com')
|
|
280
|
+
.get('/profile')
|
|
281
|
+
.reply(200, sampleProfileSrc)
|
|
282
|
+
|
|
273
283
|
nock('https://example.com')
|
|
274
284
|
.options('/profile')
|
|
275
285
|
.reply(204, 'No content', {
|
|
@@ -12,6 +12,7 @@ const expect = chai.expect
|
|
|
12
12
|
const serverUri = 'https://example.com'
|
|
13
13
|
|
|
14
14
|
const sampleProfileSrc = require('../resources/sample-webid-profile')
|
|
15
|
+
const sampleProfileSrcWithOidcIssuer = require('../resources/sample-webid-profile-with-oidc-issuer')
|
|
15
16
|
|
|
16
17
|
describe('preferred-provider.js', () => {
|
|
17
18
|
afterEach(() => {
|
|
@@ -22,6 +23,10 @@ describe('preferred-provider.js', () => {
|
|
|
22
23
|
const webId = 'https://example.com/#me'
|
|
23
24
|
|
|
24
25
|
it('should extract and validate the provider uri from link rel header', () => {
|
|
26
|
+
nock('https://example.com')
|
|
27
|
+
.get('/')
|
|
28
|
+
.reply(200, sampleProfileSrc)
|
|
29
|
+
|
|
25
30
|
nock(serverUri)
|
|
26
31
|
.options('/')
|
|
27
32
|
.reply(204, 'No content', {
|
|
@@ -35,6 +40,10 @@ describe('preferred-provider.js', () => {
|
|
|
35
40
|
})
|
|
36
41
|
|
|
37
42
|
it('should not drop the path from extracted provider uri', () => {
|
|
43
|
+
nock('https://example.com')
|
|
44
|
+
.get('/')
|
|
45
|
+
.reply(200, sampleProfileSrc)
|
|
46
|
+
|
|
38
47
|
nock(serverUri)
|
|
39
48
|
.options('/')
|
|
40
49
|
.reply(204, 'No content', {
|
|
@@ -48,13 +57,9 @@ describe('preferred-provider.js', () => {
|
|
|
48
57
|
})
|
|
49
58
|
|
|
50
59
|
it('should extract and validate the provider uri from the webid profile', () => {
|
|
51
|
-
nock(serverUri)
|
|
52
|
-
.options('/')
|
|
53
|
-
.reply(204, 'No content')
|
|
54
|
-
|
|
55
60
|
nock(serverUri)
|
|
56
61
|
.get('/')
|
|
57
|
-
.reply(200,
|
|
62
|
+
.reply(200, sampleProfileSrcWithOidcIssuer, {
|
|
58
63
|
'Content-Type': 'text/turtle'
|
|
59
64
|
})
|
|
60
65
|
|
|
@@ -147,6 +152,10 @@ describe('preferred-provider.js', () => {
|
|
|
147
152
|
})
|
|
148
153
|
|
|
149
154
|
it('should discover preferred provider if no oidc capability at webid', () => {
|
|
155
|
+
nock('https://example.com')
|
|
156
|
+
.get('/profile')
|
|
157
|
+
.reply(200, sampleProfileSrc)
|
|
158
|
+
|
|
150
159
|
nock('https://example.com')
|
|
151
160
|
.head('/.well-known/openid-configuration')
|
|
152
161
|
.reply(404)
|
|
File without changes
|
|
File without changes
|